//This is the way we Listen for mob killing events. private bool OnKillListener(List<uint> monstersAlive, Map.World world) { Int32 monstersKilled = 0; var monsterCount = monstersAlive.Count; //Since we are removing values while iterating, this is set at the first real read of the mob counting. while (monstersKilled != monsterCount) { //Iterate through monstersAlive List, if found dead we start to remove em till all of em are dead and removed. for (int i = monstersAlive.Count - 1; i >= 0; i--) { if (world.HasMonster(monstersAlive[i])) { //Alive: Nothing. } else { //If dead we remove it from the list and keep iterating. Logger.Debug(monstersAlive[i] + " has been killed"); monstersAlive.RemoveAt(i); monstersKilled++; } } } return true; }
//just for the WMQ private bool OnWMQKillListener(uint monsterDynID, Map.World world) { while (true) { if (world.HasMonster(monsterDynID)) { //RAS } else { Logger.Debug(" The wretched mother queen has been killed"); world.Game.Quests.NotifyQuest(87700, Mooege.Common.MPQ.FileFormats.QuestStepObjectiveType.EventReceived, -1); //Mooege.Common.MPQ.FileFormats.QuestStepObjectiveType.KillMonster, 1); break; } } return true; }