public void RunDeathEvent() { MapInstance.InstanceBag.NpcsKilled++; OnDeathEvents.ForEach(e => { if (e.EventActionType == EventActionType.THROWITEMS) { Tuple <int, short, byte, int, int> evt = (Tuple <int, short, byte, int, int>)e.Parameter; e.Parameter = new Tuple <int, short, byte, int, int>(MapNpcId, evt.Item2, evt.Item3, evt.Item4, evt.Item5); } EventHelper.Instance.RunEvent(e); }); if (OnDeathEvents.Any(s => s.EventActionType == EventActionType.SPAWNMONSTERS) && (List <MonsterToSummon>)OnDeathEvents.FirstOrDefault(e => e.EventActionType == EventActionType.SPAWNMONSTERS).Parameter is List <MonsterToSummon> summonParameters) { Parallel.ForEach(summonParameters, npcMonster => { npcMonster.SpawnCell.X = MapX; npcMonster.SpawnCell.Y = MapY; }); } if (OnDeathEvents.Any(s => s.EventActionType == EventActionType.SPAWNNPC) && (NpcToSummon)OnDeathEvents.FirstOrDefault(e => e.EventActionType == EventActionType.SPAWNNPC).Parameter is NpcToSummon npcMonsterToSummon) { npcMonsterToSummon.SpawnCell.X = MapX; npcMonsterToSummon.SpawnCell.Y = MapY; } OnDeathEvents.RemoveAll(s => s != null); }
public void RunDeathEvent() { MapInstance.InstanceBag.NpcsKilled++; OnDeathEvents.ForEach(e => { EventHelper.Instance.RunEvent(e); }); OnDeathEvents.RemoveAll(s => s != null); }
public void RunDeathEvent() { MapInstance.InstanceBag.NpcsKilled++; OnDeathEvents.ForEach(e => { if (e.EventActionType == EventActionType.THROWITEMS) { Tuple <int, short, byte, int, int> evt = (Tuple <int, short, byte, int, int>)e.Parameter; e.Parameter = new Tuple <int, short, byte, int, int>(MapNpcId, evt.Item2, evt.Item3, evt.Item4, evt.Item5); } EventHelper.Instance.RunEvent(e); }); OnDeathEvents.RemoveAll(s => s != null); }
public void RunDeathEvent() { if (IsBonus) { MapInstance.InstanceBag.Combo++; MapInstance.InstanceBag.Point += EventHelper.Instance.CalculateComboPoint(MapInstance.InstanceBag.Combo + 1); } else { MapInstance.InstanceBag.Combo = 0; MapInstance.InstanceBag.Point += EventHelper.Instance.CalculateComboPoint(MapInstance.InstanceBag.Combo); } MapInstance.InstanceBag.MonstersKilled++; OnDeathEvents.ForEach(e => { EventHelper.Instance.RunEvent(e); }); OnDeathEvents.RemoveAll(s => s != null); }