Esempio n. 1
0
        public static async Task <bool> CastStatus(TkClient caster, Npc target, NpcDebuffActivity activity, KeySpell statusEffectSpell)
        {
            if (activity.IsActive)
            {
                return(false);
            }

            if (statusEffectSpell != null && statusEffectSpell.IsOrbSpell) // TODO: Probably remove this delay once you figure out how to read the curse status of NPCs. It will then cast spells too rapidly, but the negative effects of doing so will have been eliminated.
            {
                // Fragile Orb of Scourge has aethers that are too short to appear in the status effects window and therefore require an additional manual delay.
                await caster.Activity.WaitForMeleeCooldown();

                caster.Activity.ResetCommandCooldown();
                await caster.Activity.WaitForMeleeCooldown();

                caster.Activity.ResetCommandCooldown();
                await caster.Activity.WaitForMovementCooldown();

                caster.Activity.ResetCommandCooldown();
            }

            if (!await CastStatus(caster, target.Uid, $"NPC {target.Uid}", statusEffectSpell))
            {
                if (statusEffectSpell != null) // Indicates that the target is off-screen without having to repeat the relatively inefficient IsTargetOffScreen() check
                {
                    caster.Npcs.Remove(target);
                }

                return(false);
            }

            activity.ResetTimer();
            return(true);
        }
Esempio n. 2
0
        public static async Task <bool> CastStatus(TkClient caster, Npc target, NpcDebuffActivity activity, KeySpell statusEffectSpell)
        {
            if (activity.IsActive)
            {
                return(false);
            }

            if (!await CastStatus(caster, target.Uid, $"NPC {target.Uid}", statusEffectSpell))
            {
                if (statusEffectSpell != null) // Indicates that the target is off-screen without having to repeat the relatively inefficient IsTargetOffScreen() check
                {
                    caster.Npcs.Remove(target);
                }

                return(false);
            }

            activity.ResetTimer();
            return(true);
        }