Exemple #1
0
 public static void SavePosition(World.Network.WorldClient client, int mapid)
 {
     Database.Records.ZaapRecord zaap = Helper.ZaapHelper.GetZaap(mapid);
     if (zaap != null)
     {
         if (client.Character.SaveMap == mapid)
         {
             return;
         }
         client.Character.SaveMap  = mapid;
         client.Character.SaveCell = zaap.CellID;
         client.SendImPacket("06");
         client.Character.SaveAndFlush();
     }
 }
Exemple #2
0
        public static void GameInformationsRequest(WorldClient client, string packet)
        {
            Utilities.ConsoleStyle.Debug("Request map details ..");
            /* Display all contents */
            try
            {
                client.Character.Map.Engine.Players.ShowPlayers(client);
                client.Character.Map.Engine.ShowNpcsOnMap(client);
                client.Character.Map.Engine.ShowMonstersGroup(client);
                client.Character.Map.Engine.ShowAllFightOnMap(client);
                client.Character.Map.Engine.ShowAllDroppedItems(client);
                client.Character.Map.Engine.ShowPaddocks(client);
                client.Character.Map.Engine.ShowIO(client);
                client.Send("GDK");

                /* Save zaaps */
                Database.Records.ZaapRecord zaap = Helper.ZaapHelper.GetZaap(client.Character.Map.ID);
                if (zaap != null)
                {
                    if (!client.Character.Zaaps.Contains(zaap.MapID))
                    {
                        client.Character.Zaaps.Add(zaap.MapID);
                        client.SendImPacket("024");
                    }
                }
            }
            catch (Exception e)
            {
                Utilities.ConsoleStyle.Error("Can't show informations on map : " + e.ToString());
                client.Send("GDK");
            }

            try
            {
                Interop.PythonScripting.ScriptManager.CallEventEnterMap(client, client.Character.MapID, client.Character.CellID);
            }
            catch (Exception e)
            {
                Utilities.ConsoleStyle.Error("Can't execute script on enter map : " + e.ToString());
            }
        }
Exemple #3
0
        public static void UseZaap(World.Network.WorldClient client, string packet)
        {
            int map = int.Parse(packet.Substring(2));

            Database.Records.ZaapRecord zaap = Helper.ZaapHelper.GetZaap(map);
            if (zaap != null)
            {
                int price = GetPriceOfTravel(map, client.Character.MapID);
                if (price <= client.Character.Kamas)
                {
                    client.Action.RemoveKamas(price);
                    Network.World.GoToMap(client, zaap.MapID, zaap.CellID);
                    CloseZaapPanel(client);
                }
                else
                {
                    client.SendImPacket("1128");
                }
            }
            else
            {
                client.Action.SystemMessage("Le zaap demander est inexistant !");
            }
        }