Exemple #1
0
 public PlayerEntity(ObjectGUID objectGUID, character databaseCharacter, WorldSession session) : base(objectGUID)
 {
     this.Character              = databaseCharacter;
     this.Session                = session;
     this.SpellCollection        = new SpellCollection(this);
     this.ActionButtonCollection = new ActionButtonCollection(this);
 }
Exemple #2
0
        public PSActionButtons(ActionButtonCollection collection)
            : base(WorldOpcodes.SMSG_ACTION_BUTTONS)
        {
            var savedButtons = collection.ToList();

            for (int button = 0; button < 120; button++)
            {
                int index = savedButtons.FindIndex(b => b.button == button);

                character_action currentButton = index != -1 ? savedButtons[index] : null;

                if (currentButton != null)
                {
                    uint packedData = (uint)currentButton.action | (uint)currentButton.type << 24;

                    this.Write(packedData);
                }
                else
                {
                    this.Write((uint)0);
                }
            }
        }
Exemple #3
0
        public PSActionButtons(ActionButtonCollection collection)
            : base(WorldOpcodes.SMSG_ACTION_BUTTONS)
        {
            var savedButtons = collection.ToList();

            for (int button = 0; button < 120; button++)
            {
                int index = savedButtons.FindIndex(b => b.button == button);

                character_action currentButton = index != -1 ? savedButtons[index] : null;

                if (currentButton != null)
                {
                    uint packedData = (uint)currentButton.action | (uint)currentButton.type << 24;

                    this.Write(packedData);
                }
                else
                {
                    this.Write((uint)0);
                }
            }
        }