|
Você não é registrado, por favor registre-se para ter acesso ao conteúdo completo. Caso seja registrado, efetue login. Esqueceu sua senha? Clique aqui Recomendamos o uso do Mozilla Firefox para uma melhor visualização. |
|
| Início | Postados Hoje | Marcar Fóruns Como Lidos | Álbums | Banidos | SE Team | Medalhas |
|
|||||||
| Registrar | Loteria VIP | Staff SE | Regras do fórum | Comunidade | Arcade | Postados Hoje | Pesquisar | Experience |
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
![]() |
|
|
LinkBack | Ferramentas do Tópico | Modos de Exibição |
|
|
#1 (permalink) | ||||||||||||||
![]() ![]() Registrado em: May 2009
Localização: Minas Gerais-Pouso Alegre
Posts: 2,249
Agradeceu: 754
Agradecido 2,075 Vezes em 922 Posts
Nome Real: Júlio César R.de Morães
|
Bom pessoal vamos la.
Estou mexeno numa rev EMU Gracia CT2 aqui e fazendo um NPC Enchante. Consegui fazer os scripts tudo certinho porém acontece isso ao clicar para enchantar a arma : [Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar] [Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar] Código:
[Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar]
import sys
from net.l2emuproject.gameserver.model.quest import State
from net.l2emuproject.gameserver.model.quest import QuestState
from net.l2emuproject.gameserver.model.quest.jython import QuestJython as JQuest
qn = "safe_enchant"
ENCHANT_NPC = 90000
weapons = ['Sword','Blunt','Dagger','Bow','Pole','Etc','Fist','Dual Sword','Dual Fist','Big Sword','Big Blunt','Ancient','Crossbow','Rapier']
armors = ['Light','Heavy','Magic','Shield']
jewels = ['None']
acceptableItemTypes = weapons+armors+jewels
class Quest (JQuest) :
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
def onEvent (self,event,st) :
if event == "choose_item" :
htmltext = ""
for Item in st.getPlayer().getInventory().getItems():
# given an item instance, get the item template to check what type it is
itemType = Item.getItem().getItemType().toString()
itemGrade = Item.getItem().getCrystalType()
if itemType in acceptableItemTypes and itemGrade > 0 :
htmltext += "<a action=\"bypass -h Quest safe_enchant enchantItem_" + str(Item.getObjectId()) +"\">" + Item.getItem().getName() + "+" + str(Item.getEnchantLevel()) + "</a><br>"
if htmltext == "":
htmltext = "You have no enchantable items in your inventory"
htmltext = "<html><body>Enchanter:<br>Please choose which item you wish me to enchant, from the below list:<br>" + htmltext + "</body></html>"
if event.startswith("enchantItem_"):
# get the object id out of the event string
objId = int(event.replace("enchantItem_", ""))
# to avoid exploitation, check if the stored objectId still corresponds to an existing item
# and if that item is still not equipped
Item = st.getPlayer().getInventory().getItemByObjectId(objId )
if Item and not Item.isEquipped() :
itemType = Item.getItem().getItemType().toString()
itemEnchant = Item.getEnchantLevel()
if st.getQuestItemsCount(57) >= 10 :
if (itemType in weapons and itemEnchant >= Config.ENCHANT_MAX_WEAPON) or (itemType in armors and itemEnchant >= Config.ENCHANT_MAX_ARMOR) or (itemType in jewels and itemEnchant >= Config.ENCHANT_MAX_JEWELRY) :
htmltext = "reachedMaxEnchant.htm"
else :
Item.setEnchantLevel(itemEnchant+1)
st.takeItems(57, 1000000)
htmltext = "congratulations.htm"
else :
htmltext = "notEnoughItems.htm"
else :
htmltext = "cheater.htm"
return htmltext
def onTalk (self,npc,player):
htmltext = "<html><body>You are either not on a quest that involves this NPC, or you don't meet this NPC's minimum quest requirements.</body></html>"
st = player.getQuestState(qn)
if not st : return htmltext
if npc.getNpcId() == ENCHANT_NPC :
htmltext = "1.htm"
return htmltext
QUEST = Quest(9000,qn,"Custom")
QUEST.addStartNpc(ENCHANT_NPC)
QUEST.addTalkId(ENCHANT_NPC)
__________________
Olá voce é novo na SecretExperience ?
Hum então voce ja deve ter lido as regras ? Não ? Então leia nossas regras evite ser alertado : [Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar] Ainda tem dúvida de algo ? Então leia nosso FAQ : [Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar] |
||||||||||||||
|
|
|
||||||||||||||
| Links Patrocinados |
|
|
#2 (permalink) |
|
Banido
![]() Registrado em: Sep 2009
Localização: Na Frente do PC =p
Posts: 2,094
Agradeceu: 701
Agradecido 1,875 Vezes em 902 Posts
Nome Real: Rodrigo R. Camellini
|
veio c tu vive ajudando a gente agora pediu ajuda a coisa ta preta em so pra dar 1 opiniao eu vi perdido por ai 1 npc c nao me engano funfando desse ai q vc quer fazer , e se vc pegasse ele e desse uma analisada nele nao ajudaria ? so uma opiniao calma ai so o leigo aqui ^^
|
|
|
|
|
|
#3 (permalink) | ||||||||||||||
![]() ![]() Registrado em: May 2009
Localização: Minas Gerais-Pouso Alegre
Posts: 2,249
Agradeceu: 754
Agradecido 2,075 Vezes em 922 Posts
Nome Real: Júlio César R.de Morães
|
@Inspector :
Caso quiser postar a script dele funcionando sera bom tb... Em outras rev eu sei fazer o NPC funcionar normalmente hehehhee. c(: O poblema mesmo é no caso do EMU pelo estilo de script dele ser diferente dos servidores que trabalho. Mesmo assim obrigado pela opinião... De noite estarei on denovo conferindo as respostas,Desde ja Obrigado...
__________________
Olá voce é novo na SecretExperience ?
Hum então voce ja deve ter lido as regras ? Não ? Então leia nossas regras evite ser alertado : [Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar] Ainda tem dúvida de algo ? Então leia nosso FAQ : [Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar] |
||||||||||||||
|
|
|
||||||||||||||
|
|
#4 (permalink) |
|
playstation
![]() Registrado em: Dec 2008
Localização: Belo Horizonte
Posts: 1,284
Agradeceu: 118
Agradecido 1,503 Vezes em 772 Posts
Nome Real: Marcelo
|
Veja se assim funciona:
Código:
[Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar]
import sys
from net.l2emuproject.gameserver.model.quest import State
from net.l2emuproject.gameserver.model.quest import QuestState
from net.l2emuproject.gameserver.model.quest.jython import QuestJython as JQuest
from net.l2emuproject import Config
qn = "safe_enchant"
ENCHANT_NPC = 90000
weapons = ['Sword','Blunt','Dagger','Bow','Pole','Etc','Fist','Dual Sword','Dual Fist','Big Sword','Big Blunt','Ancient','Crossbow','Rapier']
armors = ['Light','Heavy','Magic','Shield']
jewels = ['None']
acceptableItemTypes = weapons+armors+jewels
class Quest (JQuest) :
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
def onEvent (self,event,st) :
if event == "choose_item" :
htmltext = ""
for Item in st.getPlayer().getInventory().getItems():
# given an item instance, get the item template to check what type it is
itemType = Item.getItem().getItemType().toString()
itemGrade = Item.getItem().getCrystalType()
if itemType in acceptableItemTypes and itemGrade > 0 :
htmltext += "<a action=\"bypass -h Quest safe_enchant enchantItem_" + str(Item.getObjectId()) +"\">" + Item.getItem().getName() + "+" + str(Item.getEnchantLevel()) + "</a><br>"
if htmltext == "":
htmltext = "You have no enchantable items in your inventory"
htmltext = "<html><body>Enchanter:<br>Please choose which item you wish me to enchant, from the below list:<br>" + htmltext + "</body></html>"
if event.startswith("enchantItem_"):
# get the object id out of the event string
objId = int(event.replace("enchantItem_", ""))
# to avoid exploitation, check if the stored objectId still corresponds to an existing item
# and if that item is still not equipped
Item = st.getPlayer().getInventory().getItemByObjectId(objId )
if Item and not Item.isEquipped() :
itemType = Item.getItem().getItemType().toString()
itemEnchant = Item.getEnchantLevel()
if st.getQuestItemsCount(57) >= 10 :
if (itemType in weapons and itemEnchant >= Config.ENCHANT_MAX_WEAPON) or (itemType in armors and itemEnchant >= Config.ENCHANT_MAX_ARMOR) or (itemType in jewels and itemEnchant >= Config.ENCHANT_MAX_JEWELRY) :
htmltext = "reachedMaxEnchant.htm"
else :
Item.setEnchantLevel(itemEnchant+1)
st.takeItems(57, 1000000)
htmltext = "congratulations.htm"
else :
htmltext = "notEnoughItems.htm"
else :
htmltext = "cheater.htm"
return htmltext
def onTalk (self,npc,player):
htmltext = "<html><body>You are either not on a quest that involves this NPC, or you don't meet this NPC's minimum quest requirements.</body></html>"
st = player.getQuestState(qn)
if not st : return htmltext
if npc.getNpcId() == ENCHANT_NPC :
htmltext = "1.htm"
return htmltext
QUEST = Quest(9000,qn,"Custom")
QUEST.addStartNpc(ENCHANT_NPC)
QUEST.addTalkId(ENCHANT_NPC)
__________________
Há! Só posso rir de quem quer vender o que mal sabe fazer... Quer ser respondido direito!? Não faça perguntas idiotas. (Y) |
|
|
|
| O seguinte membro ao lado disse Obrigado(a) a : paytaly por gostar deste Post : |
CavaleiroNegro (05-10-2009)
|
|
|
#5 (permalink) |
|
Banido
![]() Registrado em: Sep 2009
Localização: Na Frente do PC =p
Posts: 2,094
Agradeceu: 701
Agradecido 1,875 Vezes em 902 Posts
Nome Real: Rodrigo R. Camellini
|
@cavaleironegro
velho ta add como amigo la ja so vi agora o pedido ^~ e sobre o npc velho eu vi ele numa rev q baixei de rgacia final ou gracia pt 2 nem lembro vo cacar essa rev aqui ( 2 hd de 1 tera =p) e assim q eu achar pego o npc e upo ele e te mando o link pra tu dar um xeretada so torce ai rpa eu nao ter deletado a rev mas mesmo assim eu te aviso ^^ c ajudar dai vai ser legal c nao tomara q vc arrume ele ai ![]() ---------- po c servir npc e encantar no ragnarok tenhu uns 20 tipos aqui uahauhauhauahuahuahauha |
|
|
|
|
|
#6 (permalink) | ||||||||||||||
![]() ![]() Registrado em: May 2009
Localização: Minas Gerais-Pouso Alegre
Posts: 2,249
Agradeceu: 754
Agradecido 2,075 Vezes em 922 Posts
Nome Real: Júlio César R.de Morães
|
@Paytaly :
Passei por despercebido disso heheh obrigado... Uma coisa que fiquei em duvida para selecionar a quantidade de enchantes em cada botão é na html mesmo ou no script ? @Inspector : Obrigado por tentar me ajudar...
__________________
Olá voce é novo na SecretExperience ?
Hum então voce ja deve ter lido as regras ? Não ? Então leia nossas regras evite ser alertado : [Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar] Ainda tem dúvida de algo ? Então leia nosso FAQ : [Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar] |
||||||||||||||
|
|
|
||||||||||||||
|
|
#7 (permalink) |
|
Banido
![]() Registrado em: Sep 2009
Localização: Na Frente do PC =p
Posts: 2,094
Agradeceu: 701
Agradecido 1,875 Vezes em 902 Posts
Nome Real: Rodrigo R. Camellini
|
@cavaleironegro
ai ta o codigo do npc q citei a vc Código:
[Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar]
import sys
from net.sf.l2j import Config
from net.sf.l2j.gameserver.model.quest import State
from net.sf.l2j.gameserver.model.quest import QuestState
from net.sf.l2j.gameserver.model.quest.jython import QuestJython as JQuest
qn = "99940_SafeEnchant"
print "..............! - Importing Custom: +10 Auto-Enchant - !.............."
QuestId = 99940
QuestName = "SafeEnchant"
QuestDesc = "custom"
ENCHANT_CHECK = 1
AMOUNT_OF_ENCHANT = 10
PAYMENT_ITEM_ID = 57
PAYMENT_AMOUNT = 1000000000
ENCHANT_NPC = 21
weapons = ['Sword','Blunt','Dagger','Bow','Pole','Etc','Fist','Dual Sword','Dual Fist','Big Sword','Big Blunt','Ancient','Crossbow','Rapier','Dual Dagger']
armors = ['Light','Heavy','Magic','Shield','Sigil']
jewels = ['None']
acceptableItemTypes = weapons+armors+jewels
class Quest (JQuest) :
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
def onEvent (self,event,st) :
if event == "choose_item" :
htmltext = ""
for Item in st.getPlayer().getInventory().getItems():
# given an item instance, get the item template to check what type it is
itemType = Item.getItem().getItemType().toString()
itemGrade = Item.getItem().getCrystalType()
if itemType in acceptableItemTypes and itemGrade > 0 :
htmltext += "<a action=\"bypass -h Quest 99940_SafeEnchant enchantItem_" + str(Item.getObjectId()) +"\">" + Item.getItem().getName() + "+" + str(Item.getEnchantLevel()) + "</a><br>"
if htmltext == "":
htmltext = "You have no enchantable items equiped or in your inventory."
htmltext = "<html><title>Auto-Enchanter By RevoltadOl</title><body>Seu Item para ser Enchantado Precisa estar +10.<br>Por Favor Selecione Um Item a ser Enchantado na Lista Abaixo:<br><br>" + htmltext + "</body></html>"
elif event.startswith("enchantItem_"):
# get the object id out of the event string
objId = int(event.replace("enchantItem_", ""))
# to avoid exploitation, check if the stored objectId still corresponds to an existing item
Item = st.getPlayer().getInventory().getItemByObjectId(objId )
if Item :
itemType = Item.getItem().getItemType().toString()
itemEnchant = Item.getEnchantLevel()
if st.getQuestItemsCount(PAYMENT_ITEM_ID) >= PAYMENT_AMOUNT :
if (itemType in weapons and itemEnchant >= ENCHANT_CHECK) or (itemType in armors and itemEnchant >= ENCHANT_CHECK) or (itemType in jewels and itemEnchant >= ENCHANT_CHECK) :
htmltext = "notPlusZero.htm"
else :
Item.setEnchantLevel(itemEnchant+AMOUNT_OF_ENCHANT)
st.takeItems(PAYMENT_ITEM_ID, PAYMENT_AMOUNT)
htmltext = "Congratulations.htm"
else :
htmltext = "notEnoughItems.htm"
else :
htmltext = "Error.htm"
return htmltext
def onTalk (self,npc,player):
htmltext = "<html><body>You are either not on a quest that involves this NPC, or you don't meet this NPC's minimum quest requirements.</body></html>"
st = player.getQuestState(qn)
if not st : return htmltext
if npc.getNpcId() == ENCHANT_NPC :
htmltext = "Start.htm"
return htmltext
QUEST = Quest(QuestId,str(QuestId) + "_" + QuestName,QuestDesc)
QUEST.addStartNpc(ENCHANT_NPC)
QUEST.addTalkId(ENCHANT_NPC)
|
|
|
|
|
|
#8 (permalink) | ||||||||||||||
![]() ![]() Registrado em: May 2009
Localização: Minas Gerais-Pouso Alegre
Posts: 2,249
Agradeceu: 754
Agradecido 2,075 Vezes em 922 Posts
Nome Real: Júlio César R.de Morães
|
@Inspector:
Consegui fazer funcionar aqui com a minha script anterior mesmo hehehhe Fiz algumas alterações nela e deu tudo certo... Mesmo assim muito obrigado,agora chego a parte de eu fazer event nessa script... c(: @Paytaly : Mais uma vez obrigado....
__________________
Olá voce é novo na SecretExperience ?
Hum então voce ja deve ter lido as regras ? Não ? Então leia nossas regras evite ser alertado : [Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar] Ainda tem dúvida de algo ? Então leia nosso FAQ : [Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar] |
||||||||||||||
|
|
|
||||||||||||||
![]() |
|
|