Esempio n. 1
0
 public override void Execute(WorldClient client, CommandParameters parameters)
 {
     if (parameters.Lenght > 0)
     {
         var packet = parameters.GetParameter(0);
         int npcid;
         if (!int.TryParse(packet, out npcid))
         {
             client.Send(new ConsoleMessage("Parametres invalide !", ConsoleColorEnum.RED));
             return;
         }
         var npc = client.Character.myMap.addNpc(npcid, client.Character.CellId, client.Character.Orientation);
         if (npc == null)
         {
             client.Send(new ConsoleMessage("Echoue de l'ajout du pnj invalide !", ConsoleColorEnum.RED));
             return;
         }
         client.Character.myMap.InitNpc(npc);
         NpcTemplateTable.Add(npcid, client.Character);
         client.Send(new ConsoleMessage("PNJ ajouté sur la map avec succès !", ConsoleColorEnum.GREEN));
     }
     else
     {
         client.Send(new ConsoleMessage("Parametres invalide !", ConsoleColorEnum.RED));
     }
 }