Beispiel #1
0
        private void UpdateWallet()
        {
            switch (Type)
            {
            case CurrencyType.Meso:
                Player.Session.Send(MesosPacket.UpdateMesos(Player.Session));
                break;

            case CurrencyType.Meret:
            case CurrencyType.GameMeret:
            case CurrencyType.EventMeret:
                Player.Session.Send(MeretsPacket.UpdateMerets(Player.Session));
                break;

            case CurrencyType.ValorToken:
            case CurrencyType.Treva:
            case CurrencyType.Rue:
            case CurrencyType.HaviFruit:
                Player.Session.Send(WalletPacket.UpdateWallet(Type, Amount));
                break;

            case CurrencyType.MesoToken:
                break;

            default:
                break;
            }
        }
Beispiel #2
0
    private void UpdateWallet()
    {
        switch (Type)
        {
        case CurrencyType.Meso:
            Session.Send(MesosPacket.UpdateMesos(Amount));
            break;

        case CurrencyType.Meret:
        case CurrencyType.GameMeret:
        case CurrencyType.EventMeret:
            Session.Send(MeretsPacket.UpdateMerets(Session.Player.Account));
            break;

        case CurrencyType.ValorToken:
        case CurrencyType.Treva:
        case CurrencyType.Rue:
        case CurrencyType.HaviFruit:
        case CurrencyType.MesoToken:
            Session.Send(WalletPacket.UpdateWallet(Type, Amount));
            break;

        case CurrencyType.BankMesos:
            Session.Send(StorageInventoryPacket.UpdateMesos(Amount));
            break;
        }
    }
        public override void Handle(GameSession session, PacketReader packet)
        {
            RequestTaxiMode mode = (RequestTaxiMode)packet.ReadByte();

            int  mapId     = 0;
            long mesoPrice = 60000;

            if (mode != RequestTaxiMode.DiscoverTaxi)
            {
                mapId = packet.ReadInt();
            }

            switch (mode)
            {
            case RequestTaxiMode.Car:
                mesoPrice = 5000;     //For now make all car taxis cost 5k, as we don't know the formula to calculate it yet.
                goto case RequestTaxiMode.RotorsMeso;

            case RequestTaxiMode.RotorsMeso:
                if (session.Player.Mesos >= mesoPrice)
                {
                    session.Player.Mesos -= mesoPrice;
                    session.Send(MesosPacket.UpdateMesos(session));
                    HandleTeleport(session, mapId);
                }
                break;

            case RequestTaxiMode.RotorsMeret:
                if (session.Player.Merets >= 15)
                {
                    session.Player.Merets -= 15;
                    session.Send(MeretsPacket.UpdateMerets(session));
                    HandleTeleport(session, mapId);
                }
                break;

            case RequestTaxiMode.DiscoverTaxi:
                //TODO: Save somewhere and load somewhere? Perhaps on login.
                session.Send(TaxiPacket.DiscoverTaxi(session.Player.MapId));
                break;

            default:
                IPacketHandler <GameSession> .LogUnknownMode(mode);

                break;
            }
        }
Beispiel #4
0
        private void HandleCreate(GameSession session, PacketReader packet)
        {
            string guildName = packet.ReadUnicodeString();

            if (session.Player.Mesos < 2000)
            {
                // TODO: Reject packets
                return;
            }
            else
            {
                session.Player.Mesos -= 2000;

                session.Send(MesosPacket.UpdateMesos(session));
                session.Send(GuildPacket.Invite(session.Player, guildName));
                session.Send(GuildPacket.Create(guildName));
                session.Send(GuildPacket.UpdateGuild(session, guildName));
                session.Send(GuildPacket.Create2(session.Player, guildName));
                session.Send(GuildPacket.Create3(session.Player, guildName));

                Guild newGuild = new(guildName, new List <Player> {
                    session.Player
                });
Beispiel #5
0
        public override void Handle(GameSession session, PacketReader packet)
        {
            byte mode  = packet.ReadByte();
            long price = 0;
            bool paid  = false;
            int  mapId = 0;

            if (mode != 5)
            {
                mapId = packet.ReadInt();
            }

            switch (mode)
            {
            case 1:     // car taxi
                price = packet.ReadShort();
                if (session.Player.Mesos >= price)
                {
                    session.Player.Mesos -= price;
                    session.Send(MesosPacket.UpdateMesos(session));
                    paid = true;
                }
                break;

            case 3:     // rotors using mesos
                price = 60000;
                if (session.Player.Mesos >= price)
                {
                    session.Player.Mesos -= price;
                    session.Send(MesosPacket.UpdateMesos(session));
                    paid = true;
                }
                break;

            case 4:     // rotors using merets
                price = 15;
                if (session.Player.Merets >= price)
                {
                    session.Player.Merets -= price;
                    session.Send(MeretsPacket.UpdateMerets(session));
                    paid = true;
                }
                break;

            case 5:     // is sent after using rotors with meret, idk why..
                return;
            }

            if (paid)
            {
                MapPlayerSpawn spawn = MapEntityStorage.GetRandomPlayerSpawn(mapId);

                if (spawn != null)
                {
                    session.Player.MapId    = mapId;
                    session.Player.Coord    = spawn.Coord.ToFloat();
                    session.Player.Rotation = spawn.Rotation.ToFloat();
                    session.Send(FieldPacket.RequestEnter(session.FieldPlayer));
                }
            }
        }