Secret Experience

Secret Experience (https://secretexperience.net/index.php)
-   [L2J] Pedidos (https://secretexperience.net/forumdisplay.php?f=38)
-   -   [Gracia Epilogue] NPC Enchanter (https://secretexperience.net/showthread.php?t=32027)

paulovitor 01-07-2011 04:00 PM

NPC Enchanter
 




Olá galera estou querendo 1 NPC Enchant que n bug o script, pq todos q eu pego da erro no Script.... na hora que ta carregano o server...

PS: uso a Rev "L2J OpenBr 2.0"

então se alguem puder me arrumar aqui tem 1 SS de exemplo.

[Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar]

bom eu queria que fosse assim olha.

Quando clicassem no item enchantava em um certo numero ex:

Weapon's: +100
Armor's: +12
Jewel's: +10

tipo assim quando clica na Weapon enchanta +100 a arma ( PS: nao e safe, ela fica enchantando até chega no Max Enchant ) 100% Seguro.

e msm coisa no Armor só que enchantava +12 a Ropa, Tattoo, etc ( PS: nao e safe, ela fica enchantando até chega no Max Enchant ) 100% Seguro.

e a msm coisa tbm na Jewel's só que enchantava +10 a Joia ( PS: nao e safe, ela fica enchantando até chega no Max Enchant ) 100% Seguro.

se não tiverem, por favor me poste algum que funcione... Obrigado desde Jah...

Bom espero que alguem poste e que possa me ajudar obrigado....


@Edite

Os que es testava dava esse erro no game server:

[Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar]

PS: Eu modifiquei a img ( tampei o IP )

dai eu vo lah na pasta do meu server/data/scripts/custom/99940_SafeEnchant/__init__.py.error.log

dai tah escrito isso:

Error on: C:\Users\PV\Desktop\Criando Servidor de Lineage II\Patch L2 Darion\l2j open 2.0\gameserver\data\scripts\custom\99940_SafeEncha nt\__init__.py.error.log
Line: -1 - Column: -1


Traceback (innermost last):
File "__init__.py", line 4, in ?
ImportError: cannot import name Config


se alguem suber resolver agradeceria muito...


@Edite²

Aqui está o meu "[COLOR="Red]__init__.py[/COLOR]"

Citação:


#Npc By RevoltadO - 30/11/2010
#..........................
import sys
from com.l2jserver import Config
from com.l2jserver.gameserver.model.quest import State
from com.l2jserver.gameserver.model.quest import QuestState
from com.l2jserver.gameserver.model.quest.jython import QuestJython as JQuest


qn = "99940_SafeEnchant"

print "============================="
print " NPC ENCHANTER - OK "
print "============================="

QuestId = 99940
QuestName = "SafeEnchant"
QuestDesc = "custom"

ENCHANT_CHECK = 1

AMOUNT_OF_ENCHANT = 7

PAYMENT_ITEM_ID = 6673
PAYMENT_AMOUNT = 10

ENCHANT_NPC = 50019
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>Enchanter</title><body>Select Item do you want to enchant +7.<br>NPC Can Enchant item +0 Only:<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(ob jId )
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)







flaviogasperini 09-07-2011 11:13 PM

Seguinte:

from com.l2jserver import Config
from com.l2jserver.gameserver.model.quest import State
from com.l2jserver.gameserver.model.quest import QuestState
from com.l2jserver.gameserver.model.quest.jython import QuestJython as JQuest

from COM.L2JSERVER, voce tem q colocar o da sua Rev.

Abre algum script q vc vai encontrar la, no inicio

lordslip 12-07-2011 12:38 AM

teria esse npc pra interlude?

securao 12-07-2011 01:55 PM

Alguem que saiba editar o Enchanter por favor ajuda aki eu vou postar o modelo dele o script e o HTML para alguem que saiba editar se funfar posta ae POR FAVOR
Citação:

[Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar]


Horários baseados na GMT -3. Agora são 01:10 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.