Esempio n. 1
0
        public void Cast(Ability_Stats Info, ushort Px, ushort Py, ushort Pz, ushort ZoneId)
        {
            GameData.AbilityResult Result = CanCast(Info, true);

            if (Result == GameData.AbilityResult.ABILITYRESULT_OK)
            {
                Ability NewAbility = new Ability(this, null, Info, _Owner.GetUnit(), false, Px, Py, Pz, ZoneId);

                if (NewAbility.Handler != null)
                {
                    Result = NewAbility.Handler.CanCast(true);
                }

                if (NewAbility.Handler == null || Result == GameData.AbilityResult.ABILITYRESULT_OK)
                {
                    //Log.Info("Cast", Info.Entry.ToString() + ":" + Info.Description + " : " + Info.Damages1);
                    SetCooldown(0, GlobalMSCoolDown);
                    CurrentAbility = NewAbility;
                    CurrentAbility.Start();
                    SetCooldown(Info.Entry, Info.Info.Cooldown * 1000);
                }
                else
                {
                    Cancel(false);
                }
            }
            else
            {
                Cancel(false);
            }
        }
Esempio n. 2
0
 public Ability(AbilityInterface Interface, Ability Parent, Ability_Stats Info, Unit Caster, bool IsBuff, ushort Px, ushort Py, ushort Pz, ushort ZoneId, string OverrideHandler = "")
     : this(Interface, Parent, Info, Caster, IsBuff, OverrideHandler)
 {
     this.Px     = Px;
     this.Py     = Py;
     this.Pz     = Pz;
     this.ZoneId = ZoneId;
 }
Esempio n. 3
0
 bool boolStatsAbility(Ability_Stats stats)
 {
     if (stats.one_handed > 0)
     {
         return(true);
     }
     if (stats.two_handed > 0)
     {
         return(true);
     }
     if (stats.distanceWeapon > 0)
     {
         return(true);
     }
     if (stats.doubleWeapon > 0)
     {
         return(true);
     }
     if (stats.fist > 0)
     {
         return(true);
     }
     if (stats.shield > 0)
     {
         return(true);
     }
     if (stats.endurance > 0)
     {
         return(true);
     }
     if (stats.revenge > 0)
     {
         return(true);
     }
     if (stats.resistance > 0)
     {
         return(true);
     }
     if (stats.hunting > 0)
     {
         return(true);
     }
     if (stats.sneaking > 0)
     {
         return(true);
     }
     if (stats.burglary > 0)
     {
         return(true);
     }
     if (stats.luck > 0)
     {
         return(true);
     }
     return(false);
 }
Esempio n. 4
0
 void labelStatsAbility(Ability_Stats stats, TextMeshProUGUI text)
 {
     if (stats.one_handed > 0)
     {
         text.text += "\n" + stats.one_handed;
     }
     if (stats.two_handed > 0)
     {
         text.text += "\n" + stats.two_handed;
     }
     if (stats.distanceWeapon > 0)
     {
         text.text += "\n" + stats.distanceWeapon;
     }
     if (stats.doubleWeapon > 0)
     {
         text.text += "\n" + stats.doubleWeapon;
     }
     if (stats.fist > 0)
     {
         text.text += "\n" + stats.fist;
     }
     if (stats.shield > 0)
     {
         text.text += "\n" + stats.shield;
     }
     if (stats.endurance > 0)
     {
         text.text += "\n" + stats.endurance;
     }
     if (stats.revenge > 0)
     {
         text.text += "\n" + stats.revenge;
     }
     if (stats.resistance > 0)
     {
         text.text += "\n" + stats.resistance;
     }
     if (stats.hunting > 0)
     {
         text.text += "\n" + stats.hunting;
     }
     if (stats.sneaking > 0)
     {
         text.text += "\n" + stats.sneaking;
     }
     if (stats.burglary > 0)
     {
         text.text += "\n" + stats.burglary;
     }
     if (stats.luck > 0)
     {
         text.text += "\n" + stats.luck;
     }
 }
Esempio n. 5
0
 public Stats()
 {
     Base        = new Base_Stats();
     Battle      = new Battle_Stats();
     Ability     = new Ability_Stats();
     Equipment   = new Equipment_Stats();
     Resistance  = new Resistance_Stats();
     Other       = new Other_Stats();
     AtkState    = new List <State_Rate>();
     ResistState = new List <State_Rate>();
 }
Esempio n. 6
0
    public void UpdateStats()
    {
        Base        = new Base_Stats();
        Battle      = new Battle_Stats();
        Ability     = new Ability_Stats();
        Equipment   = new Equipment_Stats();
        Resistance  = new Resistance_Stats();
        Other       = new Other_Stats();
        AtkState    = new List <State_Rate>();
        ResistState = new List <State_Rate>();

        dmgWeapons[0] = new DmgWeapon();
        dmgWeapons[1] = new DmgWeapon();
    }
Esempio n. 7
0
 void CalculateAbility(Ability_Stats stat)
 {
     currentStats.Ability.burglary       += stat.burglary;
     currentStats.Ability.distanceWeapon += stat.distanceWeapon;
     currentStats.Ability.doubleWeapon   += stat.doubleWeapon;
     currentStats.Ability.endurance      += stat.endurance;
     currentStats.Ability.fist           += stat.fist;
     currentStats.Ability.hunting        += stat.hunting;
     currentStats.Ability.luck           += stat.luck;
     currentStats.Ability.one_handed     += stat.one_handed;
     currentStats.Ability.resistance     += stat.resistance;
     currentStats.Ability.revenge        += stat.revenge;
     currentStats.Ability.shield         += stat.shield;
     currentStats.Ability.sneaking       += stat.sneaking;
     currentStats.Ability.two_handed     += stat.two_handed;
 }
Esempio n. 8
0
 public static CharacterStats CalculateAbility(CharacterStats current, Ability_Stats stat)
 {
     current.Ability.burglary       += stat.burglary;
     current.Ability.distanceWeapon += stat.distanceWeapon;
     current.Ability.doubleWeapon   += stat.doubleWeapon;
     current.Ability.endurance      += stat.endurance;
     current.Ability.fist           += stat.fist;
     current.Ability.hunting        += stat.hunting;
     current.Ability.luck           += stat.luck;
     current.Ability.one_handed     += stat.one_handed;
     current.Ability.resistance     += stat.resistance;
     current.Ability.revenge        += stat.revenge;
     current.Ability.shield         += stat.shield;
     current.Ability.sneaking       += stat.sneaking;
     current.Ability.two_handed     += stat.two_handed;
     return(current);
 }
Esempio n. 9
0
        public GameData.AbilityResult CanCast(Ability_Stats Info, bool CheckCoolDown)
        {
            if (Info.Info.ApCost > GetPlayer().ActionPoints)
            {
                return(GameData.AbilityResult.ABILITYRESULT_AP);
            }
            else if (CheckCoolDown && !CanCastCooldown(0))
            {
                return(GameData.AbilityResult.ABILITYRESULT_NOTREADY);
            }
            else if (CheckCoolDown && !CanCastCooldown(Info.Entry))
            {
                return(GameData.AbilityResult.ABILITYRESULT_NOTREADY);
            }

            return(GameData.AbilityResult.ABILITYRESULT_OK);
        }
Esempio n. 10
0
 public static void ViewAbility(Ability_Stats selected)
 {
     selected.one_handed     = EditorGUILayout.IntField("One Handed", selected.one_handed);
     selected.two_handed     = EditorGUILayout.IntField("Two Handed", selected.two_handed);
     selected.distanceWeapon = EditorGUILayout.IntField("Distance Weapon", selected.distanceWeapon);
     selected.doubleWeapon   = EditorGUILayout.IntField("Double Weapon", selected.doubleWeapon);
     selected.fist           = EditorGUILayout.IntField("Fist", selected.fist);
     GUILayout.Space(10);
     selected.shield     = EditorGUILayout.IntField("Shield", selected.shield);
     selected.endurance  = EditorGUILayout.IntField("Endurance", selected.endurance);
     selected.revenge    = EditorGUILayout.IntField("Revenge", selected.revenge);
     selected.resistance = EditorGUILayout.IntField("Resistance", selected.resistance);
     GUILayout.Space(10);
     selected.hunting  = EditorGUILayout.IntField("Hunting", selected.hunting);
     selected.sneaking = EditorGUILayout.IntField("Sneaking", selected.sneaking);
     selected.burglary = EditorGUILayout.IntField("Burglary", selected.burglary);
     selected.luck     = EditorGUILayout.IntField("Luck", selected.luck);
 }
Esempio n. 11
0
        public void StartCast(ushort AbilityID, ushort Px, ushort Py, ushort Pz, ushort ZoneId)
        {
            Ability_Stats Info = GetAbility(AbilityID);

            if (Info == null)
            {
                return;
            }

            if (IsCasting() && CurrentAbility.Info == Info)
            {
                return;
            }

            Cancel(false);

            Cast(Info, Px, Py, Pz, ZoneId);
        }
Esempio n. 12
0
        public Ability(AbilityInterface Interface, Ability Parent, Ability_Stats Info, Unit Caster, bool IsBuff, string OverrideHandler = "")
        {
            this.Parent    = Parent;
            this.Info      = Info;
            this.Caster    = Caster;
            this.Interface = Interface;
            if (OverrideHandler == "")
            {
                this.Handler = AbilityMgr.GetAbilityHandler(Info.Entry, Info.Info.HandlerName);
            }
            else
            {
                this.Handler = AbilityMgr.GetAbilityHandler(0, OverrideHandler);
            }

            this.IsBuff = IsBuff;

            if (Handler != null)
            {
                Handler.InitAbility(this);
            }
        }
Esempio n. 13
0
        public void SendSpellEffect(Object Caster, Unit Target, UInt16 RealDamage, UInt16 Damage, Ability_Stats Ability = null)
        {
            if (Target == null)
            {
                return;
            }

            // Frappe

            /*{
             *  PacketOut Out = new PacketOut((byte)Opcodes.F_USE_ABILITY);
             *  Out.WriteUInt16(Target.Oid);
             *  Out.WriteUInt16(Ability.Entry);
             *  Out.WriteUInt16(Caster.Oid);
             *  Out.WriteUInt16(Ability.EffectID);
             *
             *  Out.WriteUInt16(Target.Oid);
             *  Out.WriteByte(6);
             *  Out.WriteByte(1);
             *  Out.WriteUInt16(0);
             *  Out.WriteUInt32(0x023F0C00);
             *  Out.WriteUInt16(0);
             *
             *  Caster.DispatchPacket(Out, true);
             * }
             *
             * {
             *  PacketOut Out = new PacketOut((byte)Opcodes.F_CAST_PLAYER_EFFECT);
             *  Out.WriteUInt16(Caster.Oid);
             *  Out.WriteUInt16(Target.Oid);
             *  Out.WriteUInt16(Ability.Entry);
             *  Out.WriteByte(2);
             *  Out.WriteByte((byte)GameData.CombatEvent.COMBATEVENT_ABILITY_HIT);
             *  Out.WriteByte(7);
             *  Out.WriteUInt16(0x0799);
             *  Out.WriteByte(0);
             *  Caster.DispatchPacket(Out, true);
             * }*/
        }