getAbilityByID() public method

public getAbilityByID ( UInt16 id ) : AbilityItem
id System.UInt16
return AbilityItem
Beispiel #1
0
        public void processAbility(ref byte[] packet)
        {
            byte[] ability    = { packet[0], packet[1] };
            byte[] targetView = { packet[2], packet[3] };
            UInt16 AbilityID  = NumericalUtils.ByteArrayToUint16(ability, 1);

            UInt16 viewId = 0;

            currentTargetViewId = NumericalUtils.ByteArrayToUint16(targetView, 1);


            // load the ability name from a list to see if we match the right ability
            DataLoader AbilityLoader = DataLoader.getInstance();

            this.currentAbility = AbilityLoader.getAbilityByID(AbilityID);

            // lets create a message for the client - we will later execute the right AbilityScript for it
            ServerPackets pak = new ServerPackets();

            pak.sendSystemChatMessage(Store.currentClient,
                                      "Ability ID is " + AbilityID.ToString() + " and the name is " + currentAbility.getAbilityName() +
                                      " and Target ViewId Is " + currentTargetViewId, "BROADCAST");

            // ToDo: do something with the entity (or queue a fx hit animation or something lol)
            this.processAbilityScript(this.currentAbility);
        }