Поставил npc переноса заточки, запустил серв зашел в игру!
Заспавнил npc зашел, нажал перенести, только нажал кнопку выбрать оружие, тут же пустое html окно с титулом Script Error
Глянул в ГС, накритовал пол батника!
Кнопка по которой вылетела ошибка находится в евенте step2
Заспавнил npc зашел, нажал перенести, только нажал кнопку выбрать оружие, тут же пустое html окно с титулом Script Error
Глянул в ГС, накритовал пол батника!
Ошибка ГС
Код:
X:\la2-pvp\pride[server]\server\data\scripts\quests\8014_LifeStone\__init__.py
Traceback (innermost last):
(no code object) at line 0
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
rce)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.Util.getInstance(Util.java:381)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1030)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3491)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3423)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1936)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2542)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.ja
va:1734)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:
1885)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewPr
oxyPreparedStatement.java:76)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: com.mysql.jdbc.except
ions.jdbc4.MySQLSyntaxErrorException: Table 'eon.z_market_icons' doesn't exist
at org.python.core.Py.JavaError(Unknown Source)
at org.python.core.PyObject._jthrow(Unknown Source)
at org.python.core.PyObject._jcall(Unknown Source)
at org.python.proxies.main$Quest$382.onAdvEvent(Unknown Source)
at net.sf.l2j.gameserver.model.quest.Quest.notifyEvent(Quest.java:299)
at net.sf.l2j.gameserver.model.actor.instance.L2PcInstance.processQuestE
vent(L2PcInstance.java:1248)
at net.sf.l2j.gameserver.network.clientpackets.RequestBypassToServer.run
Impl(RequestBypassToServer.java:184)
at net.sf.l2j.gameserver.network.clientpackets.L2GameClientPacket.run(L2
GameClientPacket.java:75)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Сам скрипт
Код:
import sys
from java.util import Iterator
from net.sf.l2j.util import Rnd
from net.sf.l2j.gameserver.network.serverpackets import SystemMessage
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
from net.sf.l2j import L2DatabaseFactory
from net.sf.l2j.gameserver.templates import L2EtcItemType
from net.sf.l2j.gameserver.templates import L2Item
from java.lang import System
from net.sf.l2j.gameserver.idfactory import IdFactory
from net.sf.l2j.gameserver.model import L2ItemInstance
from net.sf.l2j.gameserver.datatables import AugmentationData
from net.sf.l2j.gameserver.model import L2Augmentation
from net.sf.l2j.gameserver.network.serverpackets import ItemList
from net.sf.l2j.gameserver.model import L2Skill
from net.sf.l2j.gameserver.datatables import SkillTable
qn = "8014_LifeStone"
#id нпц
NPC = 80007
#id итема для переноса
ITEM = 4037
#стоимость переноса
COST = 25
#список запрещенных итемов
FORBIDDEN = [6611,6612,6613,6614,6615,6616,6617,6618,6619,6620,6621]
print "importing custom: 8014_LifeStone OK"
class Quest (JQuest) :
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
def onAdvEvent (self,event,npc,player):
st = player.getQuestState(qn)
if event == "spisok":
if st.getQuestItemsCount(ITEM) < COST:
htmltext = u"<html><body>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u041b\u0421 \u0441\u0442\u043e\u0438\u0442<font color=74bff5>"+str(COST)+" Event Coin</font></body></html>"
return htmltext
htmltext = "<html><body><center><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br><img src=\"L2UI.SquareBlank\" width=260 height=2><br1>"
htmltext += u"<table width=260><tr><td align=center><font color=LEVEL>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u041b\u0421</font></td></tr></table>"
htmltext += u"<button value=\"\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043e\u0440\u0443\u0436\u0438\u0435\" action=\"bypass -h Quest 8014_LifeStone step1\" width=80 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><br1>"
htmltext += "<center><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32></center></body></html>"
elif event == "step1":
htmltext = u"<html><body>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u041b\u0421:<br>\u041e\u0442\u043a\u0443\u0434\u0430 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c?<br><br><table width=300>"
SPWEAPONS = ["Sword","Blunt","Dagger","Bow","Etc","Pole","Fist","Dual Sword","Dual Fist","Big Sword","Big Blunt"]
for Item in st.getPlayer().getInventory().getItems():
itemTemplate = Item.getItem()
idtest = Item.getItemId()
itype = str(Item.getItemType())
if idtest not in FORBIDDEN and Item.isAugmented() and not Item.isEquipped() and itype in SPWEAPONS:
cnt = Item.getCount()
count = str(cnt)
grade = itemTemplate.getCrystalType()
con=L2DatabaseFactory.getInstance().getConnection()
listitems=con.prepareStatement("SELECT itemIcon FROM z_market_icons WHERE itemId=?")
listitems.setInt(1, idtest)
rs=listitems.executeQuery()
while (rs.next()) :
icon=rs.getString("itemIcon")
try :
if grade == 1:
pgrade = str("[D]")
elif grade == 2:
pgrade = str("[C]")
elif grade == 3:
pgrade = str("[B]")
elif grade == 4:
pgrade = str("[A]")
elif grade == 5:
pgrade = str("[S]")
else:
pgrade = str("")
if Item.getEnchantLevel() == 0:
enchant = str("")
else:
enchant = " +"+str(Item.getEnchantLevel())+""
htmltext += "<tr><td><img src=\"Icon."+str(icon)+"\" width=32 height=32></td><td><a action=\"bypass -h Quest 8014_LifeStone step1next_" + str(Item.getObjectId()) +"\">" + itemTemplate.getName() + ""+str(pgrade)+" " + enchant + "</a></td></tr>"
except :
try : insertion.close()
except : pass
try :
con.close()
except :
pass
htmltext += u"</table><br><a action=\"bypass -h Quest 8014_LifeStone spisok\">\u0412\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f.</a></body></html>"
elif event.startswith("step1next_"):
itemObjId = int(event.replace("step1next_", ""))
obj = str(itemObjId)
Item = st.getPlayer().getInventory().getItemByObjectId(itemObjId)
itemTemplate = Item.getItem()
if Item and not Item.isEquipped():
cnt = Item.getCount()
count = str(cnt)
grade = itemTemplate.getCrystalType()
igrade = str(itemTemplate.getCrystalType())
itype = str(Item.getItemType())
idtest = Item.getItemId()
con=L2DatabaseFactory.getInstance().getConnection()
listitems=con.prepareStatement("SELECT itemIcon, skill, attributes FROM `z_market_icons` icon, `augmentations` aug WHERE icon.itemId=? AND aug.item_id=?")
listitems.setInt(1, idtest)
listitems.setInt(2, itemObjId)
rs=listitems.executeQuery()
while (rs.next()) :
icon=rs.getString("itemIcon")
skill=rs.getInt("skill")
attributes=rs.getInt("attributes")
try :
st.set("oneitem",obj)
st.set("skill",str(skill))
grades = {1: "d", 2: "c", 3: "b", 4: "a", 5: "s"}
pgrade = grades.get(grade, str(""))
enchant = (Item.getEnchantLevel() > 0 and " +"+str(Item.getEnchantLevel())+"") or str("")
htmltext = u"<html><body>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u041b\u0421:<br>\u0418\u0437 \u044d\u0442\u043e\u0433\u043e \u043e\u0440\u0443\u0436\u0438\u044f \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c?<br>"
htmltext += "<table width=300><tr><td><img src=\"Icon."+str(icon)+"\" width=32 height=32></td><td><font color=LEVEL>" + itemTemplate.getName() + " " + enchant + "</font><img src=\"symbol.grade_"+str(pgrade)+"\" width=16 height=16><br></td></tr></table><br><br>"
if skill != 0:
skill = SkillTable.getInstance().getInfo(skill, 1)
name = skill.getName()
htmltext += "<br><font color=bef574>["+str(name)+"]</font><br>"
htmltext += u"<button value=\"\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c\" action=\"bypass -h Quest 8014_LifeStone step2\" width=60 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><br>"
else:
htmltext += u"\u0412 \u044d\u0442\u043e\u043c \u043e\u0440\u0443\u0436\u0438\u0435 \u043d\u0435\u0442 \u0441\u043a\u0438\u043b\u043b\u0430"
htmltext += u"<br><a action=\"bypass -h Quest 8014_LifeStone spisok\">\u0412\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f.</a></body></html>"
except :
try : listitems.close()
except : pass
try :
con.close()
except :
pass
else :
htmltext = u"<html><body>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u041b\u0421:<br>\u041e\u0448\u0438\u0431\u043a\u0430!<br><a action=\"bypass -h Quest 8014_LifeStone spisok\">\u0412\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f.</a></body></html>"
elif event == "step2":
htmltext = u"<html><body>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u041b\u0421:<br>\u041a\u0443\u0434\u0430 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c?<br><br><table width=300>"
SPWEAPONS = ["Sword","Blunt","Dagger","Bow","Etc","Pole","Fist","Dual Sword","Dual Fist","Big Sword","Big Blunt"]
weapon1 = st.getInt("oneitem")
for Item in st.getPlayer().getInventory().getItems():
itemTemplate = Item.getItem()
idtest = Item.getItemId()
itype = str(Item.getItemType())
if idtest not in FORBIDDEN and not Item.isEquipped() and itype in SPWEAPONS and Item.getObjectId() != weapon1 and not Item.isAugmented():
grade = itemTemplate.getCrystalType()
con=L2DatabaseFactory.getInstance().getConnection()
listitems=con.prepareStatement("SELECT itemIcon FROM icons WHERE itemId=?")
listitems.setInt(1, idtest)
rs=listitems.executeQuery()
while (rs.next()) :
icon=rs.getString("itemIcon")
try :
if grade == 1:
pgrade = str("[D]")
elif grade == 2:
pgrade = str("[C]")
elif grade == 3:
pgrade = str("[B]")
elif grade == 4:
pgrade = str("[A]")
elif grade == 5:
pgrade = str("[S]")
else:
pgrade = str("")
if Item.getEnchantLevel() == 0:
enchant = str("")
else:
enchant = " +"+str(Item.getEnchantLevel())+""
htmltext += "<tr><td><img src=\"Icon."+str(icon)+"\" width=32 height=32></td><td><a action=\"bypass -h Quest 8014_LifeStone step2next_" + str(Item.getObjectId()) +"\">" + itemTemplate.getName() + ""+str(pgrade)+" " + enchant + "</a></td></tr>"
except :
try : insertion.close()
except : pass
try :
con.close()
except :
pass
htmltext += u"</table><br><a action=\"bypass -h Quest 8014_LifeStone spisok\">\u0412\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f.</a></body></html>"
elif event.startswith("step2next_"):
itemObjId = int(event.replace("step2next_", ""))
obj = str(itemObjId)
Item = st.getPlayer().getInventory().getItemByObjectId(itemObjId)
itemTemplate = Item.getItem()
if Item and not Item.isAugmented() and not Item.isEquipped():
cnt = Item.getCount()
count = str(cnt)
grade = itemTemplate.getCrystalType()
igrade = str(itemTemplate.getCrystalType())
itype = str(Item.getItemType())
idtest = Item.getItemId()
con=L2DatabaseFactory.getInstance().getConnection()
listitems=con.prepareStatement("SELECT itemIcon FROM z_market_icons WHERE itemId=?")
listitems.setInt(1, idtest)
rs=listitems.executeQuery()
while (rs.next()) :
icon=rs.getString("itemIcon")
try :
st.set("twoitem",obj)
st.set("lcount",count)
st.set("grade",igrade)
st.set("type",itype)
grades = {1: "d", 2: "c", 3: "b", 4: "a", 5: "s"}
pgrade = grades.get(grade, str(""))
enchant = (Item.getEnchantLevel() > 0 and " +"+str(Item.getEnchantLevel())+"") or str("")
htmltext = u"<html><body>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u041b\u0421:<br>\u0412 \u044d\u0442\u043e \u043e\u0440\u0443\u0436\u0438\u0435 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c?<br>"
htmltext += "<table width=300><tr><td><img src=\"Icon."+str(icon)+"\" width=32 height=32></td><td><font color=LEVEL>" + itemTemplate.getName() + " " + enchant + "</font><img src=\"symbol.grade_"+str(pgrade)+"\" width=16 height=16><br></td></tr></table><br><br>"
htmltext += u"<button value=\"\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c\" action=\"bypass -h Quest 8014_LifeStone step3\" width=60 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><br>"
htmltext += u"<br><a action=\"bypass -h Quest 8014_LifeStone spisok\">\u0412\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f.</a></body></html>"
except :
try : listitems.close()
except : pass
try :
con.close()
except :
pass
else :
htmltext = u"<html><body>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u041b\u0421:<br>\u041e\u0448\u0438\u0431\u043a\u0430!<br><a action=\"bypass -h Quest 8014_LifeStone spisok\">\u0412\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f.</a></body></html>"
elif event.startswith("step3"):
weapon1 = st.getInt("oneitem")
weapon2 = st.getInt("twoitem")
skillp = st.getInt("skill")
htmltext = u"<html><body>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u041b\u0421:<br>\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u043c?<br>"
skill = SkillTable.getInstance().getInfo(skillp, 1)
name = skill.getName()
htmltext += "<font color=bef574>["+str(name)+"]</font><br>"
htmltext += u"\u0438\u0437:"
Item = st.getPlayer().getInventory().getItemByObjectId(weapon1)
itemTemplate = Item.getItem()
if Item and Item.isAugmented() and not Item.isEquipped():
cnt = Item.getCount()
count = str(cnt)
grade = itemTemplate.getCrystalType()
igrade = str(itemTemplate.getCrystalType())
itype = str(Item.getItemType())
idtest = Item.getItemId()
con=L2DatabaseFactory.getInstance().getConnection()
listitems=con.prepareStatement("SELECT itemIcon FROM z_market_icons WHERE itemId=?")
listitems.setInt(1, idtest)
rs=listitems.executeQuery()
while (rs.next()) :
icon=rs.getString("itemIcon")
try :
grades = {1: "d", 2: "c", 3: "b", 4: "a", 5: "s"}
pgrade = grades.get(grade, str(""))
enchant = (Item.getEnchantLevel() > 0 and " +"+str(Item.getEnchantLevel())+"") or str("")
htmltext += "<table width=300><tr><td><img src=\"Icon."+str(icon)+"\" width=32 height=32></td><td><font color=LEVEL>" + itemTemplate.getName() + " " + enchant + "</font><img src=\"symbol.grade_"+str(pgrade)+"\" width=16 height=16><br></td></tr></table><br><br>"
except :
try : listitems.close()
except : pass
try :
con.close()
except :
pass
htmltext += "6=B:<br>"
Item = st.getPlayer().getInventory().getItemByObjectId(weapon2)
itemTemplate = Item.getItem()
if Item and not Item.isAugmented() and not Item.isEquipped():
cnt = Item.getCount()
count = str(cnt)
grade = itemTemplate.getCrystalType()
igrade = str(itemTemplate.getCrystalType())
itype = str(Item.getItemType())
idtest = Item.getItemId()
cons=L2DatabaseFactory.getInstance().getConnection()
listitemss=cons.prepareStatement("SELECT itemIcon FROM z_market_icons WHERE itemId=?")
listitemss.setInt(1, idtest)
rs=listitemss.executeQuery()
while (rs.next()) :
icon=rs.getString("itemIcon")
try :
grades = {1: "d", 2: "c", 3: "b", 4: "a", 5: "s"}
pgrade = grades.get(grade, str(""))
enchant = (Item.getEnchantLevel() > 0 and " +"+str(Item.getEnchantLevel())+"") or str("")
htmltext += "<table width=300><tr><td><img src=\"Icon."+str(icon)+"\" width=32 height=32></td><td><font color=LEVEL>" + itemTemplate.getName() + " " + enchant + "</font><img src=\"symbol.grade_"+str(pgrade)+"\" width=16 height=16><br></td></tr></table><br><br>"
except :
try : listitemss.close()
except : pass
try :
cons.close()
except :
pass
htmltext += u"<button value=\"\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c\" action=\"bypass -h Quest 8014_LifeStone step4\" width=60 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><br>"
else :
htmltext = u"<html><body>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u041b\u0421:<br>\u041e\u0448\u0438\u0431\u043a\u0430!<br><a action=\"bypass -h Quest 8014_LifeStone spisok\">\u0412\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f.</a></body></html>"
elif event.startswith("step4"):
weapon1 = st.getInt("oneitem")
weapon2 = st.getInt("twoitem")
htmltext = u"<html><body>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u041b\u0421:<br>\u041f\u043e\u0434\u043e\u0436\u0434\u0438\u0442\u0435...<br><br>"
if st.getQuestItemsCount(ITEM) < COST:
htmltext = u"<html><body>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u041b\u0421 \u0441\u0442\u043e\u0438\u0442<font color=74bff5>"+str(COST)+" Event Coin</font></body></html>"
return htmltext
item2 = st.getPlayer().getInventory().getItemByObjectId(weapon2)
item1 = st.getPlayer().getInventory().getItemByObjectId(weapon1)
con=L2DatabaseFactory.getInstance().getConnection()
listitems=con.prepareStatement("SELECT * FROM `augmentations` WHERE item_id=?")
listitems.setInt(1, weapon1)
rs=listitems.executeQuery()
while (rs.next()) :
attributes=rs.getInt("attributes")
skill=rs.getInt("skill")
try :
st.takeItems(ITEM,COST)
item2.setAugmentation(L2Augmentation(item2, attributes, skill, 10, True))
player.sendPacket(ItemList(player, False))
item1.removeAugmentation()
skilla = SkillTable.getInstance().getInfo(skill, 1)
name = skilla.getName()
htmltext += u"<font color=bef574>["+str(name)+"]</font> "u"\u041f\u0435\u0440\u0435\u043d\u0435\u0441\u0451\u043d.<br>"
except :
try : listitems.close()
except : pass
try :
con.close()
except :
pass
else:
htmltext = u"<html><body>\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u041b\u0421:<br>Oops!</body></html>"
return htmltext
def onTalk (self,npc,player):
st = player.getQuestState(qn)
npcId = npc.getNpcId()
if npcId == NPC:
htmltext = "privetstvie.htm"
return htmltext
QUEST = Quest(8014,qn,"custom")
QUEST.addStartNpc(NPC)
QUEST.addTalkId(NPC)
Кнопка по которой вылетела ошибка находится в евенте step2