Перейти к содержанию
Авторизация  
Riper

Нужна Помощь По Квесту

Рекомендуемые сообщения

Поставил квест на сервер, грузится все норм.

Но при вызове квеста в ГС летит ошибка:

Скрытый текст

File "__init__.py", line 63, in onTalk

AttributeError: class 'com.l2jfrozen.gameserver.model.quest.State' has no attrib

ute 'COMPLETED'

 

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.pycode._pyx444.onTalk$4(__init__.py:63)

at org.python.pycode._pyx444.call_function(__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.main$Quest$443.onTalk(Unknown Source)

at com.l2jfrozen.gameserver.model.quest.Quest.notifyTalk(Quest.java:514)

 

at com.l2jfrozen.gameserver.model.actor.instance.L2NpcInstance.showQuest

Window(L2NpcInstance.java:1865)

at com.l2jfrozen.gameserver.model.actor.instance.L2NpcInstance.onBypassF

eedback(L2NpcInstance.java:1127)

at com.l2jfrozen.gameserver.network.clientpackets.RequestBypassToServer.

runImpl(RequestBypassToServer.java:237)

at com.l2jfrozen.gameserver.network.clientpackets.L2GameClientPacket.run

(L2GameClientPacket.java:75)

at com.l2jfrozen.gameserver.network.L2GameClient.run(L2GameClient.java:1

202)

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)

Вот сам квест:

Скрытый текст
import sys

from com.l2jfrozen import Config

from com.l2jfrozen.gameserver.model.quest import State

from com.l2jfrozen.gameserver.model.quest import QuestState

from com.l2jfrozen.gameserver.model.quest.jython import QuestJython as JQuest

 

qn = "q902_FeatherGathering"

 

## нпц

NPC = 77777

 

## Мобы

MOBS = [22126,22124,22123]

#босс

BOSS = 70020

 

## Дроп

#id перьев с мобов в мос

FEATHER = 9983

#сколько нужно?

FEATHER_NEED = 300

#шанс дропа, %

FEATHER_CHANCE = 50

#id итема с босса

BOSS_ITEM = 9984

 

##Награда

#id крыльев

WINGS = 9996

 

class Quest (JQuest) :

 

def __init__(self,id,name,descr) : JQuest.__init__(self,id,name,descr)

 

def onEvent (self,event,st) :

htmltext = event

if event == "accept.htm":

st.setState(State.STARTED)

st.playSound("ItemSound.quest_accept")

st.set("cond","1")

elif event == "finish.htm":

if st.getQuestItemsCount(FEATHER) >= FEATHER_NEED and st.getQuestItemsCount(BOSS_ITEM) >= 1:

st.takeItems(FEATHER, -1)

st.takeItems(BOSS_ITEM, -1)

st.giveItems(WINGS, 1)

st.set("cond","0")

st.playSound("ItemSound.quest_finish")

st.setState(State.COMPLETED)

else:

htmltext = "mobs.htm"

return htmltext

 

def onTalk (self,npc,player):

st = player.getQuestState(qn)

if not st:

return "<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>"

npcId = npc.getNpcId()

idd = st.getState()

cond = st.getInt("cond")

if npcId == NPC:

if idd == State.COMPLETED :

htmltext = "completed.htm"

if idd == State.CREATED :

htmltext = "hello1.htm"

elif cond == 1:

if st.getQuestItemsCount(FEATHER) >= FEATHER_NEED and st.getQuestItemsCount(BOSS_ITEM) >= 1:

htmltext = "mobs2.htm"

else:

htmltext = "mobs.htm"

return htmltext

 

def onKill(self,npc,player,isPet):

st = player.getQuestState(qn)

if not st or st.getInt("cond") != 1:

return

npcId = npc.getNpcId()

reward = 0

limit = 1

chance = 100

if npcId in MOBS:

reward = FEATHER

limit = FEATHER_NEED

chance = FEATHER_CHANCE

if npcId == BOSS:

reward = BOSS_ITEM

limit = 1

if reward > 0:

party = player.getParty()

if party:

for member in party.getPartyMembers():

if not member.isAlikeDead():

st = member.getQuestState("q902_FeatherGathering")

if st and st.getQuestItemsCount(reward) < limit and st.getRandom(100) <= chance:

st.giveItems(reward, 1)

st.playSound("ItemSound.quest_itemget")

if st.getQuestItemsCount(reward) >= limit:

st.playSound("ItemSound.quest_middle")

else:

if st.getQuestItemsCount(reward) < limit and st.getRandom(100) <= chance:

st.giveItems(reward, 1)

st.playSound("ItemSound.quest_itemget")

return

 

QUEST = Quest(902, qn, "Feather Gathering")

 

QUEST.addStartNpc(NPC)

QUEST.addTalkId(NPC)

QUEST.addKillId(BOSS)

 

for m in MOBS:

QUEST.addKillId(m)

 

Помогите решить данный геморой пожалуйста)

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

перепиши квест в чем проблемаmee.png

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

ну если бы я мог переписал его, я бы обращался на форум?

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

я тоже питон не знаю но переписал его за 5 минут под фрозенов в чем проблема?я даже не кодер

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

Вот ппц ты думаешь я не пробовал?

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

думаю что нет раз у тебя 1 ошибка из 5-6 выдается

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

from com.l2jfrozen.gameserver.model.quest.jython import QuestJython as JQuest

 

попробуй из него сделать так

 

 

from import QuestJython as JQuest

 

 

Помог напиши в ICQ 8-650-259 твоя помощь нужна))

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

А блин. Черкани в аську. помогу с ними. то что я написал не поможет в кв импорты не правильно сделаны.

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты
from com.l2jfrozen.gameserver.model.quest.jython import QuestJython as JQuest

 

попробуй из него сделать так

 

 

from import QuestJython as JQuest

 

 

Помог напиши в ICQ 8-650-259 твоя помощь нужна))

Не помог( не грузится(

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

дак подскажите какой и как исправить)

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

#достал попкорн наблюдаю за происходящим

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

был бы модератором, дал бы бан за ап каждые 10 минут...

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты
Поставил квест на сервер, грузится все норм.

Но при вызове квеста в ГС летит ошибка:

Скрытый текст

File "__init__.py", line 63, in onTalk

AttributeError: class 'com.l2jfrozen.gameserver.model.quest.State' has no attrib

ute 'COMPLETED'

 

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.pycode._pyx444.onTalk$4(__init__.py:63)

at org.python.pycode._pyx444.call_function(__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.main$Quest$443.onTalk(Unknown Source)

at com.l2jfrozen.gameserver.model.quest.Quest.notifyTalk(Quest.java:514)

 

at com.l2jfrozen.gameserver.model.actor.instance.L2NpcInstance.showQuest

Window(L2NpcInstance.java:1865)

at com.l2jfrozen.gameserver.model.actor.instance.L2NpcInstance.onBypassF

eedback(L2NpcInstance.java:1127)

at com.l2jfrozen.gameserver.network.clientpackets.RequestBypassToServer.

runImpl(RequestBypassToServer.java:237)

at com.l2jfrozen.gameserver.network.clientpackets.L2GameClientPacket.run

(L2GameClientPacket.java:75)

at com.l2jfrozen.gameserver.network.L2GameClient.run(L2GameClient.java:1

202)

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)

Вот сам квест:

Скрытый текст
import sys

from com.l2jfrozen import Config

from com.l2jfrozen.gameserver.model.quest import State

from com.l2jfrozen.gameserver.model.quest import QuestState

from com.l2jfrozen.gameserver.model.quest.jython import QuestJython as JQuest

 

qn = "q902_FeatherGathering"

 

## нпц

NPC = 77777

 

## Мобы

MOBS = [22126,22124,22123]

#босс

BOSS = 70020

 

## Дроп

#id перьев с мобов в мос

FEATHER = 9983

#сколько нужно?

FEATHER_NEED = 300

#шанс дропа, %

FEATHER_CHANCE = 50

#id итема с босса

BOSS_ITEM = 9984

 

##Награда

#id крыльев

WINGS = 9996

 

class Quest (JQuest) :

 

def __init__(self,id,name,descr) : JQuest.__init__(self,id,name,descr)

 

def onEvent (self,event,st) :

htmltext = event

if event == "accept.htm":

st.setState(State.STARTED)

st.playSound("ItemSound.quest_accept")

st.set("cond","1")

elif event == "finish.htm":

if st.getQuestItemsCount(FEATHER) >= FEATHER_NEED and st.getQuestItemsCount(BOSS_ITEM) >= 1:

st.takeItems(FEATHER, -1)

st.takeItems(BOSS_ITEM, -1)

st.giveItems(WINGS, 1)

st.set("cond","0")

st.playSound("ItemSound.quest_finish")

st.setState(State.COMPLETED)

else:

htmltext = "mobs.htm"

return htmltext

 

def onTalk (self,npc,player):

st = player.getQuestState(qn)

if not st:

return "<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>"

npcId = npc.getNpcId()

idd = st.getState()

cond = st.getInt("cond")

if npcId == NPC:

if idd == State.COMPLETED :

htmltext = "completed.htm"

if idd == State.CREATED :

htmltext = "hello1.htm"

elif cond == 1:

if st.getQuestItemsCount(FEATHER) >= FEATHER_NEED and st.getQuestItemsCount(BOSS_ITEM) >= 1:

htmltext = "mobs2.htm"

else:

htmltext = "mobs.htm"

return htmltext

 

def onKill(self,npc,player,isPet):

st = player.getQuestState(qn)

if not st or st.getInt("cond") != 1:

return

npcId = npc.getNpcId()

reward = 0

limit = 1

chance = 100

if npcId in MOBS:

reward = FEATHER

limit = FEATHER_NEED

chance = FEATHER_CHANCE

if npcId == BOSS:

reward = BOSS_ITEM

limit = 1

if reward > 0:

party = player.getParty()

if party:

for member in party.getPartyMembers():

if not member.isAlikeDead():

st = member.getQuestState("q902_FeatherGathering")

if st and st.getQuestItemsCount(reward) < limit and st.getRandom(100) <= chance:

st.giveItems(reward, 1)

st.playSound("ItemSound.quest_itemget")

if st.getQuestItemsCount(reward) >= limit:

st.playSound("ItemSound.quest_middle")

else:

if st.getQuestItemsCount(reward) < limit and st.getRandom(100) <= chance:

st.giveItems(reward, 1)

st.playSound("ItemSound.quest_itemget")

return

 

QUEST = Quest(902, qn, "Feather Gathering")

 

QUEST.addStartNpc(NPC)

QUEST.addTalkId(NPC)

QUEST.addKillId(BOSS)

 

for m in MOBS:

QUEST.addKillId(m)

 

Помогите решить данный геморой пожалуйста)

 

после обьявления переменной st в методе onTalk добавь

id = st.getState()

 

и последующие

 

if idd == State.COMPLETED :

 

заменяй на

 

if id == COMPLETED :

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

Дак там есть id = st.getState() только с idd:

Скрытый текст
def onTalk (self,npc,player):

st = player.getQuestState(qn)

if not st:

return "<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>"

npcId = npc.getNpcId()

idd = st.getState()

cond = st.getInt("cond")

if npcId == NPC:

if id == COMPLETED :

htmltext = "completed.htm"

if id == CREATED :

htmltext = "hello1.htm"

elif cond == 1:

if st.getQuestItemsCount(FEATHER) >= FEATHER_NEED and st.getQuestItemsCount(BOSS_ITEM) >= 1:

htmltext = "mobs2.htm"

else:

htmltext = "mobs.htm"

return htmltext

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

Для публикации сообщений создайте учётную запись или авторизуйтесь

Вы должны быть пользователем, чтобы оставить комментарий

Создать учетную запись

Зарегистрируйте новую учётную запись в нашем сообществе. Это очень просто!

Регистрация нового пользователя

Войти

Уже есть аккаунт? Войти в систему.

Войти
Авторизация  

  • Последние посетители   0 пользователей онлайн

    Ни одного зарегистрированного пользователя не просматривает данную страницу

×
×
  • Создать...