nemo 0 Опубликовано 29 января, 2016 Здравствуйте проблема с квестом взросление дракончика.фея Mimyu дает мне 4шт Лист Феи и я иду бить дракончиком деревья.После некоторого времени дерево должно у меня забрать Лист Феино этого не происходит. Били 2 часа дерево и нечего не произошло и не один раз пробовали, и другие деревья но результат тот же.Помогите разобраться пожалуйста. Сборка grind-teamВот здесь как я понял сравнивает количество ударов по дереву - if(attaked_times > Min_Fairy_Tree_Attaks)Вот тут Min_Fairy_Tree_Attaks = 110; ставил меньше число но нечего не помогло.вот скрипт. _421_LittleWingAdventures.java package quests; import java.util.ArrayList; import java.util.List; import core.commons.dao.JdbcEntityState; import core.commons.threading.RunnableImpl; import core.commons.util.Rnd; import core.gameserver.ThreadPoolManager; import core.gameserver.ai.CtrlEvent; import core.gameserver.data.xml.holder.NpcHolder; import core.gameserver.model.Playable; import core.gameserver.model.Player; import core.gameserver.model.Summon; import core.gameserver.model.World; import core.gameserver.model.SimpleSpawner; import core.gameserver.model.instances.NpcInstance; import core.gameserver.model.items.ItemInstance; import core.gameserver.model.quest.Quest; import core.gameserver.model.quest.QuestState; import core.gameserver.network.l2.s2c.InventoryUpdate; import core.gameserver.scripts.Functions; import core.gameserver.scripts.ScriptFile; import core.gameserver.tables.PetDataTable; import core.gameserver.tables.PetDataTable.L2Pet; import core.gameserver.templates.npc.NpcTemplate; import core.gameserver.utils.Location; /* * Author DRiN, Last Updated: 2008/04/13 */ public class _421_LittleWingAdventures extends Quest implements ScriptFile { // NPCs private static int Cronos = 30610; private static int Mimyu = 30747; // Mobs private static int Fairy_Tree_of_Wind = 27185; private static int Fairy_Tree_of_Star = 27186; private static int Fairy_Tree_of_Twilight = 27187; private static int Fairy_Tree_of_Abyss = 27188; private static int Soul_of_Tree_Guardian = 27189; // Items private static int Dragonflute_of_Wind = L2Pet.HATCHLING_WIND.getControlItemId(); private static int Dragonflute_of_Star = L2Pet.HATCHLING_STAR.getControlItemId(); private static int Dragonflute_of_Twilight = L2Pet.HATCHLING_TWILIGHT.getControlItemId(); private static int Dragon_Bugle_of_Wind = L2Pet.STRIDER_WIND.getControlItemId(); private static int Dragon_Bugle_of_Star = L2Pet.STRIDER_STAR.getControlItemId(); private static int Dragon_Bugle_of_Twilight = L2Pet.STRIDER_TWILIGHT.getControlItemId(); // Quest Items private static int Fairy_Leaf = 4325; private static int Min_Fairy_Tree_Attaks = 110; public _421_LittleWingAdventures() { super(false); addStartNpc(Cronos); addTalkId(Mimyu); addKillId(Fairy_Tree_of_Wind); addKillId(Fairy_Tree_of_Star); addKillId(Fairy_Tree_of_Twilight); addKillId(Fairy_Tree_of_Abyss); addAttackId(Fairy_Tree_of_Wind); addAttackId(Fairy_Tree_of_Star); addAttackId(Fairy_Tree_of_Twilight); addAttackId(Fairy_Tree_of_Abyss); addQuestItem(Fairy_Leaf); } private static ItemInstance GetDragonflute(QuestState st) { List<ItemInstance> Dragonflutes = new ArrayList<ItemInstance>(); for(ItemInstance item : st.getPlayer().getInventory().getItems()) if(item != null && (item.getItemId() == Dragonflute_of_Wind || item.getItemId() == Dragonflute_of_Star || item.getItemId() == Dragonflute_of_Twilight)) Dragonflutes.add(item); if(Dragonflutes.isEmpty()) return null; if(Dragonflutes.size() == 1) return Dragonflutes.get(0); if(st.getState() == CREATED) return null; int dragonflute_id = st.getInt("dragonflute"); for(ItemInstance item : Dragonflutes) if(item.getObjectId() == dragonflute_id) return item; return null; } private static boolean HatchlingSummoned(QuestState st, boolean CheckObjID) { Summon _pet = st.getPlayer().getPet(); if(_pet == null) return false; if(CheckObjID) { int dragonflute_id = st.getInt("dragonflute"); if(dragonflute_id == 0) return false; if(_pet.getControlItemObjId() != dragonflute_id) return false; } ItemInstance dragonflute = GetDragonflute(st); if(dragonflute == null) return false; if(PetDataTable.getControlItemId(_pet.getNpcId()) != dragonflute.getItemId()) return false; return true; } private static boolean CheckTree(QuestState st, int Fairy_Tree_id) { return st.getInt(String.valueOf(Fairy_Tree_id)) == 1000000; } @Override public String onEvent(String event, QuestState st, NpcInstance npc) { int _state = st.getState(); ItemInstance dragonflute = GetDragonflute(st); int dragonflute_id = st.getInt("dragonflute"); int cond = st.getCond(); if(event.equalsIgnoreCase("30610_05.htm") && _state == CREATED) { st.setState(STARTED); st.setCond(1); st.playSound(SOUND_ACCEPT); } else if((event.equalsIgnoreCase("30747_03.htm") || event.equalsIgnoreCase("30747_04.htm")) && _state == STARTED && cond == 1) { if(dragonflute == null) return "noquest"; if(dragonflute.getObjectId() != dragonflute_id) { if(Rnd.chance(10)) { st.takeItems(dragonflute.getItemId(), 1); st.playSound(SOUND_FINISH); st.exitCurrentQuest(true); } return "30747_00.htm"; } if(!HatchlingSummoned(st, false)) return event.equalsIgnoreCase("30747_04.htm") ? "30747_04a.htm" : "30747_02.htm"; if(event.equalsIgnoreCase("30747_04.htm")) { st.setCond(2); st.takeItems(Fairy_Leaf, -1); st.giveItems(Fairy_Leaf, 4); st.playSound(SOUND_MIDDLE); } } return event; } @Override public String onTalk(NpcInstance npc, QuestState st) { int _state = st.getState(); int npcId = npc.getNpcId(); int cond = st.getCond(); ItemInstance dragonflute = GetDragonflute(st); int dragonflute_id = st.getInt("dragonflute"); if(_state == CREATED) { if(npcId != Cronos) return "noquest"; if(st.getPlayer().getLevel() < 45) { st.exitCurrentQuest(true); return "30610_01.htm"; } if(dragonflute == null) { st.exitCurrentQuest(true); return "30610_02.htm"; } if(dragonflute.getEnchantLevel() < 55) { st.exitCurrentQuest(true); return "30610_03.htm"; } st.setCond(0); st.set("dragonflute", String.valueOf(dragonflute.getObjectId())); return "30610_04.htm"; } if(_state != STARTED) return "noquest"; if(npcId == Cronos) { if(dragonflute == null) return "30610_02.htm"; return dragonflute.getObjectId() == dragonflute_id ? "30610_07.htm" : "30610_06.htm"; } if(npcId == Mimyu) { if(st.getQuestItemsCount(Dragon_Bugle_of_Wind) + st.getQuestItemsCount(Dragon_Bugle_of_Star) + st.getQuestItemsCount(Dragon_Bugle_of_Twilight) > 0) return "30747_00b.htm"; if(dragonflute == null) return "noquest"; if(cond == 1) return "30747_01.htm"; if(cond == 2) { if(!HatchlingSummoned(st, false)) return "30747_09.htm"; if(st.getQuestItemsCount(Fairy_Leaf) == 0) { st.playSound(SOUND_FINISH); st.exitCurrentQuest(true); return "30747_11.htm"; } return "30747_10.htm"; } if(cond == 3) { if(dragonflute.getObjectId() != dragonflute_id) return "30747_00a.htm"; if(st.getQuestItemsCount(Fairy_Leaf) > 0) { st.playSound(SOUND_FINISH); st.exitCurrentQuest(true); return "30747_11.htm"; } if(!(CheckTree(st, Fairy_Tree_of_Wind) && CheckTree(st, Fairy_Tree_of_Star) && CheckTree(st, Fairy_Tree_of_Twilight) && CheckTree(st, Fairy_Tree_of_Abyss))) { st.playSound(SOUND_FINISH); st.exitCurrentQuest(true); return "30747_11.htm"; } if(st.getInt("welldone") == 0) { if(!HatchlingSummoned(st, false)) return "30747_09.htm"; st.set("welldone", "1"); return "30747_12.htm"; } if(HatchlingSummoned(st, false) || st.getPlayer().getPet() != null) return "30747_13a.htm"; dragonflute.setItemId(Dragon_Bugle_of_Wind + dragonflute.getItemId() - Dragonflute_of_Wind); dragonflute.setJdbcState(JdbcEntityState.UPDATED); dragonflute.update(); st.getPlayer().sendPacket(new InventoryUpdate().addModifiedItem(dragonflute)); st.playSound(SOUND_FINISH); st.exitCurrentQuest(true); return "30747_13.htm"; } } return "noquest"; } /* * благодаря ai.Quest421FairyTree вызовется только при атаке от L2PetInstance */ @Override public String onAttack(NpcInstance npc, QuestState st) { if(st.getState() != STARTED || st.getCond() != 2 || !HatchlingSummoned(st, true) || st.getQuestItemsCount(Fairy_Leaf) == 0) return null; String npcID = String.valueOf(npc.getNpcId()); Integer attaked_times = st.getInt(npcID); if(CheckTree(st, npc.getNpcId())) return null; if(attaked_times > Min_Fairy_Tree_Attaks) { st.set(npcID, "1000000"); Functions.npcSay(npc, "Give me the leaf!"); st.takeItems(Fairy_Leaf, 1); if(CheckTree(st, Fairy_Tree_of_Wind) && CheckTree(st, Fairy_Tree_of_Star) && CheckTree(st, Fairy_Tree_of_Twilight) && CheckTree(st, Fairy_Tree_of_Abyss)) { st.setCond(3); st.playSound(SOUND_MIDDLE); } else st.playSound(SOUND_ITEMGET); } else st.set(npcID, String.valueOf(attaked_times + 1)); return null; } @Override public String onKill(NpcInstance npc, QuestState st) { ThreadPoolManager.getInstance().schedule(new GuardiansSpawner(npc, st, Rnd.get(15, 20)), 1000); return null; } @Override public void onLoad() { } @Override public void onReload() { } @Override public void onShutdown() { } public class GuardiansSpawner extends RunnableImpl { private SimpleSpawner _spawn = null; private String agressor; private String agressors_pet = null; private List<String> agressors_party = null; private int tiks = 0; public GuardiansSpawner(NpcInstance npc, QuestState st, int _count) { NpcTemplate template = NpcHolder.getInstance().getTemplate(Soul_of_Tree_Guardian); if(template == null) return; try { _spawn = new SimpleSpawner(template); } catch(Exception e) { e.printStackTrace(); } for(int i = 0; i < _count; i++) { _spawn.setLoc(Location.findPointToStay(npc, 50, 200)); _spawn.setHeading(Rnd.get(0, 0xFFFF)); _spawn.setAmount(1); _spawn.doSpawn(true); agressor = st.getPlayer().getName(); if(st.getPlayer().getPet() != null) agressors_pet = st.getPlayer().getPet().getName(); if(st.getPlayer().getParty() != null) { agressors_party = new ArrayList<String>(); for(Player _member : st.getPlayer().getParty().getPartyMembers()) if(!_member.equals(st.getPlayer())) agressors_party.add(_member.getName()); } } _spawn.stopRespawn(); updateAgression(); } private void AddAgression(Playable player, int aggro) { if(player == null) return; for(NpcInstance mob : _spawn.getAllSpawned()) { mob.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, player, aggro); } } private void updateAgression() { Player _player = World.getPlayer(agressor); if(_player != null) { if(agressors_pet != null && _player.getPet() != null && _player.getPet().getName().equalsIgnoreCase(agressors_pet)) AddAgression(_player.getPet(), 10); AddAgression(_player, 2); } if(agressors_party != null) for(String _agressor : agressors_party) AddAgression(World.getPlayer(_agressor), 1); } @Override public void runImpl() throws Exception { if(_spawn == null) return; tiks++; if(tiks < 600) { updateAgression(); ThreadPoolManager.getInstance().schedule(this, 1000); return; } _spawn.deleteAll(); } } } Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты
terege 110 Опубликовано 29 января, 2016 Возми с другой сборки квест этот Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты
nemo 0 Опубликовано 29 января, 2016 Возми с другой сборки квест этот А где взять его? Что то пока не нашел. Если есть у вас то можете выложить? Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты
terege 110 Опубликовано 29 января, 2016 А где взять его? Что то пока не нашел. Если есть у вас то можете выложить? # Upgrade your Hatchling to Strider version 0.3 # by DrLecter & DraX_ # last modify by Kerberos import sys from java.sql import PreparedStatement from java.sql import ResultSet from java.sql import SQLException from com.l2open import L2DatabaseFactory from com.l2open.gameserver.datatables import SkillTable from com.l2open.gameserver.model.quest import State from com.l2open.gameserver.model.quest import QuestState from com.l2open.gameserver.model.quest.jython import QuestJython as JQuest from com.l2open.gameserver.network import SystemMessageId from com.l2open.gameserver.network.serverpackets import ItemList; from com.l2open.gameserver.network.serverpackets import NpcSay from com.l2open.gameserver.network.serverpackets import SystemMessage qn = "421_LittleWingAdventures" #Quest items FT_LEAF = 4325 #NPCs CRONOS = 30610 MIMYU = 30747 #kinda bugged, missing refresh, works only when player relog so far def EvolvePet(player, item, striderControlItem) : con = L2DatabaseFactory.getInstance().getConnection() statement = con.prepareStatement("UPDATE items SET item_id =? WHERE object_id=? AND owner_id=?") statement.setInt(1, striderControlItem) statement.setInt(2, item.getObjectId()) statement.setInt(3, player.getObjectId()) statement.execute() statement.close() con.close() sm1 = SystemMessage(SystemMessageId.S2_S1_DISAPPEARED) sm1.addItemName(item.getItemId()) sm1.addNumber(1) sm2 = SystemMessage(SystemMessageId.YOU_PICKED_UP_A_S1_S2) sm2.addNumber(item.getEnchantLevel()) sm2.addItemName(striderControlItem) player.sendPacket(sm1) player.sendPacket(sm2) player.sendPacket(ItemList(player, False)) return class Quest (JQuest) : def __init__(self, id, name, descr): JQuest.__init__(self, id, name, descr) self.questItemIds = [FT_LEAF] self.killedTrees = [] def onAdvEvent (self, event, npc, player): htmltext = event st = player.getQuestState(qn) if not st: return if event == "30610-05.htm" : if ((st.getQuestItemsCount(3500) + st.getQuestItemsCount(3501) + st.getQuestItemsCount(3502)) == 1) : if st.getQuestItemsCount(3500) == 1 : item = player.getInventory().getItemByItemId(3500) if item.getEnchantLevel() < 55 : st.exitQuest(1) htmltext = "30610-06.htm" else : st.setState(State.STARTED) st.set("summonOid", str(item.getObjectId())) st.set("cond", "1") st.set("id", "1") st.playSound("ItemSound.quest_accept") elif st.getQuestItemsCount(3501) == 1 : item = player.getInventory().getItemByItemId(3501) if item.getEnchantLevel() < 55 : st.exitQuest(1) htmltext = "30610-06.htm" else : st.setState(State.STARTED) st.set("summonOid", str(item.getObjectId())) st.set("cond", "1") st.set("id", "1") st.playSound("ItemSound.quest_accept") elif st.getQuestItemsCount(3502) == 1 : item = player.getInventory().getItemByItemId(3502) if item.getEnchantLevel() < 55 : st.exitQuest(1) htmltext = "30610-06.htm" else : st.setState(State.STARTED) st.set("summonOid", str(item.getObjectId())) st.set("cond", "1") st.set("id", "1") st.playSound("ItemSound.quest_accept") else : st.exitQuest(1) htmltext = "30610-06.htm" elif event == "30747-02.htm" : summon = player.getPet() if summon : if summon.getControlItem().getObjectId() == st.getInt("summonOid"): htmltext = "30747-04.htm" else : htmltext = "30747-03.htm" elif event == "30747-05.htm" : summon = player.getPet() if summon : if summon.getControlItem().getObjectId() == st.getInt("summonOid"): htmltext = "30747-05.htm" st.giveItems(FT_LEAF, 4) st.set("cond", "2") st.set("id", "0") st.playSound("ItemSound.quest_middle") else : htmltext = "30747-06.htm" else : htmltext = "30747-06.htm" return htmltext 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 htmltext id = st.getState() cond = st.getInt("cond") npcId = npc.getNpcId() if id == State.CREATED and npcId == CRONOS : if player.getLevel() < 45 and (st.getQuestItemsCount(3500) or st.getQuestItemsCount(3501) or st.getQuestItemsCount(3502)) : st.exitQuest(1) htmltext = "30610-01.htm" elif player.getLevel() >= 45 and ((st.getQuestItemsCount(3500) + st.getQuestItemsCount(3501) + st.getQuestItemsCount(3502)) >= 2) : st.exitQuest(1) htmltext = "30610-02.htm" elif player.getLevel() >= 45 and ((st.getQuestItemsCount(3500) + st.getQuestItemsCount(3501) + st.getQuestItemsCount(3502)) == 1) : if st.getQuestItemsCount(3500) == 1 : item = player.getInventory().getItemByItemId(3500) if item.getEnchantLevel() < 55 : htmltext = "30610-03.htm" else : htmltext = "30610-04.htm" elif st.getQuestItemsCount(3501) == 1 : item = player.getInventory().getItemByItemId(3501) if item.getEnchantLevel() < 55 : htmltext = "30610-03.htm" else : htmltext = "30610-04.htm" elif st.getQuestItemsCount(3502) == 1 : item = player.getInventory().getItemByItemId(3502) if item.getEnchantLevel() < 55 : htmltext = "30610-03.htm" else : htmltext = "30610-04.htm" elif id == State.STARTED : if npcId == CRONOS : htmltext = "30610-07.htm" if npcId == MIMYU : if st.getInt("id") == 1 : st.set("id", "2") htmltext = "30747-01.htm" elif st.getInt("id") == 2 : summon = player.getPet() if summon : if summon.getControlItem().getObjectId() == st.getInt("summonOid"): htmltext = "30747-04.htm" else : htmltext = "30747-03.htm" else : htmltext = "30747-02.htm" elif st.getInt("id") == 0 : htmltext = "30747-07.htm" elif st.getInt("id") > 0 and st.getInt("id") < 15 and st.getQuestItemsCount(FT_LEAF) >= 1 : htmltext = "30747-11.htm" elif st.getInt("id") == 15 and st.getQuestItemsCount(FT_LEAF) == 0 : summon = player.getPet() if summon : if summon.getControlItem().getObjectId() == st.getInt("summonOid"): st.set("id", "16") htmltext = "30747-13.htm" else : htmltext = "30747-14.htm" else : htmltext = "30747-12.htm" elif st.getInt("id") == 16: summon = player.getPet() if summon : htmltext = "30747-15.htm" elif (st.getQuestItemsCount(3500) + st.getQuestItemsCount(3501) + st.getQuestItemsCount(3502)) == 1 : if st.getQuestItemsCount(3500) == 1 : item = player.getInventory().getItemByItemId(3500) if item.getObjectId() == st.getInt("summonOid"): #EvolvePet(player,item,4422) st.takeItems(3500, 1) st.giveItems(4422, 1) htmltext = "30747-16.htm" st.exitQuest(1) st.playSound("ItemSound.quest_finish") else : npc.setTarget(player) skill = SkillTable.getInstance().getInfo(4167, 1) if skill != None: skill.getEffects(npc, player) htmltext = "30747-18.htm" elif st.getQuestItemsCount(3501) == 1 : item = player.getInventory().getItemByItemId(3501) if item.getObjectId() == st.getInt("summonOid"): #EvolvePet(player,item,4423) st.takeItems(3501, 1) st.giveItems(4423, 1) htmltext = "30747-16.htm" st.exitQuest(1) st.playSound("ItemSound.quest_finish") else : npc.setTarget(player) skill = SkillTable.getInstance().getInfo(4167, 1) if skill != None: skill.getEffects(npc, player) htmltext = "30747-18.htm" elif st.getQuestItemsCount(3502) == 1 : item = player.getInventory().getItemByItemId(3502) if item.getObjectId() == st.getInt("summonOid"): #EvolvePet(player,item,4424) st.takeItems(3502, 1) st.giveItems(4424, 1) htmltext = "30747-16.htm" st.exitQuest(1) st.playSound("ItemSound.quest_finish") else : npc.setTarget(player) skill = SkillTable.getInstance().getInfo(4167, 1) if skill != None: skill.getEffects(npc, player) htmltext = "30747-18.htm" else : htmltext = "30747-18.htm" elif (st.getQuestItemsCount(3500) + st.getQuestItemsCount(3501) + st.getQuestItemsCount(3502)) >= 2 : htmltext = "30747-17.htm" return htmltext def onAttack(self, npc, player, damage, isPet, skill) : st = player.getQuestState(qn) if not st: return npcId = npc.getNpcId() for pc, mobId, in self.killedTrees: if pc == player and mobId == npcId: return if isPet and st.getInt("id") < 16: pet = player.getPet() if st.getRandom(100) <= 2 and st.getQuestItemsCount(FT_LEAF) >= 0: st.takeItems(FT_LEAF, 1) st.playSound("ItemSound.quest_middle") npc.broadcastPacket(NpcSay(npc.getNpcId(), 0, npcId, "gives me spirit leaf...!")) self.killedTrees.append([player, npcId]) if st.getQuestItemsCount(FT_LEAF) == 0 : st.set("id", "15") st.set("cond", "3") return # Quest class and state definition QUEST = Quest(421, qn, "Little Wing's Big Adventures") # Quest NPC starter initialization QUEST.addStartNpc(CRONOS) # Quest initialization QUEST.addTalkId(CRONOS) QUEST.addTalkId(MIMYU) for i in range(27185, 27189): QUEST.addAttackId(i) Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты
nemo 0 Опубликовано 29 января, 2016 Спасибо сейчас попробую. Кстати я посмотрел в других сборках First Team Lasteam MmoCore Overworld Revolt Shark Так вот там этот файл и код абсолютно одинаковые как у меня. Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты
P1ckw1ck 158 Опубликовано 2 февраля, 2016 (изменено) Там вроде идет специальная очередность битья деревьев, а не все подрят. Изменено 2 февраля, 2016 пользователем P1ckw1ck Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты
TaleQale 212 Опубликовано 2 февраля, 2016 Там вроде идет специальная очередность битья деревьев, а не все подрят. Не должно так быть Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты