joof 1 Опубликовано 15 июня, 2013 (изменено) Как в квесте на питоне зделать запуск квеста, когда игрок зашел в игру? То есть, квест должен быть всегда включен. Кусок скрипта: class Quest (JQuest) : def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr) self.questItemIds = questitem def onTalk (self,npc,player): htmltext = "<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>" st = player.getQuestState(qn) if not st : return STARTED = Quest.STATE_STARTED return def onAttack (self, npc, player, damage, isPet): st = player.getQuestState(qn) if not st : return player = st.getPlayer() npcId = npc.getNpcId() if player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LHAND) != None: type = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LHAND) elif player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND) != None: type = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND) else : return Изменено 15 июня, 2013 пользователем joof Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты
Anarchy 210 Опубликовано 15 июня, 2013 Как в квесте на питоне зделать запуск квеста, когда игрок зашел в игру? То есть, квест должен быть всегда включен. Кусок скрипта: class Quest (JQuest) : def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr) self.questItemIds = questitem def onTalk (self,npc,player): htmltext = "<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>" st = player.getQuestState(qn) if not st : return STARTED = Quest.STATE_STARTED return def onAttack (self, npc, player, damage, isPet): st = player.getQuestState(qn) if not st : return player = st.getPlayer() npcId = npc.getNpcId() if player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LHAND) != None: type = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LHAND) elif player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND) != None: type = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND) else : return Ну как-то так: class Quest (JQuest) : def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr) self.questItemIds = questitem def onAttack (self, npc, player, damage, isPet): npcId = npc.getNpcId() if player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LHAND) != None: type = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LHAND) elif player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND) != None: type = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND) else : return 1 Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты
joof 1 Опубликовано 15 июня, 2013 Не работает. Вылетает ошибка "NameError: st" Вот продолжение скрипта: itemId = type.getItemId() if itemId in ONE_TYPE_WEAPON and npcId in ONE_MOB_ID: if itemId == ONE_TYPE_WEAPON[0] : if ONE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(ONE_TYPE_DROP_ID[0], ONE_TYPE_DROP_COUNT) if ONE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(ONE_TYPE_DROP_ID[1], ONE_TYPE_DROP_COUNT) Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты
meX 144 Опубликовано 15 июня, 2013 Это делается в EnterWorld.java По примеру квеста Tutorial_255 Напиши мне в скайп, помогу 2 Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты
Anarchy 210 Опубликовано 16 июня, 2013 Не работает. Вылетает ошибка "NameError: st" Вот продолжение скрипта: itemId = type.getItemId() if itemId in ONE_TYPE_WEAPON and npcId in ONE_MOB_ID: if itemId == ONE_TYPE_WEAPON[0] : if ONE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(ONE_TYPE_DROP_ID[0], ONE_TYPE_DROP_COUNT) if ONE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(ONE_TYPE_DROP_ID[1], ONE_TYPE_DROP_COUNT) Выложите весь код, решим проблему. Или смотрите где у вас присвоена переменная st. Примерно это выглядит так: def __init__(st, бла, бла, бла) Убирайте st и всё должно работать. Это делается в EnterWorld.java По примеру квеста Tutorial_255 Напиши мне в скайп, помогу К чему такие сложности? Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты
joof 1 Опубликовано 16 июня, 2013 (изменено) Вот весь скрипт, без импортов: qn = "9991_CraftSystem" #NPC NPC_ID = [30086] #QUEST ITEM PACKAGE = 7263 ONE_TYPE_WEAPON = [1, 2, 3, 4] ONE_TYPE_DROP_ID = [4037, 57, 4356, 4357, 6673] ONE_TYPE_DROP_COUNT = 1 ONE_TYPE_DROP_CHANCE = 100 ONE_MOB_ID = [18342, 18341, 18343, 18330, 18331] TWO_TYPE_WEAPON = [1, 2, 3, 4] TWO_TYPE_DROP_ID = [1, 2, 3, 4, 5] TWO_TYPE_DROP_COUNT = 1 TWO_TYPE_DROP_CHANCE = 100 TWO_MOB_ID = [111, 111, 111, 111, 111] THREE_TYPE_WEAPON = [1, 2, 3, 4] THREE_TYPE_DROP_ID = [1, 2, 3, 4, 5] THREE_TYPE_DROP_COUNT = 1 THREE_TYPE_DROP_CHANCE = 100 THREE_MOB_ID = [111, 111, 111, 111, 111] FO_TYPE_WEAPON = [1, 2, 3, 4] FO_TYPE_DROP_ID = [1, 2, 3, 4, 5] FO_TYPE_DROP_COUNT = 1 FO_TYPE_DROP_CHANCE = 100 FO_MOB_ID = [111, 111, 111, 111, 111] FIVE_TYPE_WEAPON = [1, 2, 3, 4] FIVE_TYPE_DROP_ID = [1, 2, 3, 4, 5] FIVE_TYPE_DROP_COUNT = 1 FIVE_TYPE_DROP_CHANCE = 100 FIVE_MOB_ID = [111, 111, 111, 111, 111] print "E6aTb KoIIaTb 3arpy3uJIocb!" class Quest (JQuest) : def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr) self.questItemIds = [PACKAGE] def onAttack (self, npc, player, damage, isPet): npcId = npc.getNpcId() if player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LHAND) != None: type = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LHAND) elif player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND) != None: type = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND) else : return itemId = type.getItemId() if itemId in ONE_TYPE_WEAPON and npcId in ONE_MOB_ID: if itemId == ONE_TYPE_WEAPON[0] : if ONE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(ONE_TYPE_DROP_ID[0], ONE_TYPE_DROP_COUNT) if ONE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(ONE_TYPE_DROP_ID[1], ONE_TYPE_DROP_COUNT) elif itemId == ONE_TYPE_WEAPON[1] : if ONE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(ONE_TYPE_DROP_ID[0], ONE_TYPE_DROP_COUNT) if ONE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(ONE_TYPE_DROP_ID[1], ONE_TYPE_DROP_COUNT) if ONE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(ONE_TYPE_DROP_ID[2], ONE_TYPE_DROP_COUNT) elif itemId == ONE_TYPE_WEAPON[2] : if ONE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(ONE_TYPE_DROP_ID[0], ONE_TYPE_DROP_COUNT) if ONE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(ONE_TYPE_DROP_ID[1], ONE_TYPE_DROP_COUNT) if ONE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(ONE_TYPE_DROP_ID[2], ONE_TYPE_DROP_COUNT) if ONE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(ONE_TYPE_DROP_ID[3], ONE_TYPE_DROP_COUNT) elif itemId == ONE_TYPE_WEAPON[3] : if ONE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(ONE_TYPE_DROP_ID[0], ONE_TYPE_DROP_COUNT) if ONE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(ONE_TYPE_DROP_ID[1], ONE_TYPE_DROP_COUNT) if ONE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(ONE_TYPE_DROP_ID[2], ONE_TYPE_DROP_COUNT) if ONE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(ONE_TYPE_DROP_ID[3], ONE_TYPE_DROP_COUNT) if ONE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(ONE_TYPE_DROP_ID[4], ONE_TYPE_DROP_COUNT) elif itemId in TWO_TYPE_WEAPON and npcId in TWO_MOB_ID: if itemId == TWO_TYPE_WEAPON[0] : if TWO_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(TWO_TYPE_WEAPON[0], TWO_TYPE_DROP_COUNT) if TWO_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(TWO_TYPE_WEAPON[1], TWO_TYPE_DROP_COUNT) elif itemId == TWO_TYPE_WEAPON[1] : if TWO_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(TWO_TYPE_WEAPON[0], TWO_TYPE_DROP_COUNT) if TWO_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(TWO_TYPE_WEAPON[1], TWO_TYPE_DROP_COUNT) if TWO_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(TWO_TYPE_WEAPON[2], TWO_TYPE_DROP_COUNT) elif itemId == TWO_TYPE_WEAPON[2] : if TWO_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(TWO_TYPE_WEAPON[0], TWO_TYPE_DROP_COUNT) if TWO_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(TWO_TYPE_WEAPON[1], TWO_TYPE_DROP_COUNT) if TWO_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(TWO_TYPE_WEAPON[2], TWO_TYPE_DROP_COUNT) if TWO_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(TWO_TYPE_WEAPON[3], TWO_TYPE_DROP_COUNT) elif itemId == TWO_TYPE_WEAPON[3] : if TWO_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(TWO_TYPE_WEAPON[0], TWO_TYPE_DROP_COUNT) if TWO_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(TWO_TYPE_WEAPON[1], TWO_TYPE_DROP_COUNT) if TWO_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(TWO_TYPE_WEAPON[2], TWO_TYPE_DROP_COUNT) if TWO_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(TWO_TYPE_WEAPON[3], TWO_TYPE_DROP_COUNT) if TWO_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(TWO_TYPE_WEAPON[4], TWO_TYPE_DROP_COUNT) elif itemId in THREE_TYPE_WEAPON and npcId in THREE_MOB_ID: if itemId == THREE_TYPE_WEAPON[0] : if THREE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(THREE_TYPE_WEAPON[0], THREE_TYPE_DROP_COUNT) if THREE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(THREE_TYPE_WEAPON[1], THREE_TYPE_DROP_COUNT) elif itemId == THREE_TYPE_WEAPON[1] : if THREE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(THREE_TYPE_WEAPON[0], THREE_TYPE_DROP_COUNT) if THREE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(THREE_TYPE_WEAPON[1], THREE_TYPE_DROP_COUNT) if THREE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(THREE_TYPE_WEAPON[2], THREE_TYPE_DROP_COUNT) elif itemId == THREE_TYPE_WEAPON[2] : if THREE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(THREE_TYPE_WEAPON[0], THREE_TYPE_DROP_COUNT) if THREE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(THREE_TYPE_WEAPON[1], THREE_TYPE_DROP_COUNT) if THREE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(THREE_TYPE_WEAPON[2], THREE_TYPE_DROP_COUNT) if THREE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(THREE_TYPE_WEAPON[3], THREE_TYPE_DROP_COUNT) elif itemId == THREE_TYPE_WEAPON[3] : if THREE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(THREE_TYPE_WEAPON[0], THREE_TYPE_DROP_COUNT) if THREE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(THREE_TYPE_WEAPON[1], THREE_TYPE_DROP_COUNT) if THREE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(THREE_TYPE_WEAPON[2], THREE_TYPE_DROP_COUNT) if THREE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(THREE_TYPE_WEAPON[3], THREE_TYPE_DROP_COUNT) if THREE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(THREE_TYPE_WEAPON[4], THREE_TYPE_DROP_COUNT) elif itemId in FO_TYPE_WEAPON and npcId in FO_MOB_ID: if itemId == FO_TYPE_WEAPON[0] : if FO_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(FO_TYPE_WEAPON[0], FO_TYPE_DROP_COUNT) if FO_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(FO_TYPE_WEAPON[1], FO_TYPE_DROP_COUNT) elif itemId == FO_TYPE_WEAPON[1] : if FO_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(FO_TYPE_WEAPON[0], FO_TYPE_DROP_COUNT) if FO_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(FO_TYPE_WEAPON[1], FO_TYPE_DROP_COUNT) if FO_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(FO_TYPE_WEAPON[2], FO_TYPE_DROP_COUNT) elif itemId == FO_TYPE_WEAPON[2] : if FO_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(FO_TYPE_WEAPON[0], FO_TYPE_DROP_COUNT) if FO_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(FO_TYPE_WEAPON[1], FO_TYPE_DROP_COUNT) if FO_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(FO_TYPE_WEAPON[2], FO_TYPE_DROP_COUNT) if FO_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(FO_TYPE_WEAPON[3], FO_TYPE_DROP_COUNT) elif itemId == FO_TYPE_WEAPON[3] : if FO_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(FO_TYPE_WEAPON[0], FO_TYPE_DROP_COUNT) if FO_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(FO_TYPE_WEAPON[1], FO_TYPE_DROP_COUNT) if FO_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(FO_TYPE_WEAPON[2], FO_TYPE_DROP_COUNT) if FO_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(FO_TYPE_WEAPON[3], FO_TYPE_DROP_COUNT) if FO_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(FO_TYPE_WEAPON[4], FO_TYPE_DROP_COUNT) elif itemId in FIVE_TYPE_WEAPON and npcId in FIVE_MOB_ID: if itemId == FIVE_TYPE_WEAPON[0] : if FIVE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(FIVE_TYPE_WEAPON[0], FIVE_TYPE_DROP_COUNT) if FIVE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(FIVE_TYPE_WEAPON[1], FIVE_TYPE_DROP_COUNT) elif itemId == FIVE_TYPE_WEAPON[1] : if FIVE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(FIVE_TYPE_WEAPON[0], FIVE_TYPE_DROP_COUNT) if FIVE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(FIVE_TYPE_WEAPON[1], FIVE_TYPE_DROP_COUNT) if FIVE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(FIVE_TYPE_WEAPON[2], FIVE_TYPE_DROP_COUNT) elif itemId == FIVE_TYPE_WEAPON[2] : if FIVE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(FIVE_TYPE_WEAPON[0], FIVE_TYPE_DROP_COUNT) if FIVE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(FIVE_TYPE_WEAPON[1], FIVE_TYPE_DROP_COUNT) if FIVE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(FIVE_TYPE_WEAPON[2], FIVE_TYPE_DROP_COUNT) if FIVE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(FIVE_TYPE_WEAPON[3], FIVE_TYPE_DROP_COUNT) elif itemId == FIVE_TYPE_WEAPON[3] : if FIVE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(FIVE_TYPE_WEAPON[0], FIVE_TYPE_DROP_COUNT) if FIVE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(FIVE_TYPE_WEAPON[1], FIVE_TYPE_DROP_COUNT) if FIVE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(FIVE_TYPE_WEAPON[2], FIVE_TYPE_DROP_COUNT) if FIVE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(FIVE_TYPE_WEAPON[3], FIVE_TYPE_DROP_COUNT) if FIVE_TYPE_DROP_CHANCE > Rnd.get(1, 100): st.giveItems(FIVE_TYPE_WEAPON[4], FIVE_TYPE_DROP_COUNT) else : return return QUEST = Quest(9991, qn, "Craft System") QUEST.addAttackId(ONE_MOB_ID) QUEST.addAttackId(TWO_MOB_ID) QUEST.addAttackId(THREE_MOB_ID) QUEST.addAttackId(FO_MOB_ID) QUEST.addAttackId(FIVE_MOB_ID) QUEST.addStartNpc(NPC_ID) QUEST.addTalkId(NPC_ID) Когда убираю с st.giveItems(ONE_TYPE_DROP_ID[0], ONE_TYPE_DROP_COUNT) значение "st." появляется ошибка "giveItems" Выложите весь код, решим проблему. Или смотрите где у вас присвоена переменная st. Примерно это выглядит так: def __init__(st, бла, бла, бла) Убирайте st и всё должно работать. К чему такие сложности? Переменная st была присвоена в: def onTalk (self,npc,player):htmltext = "<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>"st = player.getQuestState(qn)if not st : returnSTARTED = Quest.STATE_STARTEDreturn Но вы сказали удалить это. Изменено 16 июня, 2013 пользователем joof Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты
Anarchy 210 Опубликовано 16 июня, 2013 qn = "9991_CraftSystem" #NPC NPC_ID = [30086] #QUEST ITEM PACKAGE = 7263 ONE_TYPE_WEAPON = [1, 2, 3, 4] ONE_TYPE_DROP_ID = [4037, 57, 4356, 4357, 6673] ONE_TYPE_DROP_COUNT = 1 ONE_TYPE_DROP_CHANCE = 100 ONE_MOB_ID = [18342, 18341, 18343, 18330, 18331] TWO_TYPE_WEAPON = [1, 2, 3, 4] TWO_TYPE_DROP_ID = [1, 2, 3, 4, 5] TWO_TYPE_DROP_COUNT = 1 TWO_TYPE_DROP_CHANCE = 100 TWO_MOB_ID = [111, 111, 111, 111, 111] THREE_TYPE_WEAPON = [1, 2, 3, 4] THREE_TYPE_DROP_ID = [1, 2, 3, 4, 5] THREE_TYPE_DROP_COUNT = 1 THREE_TYPE_DROP_CHANCE = 100 THREE_MOB_ID = [111, 111, 111, 111, 111] FO_TYPE_WEAPON = [1, 2, 3, 4] FO_TYPE_DROP_ID = [1, 2, 3, 4, 5] FO_TYPE_DROP_COUNT = 1 FO_TYPE_DROP_CHANCE = 100 FO_MOB_ID = [111, 111, 111, 111, 111] FIVE_TYPE_WEAPON = [1, 2, 3, 4] FIVE_TYPE_DROP_ID = [1, 2, 3, 4, 5] FIVE_TYPE_DROP_COUNT = 1 FIVE_TYPE_DROP_CHANCE = 100 FIVE_MOB_ID = [111, 111, 111, 111, 111] print "E6aTb KoIIaTb 3arpy3uJIocb!" class Quest (JQuest) : def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr) self.questItemIds = [PACKAGE] def onAttack (self, npc, player, damage, isPet): npcId = npc.getNpcId() if player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LHAND) != None: type = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LHAND) elif player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND) != None: type = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND) else : return itemId = type.getItemId() if itemId in ONE_TYPE_WEAPON and npcId in ONE_MOB_ID: if itemId == ONE_TYPE_WEAPON[0] : if ONE_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(ONE_TYPE_DROP_ID[0], ONE_TYPE_DROP_COUNT) if ONE_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(ONE_TYPE_DROP_ID[1], ONE_TYPE_DROP_COUNT) elif itemId == ONE_TYPE_WEAPON[1] : if ONE_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(ONE_TYPE_DROP_ID[0], ONE_TYPE_DROP_COUNT) if ONE_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(ONE_TYPE_DROP_ID[1], ONE_TYPE_DROP_COUNT) if ONE_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(ONE_TYPE_DROP_ID[2], ONE_TYPE_DROP_COUNT) elif itemId == ONE_TYPE_WEAPON[2] : if ONE_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(ONE_TYPE_DROP_ID[0], ONE_TYPE_DROP_COUNT) if ONE_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(ONE_TYPE_DROP_ID[1], ONE_TYPE_DROP_COUNT) if ONE_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(ONE_TYPE_DROP_ID[2], ONE_TYPE_DROP_COUNT) if ONE_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(ONE_TYPE_DROP_ID[3], ONE_TYPE_DROP_COUNT) elif itemId == ONE_TYPE_WEAPON[3] : if ONE_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(ONE_TYPE_DROP_ID[0], ONE_TYPE_DROP_COUNT) if ONE_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(ONE_TYPE_DROP_ID[1], ONE_TYPE_DROP_COUNT) if ONE_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(ONE_TYPE_DROP_ID[2], ONE_TYPE_DROP_COUNT) if ONE_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(ONE_TYPE_DROP_ID[3], ONE_TYPE_DROP_COUNT) if ONE_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(ONE_TYPE_DROP_ID[4], ONE_TYPE_DROP_COUNT) elif itemId in TWO_TYPE_WEAPON and npcId in TWO_MOB_ID: if itemId == TWO_TYPE_WEAPON[0] : if TWO_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(TWO_TYPE_WEAPON[0], TWO_TYPE_DROP_COUNT) if TWO_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(TWO_TYPE_WEAPON[1], TWO_TYPE_DROP_COUNT) elif itemId == TWO_TYPE_WEAPON[1] : if TWO_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(TWO_TYPE_WEAPON[0], TWO_TYPE_DROP_COUNT) if TWO_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(TWO_TYPE_WEAPON[1], TWO_TYPE_DROP_COUNT) if TWO_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(TWO_TYPE_WEAPON[2], TWO_TYPE_DROP_COUNT) elif itemId == TWO_TYPE_WEAPON[2] : if TWO_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(TWO_TYPE_WEAPON[0], TWO_TYPE_DROP_COUNT) if TWO_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(TWO_TYPE_WEAPON[1], TWO_TYPE_DROP_COUNT) if TWO_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(TWO_TYPE_WEAPON[2], TWO_TYPE_DROP_COUNT) if TWO_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(TWO_TYPE_WEAPON[3], TWO_TYPE_DROP_COUNT) elif itemId == TWO_TYPE_WEAPON[3] : if TWO_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(TWO_TYPE_WEAPON[0], TWO_TYPE_DROP_COUNT) if TWO_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(TWO_TYPE_WEAPON[1], TWO_TYPE_DROP_COUNT) if TWO_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(TWO_TYPE_WEAPON[2], TWO_TYPE_DROP_COUNT) if TWO_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(TWO_TYPE_WEAPON[3], TWO_TYPE_DROP_COUNT) if TWO_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(TWO_TYPE_WEAPON[4], TWO_TYPE_DROP_COUNT) elif itemId in THREE_TYPE_WEAPON and npcId in THREE_MOB_ID: if itemId == THREE_TYPE_WEAPON[0] : if THREE_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(THREE_TYPE_WEAPON[0], THREE_TYPE_DROP_COUNT) if THREE_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(THREE_TYPE_WEAPON[1], THREE_TYPE_DROP_COUNT) elif itemId == THREE_TYPE_WEAPON[1] : if THREE_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(THREE_TYPE_WEAPON[0], THREE_TYPE_DROP_COUNT) if THREE_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(THREE_TYPE_WEAPON[1], THREE_TYPE_DROP_COUNT) if THREE_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(THREE_TYPE_WEAPON[2], THREE_TYPE_DROP_COUNT) elif itemId == THREE_TYPE_WEAPON[2] : if THREE_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(THREE_TYPE_WEAPON[0], THREE_TYPE_DROP_COUNT) if THREE_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(THREE_TYPE_WEAPON[1], THREE_TYPE_DROP_COUNT) if THREE_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(THREE_TYPE_WEAPON[2], THREE_TYPE_DROP_COUNT) if THREE_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(THREE_TYPE_WEAPON[3], THREE_TYPE_DROP_COUNT) elif itemId == THREE_TYPE_WEAPON[3] : if THREE_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(THREE_TYPE_WEAPON[0], THREE_TYPE_DROP_COUNT) if THREE_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(THREE_TYPE_WEAPON[1], THREE_TYPE_DROP_COUNT) if THREE_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(THREE_TYPE_WEAPON[2], THREE_TYPE_DROP_COUNT) if THREE_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(THREE_TYPE_WEAPON[3], THREE_TYPE_DROP_COUNT) if THREE_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(THREE_TYPE_WEAPON[4], THREE_TYPE_DROP_COUNT) elif itemId in FO_TYPE_WEAPON and npcId in FO_MOB_ID: if itemId == FO_TYPE_WEAPON[0] : if FO_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(FO_TYPE_WEAPON[0], FO_TYPE_DROP_COUNT) if FO_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(FO_TYPE_WEAPON[1], FO_TYPE_DROP_COUNT) elif itemId == FO_TYPE_WEAPON[1] : if FO_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(FO_TYPE_WEAPON[0], FO_TYPE_DROP_COUNT) if FO_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(FO_TYPE_WEAPON[1], FO_TYPE_DROP_COUNT) if FO_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(FO_TYPE_WEAPON[2], FO_TYPE_DROP_COUNT) elif itemId == FO_TYPE_WEAPON[2] : if FO_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(FO_TYPE_WEAPON[0], FO_TYPE_DROP_COUNT) if FO_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(FO_TYPE_WEAPON[1], FO_TYPE_DROP_COUNT) if FO_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(FO_TYPE_WEAPON[2], FO_TYPE_DROP_COUNT) if FO_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(FO_TYPE_WEAPON[3], FO_TYPE_DROP_COUNT) elif itemId == FO_TYPE_WEAPON[3] : if FO_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(FO_TYPE_WEAPON[0], FO_TYPE_DROP_COUNT) if FO_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(FO_TYPE_WEAPON[1], FO_TYPE_DROP_COUNT) if FO_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(FO_TYPE_WEAPON[2], FO_TYPE_DROP_COUNT) if FO_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(FO_TYPE_WEAPON[3], FO_TYPE_DROP_COUNT) if FO_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(FO_TYPE_WEAPON[4], FO_TYPE_DROP_COUNT) elif itemId in FIVE_TYPE_WEAPON and npcId in FIVE_MOB_ID: if itemId == FIVE_TYPE_WEAPON[0] : if FIVE_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(FIVE_TYPE_WEAPON[0], FIVE_TYPE_DROP_COUNT) if FIVE_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(FIVE_TYPE_WEAPON[1], FIVE_TYPE_DROP_COUNT) elif itemId == FIVE_TYPE_WEAPON[1] : if FIVE_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(FIVE_TYPE_WEAPON[0], FIVE_TYPE_DROP_COUNT) if FIVE_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(FIVE_TYPE_WEAPON[1], FIVE_TYPE_DROP_COUNT) if FIVE_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(FIVE_TYPE_WEAPON[2], FIVE_TYPE_DROP_COUNT) elif itemId == FIVE_TYPE_WEAPON[2] : if FIVE_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(FIVE_TYPE_WEAPON[0], FIVE_TYPE_DROP_COUNT) if FIVE_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(FIVE_TYPE_WEAPON[1], FIVE_TYPE_DROP_COUNT) if FIVE_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(FIVE_TYPE_WEAPON[2], FIVE_TYPE_DROP_COUNT) if FIVE_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(FIVE_TYPE_WEAPON[3], FIVE_TYPE_DROP_COUNT) elif itemId == FIVE_TYPE_WEAPON[3] : if FIVE_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(FIVE_TYPE_WEAPON[0], FIVE_TYPE_DROP_COUNT) if FIVE_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(FIVE_TYPE_WEAPON[1], FIVE_TYPE_DROP_COUNT) if FIVE_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(FIVE_TYPE_WEAPON[2], FIVE_TYPE_DROP_COUNT) if FIVE_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(FIVE_TYPE_WEAPON[3], FIVE_TYPE_DROP_COUNT) if FIVE_TYPE_DROP_CHANCE > Rnd.get(1, 100): player.giveItems(FIVE_TYPE_WEAPON[4], FIVE_TYPE_DROP_COUNT) else : return return QUEST = Quest(9991, qn, "Craft System") QUEST.addAttackId(ONE_MOB_ID) QUEST.addAttackId(TWO_MOB_ID) QUEST.addAttackId(THREE_MOB_ID) QUEST.addAttackId(FO_MOB_ID) QUEST.addAttackId(FIVE_MOB_ID) QUEST.addStartNpc(NPC_ID) QUEST.addTalkId(NPC_ID) 2 Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты
joof 1 Опубликовано 17 июня, 2013 Когда бью моба, ошибка : "AtributeError: giveItems" Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты