Advertisement
KidaCoding

Untitled

Jul 10th, 2024
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.97 KB | Source Code | 0 0
  1.         public unsafe static void RemoveMapMonster(ServerSockets.Packet stream, Role.GameMap map, uint ID, uint DinamicID = 0)
  2.         {
  3.             if (map.MonstersColletion == null)
  4.             {
  5.                 Console.WriteLine(" Monsters collection is null.");
  6.                 return;
  7.             }
  8.  
  9.             Game.MsgMonster.MonsterRole rolemonster = map.MonstersColletion.GetMonsterByID(ID, DinamicID);
  10.  
  11.             if (rolemonster == null)
  12.             {
  13.                 Console.WriteLine("Monster not found.");
  14.                 return;
  15.             }
  16.  
  17.             map.MonstersColletion.Remove(rolemonster);
  18.  
  19.             Game.MsgServer.ActionQuery action = new Game.MsgServer.ActionQuery()
  20.             {
  21.                 ObjId = rolemonster.UID,
  22.                 Type = Game.MsgServer.ActionType.RemoveEntity
  23.             };
  24.             rolemonster.Send(stream.ActionCreate(&action));
  25.  
  26.             Console.WriteLine("Monster removed successfully.");
  27.         }
Tags: MS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement