Перейти к содержимому
La2Base
Главная
ЗагрузкиВикиФорумFAQ
ruen
Регистрация Войти
ГлавнаяФайлыВикиВойти
  • Главная
  • Загрузки
  • Вики
  • FAQ
  • Обратная связь
  • О проекте
  • Правила
  • Конфиденциальность
  • Условия использования

© 2026 la2base.com · Все права защищены

ruen
Форум/Дополнения к Lineage 2 Java серверам/[help] Точилка для L2j-archid
Поиск

[help] Точилка для L2j-archid

2 ответов138 просмотровСейчас просматривают: 1
slastik24
slastik24

Пользователь

Бывалый

Постов: 199

На форуме с: 13.08.2008

Репутация: +135

Рейтинг: 0

· 03.06.2009, 14:29

Вот решил спросить, есть ли у кого нибудь рабочий Enchanter для L2J-Archid?

У меня есть, но он не точит почему-то(в квестах не силен).
Вот содержимое:

Раскрывающийся текст
Код
#------------------------------------------------------------------------------------------------------#
#Made by Z0mbie! (418260172) for www.la2base.ru. Have Fun!---------------------------------------------#
#------------------------------------------------------------------------------------------------------#
#---12.03.08 11.55 (GMT+5) NPC стало точить итемы правельно--------------------------------------------#
#---7.11.08 18.54 (GMT+5) Переписал код. добавил проверку на наличии проклятого оружия.----------------#
#---15.11.08 16.14 (GMT+5) Переписал полностью. теперь предметы именно _точатся_,а не так как раньше---#
#------------------------------------------------------------------------------------------------------#
#------Секция импортов,щас настроена на L2Jserver CT1.5,настройте под свою сборку----------------------#
import sys                                                                                            #
from com.l2jarchid.gameserver.model              import Inventory                                       #
from com.l2jarchid.gameserver.cache              import HtmCache                                        #
from com.l2jarchid.gameserver.model              import L2ItemInstance                                  #
from com.l2jarchid.gameserver.model.quest        import State                                           #
from com.l2jarchid.gameserver.model.quest        import QuestState                                      #
from com.l2jarchid.gameserver.network.serverpackets      import InventoryUpdate                                 #
from com.l2jarchid.gameserver.network.serverpackets      import UserInfo                                        #
from com.l2jarchid.gameserver.network.serverpackets      import CharInfo                                        #
from com.l2jarchid.gameserver.network.serverpackets      import SystemMessage                                   #
from com.l2jarchid.gameserver.model.quest.jython import QuestJython as JQuest                           #
                                                                                                       #
#-----Секция настроек,настраивате как вам надо---------------------------------------------------------#
qn = "7778_Ench"
ADENA = 9999
PRISE = 100      #Цена
maxTalk = 0        # Сколько раз игрок может точнуть у НПЦ весчи.0 чтобы безконечно
ench = 1           # на скока точить
maxEnch =10000     # Максимальная заточка
lvl=20              # Минимальный уровень игрока,каторому можно пользоваться точилкой. 0 - для отключения
NPC = 56  

#-----Главный код,ни чё не изминяйте,если не знаете что и куда--------------------------------------------
def Ench (st,item,player):
    htmltext = HtmCache.getInstance().getHtm("data/scripts/custom/" + qn + "/enchanter.htm")
    itemInstance = player.getInventory().getPaperdollItem(item)
    curEnchant = itemInstance.getEnchantLevel()
    encc=curEnchant+ench
    if maxTalk==0:
         htma=""
         htmltext = htmltext.replace("htma",htma)
    elif maxTalk>0:
         id=st.getInt("cound")+1
         st.set("cound",str(id))
         htma="<br>Вы можете точиться:<font color=\"LEVEL\">"+str(maxTalk-id) +"</font>раз"
         htmltext = htmltext.replace("htma",htma)
    if encc>=maxEnch:
       htmltext="<html>Вы больше не можети точиться</html>"
    else:  
       st.takeItems(ADENA,PRISE)
       player.getInventory().unEquipItemInSlotAndRecord(item)
       itemInstance.setEnchantLevel(encc)
       player.getInventory().equipItemAndRecord(itemInstance)
       InventoryUpdate().addModifiedItem(itemInstance)
       player.sendPacket(InventoryUpdate())
       player.broadcastPacket(CharInfo(player))
       player.sendPacket(UserInfo(player))
       player.sendMessage("Enchanted"+itemInstance.getItem().getName()+" from "+str(curEnchant)+" to "+str(encc))
    if st.getInt("cound")==maxTalk>0:
       htmltext = "<html>Вы Больше не можете точиться</html>"
    return htmltext
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 == "0" :
        htmltext=Ench(st,Inventory.PAPERDOLL_UNDER,player)
     if event == "1" :
        htmltext=Ench(st,Inventory.PAPERDOLL_LEAR,player)
     if event == "2" :
        htmltext=Ench(st,Inventory.PAPERDOLL_REAR,player)
     if event == "4" :
        htmltext=Ench(st,Inventory.PAPERDOLL_NECK,player)
     if event == "5" :
        htmltext=Ench(st,Inventory.PAPERDOLL_RFINGER,player)
     if event == "6" :
        htmltext=Ench(st,Inventory.PAPERDOLL_LFINGER,player)
     if event == "8" :
        htmltext=Ench(st,Inventory.PAPERDOLL_HEAD,player)
     if event == "9" :
        htmltext=Ench(st,Inventory.PAPERDOLL_RHAND,player)
     if event == "10" :
        htmltext=Ench(st,Inventory.PAPERDOLL_LHAND,player)
     if event == "11" :
        htmltext=Ench(st,Inventory.PAPERDOLL_GLOVES,player)
     if event == "12" :
        htmltext=Ench(st,Inventory.PAPERDOLL_CHEST,player)
     if event == "13" :
        htmltext=Ench(st,Inventory.PAPERDOLL_LEGS,player)
     if event == "14" :
        htmltext=Ench(st,Inventory.PAPERDOLL_FEET,player)
     return htmltext
def onTalk (self,npc,player) :
   st = player.getQuestState(qn)
   id = st.getInt("cound")
   if not st : return htmltext
   if npc.getNpcId() == NPC:
    if player.getLevel()<lvl:
        htmltext="<html>Достигнити вначале <font color=\"LEVEL\">"+str(lvl)+" уровня </font></html>"
        st.exitQuest(1)
    elif maxTalk==0:
          htmltext = HtmCache.getInstance().getHtm("data/scripts/custom/"+qn+"/enchanter.htm")
          htmltext = htmltext.replace("htma","")
    elif player.isCursedWeaponEquipped():
        htmltext = "<html>Я не точу игроков с проклятым оружеем!</html>"
        st.exitQuest(1)
    elif st.getQuestItemsCount(ADENA)<PRISE:
         htmltext="<html> У вас нехватает денег<br> необходимо <font color=\"LEVEL\">"+str(PRISE)+"Аден</font></html>"
         st.exitQuest(1)
    elif id == maxTalk:
          htmltext = "<html>Ты больше не можеш точитьcя</html>"
          st.exitQuest(1)
    elif maxTalk>=1:
          htmltext = HtmCache.getInstance().getHtm("data/scripts/custom/"+qn+"/enchanter.htm")
          htma="<br>Вы можете точиться:<font color=\"LEVEL\">"+str(maxTalk-id)+"</font>раз"
          htmltext = htmltext.replace("htma",htma)        
   return htmltext
QUEST=Quest(7778, qn, "custom")
QUEST.addStartNpc(NPC)                        
QUEST.addTalkId(NPC)
print "-------------------------------> Enchanter loaded <-----------------------------"


А при нажатии на кнопку, у меня вылазит в ГС следующее:

Раскрывающийся текст
Код
03.06.2009 17:27:38 com.l2jarchid.gameserver.network.clientpackets.RequestBypassToServer runImpl
WARNING: Bad RequestBypassToServer:
java.lang.NullPointerException
    at com.l2jarchid.gameserver.model.quest.QuestState.getStateId(QuestState.java:188)
    at com.l2jarchid.gameserver.model.quest.Quest.createQuestInDb(Quest.java:744)
    at com.l2jarchid.gameserver.model.quest.Quest.newQuestState(Quest.java:183)
    at com.l2jarchid.gameserver.model.actor.L2Npc.showQuestWindow(L2Npc.java:1302)
    at com.l2jarchid.gameserver.model.actor.L2Npc.onBypassFeedback(L2Npc.java:970)
    at com.l2jarchid.gameserver.model.actor.instance.L2NpcInstance.onBypassFeedback(L2NpcInstance.java:321)
    at com.l2jarchid.gameserver.network.clientpackets.RequestBypassToServer.runImpl(RequestBypassToServer.java:196)
    at com.l2jarchid.gameserver.network.clientpackets.L2GameClientPacket.run(L2GameClientPacket.java:78)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
03.06.2009 17:31:21 com.l2jarchid.gameserver.model.quest.Quest showError
WARNING:
Traceback (innermost last):
  File "E:\server\My Server\server\L2JArchid-Game\data\jscript\custom\7778_Ench\__init__.py", line 101, in onTalk
AttributeError: 'NoneType' object has no attribute 'replace'

    at org.python.core.Py.AttributeError(Unknown Source)
    at org.python.core.PyObject.noAttributeError(Unknown Source)
    at org.python.core.PyObject.__getattr__(Unknown Source)
    at org.python.core.PyObject.invoke(Unknown Source)
    at data.jscript.custom.7778_Ench$py.onTalk$5(E:\server\My Server\server\L2JArchid-Game\data\jscript\custom\7778_Ench\__init__.py:101)
    at data.jscript.custom.7778_Ench$py.call_function(E:\server\My Server\server\L2JArchid-Game\data\jscript\custom\7778_Ench\__init__.py)
    at org.python.core.PyTableCode.call(Unknown Source)
    at org.python.core.PyTableCode.call(Unknown Source)
    at org.python.core.PyTableCode.call(Unknown Source)
    at org.python.core.PyFunction.__call__(Unknown Source)
    at org.python.core.PyMethod.__call__(Unknown Source)
    at org.python.core.PyObject.__call__(Unknown Source)
    at org.python.core.PyObject._jcallexc(Unknown Source)
    at org.python.core.PyObject._jcall(Unknown Source)
    at org.python.proxies.data.jscript.custom.7778_Ench$Quest$273.onTalk(Unknown Source)
    at com.l2jarchid.gameserver.model.quest.Quest.notifyTalk(Quest.java:318)
    at com.l2jarchid.gameserver.model.actor.L2Npc.showQuestWindow(L2Npc.java:1286)
    at com.l2jarchid.gameserver.model.actor.L2Npc.onBypassFeedback(L2Npc.java:970)
    at com.l2jarchid.gameserver.model.actor.instance.L2NpcInstance.onBypassFeedback(L2NpcInstance.java:321)
    at com.l2jarchid.gameserver.network.clientpackets.RequestBypassToServer.runImpl(RequestBypassToServer.java:196)
    at com.l2jarchid.gameserver.network.clientpackets.L2GameClientPacket.run(L2GameClientPacket.java:78)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
03.06.2009 17:31:50 com.l2jarchid.gameserver.model.quest.Quest showError
WARNING:
Traceback (innermost last):
  File "E:\server\My Server\server\L2JArchid-Game\data\jscript\custom\7778_Ench\__init__.py", line 101, in onTalk
AttributeError: 'NoneType' object has no attribute 'replace'

    at org.python.core.Py.AttributeError(Unknown Source)
    at org.python.core.PyObject.noAttributeError(Unknown Source)
    at org.python.core.PyObject.__getattr__(Unknown Source)
    at org.python.core.PyObject.invoke(Unknown Source)
    at data.jscript.custom.7778_Ench$py.onTalk$5(E:\server\My Server\server\L2JArchid-Game\data\jscript\custom\7778_Ench\__init__.py:101)
    at data.jscript.custom.7778_Ench$py.call_function(E:\server\My Server\server\L2JArchid-Game\data\jscript\custom\7778_Ench\__init__.py)
    at org.python.core.PyTableCode.call(Unknown Source)
    at org.python.core.PyTableCode.call(Unknown Source)
    at org.python.core.PyTableCode.call(Unknown Source)
    at org.python.core.PyFunction.__call__(Unknown Source)
    at org.python.core.PyMethod.__call__(Unknown Source)
    at org.python.core.PyObject.__call__(Unknown Source)
    at org.python.core.PyObject._jcallexc(Unknown Source)
    at org.python.core.PyObject._jcall(Unknown Source)
    at org.python.proxies.data.jscript.custom.7778_Ench$Quest$273.onTalk(Unknown Source)
    at com.l2jarchid.gameserver.model.quest.Quest.notifyTalk(Quest.java:318)
    at com.l2jarchid.gameserver.model.actor.L2Npc.showQuestWindow(L2Npc.java:1286)
    at com.l2jarchid.gameserver.model.actor.L2Npc.onBypassFeedback(L2Npc.java:970)
    at com.l2jarchid.gameserver.model.actor.instance.L2NpcInstance.onBypassFeedback(L2NpcInstance.java:321)
    at com.l2jarchid.gameserver.network.clientpackets.RequestBypassToServer.runImpl(RequestBypassToServer.java:196)
    at com.l2jarchid.gameserver.network.clientpackets.L2GameClientPacket.run(L2GameClientPacket.java:78)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)



Помогите разобраться.

— I am DJ

0
segal
segal

Пользователь

Бывалый

Постов: 317

На форуме с: 03.11.2008

Репутация: +242

Рейтинг: 0

· 04.06.2009, 18:35

попробуй так

Код
#------------------------------------------------------------------------------------------------------#
#Made by Z0mbie! (418260172) for www.la2base.ru. Have Fun!---------------------------------------------#
#------------------------------------------------------------------------------------------------------#
#---12.03.08 11.55 (GMT+5) NPC стало точить итемы правельно--------------------------------------------#
#---7.11.08 18.54 (GMT+5) Переписал код. добавил проверку на наличии проклятого оружия.----------------#
#---15.11.08 16.14 (GMT+5) Переписал полностью. теперь предметы именно _точатся_,а не так как раньше---#
#------------------------------------------------------------------------------------------------------#
#------Секция импортов,щас настроена на L2Jserver CT1.5,настройте под свою сборку----------------------#
import sys                                                                                            #
from com.l2jarchid.gameserver.model              import Inventory                                       #
from com.l2jarchid.gameserver.cache              import HtmCache                                        #
from com.l2jarchid.gameserver.model              import L2ItemInstance                                  #
from com.l2jarchid.gameserver.model.quest        import State                                           #
from com.l2jarchid.gameserver.model.quest        import QuestState                                      #
from com.l2jarchid.gameserver.network.serverpackets      import InventoryUpdate                                 #
from com.l2jarchid.gameserver.network.serverpackets      import UserInfo                                        #
from com.l2jarchid.gameserver.network.serverpackets      import CharInfo                                        #
from com.l2jarchid.gameserver.network.serverpackets      import SystemMessage                                   #
from com.l2jarchid.gameserver.model.quest.jython import QuestJython as JQuest                           #
                                                                                                       #
#-----Секция настроек,настраивате как вам надо---------------------------------------------------------#
qn = "7778_Ench"
ADENA = 57
PRISE = 10000      #Цена
maxTalk = 0        # Сколько раз игрок может точнуть у НПЦ весчи.0 чтобы безконечно
ench = 1           # на скока точить
maxEnch =31     # Максимальная заточка
lvl=0              # Минимальный уровень игрока,каторому можно пользоваться точилкой. 0 - для отключения
NPC = 70041  

#-----Главный код,ни чё не изминяйте,если не знаете что и куда--------------------------------------------
def Ench (st,item,player):
    htmltext = HtmCache.getInstance().getHtm("L2JArchid-Game/data/jscript/"+qn+"/enchanter.htm")
    itemInstance = player.getInventory().getPaperdollItem(item)
    curEnchant = itemInstance.getEnchantLevel()
    encc=curEnchant+ench
    if maxTalk==0:
         htma=""
         htmltext = htmltext.replace("htma",htma)
    elif maxTalk>0:
         id=st.getInt("cound")+1
         st.set("cound",str(id))
         htma="<br>Вы можете точиться:<font color=\"LEVEL\">"+str(maxTalk-id) +"</font>раз"
         htmltext = htmltext.replace("htma",htma)
    if encc>=maxEnch:
       htmltext="<html>Вы больше не можети точиться</html>"
    else:  
       st.takeItems(ADENA,PRISE)
       player.getInventory().unEquipItemInSlotAndRecord(item)
       itemInstance.setEnchantLevel(encc)
       player.getInventory().equipItemAndRecord(itemInstance)
       InventoryUpdate().addModifiedItem(itemInstance)
       player.sendPacket(InventoryUpdate())
       player.broadcastPacket(CharInfo(player))
       player.sendPacket(UserInfo(player))
       player.sendMessage("Enchanted"+itemInstance.getItem().getName()+" from "+str(curEnchant)+" to "+str(encc))
    if st.getInt("cound")==maxTalk>0:
       htmltext = "<html>Вы Больше не можете точиться</html>"
    return htmltext
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 == "0" :
        htmltext=Ench(st,Inventory.PAPERDOLL_UNDER,player)
     if event == "1" :
        htmltext=Ench(st,Inventory.PAPERDOLL_LEAR,player)
     if event == "2" :
        htmltext=Ench(st,Inventory.PAPERDOLL_REAR,player)
     if event == "4" :
        htmltext=Ench(st,Inventory.PAPERDOLL_NECK,player)
     if event == "5" :
        htmltext=Ench(st,Inventory.PAPERDOLL_RFINGER,player)
     if event == "6" :
        htmltext=Ench(st,Inventory.PAPERDOLL_LFINGER,player)
     if event == "8" :
        htmltext=Ench(st,Inventory.PAPERDOLL_HEAD,player)
     if event == "9" :
        htmltext=Ench(st,Inventory.PAPERDOLL_RHAND,player)
     if event == "10" :
        htmltext=Ench(st,Inventory.PAPERDOLL_LHAND,player)
     if event == "11" :
        htmltext=Ench(st,Inventory.PAPERDOLL_GLOVES,player)
     if event == "12" :
        htmltext=Ench(st,Inventory.PAPERDOLL_CHEST,player)
     if event == "13" :
        htmltext=Ench(st,Inventory.PAPERDOLL_LEGS,player)
     if event == "14" :
        htmltext=Ench(st,Inventory.PAPERDOLL_FEET,player)
     return htmltext
def onTalk (self,npc,player) :
   st = player.getQuestState(qn)
   id = st.getInt("cound")
   if not st : return htmltext
   if npc.getNpcId() == NPC:
    if player.getLevel()<lvl:
        htmltext="<html>Достигнити вначале <font color=\"LEVEL\">"+str(lvl)+" уровня </font></html>"
        st.exitQuest(1)
    elif maxTalk==0:
          htmltext = HtmCache.getInstance().getHtm("L2JArchid-Game/data/jscript/"+qn+"/enchanter.htm")
          htmltext = htmltext.replace("htma","")
    elif player.isCursedWeaponEquipped():
        htmltext = "<html>Я не точу игроков с проклятым оружеем!</html>"
        st.exitQuest(1)
    elif st.getQuestItemsCount(ADENA)<PRISE:
         htmltext="<html> У вас нехватает денег<br> необходимо <font color=\"LEVEL\">"+str(PRISE)+"Аден</font></html>"
         st.exitQuest(1)
    elif id == maxTalk:
          htmltext = "<html>Ты больше не можеш точитьcя</html>"
          st.exitQuest(1)
    elif maxTalk>=1:
          htmltext = HtmCache.getInstance().getHtm("L2JArchid-Game/data/jscript/"+qn+"/enchanter.htm")
          htma="<br>Вы можете точиться:<font color=\"LEVEL\">"+str(maxTalk-id)+"</font>раз"
          htmltext = htmltext.replace("htma",htma)        
   return htmltext
QUEST=Quest(7778, qn, "custom")
QUEST.addStartNpc(NPC)                        
QUEST.addTalkId(NPC)
print "-------------------------------> Enchanter loaded <-----------------------------"

0
Тема закрыта для ответов