//!spawnmob [mobId] optional:[mobAmount] public static void SpawnMob(string[] split, MapleClient c) { int mobId = int.Parse(split[1]); WzMob mobInfo = DataBuffer.GetMobById(mobId); if (mobInfo == null) { return; } int amount = 1; if (split.Length > 2) { amount = int.Parse(split[2]); } if (amount > 1) { List <MapleMonster> mobs = new List <MapleMonster>(); for (int i = 0; i < amount; i++) { MapleMonster mob = new MapleMonster(mobInfo, c.Account.Character.Map); mobs.Add(mob); } c.Account.Character.Map.SpawnMobsOnGroundBelow(mobs, new Point(c.Account.Character.Position.X, c.Account.Character.Position.Y - 1)); } else { MapleMonster mob = new MapleMonster(mobInfo, c.Account.Character.Map); c.Account.Character.Map.SpawnMobOnGroundBelow(mob, new Point(c.Account.Character.Position.X, c.Account.Character.Position.Y - 1)); } }
private void RandomSpawnMobs(int mobId, int count, Point maxPos, Point minPos) { WzMob mobInfo = DataBuffer.GetMobById(mobId); for (int i = 0; i < count; i++) { MapleMap spawnMap = null; if (RecreatedMap) { spawnMap = EventMap; } else if (Starter.Map != null) { spawnMap = Starter.Map; } if (spawnMap == null) { return; } WzMap.FootHold randomFh = spawnMap.GetRandomFoothold(maxPos, minPos); spawnMap.SpawnMobOnGroundBelow(new MapleMonster(mobInfo, spawnMap), randomFh.Point1); } }
public MapleMonster(WzMob Info, MapleMap map) { WzInfo = Info; Controller = new WeakReference <MapleCharacter>(null); ControllerHasAggro = false; HP = WzInfo.HP; Stance = 2; Alive = true; Map = map; foreach (MobSkill skill in Info.Skills) { SkillTimes[skill] = DateTime.MinValue; } }
private void SpawnMobs(int mobId, int count, int x, int y) { WzMob mobInfo = DataBuffer.GetMobById(mobId); for (int i = 0; i < count; i++) { MapleMap spawnMap = null; if (RecreatedMap) { spawnMap = EventMap; } else if (Starter.Map != null) { spawnMap = Starter.Map; } if (spawnMap == null) { return; } spawnMap.SpawnMobOnGroundBelow(new MapleMonster(mobInfo, spawnMap), new Point(x, y)); } }