예제 #1
0
 public void RejoinMap(bool spawnjoin, bool winner)
 {
     Client.Send(new GameContextDestroyMessage());
     Client.Send(new GameContextCreateMessage(1));
     if (winner && FighterInstance.Fight.Map.DugeonMap)
     {
         var dungeonMap = DungeonRecord.GetDungeonData(FighterInstance.Fight.Map.Id);
         FighterInstance = null;
         Client.Character.Teleport(dungeonMap.TeleportMapId, dungeonMap.TeleportCellId);
         RefreshStats();
         return;
     }
     FighterInstance = null;
     if (spawnjoin && !winner)
     {
         if (Client.Character.Record.SpawnPointMapId != -1)
         {
             MapsHandler.SendCurrentMapMessage(Client, Client.Character.Record.SpawnPointMapId);
             Record.CellId = (short)InteractiveRecord.GetTeleporterCellId(Client.Character.Record.SpawnPointMapId, TeleporterTypeEnum.TELEPORTER_ZAAP);
         }
         else
         {
             Client.Character.Teleport(ConfigurationManager.Instance.StartMapId, ConfigurationManager.Instance.StartCellId);
         }
     }
     else
     {
         MapsHandler.SendCurrentMapMessage(Client, Client.Character.Record.MapId);
     }
     RefreshStats();
 }
예제 #2
0
        public static void HandleTeleportRequestMessage(TeleportRequestMessage message, WorldClient client)
        {
            if ((TeleporterTypeEnum)message.teleporterType == TeleporterTypeEnum.TELEPORTER_ZAAP)
            {
                InteractiveRecord destinationZaap = MapRecord.GetMap(message.mapId).Zaap;
                if (client.Character.Map != null)
                {
                    InteractiveRecord currentZaap = client.Character.Map.Zaap;
                    if (destinationZaap.OptionalValue1 != currentZaap.OptionalValue1)
                    {
                        return;
                    }
                }
                else
                {
                    return;
                }
            }
            client.Character.Teleport(message.mapId, (short)InteractiveRecord.GetTeleporterCellId(message.mapId, (TeleporterTypeEnum)message.teleporterType));
            switch ((TeleporterTypeEnum)message.teleporterType)
            {
            case TeleporterTypeEnum.TELEPORTER_ZAAP:
                client.Character.RemoveKamas(InteractiveActionProvider.ZaapCost, true);
                break;

            case TeleporterTypeEnum.TELEPORTER_SUBWAY:
                client.Character.RemoveKamas(InteractiveActionProvider.ZaapiCost, true);
                break;

            case TeleporterTypeEnum.TELEPORTER_PRISM:
                break;
            }
            client.Character.LeaveDialog();
            client.Character.Reply("Vous avez été téleporté");
        }
예제 #3
0
 public void TeleportToSpawnPoint()
 {
     if (Record.SpawnPointMapId != -1)
     {
         InteractiveRecord zaap = MapRecord.GetMap(Record.SpawnPointMapId).Zaap;
         Teleport(Record.SpawnPointMapId, (short)InteractiveRecord.GetTeleporterCellId(zaap.MapId, TeleporterTypeEnum.TELEPORTER_ZAAP));
     }
     else
     {
         Client.Character.Teleport(ConfigurationManager.Instance.StartMapId, ConfigurationManager.Instance.StartCellId);
     }
     Reply("Vous avez été téléporté.");
 }