public static void OnDeSpawn(uint monsterid) { if (monsterid != 0) { PacketWriter writer = new PacketWriter(); writer.SetOpcode(SERVER_OPCODES.GAME_SERVER_DESPAWN); writer.AppendDword(monsterid); int ObjectIndex = Players.GetObjectIndex(monsterid); ServerSocket.SendPacketIfMonsterIsSpawned(writer.getWorkspace(), ObjectIndex); } }
public static void KillMonster(PacketReader reader_, int Index_) { uint ObjectId = reader_.ReadDword(); int ObjectIndex = Players.GetObjectIndex(ObjectId); ServerSocket.SendPacketIfMonsterIsSpawned(Players.CreateDeSpawnPacket(ObjectId), ObjectIndex); for (int i = 0; i <= Monsters.MonsterAmount; i++) { if (Monsters.General[i].ID == ObjectId) { Timers.MonsterAttack[i].Stop(); Timers.MonsterMovement[i].Stop(); break; } } }
public static void OnUnique(uint monsterid, bool kill, string name) { PacketWriter writer = new PacketWriter(); writer.SetOpcode(SERVER_OPCODES.GAME_SERVER_UNIQUE); if (kill) { writer.AppendByte(6); writer.AppendDword(monsterid); writer.AppendWord((ushort)name.Length); writer.AppendString(false, name); } else { writer.AppendByte(5); writer.AppendDword(monsterid); } int ObjectIndex = Players.GetObjectIndex(monsterid); ServerSocket.SendPacketIfMonsterIsSpawned(writer.getWorkspace(), ObjectIndex); }