maxfmm 15 Опубликовано 22 августа, 2013 Всем привет. Проблема такая: поставил баффера, прописал его в цфг все дела, как обычно, но при запуске гс вижу ошибку загрузки квеста от него. Захожу в логи, вижу: Error on: C:\server\game\data\scripts\custom\9990_buffer\__init__.py.error.log Line: -1 - Column: -1 Traceback (innermost last): File "__init__.py", line 2, in ? ImportError: no module named util import sys from com.l2jfrozen.util.database import L2DatabaseFactory 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 from com.l2jfrozen.gameserver.model.actor.instance import L2PcInstance from com.l2jfrozen.gameserver.model import L2Skill from java.util import Iterator from com.l2jfrozen.gameserver.datatables import SkillTable from com.l2jfrozen.gameserver.network.serverpackets import MagicSkillUser from com.l2jfrozen.gameserver.model import L2Effect from java.lang import System qn = "9990_buffer" NPC = [40002] ACCEPT_BUFF = [1040, 1068, 1035, 1043, 1077, 1078, 1085, 1311, 1032, 1036, 1045, 1048, 4352, 4357, 4391, 4403, 4405, 1243, 1388, 1389, 1087, 1259, 1059, 1268] ACCEPT_DANCES = [271, 272, 273, 274, 275, 276, 277, 307, 309, 310, 311, 365] ACCEPT_SONGS = [364, 264, 306, 269, 270, 265, 363, 349, 308, 305, 304, 267, 266, 268] ACCEPT_CHANTS = [1251, 1252, 1253, 1284, 1006, 1007, 1009, 1362, 1310, 1309, 1308, 1391, 1390] ACCEPT_SPECIAL = [1364, 1356, 1355, 1357, 1413, 4702, 4703, 4700, 4699, 1323] ACCEPT_RESISTS = [1393, 1392, 1182, 1189, 1191, 1352, 1353, 1073] QuestId = -1 QuestName = "Buffer" QuestDesc = "custom" print qn + "Buffer CrushGame" class Quest (JQuest) : def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr) def onEvent(self, event, st): htmltext = "Sory, failed Event" ownerid = st.getPlayer().getObjectId() effects = st.getPlayer().getAllEffects() if event.startswith("page_") : page = int(event.replace("page_", "")) htmltext = str(page) + ".htm" elif event == "cancel" : st.getPlayer().stopAllEffects() htmltext = "1.htm" activePage = 1 elif event == "reloadcp": st.getPlayer().restoreCP() return "1.htm" st.setState(State.COMPLETED) elif event == "reloadhp": st.getPlayer().setCurrentHp(st.getPlayer().getMaxHp()) return "1.htm" st.setState(State.COMPLETED) elif event == "reloadmp": st.getPlayer().setCurrentMp(st.getPlayer().getMaxMp()) return "1.htm" st.setState(State.COMPLETED) elif event == "magebuff": SkillTable.getInstance().getInfo(4348,6).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(1087,3).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(4351,6).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(4356,3).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(4346,4).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(4342,2).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(4344,3).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(4355,3).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(4349,2).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(4347,6).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(1303,1).getEffects(st.getPlayer(),st.getPlayer()) return "1.htm" st.setState(State.COMPLETED) elif event == "voinbuff": SkillTable.getInstance().getInfo(4348,6).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(1087,3).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(4360,3).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(4359,3).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(4358,3).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(4357,2).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(4354,4).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(4346,4).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(4342,2).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(4344,3).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(4349,2).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(4347,6).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(4345,3).getEffects(st.getPlayer(),st.getPlayer()) return "1.htm" st.setState(State.COMPLETED) elif event == "cov": st.getPlayer().broadcastPacket(MagicSkillUser(npc,st.getPlayer(),1363,1,1000,1000)) SkillTable.getInstance().getInfo(1363,1).getEffects(st.getPlayer(),st.getPlayer()) return "6.htm" st.setState(State.COMPLETED) elif event == "pof": SkillTable.getInstance().getInfo(1356,1).getEffects(st.getPlayer(),st.getPlayer()) return "6.htm" st.setState(State.COMPLETED) elif event == "mangus": SkillTable.getInstance().getInfo(1413,1).getEffects(st.getPlayer(),st.getPlayer()) return "6.htm" st.setState(State.COMPLETED) elif event == "powa": SkillTable.getInstance().getInfo(1355,1).getEffects(st.getPlayer(),st.getPlayer()) return "6.htm" st.setState(State.COMPLETED) elif event == "powi": SkillTable.getInstance().getInfo(1357,1).getEffects(st.getPlayer(),st.getPlayer()) return "6.htm" st.setState(State.COMPLETED) elif event == "gq": SkillTable.getInstance().getInfo(4700,1).getEffects(st.getPlayer(),st.getPlayer()) return "6.htm" st.setState(State.COMPLETED) elif event == "bq": SkillTable.getInstance().getInfo(4699,1).getEffects(st.getPlayer(),st.getPlayer()) return "6.htm" st.setState(State.COMPLETED) elif event == "gs": SkillTable.getInstance().getInfo(4703,1).getEffects(st.getPlayer(),st.getPlayer()) return "6.htm" st.setState(State.COMPLETED) elif event == "bs": SkillTable.getInstance().getInfo(4702,1).getEffects(st.getPlayer(),st.getPlayer()) return "6.htm" st.setState(State.COMPLETED) elif event == "bers": SkillTable.getInstance().getInfo(1062,2).getEffects(st.getPlayer(),st.getPlayer()) return "6.htm" st.setState(State.COMPLETED) elif event == "gm": SkillTable.getInstance().getInfo(1388,3).getEffects(st.getPlayer(),st.getPlayer()) return "6.htm" st.setState(State.COMPLETED) elif event == "gh": SkillTable.getInstance().getInfo(1389,3).getEffects(st.getPlayer(),st.getPlayer()) return "6.htm" st.setState(State.COMPLETED) elif event == "dansmag": SkillTable.getInstance().getInfo(265,1).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(273,1).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(276,1).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(365,1).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(276,1).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(268,1).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(264,1).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(266,1).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(304,1).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(305,1).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(363,1).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(349,1).getEffects(st.getPlayer(),st.getPlayer()) return "1.htm" st.setState(State.COMPLETED) elif event == "dansvoin": SkillTable.getInstance().getInfo(265,1).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(274,1).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(272,1).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(271,1).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(275,1).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(310,1).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(267,1).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(268,1).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(269,1).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(264,1).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(266,1).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(304,1).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(305,1).getEffects(st.getPlayer(),st.getPlayer()) SkillTable.getInstance().getInfo(364,1).getEffects(st.getPlayer(),st.getPlayer()) return "1.htm" st.setState(State.COMPLETED) elif event.startswith("buff_") : id_lvl = event.replace("buff_", "") id_lvl = id_lvl.split("_") SkillTable.getInstance().getInfo(int(id_lvl[0]), int(id_lvl[1])).getEffects(st.getPlayer(), st.getPlayer()) htmltext = str(int(id_lvl[2])) + ".htm" elif event.startswith("profile_") : act = event.replace("profile_", "") con = L2DatabaseFactory.getInstance().getConnection() if act.startswith("buff_") : act = str(int(act.replace("buff_", ""))) sql = con.prepareStatement("SELECT * FROM profile_buff WHERE char_id = ? AND pindex = ?") sql.setInt(1, int(ownerid)) sql.setInt(2, int(act)) rs = sql.executeQuery() rs.next() full_buffs = rs.getString("skills").split(";") sql.close() rs.close() for buff in full_buffs : if buff != "" : buff = buff.split(",") SkillTable.getInstance().getInfo(int(buff[0]), int(buff[1])).getEffects(st.getPlayer(), st.getPlayer()) htmltext = "1.htm" elif act.startswith("save_") : act = str(int(act.replace("save_", ""))) sqll = con.prepareStatement("DELETE FROM profile_buff WHERE char_id = ? AND pindex = ?") sqll.setInt(1, int(ownerid)) sqll.setInt(2, int(act)) sqll.execute() sqll.close() saving = "++" for eff in effects : eff_id = eff.getSkill().getId() eff_level = eff.getSkill().getLevel() if saving == "++" : if (eff_id in ACCEPT_BUFF or eff_id in ACCEPT_DANCES or eff_id in ACCEPT_SONGS or eff_id in ACCEPT_CHANTS or eff_id in ACCEPT_SPECIAL or eff_id in ACCEPT_RESISTS) : saving = str(eff_id) + "," + str(eff_level) + ";" else : if (eff_id in ACCEPT_BUFF or eff_id in ACCEPT_DANCES or eff_id in ACCEPT_SONGS or eff_id in ACCEPT_CHANTS or eff_id in ACCEPT_SPECIAL or eff_id in ACCEPT_RESISTS) : saving += str(eff_id) + "," + str(eff_level) + ";" sql = con.prepareStatement("INSERT INTO profile_buff (char_id, pindex, skills) VALUES ('" + str(ownerid) + "', '" + str(act) + "', '" + saving + "')") sql.execute() sql.close() htmltext = "8.htm" con.close() return htmltext def onTalk (self, npc, player): htmltext = "1.htm" st = player.getQuestState(qn) if not st : return htmltext npcId = npc.getNpcId() return htmltext QUEST = Quest(QuestId, qn, QuestDesc) CREATED = State('Start', QUEST) STARTED = State('Started', QUEST) COMPLETED = State('Completed', QUEST) QUEST.setInitialState(CREATED) for npcId in NPC: QUEST.addStartNpc(npcId) QUEST.addTalkId(npcId) Надеюсь на Вашу помощь Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты
Detect 618 Опубликовано 22 августа, 2013 Я так понимаю ты используешь 12 ревизию фрозен дев, так вот. прежде чем использовать, зайди на сайт, и почитай, что и как... Используй вот эти импорты import sys from com.l2jfrozen.commons.util.database import L2DatabaseFactory 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 from com.l2jfrozen.gameserver.model.actor.instance import L2PcInstance from com.l2jfrozen.gameserver.model import L2Skill from java.util import Iterator from com.l2jfrozen.gameserver.datatables import SkillTable from com.l2jfrozen.gameserver.network.serverpackets import MagicSkillUser from com.l2jfrozen.gameserver.model import L2Effect from java.lang import System Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты
maxfmm 15 Опубликовано 23 августа, 2013 Я так понимаю ты используешь 12 ревизию фрозен дев, так вот. прежде чем использовать, зайди на сайт, и почитай, что и как... Используй вот эти импорты import sys from com.l2jfrozen.commons.util.database import L2DatabaseFactory 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 from com.l2jfrozen.gameserver.model.actor.instance import L2PcInstance from com.l2jfrozen.gameserver.model import L2Skill from java.util import Iterator from com.l2jfrozen.gameserver.datatables import SkillTable from com.l2jfrozen.gameserver.network.serverpackets import MagicSkillUser from com.l2jfrozen.gameserver.model import L2Effect from java.lang import System Спасибо, помогло, тему можно закрыть Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты