Exemplo n.º 1
0
        protected virtual void OnLevelChanged(Character character)
        {
            ExperienceLevelFloor     = ExperienceManager.Instance.GetMountLevelExperience(Level);
            ExperienceNextLevelFloor = ExperienceManager.Instance.GetMountNextLevelExperience(Level);

            UnApplyMountEffects();
            m_effects = MountManager.Instance.GetMountEffects(this);
            ApplyMountEffects();

            MountHandler.SendMountSetMessage(character.Client, GetMountClientData());
        }
Exemplo n.º 2
0
        public override uint UseItem(int amount = 1, Cell targetCell = null, Character target = null)
        {
            if (!Owner.HasEquippedMount())
            {
                return(0);
            }

            if (Owner.EquippedMount.Behaviors.Contains((int)MountBehaviorEnum.Caméléone))
            {
                return(0);
            }

            Owner.EquippedMount.AddBehavior(MountBehaviorEnum.Caméléone);
            Owner.UpdateLook();

            MountHandler.SendMountSetMessage(Owner.Client, Owner.EquippedMount.GetMountClientData());

            return(1);
        }
Exemplo n.º 3
0
        public static void CommonCharacterSelection(WorldClient client, CharacterRecord character)
        {
            if (character.IsDeleted)
            {
                return;
            }

            // Check if we also have a world account
            if (client.WorldAccount == null)
            {
                var account = AccountManager.Instance.FindById(client.Account.Id) ??
                              AccountManager.Instance.CreateWorldAccount(client);
                client.WorldAccount = account;
            }

            // update tokens
            if (client.WorldAccount.Tokens + client.WorldAccount.NewTokens <= 0)
            {
                client.WorldAccount.Tokens = 0;
            }
            else
            {
                client.WorldAccount.Tokens += client.WorldAccount.NewTokens;
            }

            client.WorldAccount.NewTokens = 0;

            client.Character = new Character(character, client);
            client.Character.LoadRecord();

            ContextHandler.SendNotificationListMessage(client, new[] { 0x7FFFFFFF });
            BasicHandler.SendBasicTimeMessage(client);

            SendCharacterSelectedSuccessMessage(client);

            if (client.Character.Inventory.Presets.Any())
            {
                InventoryHandler.SendInventoryContentAndPresetMessage(client);
            }
            else
            {
                InventoryHandler.SendInventoryContentMessage(client);
            }

            ShortcutHandler.SendShortcutBarContentMessage(client, ShortcutBarEnum.GENERAL_SHORTCUT_BAR);

            ContextRoleplayHandler.SendEmoteListMessage(client, client.Character.Emotes.Select(x => (byte)x));

            // Jobs
            ContextRoleplayHandler.SendJobDescriptionMessage(client, client.Character);
            ContextRoleplayHandler.SendJobExperienceMultiUpdateMessage(client, client.Character);
            ContextRoleplayHandler.SendJobCrafterDirectorySettingsMessage(client, client.Character);

            PvPHandler.SendAlignmentRankUpdateMessage(client, client.Character);

            ChatHandler.SendEnabledChannelsMessage(client, new sbyte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13 }, new sbyte[] { });
            ChatHandler.SendChatSmileyExtraPackListMessage(client, client.Character.SmileyPacks.ToArray());

            InventoryHandler.SendSpellListMessage(client, true);
            ShortcutHandler.SendShortcutBarContentMessage(client, ShortcutBarEnum.SPELL_SHORTCUT_BAR);

            InitializationHandler.SendSetCharacterRestrictionsMessage(client, client.Character);

            InventoryHandler.SendInventoryWeightMessage(client);

            FriendHandler.SendFriendWarnOnConnectionStateMessage(client, client.Character.FriendsBook.WarnOnConnection);
            FriendHandler.SendFriendWarnOnLevelGainStateMessage(client, client.Character.FriendsBook.WarnOnLevel);
            GuildHandler.SendGuildMemberWarnOnConnectionStateMessage(client, client.Character.WarnOnGuildConnection);

            //Guild
            if (client.Character.GuildMember != null)
            {
                GuildHandler.SendGuildMembershipMessage(client, client.Character.GuildMember);
            }

            //Mount
            if (client.Character.EquippedMount != null)
            {
                MountHandler.SendMountSetMessage(client, client.Character.EquippedMount.GetMountClientData());
                MountHandler.SendMountXpRatioMessage(client, client.Character.EquippedMount.GivenExperience);

                if (client.Character.IsRiding)
                {
                    MountHandler.SendMountRidingMessage(client, client.Character.IsRiding);
                }
            }

            client.Character.SendConnectionMessages();

            //Don't know why ?
            ActionsHandler.SendSequenceNumberRequestMessage(client);

            //Start Cinematic
            if ((DateTime.Now - client.Character.Record.CreationDate).TotalSeconds <= 30)
            {
                BasicHandler.SendCinematicMessage(client, 10);
            }

            ContextRoleplayHandler.SendGameRolePlayArenaUpdatePlayerInfosMessage(client, client.Character);

            SendCharacterCapabilitiesMessage(client);

            ContextRoleplayHandler.SendAlmanachCalendarDateMessage(client);

            //Loading complete
            SendCharacterLoadingCompleteMessage(client);

            BasicHandler.SendServerExperienceModificatorMessage(client);

            // Update LastConnection and Last Ip
            client.WorldAccount.LastConnection     = DateTime.Now;
            client.WorldAccount.LastIp             = client.IP;
            client.WorldAccount.ConnectedCharacter = character.Id;

            WorldServer.Instance.DBAccessor.Database.Execute(string.Format(WorldAccountRelator.UpdateNewTokens, 0));
            WorldServer.Instance.DBAccessor.Database.Update(client.WorldAccount);
        }
Exemplo n.º 4
0
 public void RefreshMount()
 {
     MountHandler.SendMountSetMessage(Owner.Client, GetMountClientData());
 }