Авторизация

Войдите, используя свой логин и пароль:

  • Страница 1 из 1
  • 1
Модератор форума: BlesseNtumble  
Форум » Lineage 2 "Java" » Дополнения к серверам » Ошибка в скрипте
Ошибка в скрипте
Отправлено 06.08.2012 - 13:271
Пользователи
6 сообщений
Мужчина
Статус: Offline
Error on: D:\Сервер\Eon_1\server\data\scripts\custom\q8014_LifeStone\__init__.py.error.log
Line: -1 - Column: -1

Traceback (innermost last):
File "__init__.py", line 321, in ?
TypeError: net.sf.l2j.gameserver.model.quest.State(): expected 0 args; got 2
Уже создавал эту тему, но он где то пропала.
Профиль Личное сообщение Дом. страница icq
0
Отправлено 06.08.2012 - 14:362
Пользователи
222 сообщений
Мужчина
Статус: Offline
выложи сам скрипт, __init__.py.error.log этот файл, ревизия твое сборки и от кого она. А то шаманов тут нету)
Профиль Личное сообщение Дом. страница icq
7
Отправлено 06.08.2012 - 16:203
Пользователи
128 сообщений
Мужчина
Статус: Offline
Quote (ex3me)
А то шаманов тут нету)


да скрипт выложи, а то хрен поймёш чо у тя там за 321 строка с ошибкой)

но вообще по идее, в net.sf.l2j.gameserver.model.quest.State(): у тя задействовано 2 аргумента, вместо 0
Профиль Личное сообщение Дом. страница icq
12
Отправлено 06.08.2012 - 20:394
Пользователи
528 сообщений
Мужчина
Статус: Offline
Вообще-то TypeError это несоответствие типов данных (отправленых и принимаемых классом) Ошибка происходит при обращении к классу State в строке 321. Скорее всего самая распространенная проблема с константами (CREATED, STARTED, COMPLETED)
Нужна помощь? Обращайся!
http://flash-dev.in.ua
Профиль Личное сообщение Дом. страница icq
49
Отправлено 08.08.2012 - 12:495
Пользователи
6 сообщений
Мужчина
Статус: Offline
Code
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 = "q8014_LifeStone"

NPC = 80007
ITEM = 4355
COST = 3
FORBIDDEN = [6611,6612,6613,6614,6615,6616,6617,6618,6619,6620,6621]

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 = "<html><body>Перенос Лс стоит <font color=74bff5>"+str(COST)+" Blue Eva</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 += "<table width=260><tr><td align=center><font color=LEVEL>Перенос ЛС</font></td></tr></table>"
      htmltext += "<button value=\"Выбрать пушку\" action=\"bypass -h Quest q8014_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 = "<html><body>Перенос ЛС:<br>Откуда переносим?<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 q8014_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 += "</table><br><a action=\"bypass -h Quest q8014_LifeStone spisok\">Вернуться.</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 =  "<html><body>Перенос ЛС:<br>Из этой пушки переносим?<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 += "<button value=\"Продолжить\" action=\"bypass -h Quest q8014_LifeStone step2\" width=60 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><br>"
            else:
              htmltext += "V etoi puwke net skilla"
            htmltext += "<br><a action=\"bypass -h Quest q8014_LifeStone spisok\">Вернуться.</a></body></html>"
          except :
            try : listitems.close()
            except : pass
        try :
          con.close()
        except :
          pass
      else :
        htmltext = "<html><body>Перенос ЛС:<br>Ошибка!<br><a action=\"bypass -h Quest q8014_LifeStone spisok\">Вернуться.</a></body></html>"
    elif event == "step2":
      htmltext = "<html><body>Перенос ЛС:<br>Куда переносим?<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 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 q8014_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 += "</table><br><a action=\"bypass -h Quest q8014_LifeStone spisok\">Вернуться.</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 =  "<html><body>Перенос ЛС:<br>В эту пушку переносим?<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 += "<button value=\"Продолжить\" action=\"bypass -h Quest q8014_LifeStone step3\" width=60 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><br>"
            htmltext += "<br><a action=\"bypass -h Quest q8014_LifeStone spisok\">Вернуться.</a></body></html>"
          except :
            try : listitems.close()
            except : pass
        try :
          con.close()
        except :
          pass
      else :
        htmltext = "<html><body>Перенос Лс:<br>Ошибка!<br><a action=\"bypass -h Quest q8014_LifeStone spisok\">Вернуться.</a></body></html>"
    elif event.startswith("step3"):
      weapon1 = st.getInt("oneitem")
      weapon2 = st.getInt("twoitem")
      skillp = st.getInt("skill")
      htmltext =  "<html><body>Перенос ЛС:<br>Подтверждаете?<br>"
      skill = SkillTable.getInstance().getInfo(skillp, 1)
      name = skill.getName()
      htmltext += "<font color=bef574>["+str(name)+"]</font><br>"
      htmltext += "Из:"
      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 += "В:<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 += "<button value=\"Продолжить\" action=\"bypass -h Quest q8014_LifeStone step4\" width=60 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><br>"
      else :
        htmltext = "<html><body>Перенос Лс:<br>Ошибка!<br><a action=\"bypass -h Quest q8014_LifeStone spisok\">Вернуться.</a></body></html>"
    elif event.startswith("step4"):
      weapon1 = st.getInt("oneitem")
      weapon2 = st.getInt("twoitem")
      htmltext =  "<html><body>Перенос Лс:<br>Подождите...<br><br>"
      if st.getQuestItemsCount(ITEM) < COST:
        htmltext = "<html><body>Перенос Лс стоит <font color=74bff5>"+str(COST)+" Blue Eva</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 += "<font color=bef574>["+str(name)+"]</font> переставлен.<br>"
        except :
          try : listitems.close()
          except : pass
      try :
        con.close()
      except :
        pass
    else:
      htmltext = "<html><body>Перенос ЛС:<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")
CREATED     = State('Start', QUEST)

QUEST.setInitialState(CREATED)

QUEST.addStartNpc(NPC)
QUEST.addTalkId(NPC)

Это тот скрипт там где эта ошибка

Добавлено (08.08.2012, 12:49)
---------------------------------------------
, а вот тот который подправил eXstreme, запускается без ошибок, но не работает(

Code
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 = "q8014_LifeStone"

NPC = 80007
ITEM = 4355
COST = 3
FORBIDDEN = [6611,6612,6613,6614,6615,6616,6617,6618,6619,6620,6621]

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 = "<html><body>Перенос Лс стоит <font color=74bff5>"+str(COST)+" Blue Eva</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 += "<table width=260><tr><td align=center><font color=LEVEL>Перенос ЛС</font></td></tr></table>"
      htmltext += "<button value=\"Выбрать пушку\" action=\"bypass -h Quest q8014_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 = "<html><body>Перенос ЛС:<br>Откуда переносим?<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 q8014_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 += "</table><br><a action=\"bypass -h Quest q8014_LifeStone spisok\">Вернуться.</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 =  "<html><body>Перенос ЛС:<br>Из этой пушки переносим?<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 += "<button value=\"Продолжить\" action=\"bypass -h Quest q8014_LifeStone step2\" width=60 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><br>"
            else:
              htmltext += "V etoi puwke net skilla"
            htmltext += "<br><a action=\"bypass -h Quest q8014_LifeStone spisok\">Вернуться.</a></body></html>"
          except :
            try : listitems.close()
            except : pass
        try :
          con.close()
        except :
          pass
      else :
        htmltext = "<html><body>Перенос ЛС:<br>Ошибка!<br><a action=\"bypass -h Quest q8014_LifeStone spisok\">Вернуться.</a></body></html>"
    elif event == "step2":
      htmltext = "<html><body>Перенос ЛС:<br>Куда переносим?<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 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 q8014_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 += "</table><br><a action=\"bypass -h Quest q8014_LifeStone spisok\">Вернуться.</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 =  "<html><body>Перенос ЛС:<br>В эту пушку переносим?<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 += "<button value=\"Продолжить\" action=\"bypass -h Quest q8014_LifeStone step3\" width=60 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><br>"
            htmltext += "<br><a action=\"bypass -h Quest q8014_LifeStone spisok\">Вернуться.</a></body></html>"
          except :
            try : listitems.close()
            except : pass
        try :
          con.close()
        except :
          pass
      else :
        htmltext = "<html><body>Перенос Лс:<br>Ошибка!<br><a action=\"bypass -h Quest q8014_LifeStone spisok\">Вернуться.</a></body></html>"
    elif event.startswith("step3"):
      weapon1 = st.getInt("oneitem")
      weapon2 = st.getInt("twoitem")
      skillp = st.getInt("skill")
      htmltext =  "<html><body>Перенос ЛС:<br>Подтверждаете?<br>"
      skill = SkillTable.getInstance().getInfo(skillp, 1)
      name = skill.getName()
      htmltext += "<font color=bef574>["+str(name)+"]</font><br>"
      htmltext += "Из:"
      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 += "В:<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 += "<button value=\"Продолжить\" action=\"bypass -h Quest q8014_LifeStone step4\" width=60 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><br>"
      else :
        htmltext = "<html><body>Перенос Лс:<br>Ошибка!<br><a action=\"bypass -h Quest q8014_LifeStone spisok\">Вернуться.</a></body></html>"
    elif event.startswith("step4"):
      weapon1 = st.getInt("oneitem")
      weapon2 = st.getInt("twoitem")
      htmltext =  "<html><body>Перенос Л
Профиль Личное сообщение Дом. страница icq
0
Отправлено 08.08.2012 - 13:576
Пользователи
528 сообщений
Мужчина
Статус: Offline
а вот тот который подправил eXstreme, запускается без ошибок, но не работает( haha
вопервых убери русский текст из питона или замени их на русский текст в кодировке ISO-8859-1

к примеру текст
Перенос Лс стоит
будет выглядеть как
\u041F\u0435\u0440\u0435\u043D\u043E\u0441 \u041B\u0441 \u0441\u0442\u043E\u0438\u0442
Нужна помощь? Обращайся!
http://flash-dev.in.ua
Профиль Личное сообщение Дом. страница icq
49
Отправлено 08.08.2012 - 18:437
Пользователи
6 сообщений
Мужчина
Статус: Offline
спс, как отпустит сделаю.

Добавлено (08.08.2012, 18:43)
---------------------------------------------
А кто подскажет, как можно(или какой програмой) заменить русский текст в кодировку ISO-8859-1
Профиль Личное сообщение Дом. страница icq
0
Отправлено 08.08.2012 - 22:478
Пользователи
528 сообщений
Мужчина
Статус: Offline
эклипс, np++, блокнот, dw... любой текстовый редактор в котором можно изменить кодировку текста.
Нужна помощь? Обращайся!
http://flash-dev.in.ua
Профиль Личное сообщение Дом. страница icq
49
Отправлено 20.08.2012 - 01:079
Пользователи
6 сообщений
Мужчина
Статус: Offline
Если меняю кодировку не в какую, не работает(
Профиль Личное сообщение Дом. страница icq
0
Форум » Lineage 2 "Java" » Дополнения к серверам » Ошибка в скрипте
  • Страница 1 из 1
  • 1
Поиск:

[email protected]

Все права соблюдены. Материал распространяется свободно, при условии указания ссылки на источник.

Хостинг от uCoz