Есть у кого НПЦ, который точит оружие
У кого есть НПЦ, точащий оружие в заданном пределе для l2jfree 1.2.3+ .
Пожалуйста, очень надо, если есть у кого, выложите мне. Буду очень признателен.
Все, что видил на сайте\форуме, не подходят (пути менял). Вечно какая-то ошибка то про синтаксис то про еще что-то вылезет...
Спасибо,
Так ты ошибку пиши а не нпц который тебе нужен...тыкай спасибку если помог :D :)
Так ты ошибку пиши а не нпц который тебе нужен...тыкай спасибку если помог :D :)
Traceback (innermost last):
(no code object) at line 0
SyntaxError: ('inconsistent dedent', ('__init__.py', 26, 3, ' if event == "1":'))
ошибка в описанной ранее сборке
скрипт:
from com.l2jfree.gameserver.model.quest import State
from com.l2jfree.gameserver.model.quest import QuestState
from com.l2jfree.gameserver.model.quest.jython import QuestJython as JQuest
qn = "5654_Enchanter"
#Items constants
SCROLL_ARMOR = 6578 #Item ID required to enchant armor
SCROLL_WEAPON = 6577 #Item ID required to enchant weapon
NUM = 10 #Item ID quantity for 1 cycle of enchant
#Configs
NPC = 70041 #NPC ID
loop = 2 #1 for one-time enchant, 2 for unlimited
ench = 0 #Enchant levels per cycle
max = 15 #Maxmum enchant for item
class Quest (JQuest) :
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
def onEvent(self,event,st):
htmltext = " "
if event == "1":
itm = st.getItemEquipped(1)
enchlv = st.getEnchantLevel(itm)
enchnew = enchlv + ench
if st.getQuestItemsCount(SCROLL_ARMOR) < NUM :
htmltext="Lack of scrolls"
st.exitQuest(1)
elif st.getQuestItemsCount(itm) >= 2 :
htmltext="<html><head>The same item lies in your inventory.</body></html>"
st.exitQuest(1)
elif itm == 0 :
htmltext = "<html><head>You should ware an item to proceed enchant!</body></html>"
st.exitQuest(1)
elif enchnew > max :
htmltext = "<html><head>You're unable to enchant over the limit!</body></html>"
st.exitQuest(1)
else:
st.takeItems(SCROLL_ARMOR,NUM)
st.takeItems(itm,1)
st.giveItems(itm,1,enchnew)
htmltext = "Earring has been enchanted"
#=========================================
if event == "4" :
itm = st.getItemEquipped(4)
enchlv = st.getEnchantLevel(itm)
enchnew = enchlv + ench
if st.getQuestItemsCount(SCROLL_ARMOR) < NUM :
htmltext="Lack of scrolls"
st.exitQuest(1)
elif st.getQuestItemsCount(itm) >= 2 :
htmltext="<html><head>The same item lies in your inventory. </body></html>"
st.exitQuest(1)
elif itm == 0 :
htmltext = "<html><head>You should ware an item to proceed enchant!</body></html>"
st.exitQuest(1)
elif enchnew > max :
htmltext = "<html><head>You're unable to enchant over the limit!</body></html>"
st.exitQuest(1)
else:
st.takeItems(SCROLL_ARMOR,NUM)
st.takeItems(itm,1)
st.giveItems(itm,1,enchnew)
htmltext = "Necklace has been enchanted"
#=========================================
if event == "5" :
itm = st.getItemEquipped(5)
enchlv = st.getEnchantLevel(itm)
enchnew = enchlv + ench
if st.getQuestItemsCount(SCROLL_ARMOR) < NUM :
htmltext="Lack of scrolls"
st.exitQuest(1)
elif st.getQuestItemsCount(itm) >= 2 :
htmltext="<html><head>The same item lies in your inventory. </body></html>"
st.exitQuest(1)
elif itm == 0 :
htmltext = "<html><head>You should ware an item to proceed enchant!</body></html>"
st.exitQuest(1)
elif enchnew > max :
htmltext = "<html><head>You're unable to enchant over the limit!</body></html>"
st.exitQuest(1)
else:
st.takeItems(SCROLL_ARMOR,NUM)
st.takeItems(itm,1)
st.giveItems(itm,1,enchnew)
htmltext = "Ring has been enchanted"
#=========================================
if event == "6" :
itm = st.getItemEquipped(6)
enchlv = st.getEnchantLevel(itm)
enchnew = enchlv + ench
if st.getQuestItemsCount(SCROLL_ARMOR) < NUM :
htmltext="Lack of scrolls"
st.exitQuest(1)
elif st.getQuestItemsCount(itm) >= 2 :
htmltext="<html><head>The same item lies in your inventory. </body></html>"
st.exitQuest(1)
elif itm == 0 :
htmltext = "<html><head>You should ware an item to proceed enchant!</body></html>"
st.exitQuest(1)
elif enchnew > max :
htmltext = "<html><head>You're unable to enchant over the limit!</body></html>"
st.exitQuest(1)
else:
st.takeItems(SCROLL_ARMOR,NUM)
st.takeItems(itm,1)
st.giveItems(itm,1,enchnew)
htmltext = "Ring has been enchanted"
#=========================================
if event == "10" :
itm = st.getItemEquipped(10)
enchlv = st.getEnchantLevel(itm)
enchnew = enchlv + ench
if st.getQuestItemsCount(SCROLL_ARMOR) < NUM :
htmltext="Lack of scrolls"
st.exitQuest(1)
elif st.getQuestItemsCount(itm) >= 2 :
htmltext="<html><head>The same item lies in your inventory. </body></html>"
st.exitQuest(1)
elif itm == 0 :
htmltext = "<html><head>You should ware an item to proceed enchant!</body></html>"
st.exitQuest(1)
elif enchnew > max :
htmltext = "<html><head>You're unable to enchant over the limit!</body></html>"
st.exitQuest(1)
else:
st.takeItems(SCROLL_ARMOR,NUM)
st.takeItems(itm,1)
st.giveItems(itm,1,enchnew)
htmltext = "Shield has been enchanted"
#=========================================
if event == "8" :
itm = st.getItemEquipped(8)
enchlv = st.getEnchantLevel(itm)
enchnew = enchlv + ench
if st.getQuestItemsCount(SCROLL_ARMOR) < NUM :
htmltext="Lack of scrolls"
st.exitQuest(1)
elif st.getQuestItemsCount(itm) >= 2 :
htmltext="<html><head>The same item lies in your inventory. </body></html>"
st.exitQuest(1)
elif itm == 0 :
htmltext = "<html><head>You should ware an item to proceed enchant!</body></html>"
st.exitQuest(1)
elif enchnew > max :
htmltext = "<html><head>You're unable to enchant over the limit!</body></html>"
st.exitQuest(1)
else:
st.takeItems(SCROLL_ARMOR,NUM)
st.takeItems(itm,1)
st.giveItems(itm,1,enchnew)
htmltext = "Helmet has been enchanted"
#=========================================
if event == "2" :
itm = st.getItemEquipped(2)
enchlv = st.getEnchantLevel(itm)
enchnew = enchlv + ench
if st.getQuestItemsCount(SCROLL_ARMOR) < NUM :
htmltext="Lack of scrolls"
st.exitQuest(1)
elif st.getQuestItemsCount(itm) >= 2 :
htmltext="<html><head>The same item lies in your inventory. </body></html>"
st.exitQuest(1)
elif itm == 0 :
htmltext = "<html><head>You should ware an item to proceed enchant!</body></html>"
st.exitQuest(1)
elif enchnew > max :
htmltext = "<html><head>You're unable to enchant over the limit!</body></html>"
st.exitQuest(1)
else:
st.takeItems(SCROLL_ARMOR,NUM)
st.takeItems(itm,1)
st.giveItems(itm,1,enchnew)
htmltext = "Earring has been enchanted"
#=========================================
if event == "11" :
itm = st.getItemEquipped(11)
enchlv = st.getEnchantLevel(itm)
enchnew = enchlv + ench
if st.getQuestItemsCount(SCROLL_ARMOR) < NUM :
htmltext="Lack of scrolls"
st.exitQuest(1)
elif st.getQuestItemsCount(itm) >= 2 :
htmltext="<html><head>The same item lies in your inventory. </body></html>"
st.exitQuest(1)
elif itm == 0 :
htmltext = "<html><head>You should ware an item to proceed enchant!</body></html>"
st.exitQuest(1)
elif enchnew > max :
htmltext = "<html><head>You're unable to enchant over the limit!</body></html>"
st.exitQuest(1)
else:
st.takeItems(SCROLL_ARMOR,NUM)
st.takeItems(itm,1)
st.giveItems(itm,1,enchnew)
htmltext = "Gloves has been enchanted"
#=========================================
if event == "13" :
itm = st.getItemEquipped(13)
enchlv = st.getEnchantLevel(itm)
enchnew = enchlv + ench
if st.getQuestItemsCount(SCROLL_ARMOR) < NUM :
htmltext="Lack of scrolls"
st.exitQuest(1)
elif st.getQuestItemsCount(itm) >= 2 :
htmltext="<html><head>The same item lies in your inventory. </body></html>"
st.exitQuest(1)
elif itm == 0 :
htmltext = "<html><head>You should ware an item to proceed enchant!</body></html>"
st.exitQuest(1)
elif enchnew > max :
htmltext = "<html><head>You're unable to enchant over the limit!</body></html>"
st.exitQuest(1)
else:
st.takeItems(SCROLL_ARMOR,NUM)
st.takeItems(itm,1)
st.giveItems(itm,1,enchnew)
htmltext = "Stockings has been enchanted"
#=========================================
if event == "14" :
itm = st.getItemEquipped(14)
enchlv = st.getEnchantLevel(itm)
enchnew = enchlv + ench
if st.getQuestItemsCount(SCROLL_ARMOR) < NUM :
htmltext="Lack of scrolls"
st.exitQuest(1)
elif st.getQuestItemsCount(itm) >= 2 :
htmltext="<html><head>The same item lies in your inventory. </body></html>"
st.exitQuest(1)
elif itm == 0 :
htmltext = "<html><head>You should ware an item to proceed enchant!</body></html>"
st.exitQuest(1)
elif enchnew > max :
htmltext = "<html><head>You're unable to enchant over the limit!</body></html>"
st.exitQuest(1)
else:
st.takeItems(SCROLL_ARMOR,NUM)
st.takeItems(itm,1)
st.giveItems(itm,1,enchnew)
htmltext = "Boots has been enchanted"
#=========================================
if event == "12" :
itm = st.getItemEquipped(12)
enchlv = st.getEnchantLevel(itm)
enchnew = enchlv + ench
if st.getQuestItemsCount(SCROLL_ARMOR) < NUM :
htmltext="Lack of scrolls"
st.exitQuest(1)
elif st.getQuestItemsCount(itm) >= 2 :
htmltext="<html><head>The same item lies in your inventory. </body></html>"
st.exitQuest(1)
elif itm == 0 :
htmltext = "<html><head>You should ware an item to proceed enchant!</body></html>"
st.exitQuest(1)
elif enchnew > max :
htmltext = "<html><head>You're unable to enchant over the limit!</body></html>"
st.exitQuest(1)
else:
st.takeItems(SCROLL_ARMOR,NUM)
st.takeItems(itm,1)
st.giveItems(itm,1,enchnew)
htmltext = "Chest has been enchanted"
#=========================================
if event == "9" :
itm = st.getItemEquipped(9)
enchlv = st.getEnchantLevel(itm)
enchnew = enchlv + ench
if itm == 8190 :
htmltext = "<html><head>Do not try to enchant Demonic Sword Zariche! It's prohibited!</body></html>"
st.exitQuest(1)
elif st.getQuestItemsCount(itm) >= 2 :
htmltext="<html><head>The same item lies in your inventory.</body></html>"
st.exitQuest(1)
elif itm == 8689 :
htmltext = "<html><head>Do not try to enchant Blood Sword Akamanah! It's prohibited!</body></html>"
st.exitQuest(1)
elif st.getQuestItemsCount(SCROLL_WEAPON) < NUM :
htmltext="Lack of scrolls"
st.exitQuest(1)
elif itm == 0 :
htmltext = "<html><head>You should ware an item to proceed enchant!</body></html>"
st.exitQuest(1)
elif enchnew > max :
htmltext = "<html><head>You're unable to enchant over the limit!</body></html>"
st.exitQuest(1)
else:
st.takeItems(itm,1)
st.takeItems(SCROLL_WEAPON,NUM)
st.giveItems(itm,1,enchnew)
htmltext = "Your weapon has been enchanted"
#=========================================
return htmltext
def onTalk (self,npc,player) :
st = player.getQuestState(qn)
npcId = npc.getNpcId()
id = st.getInt("cound")
htmltext = "<html><head><body>I have nothing to say to you</body></html>"
if not st : return htmltext
if npcId == NPC:
if id == loop:
htmltext = "You can't enchant any more"
else:
htmltext = "ench.htm"
return htmltext
QUEST = Quest(5654, qn, "custom")
QUEST.addStartNpc(NPC)
QUEST.addTalkId(NPC)
print "------------->Enchanter (scrolls) loaded"
Неужели так трудуно помочь... Хотябы намек бы дали что-ли что делать и где ошибка..
http://la2base.ru/forum/index.php?showtopic=19771
вот доработаный у меня пашет
— Бойтесь


