Beispiel #1
0
        /// <summary>
        /// Action
        /// </summary>
        /// <param name="living"></param>
        public override void Execute(GameLiving living)
        {
            if (CheckPreconditions(living, DEAD | SITTING | MEZZED | STUNNED )) return;

            bool deactivate = false;

            GamePlayer player = living as GamePlayer;
            if (player != null)
            {
                if (player.Group != null)
                {
                    SendCasterSpellEffectAndCastMessage(living, 7066, true);
                    foreach (GamePlayer member in player.Group.GetPlayersInTheGroup())
                    {
                        if (!CheckPreconditions(member, DEAD) && living.IsWithinRadius(member, 2000))
                        {
                            if (restoreMana(member, player))
                                deactivate = true;
                        }
                    }
                }
                else
                {
                    if (!CheckPreconditions(player, DEAD))
                    {
                        if (restoreMana(player, player))
                            deactivate = true;
                    }
                }

                if (deactivate)
                    DisableSkill(living);
            }
        }
        /// <summary>
        /// Action
        /// </summary>
        /// <param name="living"></param>
        public override void Execute(GameLiving living)
        {
            if (CheckPreconditions(living, DEAD | SITTING | MEZZED | STUNNED))
            {
                return;
            }

            GameLiving target = (GameLiving)living.TargetObject;

            if (target == null)
            {
                return;
            }

            if (!GameServer.ServerRules.IsAllowedToAttack(living, target, false))
            {
                return;
            }

            if (!living.IsWithinRadius(target, 1000))
            {
                return;
            }

            if (living.ActiveWeaponSlot != GameLiving.eActiveWeaponSlot.Distance)
            {
                return;
            }

            SendCasterSpellEffectAndCastMessage(living, 7061, true);
            new DesperateBowmanDisarmEffect().Start(living);
            new DesperateBowmanStunEffect().Start(target);
            DamageTarget(target, living);
            DisableSkill(living);
        }
        /// <summary>
        /// Action
        /// </summary>
        /// <param name="living"></param>
        public override void Execute(GameLiving living)
        {
            if (CheckPreconditions(living, DEAD | SITTING | MEZZED | STUNNED)) return;

            if (living.TargetObject == null)
                return;

            GameLiving target = (GameLiving)living.TargetObject;

            if (target == null) return;

            if (!GameServer.ServerRules.IsAllowedToAttack(living, target, false))
                return;

            if (!living.IsWithinRadius(target, 1000))
                return;

            if (living.ActiveWeaponSlot != GameLiving.eActiveWeaponSlot.Distance)
                return;

            SendCasterSpellEffectAndCastMessage(living, 7061, true);
            new DesperateBowmanDisarmEffect().Start(living);
            new DesperateBowmanStunEffect().Start(target);
            DamageTarget(target, living);
            DisableSkill(living);
        }
        private void OnAttack(DOLEvent e, object sender, EventArgs arguments)
        {
            if (arguments == null)
            {
                return;
            }
            AttackedByEnemyEventArgs args = arguments as AttackedByEnemyEventArgs;

            if (args == null)
            {
                return;
            }
            if (args.AttackData == null)
            {
                return;
            }
            if (!args.AttackData.IsMeleeAttack)
            {
                return;
            }
            //FIXME: [WARN] this has been commented out, it should be handled somewhere
            if (args.AttackData.Attacker.EffectList.GetOfType <ChargeEffect>() != null || args.AttackData.Attacker.TempProperties.getProperty("Charging", false))
            {
                return;
            }
            if (!owner.IsWithinRadius(args.AttackData.Attacker, 300))
            {
                return;
            }
            if (Util.Chance(50))
            {
                RetributionOfTheFaithfulStunEffect effect = new RetributionOfTheFaithfulStunEffect();
                effect.Start(args.AttackData.Attacker);
            }
        }
Beispiel #5
0
        /// <summary>
        /// Action
        /// </summary>
        /// <param name="living"></param>
        public override void Execute(GameLiving living)
        {
            if (CheckPreconditions(living, DEAD | SITTING | MEZZED | STUNNED)) return;
            InventoryItem shield = living.Inventory.GetItem(eInventorySlot.LeftHandWeapon);
            if (shield == null)
                return;
            if (shield.Object_Type != (int)eObjectType.Shield)
                return;
            if (living.TargetObject == null)
                return;
            if (living.ActiveWeaponSlot == GameLiving.eActiveWeaponSlot.Distance)
                return;
            if (living.AttackWeapon == null)
                return;
            if (living.AttackWeapon.Hand == 1)
                return;
            GameLiving target = (GameLiving)living.TargetObject;
            if (target == null) return;
            if (!GameServer.ServerRules.IsAllowedToAttack(living, target, false))
                return;
            if (!living.IsWithinRadius( target, 1000 ))
                return;
            new ShieldTripRootEffect().Start(target);

            GamePlayer player = living as GamePlayer;
            if (player != null)
            {
                SendCasterSpellEffectAndCastMessage(player, 7046, true);
                ShieldTripDisarmEffect effect = new ShieldTripDisarmEffect();
                effect.Start(player);
            }
            DisableSkill(living);
        }
Beispiel #6
0
        /// <summary>
        /// Come to this living's aid.
        /// </summary>
        /// <param name="target"></param>
        /// <param name="attacker"></param>
        protected override void OnLivingAttacked(GameLiving target, GameLiving attacker)
        {
            base.OnLivingAttacked(target, attacker);

            if (target.IsWithinRadius(Body, AggressionRange))
                EngageOn(attacker);
        }
        /// <summary>
        /// Action
        /// </summary>
        /// <param name="living"></param>
        public override void Execute(GameLiving living)
        {
            if (CheckPreconditions(living, DEAD | SITTING | MEZZED | STUNNED))
            {
                return;
            }
            InventoryItem shield = living.Inventory.GetItem(eInventorySlot.LeftHandWeapon);

            if (shield == null)
            {
                return;
            }
            if (shield.Object_Type != (int)eObjectType.Shield)
            {
                return;
            }
            if (living.TargetObject == null)
            {
                return;
            }
            if (living.ActiveWeaponSlot == GameLiving.eActiveWeaponSlot.Distance)
            {
                return;
            }
            if (living.AttackWeapon == null)
            {
                return;
            }
            if (living.AttackWeapon.Hand == 1)
            {
                return;
            }
            GameLiving target = (GameLiving)living.TargetObject;

            if (target == null)
            {
                return;
            }
            if (!GameServer.ServerRules.IsAllowedToAttack(living, target, false))
            {
                return;
            }
            if (!living.IsWithinRadius(target, 1000))
            {
                return;
            }
            new ShieldTripRootEffect().Start(target);

            GamePlayer player = living as GamePlayer;

            if (player != null)
            {
                SendCasterSpellEffectAndCastMessage(player, 7046, true);
                ShieldTripDisarmEffect effect = new ShieldTripDisarmEffect();
                effect.Start(player);
            }
            DisableSkill(living);
        }
        /// <summary>
        /// Come to this living's aid.
        /// </summary>
        /// <param name="target"></param>
        /// <param name="attacker"></param>
        protected override void OnLivingAttacked(GameLiving target, GameLiving attacker)
        {
            base.OnLivingAttacked(target, attacker);

            if (target.IsWithinRadius(Body, AggressionRange))
            {
                EngageOn(attacker);
            }
        }
Beispiel #9
0
        /// <summary>
        /// Action
        /// </summary>
        /// <param name="living"></param>
        public override void Execute(GameLiving living)
        {
            if (CheckPreconditions(living, DEAD | SITTING | MEZZED | STUNNED))
            {
                return;
            }

            if (!(living is GamePlayer player))
            {
                return;
            }

            if (player.TargetObject == null || !(living.TargetObject is GamePlayer target))
            {
                player.Out.SendMessage("You must target a player to launch this spell!", eChatType.CT_SpellResisted, eChatLoc.CL_SystemWindow);
                return;
            }

            if (!GameServer.ServerRules.IsAllowedToAttack(living, target, true))
            {
                player.Out.SendMessage("You must select an enemy target!", eChatType.CT_SpellResisted, eChatLoc.CL_SystemWindow);
                return;
            }

            if (!living.IsWithinRadius(target, (int)(1500 * living.GetModified(eProperty.SpellRange) * 0.01)))
            {
                Message.ChatToOthers(living, "You are too far away from your target to use this ability!", eChatType.CT_SpellResisted);
                return;
            }

            SendCasterSpellEffectAndCastMessage(living, 3505, true);
            DamageTarget(target, living, 0);
            GamePlayer oldtarget = target;
            GamePlayer newtarget = null;

            for (int x = 1; x < 5; x++)
            {
                if (newtarget != null)
                {
                    oldtarget = newtarget;
                }

                foreach (GamePlayer p in oldtarget.GetPlayersInRadius(500))
                {
                    if (p != oldtarget && p != living && GameServer.ServerRules.IsAllowedToAttack(living, p, true))
                    {
                        DamageTarget(p, living, x);
                        p.StartInterruptTimer(3000, AttackData.eAttackType.Spell, living);
                        newtarget = p;
                        break;
                    }
                }
            }

            DisableSkill(living);
        }
Beispiel #10
0
        /// <summary>
        /// Start the guarding on player
        /// </summary>
        /// <param name="guardSource">The guarder</param>
        /// <param name="guardTarget">The player guarded by guarder</param>
        public void Start(GameLiving guardSource, GameLiving guardTarget)
        {
            if (guardSource == null || guardTarget == null)
            {
                return;
            }

            if (guardSource is GamePlayer && guardTarget is GamePlayer)
            {
                m_playerGroup = ((GamePlayer)guardSource).Group;
                if (m_playerGroup == null)
                {
                    return;
                }

                if (m_playerGroup != guardTarget.Group)
                {
                    return;
                }

                GameEventMgr.AddHandler(m_playerGroup, GroupEvent.MemberDisbanded, new DOLEventHandler(GroupDisbandCallback));
            }

            m_guardSource = guardSource;
            m_guardTarget = guardTarget;
            m_owner       = m_guardSource;

            if (!guardSource.IsWithinRadius(guardTarget, GuardAbilityHandler.GUARD_DISTANCE))
            {
                if (guardSource is GamePlayer)
                {
                    ((GamePlayer)guardSource).Out.SendMessage(LanguageMgr.GetTranslation(((GamePlayer)guardSource).Client, "Effects.GuardEffect.YouAreNowGuardingYBut", guardTarget.GetName(0, false)), eChatType.CT_System, eChatLoc.CL_SystemWindow);
                }

                if (guardSource is GamePlayer && guardTarget is GamePlayer)
                {
                    ((GamePlayer)guardTarget).Out.SendMessage(LanguageMgr.GetTranslation(((GamePlayer)guardTarget).Client, "Effects.GuardEffect.XIsNowGuardingYouBut", guardSource.GetName(0, true)), eChatType.CT_System, eChatLoc.CL_SystemWindow);
                }
            }
            else
            {
                if (guardSource is GamePlayer)
                {
                    ((GamePlayer)guardSource).Out.SendMessage(LanguageMgr.GetTranslation(((GamePlayer)guardSource).Client, "Effects.GuardEffect.YouAreNowGuardingY", guardTarget.GetName(0, false)), eChatType.CT_System, eChatLoc.CL_SystemWindow);
                }

                if (guardSource is GamePlayer && guardTarget is GamePlayer)
                {
                    ((GamePlayer)guardTarget).Out.SendMessage(LanguageMgr.GetTranslation(((GamePlayer)guardTarget).Client, "Effects.GuardEffect.XIsNowGuardingYou", guardSource.GetName(0, true)), eChatType.CT_System, eChatLoc.CL_SystemWindow);
                }
            }

            m_guardSource.EffectList.Add(this);
            m_guardTarget.EffectList.Add(this);
        }
Beispiel #11
0
		/// <summary>
		/// Action
		/// </summary>
		/// <param name="living"></param>
		public override void Execute(GameLiving living)
		{
			if (CheckPreconditions(living, DEAD | SITTING | MEZZED | STUNNED)) return;

			ushort Icon = 7026;
			effectiveness = 0;
			owner = living;

			if(ServerProperties.Properties.USE_NEW_ACTIVES_RAS_SCALING)
			{
				switch (Level)
				{
					case 1: effectiveness = 300; break;
					case 2: effectiveness = 450; break;
					case 3: effectiveness = 600; break;
					case 4: effectiveness = 750; break;
					case 5: effectiveness = 900; break;
				}
			}
			else
			{
				switch (Level)
				{
					case 1: effectiveness = 300; break;
					case 2: effectiveness = 600; break;
					case 3: effectiveness = 900; break;
				}
			}

			if (living.GroundTarget == null)
				return;
			if (!living.IsWithinRadius( living.GroundTarget, 1500 ))
				return;
			GamePlayer player = living as GamePlayer;
			if (player == null)
				return;

			if (player.RealmAbilityCastTimer != null)
			{
				player.RealmAbilityCastTimer.Stop();
				player.RealmAbilityCastTimer = null;
				player.Out.SendMessage("You cancel your Spell!", eChatType.CT_SpellResisted, eChatLoc.CL_SystemWindow);
			}

			foreach (GamePlayer p in living.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
				p.Out.SendSpellCastAnimation(living, Icon, 20);

			player.RealmAbilityCastTimer = new RegionTimer(player);
			player.RealmAbilityCastTimer.Callback = new RegionTimerCallback(startSpell);
			player.RealmAbilityCastTimer.Start(2000);
		}
Beispiel #12
0
        /// <summary>
        /// Sends cast message to environment
        /// </summary>
        protected virtual void SendCastMessage(GameLiving caster)
        {
            foreach (GamePlayer player in caster.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
            {
                if (caster.IsWithinRadius(player, WorldMgr.INFO_DISTANCE))
                {
                    var message = player == caster
                        ? LanguageMgr.GetTranslation(player.Client.Account.Language, "RealmAbility.SendCastMessage.YouCast", m_name)
                        : LanguageMgr.GetTranslation(player.Client.Account.Language, "RealmAbility.SendCastMessage.PlayerCasts", player.Name);

                    player.Out.SendMessage(message, eChatType.CT_Spell, eChatLoc.CL_SystemWindow);
                }
            }
        }
Beispiel #13
0
        /// <summary>
        /// Send spell effect animation on caster and send messages
        /// </summary>
        /// <param name="caster"></param>
        /// <param name="spellEffect"></param>
        /// <param name="success"></param>
        public virtual void SendCasterSpellEffectAndCastMessage(GameLiving caster, ushort spellEffect, bool success)
        {
            foreach (GamePlayer player in caster.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
            {
                player.Out.SendSpellEffectAnimation(caster, caster, spellEffect, 0, false, success ? (byte)1 : (byte)0);

                if (caster.IsWithinRadius(player, WorldMgr.INFO_DISTANCE))
                {
                    var message = player == caster
                        ? LanguageMgr.GetTranslation(player.Client.Account.Language, "RealmAbility.SendCasterSpellEffectAndCastMessage.You", m_name)
                        : LanguageMgr.GetTranslation(player.Client.Account.Language, "RealmAbility.SendCasterSpellEffectAndCastMessage.Caster", caster.Name);

                    player.Out.SendMessage(message, eChatType.CT_Spell, eChatLoc.CL_SystemWindow);
                }
            }
        }
        /// <summary>
        /// Action
        /// </summary>
        /// <param name="living"></param>
        public override void Execute(GameLiving living)
        {
            if (CheckPreconditions(living, DEAD | SITTING | MEZZED | STUNNED)) return;

            bool deactivate = false;
            AbstractServerRules rules = GameServer.ServerRules as AbstractServerRules;
            GamePlayer player = living as GamePlayer;
            GamePlayer target = living.TargetObject as GamePlayer;
            if (player.TargetObject == null || target == null)
            {
                player.Out.SendMessage("You must target a player to launch this spell!", eChatType.CT_SpellResisted, eChatLoc.CL_SystemWindow);
                return;
            }
            if (!GameServer.ServerRules.IsAllowedToAttack(living, target, true))
            {
                player.Out.SendMessage("You must select an enemy target!", eChatType.CT_SpellResisted, eChatLoc.CL_SystemWindow);
                return;
            }

            if (!living.IsWithinRadius(target, (int)(1500 * living.GetModified(eProperty.SpellRange) * 0.01)))
            {
                Message.ChatToOthers(living, "You are too far away from your target to use this ability!", eChatType.CT_SpellResisted);
                return;
            }
            SendCasterSpellEffectAndCastMessage(living, 3505, true);
            DamageTarget(target, living, 0);
            deactivate = true;
            GamePlayer m_oldtarget = target;
            GamePlayer m_newtarget = null;
            for (int x = 1; x < 5; x++)
            {
                if (m_newtarget != null)
                    m_oldtarget = m_newtarget;
                foreach (GamePlayer p in m_oldtarget.GetPlayersInRadius(500))
                {
                    if (p != m_oldtarget && p != living && GameServer.ServerRules.IsAllowedToAttack(living, p, true))
                    {
                        DamageTarget(p, living, x);
                        p.StartInterruptTimer(3000, AttackData.eAttackType.Spell, living);
                        m_newtarget = p;
                        break;
                    }
                }
            }
            if (deactivate)
                DisableSkill(living);
        }
Beispiel #15
0
        /// <summary>
        /// Action
        /// </summary>
        /// <param name="living"></param>
        public override void Execute(GameLiving living)
        {
            if (CheckPreconditions(living, DEAD | SITTING | MEZZED | STUNNED))
            {
                return;
            }



            bool deactivate = false;

            GamePlayer player = living as GamePlayer;

            if (player != null)
            {
                if (player.Group != null)
                {
                    SendCasterSpellEffectAndCastMessage(living, 7071, true);
                    foreach (GamePlayer member in player.Group.GetPlayersInTheGroup())
                    {
                        RestorativeMindEffect aog = member.EffectList.GetOfType <RestorativeMindEffect>();
                        if (!CheckPreconditions(member, DEAD) && aog == null &&
                            living.IsWithinRadius(member, 2000))
                        {
                            RestorativeMindEffect effect = new RestorativeMindEffect();
                            effect.Start(member);
                            deactivate = true;
                        }
                    }
                }
                else
                {
                    RestorativeMindEffect aog = player.EffectList.GetOfType <RestorativeMindEffect>();
                    if (!CheckPreconditions(player, DEAD) && aog == null)
                    {
                        RestorativeMindEffect effect = new RestorativeMindEffect();
                        effect.Start(player);
                        deactivate = true;
                    }
                }
            }
            if (deactivate)
            {
                DisableSkill(living);
            }
        }
Beispiel #16
0
        /// <summary>
        /// Start the intercepting on player
        /// </summary>
        /// <param name="interceptor">The interceptor</param>
        /// <param name="intercepted">The intercepted</param>
        public void Start(GameLiving interceptor, GameLiving intercepted)
        {
            if (interceptor is GamePlayer && intercepted is GamePlayer)
            {
                m_group = ((GamePlayer)interceptor).Group;
                if (m_group == null)
                {
                    return;
                }

                GameEventMgr.AddHandler(m_group, GroupEvent.MemberDisbanded, new DOLEventHandler(GroupDisbandCallback));
            }

            m_interceptSource = interceptor;
            m_owner           = m_interceptSource;
            m_interceptTarget = intercepted;

            if (!interceptor.IsWithinRadius(intercepted, InterceptAbilityHandler.INTERCEPT_DISTANCE))
            {
                if (interceptor is GamePlayer)
                {
                    ((GamePlayer)interceptor).Out.SendMessage(LanguageMgr.GetTranslation(((GamePlayer)interceptor).Client, "Effects.InterceptEffect.YouAttemtInterceptYBut", intercepted.GetName(0, false)), eChatType.CT_System, eChatLoc.CL_SystemWindow);
                }

                if (intercepted is GamePlayer && interceptor is GamePlayer)
                {
                    ((GamePlayer)intercepted).Out.SendMessage(LanguageMgr.GetTranslation(((GamePlayer)intercepted).Client, "Effects.InterceptEffect.XAttemtInterceptYouBut", interceptor.GetName(0, true)), eChatType.CT_System, eChatLoc.CL_SystemWindow);
                }
            }
            else
            {
                if (interceptor is GamePlayer)
                {
                    ((GamePlayer)interceptor).Out.SendMessage(LanguageMgr.GetTranslation(((GamePlayer)interceptor).Client, "Effects.InterceptEffect.YouAttemtInterceptY", intercepted.GetName(0, false)), eChatType.CT_System, eChatLoc.CL_SystemWindow);
                }

                if (intercepted is GamePlayer && interceptor is GamePlayer)
                {
                    ((GamePlayer)intercepted).Out.SendMessage(LanguageMgr.GetTranslation(((GamePlayer)intercepted).Client, "Effects.InterceptEffect.XAttemptInterceptYou", interceptor.GetName(0, true)), eChatType.CT_System, eChatLoc.CL_SystemWindow);
                }
            }

            interceptor.EffectList.Add(this);
            intercepted.EffectList.Add(this);
        }
Beispiel #17
0
        /// <summary>
        /// Called on every timer tick
        /// </summary>
        protected override void OnTick()
        {
            if (m_caster == null ||
                m_owner == null ||
                m_effect == null)
            {
                return;
            }

            if (!m_caster.IsWithinRadius(m_owner, ServerProperties.Properties.BUFF_RANGE))
            {
                m_effect.Cancel(false);
            }
            else
            {
                Start(BUFFCHECKINTERVAL);
            }
        }
Beispiel #18
0
        /// <summary>
        /// Action
        /// </summary>
        /// <param name="living"></param>
        public override void Execute(GameLiving living)
        {
            if (CheckPreconditions(living, DEAD | SITTING | MEZZED | STUNNED))
            {
                return;
            }

            bool deactivate = false;

            GamePlayer player = living as GamePlayer;

            if (player != null)
            {
                if (player.Group != null)
                {
                    SendCasterSpellEffectAndCastMessage(living, 7066, true);
                    foreach (GamePlayer member in player.Group.GetPlayersInTheGroup())
                    {
                        if (!CheckPreconditions(member, DEAD) && living.IsWithinRadius(member, 2000))
                        {
                            if (restoreMana(member, player))
                            {
                                deactivate = true;
                            }
                        }
                    }
                }
                else
                {
                    if (!CheckPreconditions(player, DEAD))
                    {
                        if (restoreMana(player, player))
                        {
                            deactivate = true;
                        }
                    }
                }

                if (deactivate)
                {
                    DisableSkill(living);
                }
            }
        }
Beispiel #19
0
        /// <summary>
        /// Action
        /// </summary>
        /// <param name="living"></param>
        public override void Execute(GameLiving living)
        {
            if (CheckPreconditions(living, DEAD | SITTING | MEZZED | STUNNED)) return;

            bool deactivate = false;

            GamePlayer player = living as GamePlayer;
            if (player != null)
            {
                if (player.Group != null)
                {
                    SendCasterSpellEffectAndCastMessage(living, 7071, true);
                    foreach (GamePlayer member in player.Group.GetPlayersInTheGroup())
                    {
                        RestorativeMindEffect aog = member.EffectList.GetOfType<RestorativeMindEffect>();
                        if (!CheckPreconditions(member, DEAD) && aog == null
                            && living.IsWithinRadius( member, 2000 ))
                        {
                            RestorativeMindEffect effect = new RestorativeMindEffect();
                            effect.Start(member);
                            deactivate = true;
                        }
                    }
                }
                else
                {
                    RestorativeMindEffect aog = player.EffectList.GetOfType<RestorativeMindEffect>();
                    if (!CheckPreconditions(player, DEAD) && aog == null)
                    {
                        RestorativeMindEffect effect = new RestorativeMindEffect();
                        effect.Start(player);
                        deactivate = true;
                    }
                }
            }
            if (deactivate)
                DisableSkill(living);
        }
Beispiel #20
0
        /// <summary>
        /// Called when the Bomber reaches his target
        /// </summary>
        private void BomberArriveAtTarget(DOLEvent e, object sender, EventArgs args)
        {
            GameNPC bomber = sender as GameNPC;

            //[Ganrod] Nidel: Prevent NPE
            if (bomber == null || m_pet == null || bomber != m_pet)
            {
                return;
            }

            //[Ganrod] Nidel: Abort and delete bomber if Spell or Target is NULL
            Spell      subspell = SkillBase.GetSpellByID(m_spell.SubSpellID);
            GameLiving living   = m_pet.TempProperties.getProperty <object>(BOMBERTARGET, null) as GameLiving;

            if (subspell == null || living == null)
            {
                if (log.IsErrorEnabled && subspell == null)
                {
                    log.Error("Bomber SubspellID for Bomber SpellID: " + m_spell.ID + " is not implemented yet");
                }
                bomber.Health = 0;
                bomber.Delete();
                return;
            }

            //Andraste
            subspell.Level = m_spell.Level;
            if (living.IsWithinRadius(bomber, 350))
            {
                ISpellHandler spellhandler = ScriptMgr.CreateSpellHandler(Caster, subspell, SkillBase.GetSpellLine(SpellLine.KeyName));
                spellhandler.StartSpell(living);
            }

            //[Ganrod] Nidel: Delete Bomber after all actions.
            bomber.Health = 0;
            bomber.Delete();
        }
        /// <summary>
        /// Start the intercepting on player
        /// </summary>
        /// <param name="interceptor">The interceptor</param>
        /// <param name="intercepted">The intercepted</param>
        public void Start(GameLiving interceptor, GameLiving intercepted)
        {
            if (interceptor is GamePlayer && intercepted is GamePlayer)
            {
                m_group = ((GamePlayer)interceptor).Group;
                if (m_group == null) return;
                GameEventMgr.AddHandler(m_group, GroupEvent.MemberDisbanded, new DOLEventHandler(GroupDisbandCallback));
            }
            m_interceptSource = interceptor;
            m_owner = m_interceptSource;
            m_interceptTarget = intercepted;

            if (!interceptor.IsWithinRadius(intercepted, InterceptAbilityHandler.INTERCEPT_DISTANCE))
            {
                if (interceptor is GamePlayer)
                    ((GamePlayer)interceptor).Out.SendMessage(LanguageMgr.GetTranslation(((GamePlayer)interceptor).Client, "Effects.InterceptEffect.YouAttemtInterceptYBut", intercepted.GetName(0, false)), eChatType.CT_System, eChatLoc.CL_SystemWindow);
                if (intercepted is GamePlayer && interceptor is GamePlayer)
                    ((GamePlayer)intercepted).Out.SendMessage(LanguageMgr.GetTranslation(((GamePlayer)intercepted).Client, "Effects.InterceptEffect.XAttemtInterceptYouBut", interceptor.GetName(0, true)), eChatType.CT_System, eChatLoc.CL_SystemWindow);
            }
            else
            {
                if (interceptor is GamePlayer)
                    ((GamePlayer)interceptor).Out.SendMessage(LanguageMgr.GetTranslation(((GamePlayer)interceptor).Client, "Effects.InterceptEffect.YouAttemtInterceptY", intercepted.GetName(0, false)), eChatType.CT_System, eChatLoc.CL_SystemWindow);
                if (intercepted is GamePlayer && interceptor is GamePlayer)
                    ((GamePlayer)intercepted).Out.SendMessage(LanguageMgr.GetTranslation(((GamePlayer)intercepted).Client, "Effects.InterceptEffect.XAttemptInterceptYou", interceptor.GetName(0, true)), eChatType.CT_System, eChatLoc.CL_SystemWindow);
            }
            interceptor.EffectList.Add(this);
            intercepted.EffectList.Add(this);
        }
        public override void Execute(GameLiving living)
        {
            if (!(living is GamePlayer player))
            {
                Log.Warn("Could not retrieve player in JuggernautAbilityHandler.");
                return;
            }

            if (!living.IsAlive)
            {
                player.Out.SendMessage("You cannot use this ability while dead!", eChatType.CT_System, eChatLoc.CL_SystemWindow);

                return;
            }

            if (living.IsMezzed)
            {
                player.Out.SendMessage("You cannot use this ability while mesmerized!", eChatType.CT_System, eChatLoc.CL_SystemWindow);

                return;
            }

            if (living.IsStunned)
            {
                player.Out.SendMessage("You cannot use this ability while stunned!", eChatType.CT_System, eChatLoc.CL_SystemWindow);

                return;
            }

            if (living.IsSitting)
            {
                player.Out.SendMessage("You cannot use this ability while sitting!", eChatType.CT_System, eChatLoc.CL_SystemWindow);

                return;
            }

            if (living.ControlledBrain == null)
            {
                player.Out.SendMessage("You must have a pet controlled to use this ability!", eChatType.CT_System, eChatLoc.CL_SystemWindow);

                return;
            }

            if (!living.IsWithinRadius(player.ControlledBrain.Body, _range))
            {
                player.Out.SendMessage("Your pet is too far away!", eChatType.CT_System, eChatLoc.CL_SystemWindow);

                return;
            }

            GameSpellEffect ml9 = SpellHandler.FindEffectOnTarget(living.ControlledBrain.Body, "SummonMastery");

            if (ml9 != null)
            {
                player.Out.SendMessage("Your Pet already has an ability of this type active", eChatType.CT_SpellResisted, eChatLoc.CL_SystemWindow);

                return;
            }

            if (ServerProperties.Properties.USE_NEW_ACTIVES_RAS_SCALING)
            {
                switch (Level)
                {
                case 1:
                    _value = 10;
                    break;

                case 2:
                    _value = 15;
                    break;

                case 3:
                    _value = 20;
                    break;

                case 4:
                    _value = 25;
                    break;

                case 5:
                    _value = 30;
                    break;

                default:
                    return;
                }
            }
            else
            {
                switch (Level)
                {
                case 1:
                    _value = 10;
                    break;

                case 2:
                    _value = 20;
                    break;

                case 3:
                    _value = 30;
                    break;

                default:
                    return;
                }
            }

            new JuggernautEffect().Start(living, _duration, _value);

            DisableSkill(living);
        }
Beispiel #23
0
        /// <summary>
        /// Heals targets group
        /// </summary>
        /// <param name="target"></param>
        /// <param name="amount">amount of hit points to heal</param>
        /// <returns>true if heal was done</returns>
        public override bool HealTarget(GameLiving target, double amount)
        {
            Hashtable  injuredTargets     = new Hashtable();
            GameLiving mostInjuredLiving  = target;
            double     mostInjuredPercent = mostInjuredLiving.Health / (float)mostInjuredLiving.MaxHealth;

            int minHealVariance;
            int maxHealVariance;
            int targetHealCap;

            CalculateHealVariance(out minHealVariance, out maxHealVariance);

            if (minHealVariance >= maxHealVariance)
            {
                targetHealCap = maxHealVariance;
            }
            else
            {
                targetHealCap = Util.Random(minHealVariance, maxHealVariance);
            }

            int groupHealCap = targetHealCap;

            Group group = target.Group;

            if (group != null)
            {
                groupHealCap  *= group.MemberCount;
                targetHealCap *= 2;

                foreach (GameLiving living in group.GetMembersInTheGroup())
                {
                    if (!living.IsAlive)
                    {
                        continue;
                    }
                    //heal only if target is in range
                    if (target.IsWithinRadius(living, m_spell.Range))
                    {
                        double livingHealthPercent = living.Health / (double)living.MaxHealth;
                        if (livingHealthPercent < 1)
                        {
                            injuredTargets.Add(living, livingHealthPercent);
                            if (livingHealthPercent < mostInjuredPercent)
                            {
                                mostInjuredLiving  = living;
                                mostInjuredPercent = livingHealthPercent;
                            }
                        }
                    }
                }
            }
            else
            {
                // heal caster
                if (mostInjuredPercent < 1)
                {
                    injuredTargets.Add(target, mostInjuredPercent);
                }
            }


            if (mostInjuredPercent >= 1)
            {
                //all are healed, 1/2 power
                SendEffectAnimation(target, 0, false, 0);
                MessageToCaster("Your group is already fully healed!", eChatType.CT_SpellResisted);
                return(false);
            }

            double    bestHealPercent = targetHealCap / (double)mostInjuredLiving.MaxHealth;
            double    totalHealed     = 0;
            Hashtable healAmount      = new Hashtable();


            IDictionaryEnumerator iter = injuredTargets.GetEnumerator();

            //calculate heal for all targets
            while (iter.MoveNext())
            {
                GameLiving healTarget          = iter.Key as GameLiving;
                double     targetHealthPercent = (double)iter.Value;
                //targets hp percent after heal is same as mostInjuredLiving
                double targetHealPercent = bestHealPercent + mostInjuredPercent - targetHealthPercent;
                int    targetHeal        = (int)(healTarget.MaxHealth * targetHealPercent);

                if (targetHeal > 0)
                {
                    totalHealed += targetHeal;
                    healAmount.Add(healTarget, targetHeal);
                }
            }

            iter = healAmount.GetEnumerator();
            //reduce healed hp according to targetHealCap and heal targets
            while (iter.MoveNext())
            {
                GameLiving healTarget   = iter.Key as GameLiving;
                double     uncappedHeal = (int)iter.Value;
                int        reducedHeal  = (int)Math.Min(targetHealCap, uncappedHeal * (groupHealCap / totalHealed));

                //heal target
                base.HealTarget(healTarget, reducedHeal);
            }

            return(true);
        }
Beispiel #24
0
        public override void Execute(GameLiving living)
        {
            GamePlayer player = living as GamePlayer;
            #region preCheck
            if (living == null)
            {
                log.Warn("Could not retrieve player in JuggernautAbilityHandler.");
                return;
            }

            if (!(living.IsAlive))
            {
                if(player != null)
                    player.Out.SendMessage("You cannot use this ability while dead!", eChatType.CT_System, eChatLoc.CL_SystemWindow);
                return;
            }
            if (living.IsMezzed)
            {
                if(player != null)
                    player.Out.SendMessage("You cannot use this ability while mesmerized!", eChatType.CT_System, eChatLoc.CL_SystemWindow);
                return;
            }
            if (living.IsStunned)
            {
                if(player != null)
                    player.Out.SendMessage("You cannot use this ability while stunned!", eChatType.CT_System, eChatLoc.CL_SystemWindow);
                return;
            }
            if (living.IsSitting)
            {
                if(player != null)
                    player.Out.SendMessage("You cannot use this ability while sitting!", eChatType.CT_System, eChatLoc.CL_SystemWindow);
                return;
            }
            if (living.ControlledBrain == null)
            {
                if(player != null)
                    player.Out.SendMessage("You must have a pet controlled to use this ability!", eChatType.CT_System, eChatLoc.CL_SystemWindow);
                return;
            }
            if (!living.IsWithinRadius( player.ControlledBrain.Body, m_range ))
            {
                if(player != null)
                    player.Out.SendMessage("Your pet is too far away!", eChatType.CT_System, eChatLoc.CL_SystemWindow);
                return;
            }
            GameSpellEffect ml9=SpellHandler.FindEffectOnTarget(living.ControlledBrain.Body,"SummonMastery");
            if (ml9 != null)
            {
                if(player != null)
                    player.Out.SendMessage("Your Pet already has an ability of this type active", eChatType.CT_SpellResisted, eChatLoc.CL_SystemWindow);
                return;
            }

            #endregion

            if(ServerProperties.Properties.USE_NEW_ACTIVES_RAS_SCALING)
            {
                switch (this.Level)
                {
                    case 1:
                        m_value = 10;
                        break;
                    case 2:
                        m_value = 15;
                        break;
                    case 3:
                        m_value = 20;
                        break;
                    case 4:
                        m_value = 25;
                        break;
                    case 5:
                        m_value = 30;
                        break;
                    default:
                        return;
                }
            }
            else
            {
                switch (this.Level)
                {
                    case 1:
                        m_value = 10;
                        break;
                    case 2:
                        m_value = 20;
                        break;
                    case 3:
                        m_value = 30;
                        break;
                    default:
                        return;
                }
            }

            new JuggernautEffect().Start(living, m_duration, m_value);

            DisableSkill(living);
        }
Beispiel #25
0
        /// <summary>
        /// Start the guarding on player
        /// </summary>
        /// <param name="guardSource">The guarder</param>
        /// <param name="guardTarget">The player guarded by guarder</param>
        public void Start(GameLiving guardSource, GameLiving guardTarget)
        {
            if (guardSource == null || guardTarget == null)
                return;

            if (guardSource is GamePlayer && guardTarget is GamePlayer)
            {
                m_playerGroup = ((GamePlayer)guardSource).Group;
                if (m_playerGroup == null) return;
                if (m_playerGroup != guardTarget.Group) return;
                GameEventMgr.AddHandler(m_playerGroup, GroupEvent.MemberDisbanded, new DOLEventHandler(GroupDisbandCallback));
            }

            m_guardSource = guardSource;
            m_guardTarget = guardTarget;
            m_owner = m_guardSource;

            if (!guardSource.IsWithinRadius(guardTarget, GuardAbilityHandler.GUARD_DISTANCE))
            {
                if (guardSource is GamePlayer)
                    ((GamePlayer)guardSource).Out.SendMessage(LanguageMgr.GetTranslation(((GamePlayer)guardSource).Client, "Effects.GuardEffect.YouAreNowGuardingYBut", guardTarget.GetName(0, false)), eChatType.CT_System, eChatLoc.CL_SystemWindow);
                if (guardSource is GamePlayer && guardTarget is GamePlayer)
                    ((GamePlayer)guardTarget).Out.SendMessage(LanguageMgr.GetTranslation(((GamePlayer)guardTarget).Client, "Effects.GuardEffect.XIsNowGuardingYouBut", guardSource.GetName(0, true)), eChatType.CT_System, eChatLoc.CL_SystemWindow);
            }
            else
            {
                if (guardSource is GamePlayer)
                    ((GamePlayer)guardSource).Out.SendMessage(LanguageMgr.GetTranslation(((GamePlayer)guardSource).Client, "Effects.GuardEffect.YouAreNowGuardingY", guardTarget.GetName(0, false)), eChatType.CT_System, eChatLoc.CL_SystemWindow);
                if (guardSource is GamePlayer && guardTarget is GamePlayer)
                    ((GamePlayer)guardTarget).Out.SendMessage(LanguageMgr.GetTranslation(((GamePlayer)guardTarget).Client, "Effects.GuardEffect.XIsNowGuardingYou", guardSource.GetName(0, true)), eChatType.CT_System, eChatLoc.CL_SystemWindow);
            }

            m_guardSource.EffectList.Add(this);
            m_guardTarget.EffectList.Add(this);
        }
Beispiel #26
0
		public virtual void AddToAggroList(GameLiving living, int aggroamount, bool NaturalAggro)
		{
			if (m_body.IsConfused) return;

			// tolakram - duration spell effects will attempt to add to aggro after npc is dead
			if (!m_body.IsAlive) return;

			if (living == null) return;

			//Handle trigger to say sentance on first aggro.
			if (m_aggroTable.Count < 1)
				Body.FireAmbientSentence(GameNPC.eAmbientTrigger.aggroing, living);
			
			// Check LOS (walls, pits, etc...) before  attacking, player + pet
			// Be sure the aggrocheck is triggered by the brain on Think() method
			if (DOL.GS.ServerProperties.Properties.ALWAYS_CHECK_LOS && NaturalAggro)
			{
				GamePlayer thisLiving = null;
				if (living is GamePlayer)
					thisLiving = (GamePlayer)living;
				
				if (living is GamePet)
				{
					IControlledBrain brain = ((GamePet)living).Brain as IControlledBrain;
					thisLiving = brain.GetPlayerOwner();
				}
				
				if (thisLiving != null)
				{
					thisLiving.Out.SendCheckLOS (Body, living, new CheckLOSResponse(CheckAggroLOS));
					if (!AggroLOS) return;
				}
			}
			
			// only protect if gameplayer and aggroamout > 0
			if (living is GamePlayer && aggroamount > 0)
			{
				GamePlayer player = (GamePlayer)living;
				
				if (player.Group != null)
				{ // player is in group, add whole group to aggro list
					lock ((m_aggroTable as ICollection).SyncRoot)
					{
						foreach (GamePlayer p in player.Group.GetPlayersInTheGroup())
						{
							if (!m_aggroTable.ContainsKey(p))
							{
								m_aggroTable[p] = 1L;	// add the missing group member on aggro table
							}
						}
					}
				}

				//ProtectEffect protect = (ProtectEffect) player.EffectList.GetOfType(typeof(ProtectEffect));
				foreach (ProtectEffect protect in player.EffectList.GetAllOfType<ProtectEffect>())
				{
					// if no aggro left => break
					if (aggroamount <= 0) break;

					//if (protect==null) continue;
					if (protect.ProtectTarget != living) continue;
					if (protect.ProtectSource.IsStunned) continue;
					if (protect.ProtectSource.IsMezzed) continue;
					if (protect.ProtectSource.IsSitting) continue;
					if (protect.ProtectSource.ObjectState != GameObject.eObjectState.Active) continue;
					if (!protect.ProtectSource.IsAlive) continue;
					if (!protect.ProtectSource.InCombat) continue;

					if (!living.IsWithinRadius(protect.ProtectSource, ProtectAbilityHandler.PROTECT_DISTANCE))
						continue;
					// P I: prevents 10% of aggro amount
					// P II: prevents 20% of aggro amount
					// P III: prevents 30% of aggro amount
					// guessed percentages, should never be higher than or equal to 50%
					int abilityLevel = protect.ProtectSource.GetAbilityLevel(Abilities.Protect);
					int protectAmount = (int)((abilityLevel * 0.10) * aggroamount);

					if (protectAmount > 0)
					{
						aggroamount -= protectAmount;
						protect.ProtectSource.Out.SendMessage(LanguageMgr.GetTranslation(protect.ProtectSource.Client.Account.Language, "AI.Brain.StandardMobBrain.YouProtDist", player.GetName(0, false),
						                                                                 Body.GetName(0, false, protect.ProtectSource.Client.Account.Language, Body)), eChatType.CT_System, eChatLoc.CL_SystemWindow);
						//player.Out.SendMessage("You are protected by " + protect.ProtectSource.GetName(0, false) + " from " + Body.GetName(0, false) + ".", eChatType.CT_System, eChatLoc.CL_SystemWindow);

						lock ((m_aggroTable as ICollection).SyncRoot)
						{
							if (m_aggroTable.ContainsKey(protect.ProtectSource))
								m_aggroTable[protect.ProtectSource] += protectAmount;
							else
								m_aggroTable[protect.ProtectSource] = protectAmount;
						}
					}
				}
			}

			lock ((m_aggroTable as ICollection).SyncRoot)
			{
				if (m_aggroTable.ContainsKey(living))
				{
					long amount = m_aggroTable[living];
					amount += aggroamount;

					// can't be removed this way, set to minimum
					if (amount <= 0)
						amount = 1L;

					m_aggroTable[living] = amount;
				}
				else
				{
					if (aggroamount > 0)
					{
						m_aggroTable[living] = aggroamount;
					}
					else
					{
						m_aggroTable[living] = 1L;
					}

				}
			}
		}
        /// <summary>
        /// Action
        /// </summary>
        /// <param name="living"></param>
        public override void Execute(GameLiving living)
        {
            if (CheckPreconditions(living, DEAD | SITTING | MEZZED | STUNNED))
            {
                return;
            }

            const ushort icon = 7026;

            _effectiveness = 0;
            _owner         = living;

            if (ServerProperties.Properties.USE_NEW_ACTIVES_RAS_SCALING)
            {
                switch (Level)
                {
                case 1: _effectiveness = 300; break;

                case 2: _effectiveness = 450; break;

                case 3: _effectiveness = 600; break;

                case 4: _effectiveness = 750; break;

                case 5: _effectiveness = 900; break;
                }
            }
            else
            {
                switch (Level)
                {
                case 1: _effectiveness = 300; break;

                case 2: _effectiveness = 600; break;

                case 3: _effectiveness = 900; break;
                }
            }

            if (living.GroundTarget == null)
            {
                return;
            }

            if (!living.IsWithinRadius(living.GroundTarget, 1500))
            {
                return;
            }

            if (!(living is GamePlayer player))
            {
                return;
            }

            if (player.RealmAbilityCastTimer != null)
            {
                player.RealmAbilityCastTimer.Stop();
                player.RealmAbilityCastTimer = null;
                player.Out.SendMessage("You cancel your Spell!", eChatType.CT_SpellResisted, eChatLoc.CL_SystemWindow);
            }

            foreach (GamePlayer p in living.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
            {
                p.Out.SendSpellCastAnimation(living, icon, 20);
            }

            player.RealmAbilityCastTimer = new RegionTimer(player)
            {
                Callback = new RegionTimerCallback(StartSpell)
            };

            player.RealmAbilityCastTimer.Start(2000);
        }
Beispiel #28
0
        /// <summary>
        /// Heals targets group
        /// </summary>
        /// <param name="target"></param>
        /// <param name="amount">amount of hit points to heal</param>
        /// <returns>true if heal was done</returns>
        public override bool HealTarget(GameLiving target, int amount)
        {
            Hashtable injuredTargets = new Hashtable();
            GameLiving mostInjuredLiving = target;
            double mostInjuredPercent = mostInjuredLiving.Health / (float)mostInjuredLiving.MaxHealth;

            int minHealVariance;
            int maxHealVariance;
            int targetHealCap;

            CalculateHealVariance(out minHealVariance, out maxHealVariance);

            if (minHealVariance >= maxHealVariance)
            {
                targetHealCap = maxHealVariance;
            }
            else
            {
                targetHealCap = Util.Random(minHealVariance, maxHealVariance);
            }

            int groupHealCap = targetHealCap;

            Group group = target.Group;
            if (group != null)
            {
                groupHealCap *= group.MemberCount;
                targetHealCap *= 2;

                foreach (GameLiving living in group.GetMembersInTheGroup())
                {
                    if (!living.IsAlive) continue;
                    //heal only if target is in range
                    if (target.IsWithinRadius(living, m_spell.Range))
                    {
                        double livingHealthPercent = living.Health / (double)living.MaxHealth;
                        if (livingHealthPercent < 1)
                        {
                            injuredTargets.Add(living, livingHealthPercent);
                            if (livingHealthPercent < mostInjuredPercent)
                            {
                                mostInjuredLiving = living;
                                mostInjuredPercent = livingHealthPercent;
                            }
                        }
                    }
                }
            }
            else
            {
                // heal caster
                if (mostInjuredPercent < 1)
                    injuredTargets.Add(target, mostInjuredPercent);
            }

            if (mostInjuredPercent >= 1)
            {
                //all are healed, 1/2 power
                SendEffectAnimation(target, 0, false, 0);
                MessageToCaster("Your group is already fully healed!", eChatType.CT_SpellResisted);
                return false;
            }

            double bestHealPercent = targetHealCap / (double)mostInjuredLiving.MaxHealth;
            double totalHealed = 0;
            Hashtable healAmount = new Hashtable();

            IDictionaryEnumerator iter = injuredTargets.GetEnumerator();
            //calculate heal for all targets
            while (iter.MoveNext())
            {
                GameLiving healTarget = iter.Key as GameLiving;
                double targetHealthPercent = (double) iter.Value;
                //targets hp percent after heal is same as mostInjuredLiving
                double targetHealPercent = bestHealPercent + mostInjuredPercent - targetHealthPercent;
                int targetHeal = (int) (healTarget.MaxHealth * targetHealPercent);

                if (targetHeal > 0)
                {
                    totalHealed += targetHeal;
                    healAmount.Add(healTarget, targetHeal);
                }
            }

            iter = healAmount.GetEnumerator();
            //reduce healed hp according to targetHealCap and heal targets
            while (iter.MoveNext())
            {
                GameLiving healTarget = iter.Key as GameLiving;
                double uncappedHeal = (int) iter.Value;
                int reducedHeal = (int) Math.Min(targetHealCap, uncappedHeal * (groupHealCap / totalHealed));

                //heal target
                base.HealTarget(healTarget, reducedHeal);
            }

            return true;
        }
Beispiel #29
0
            protected override void OnTick()
            {
                IDictionary effects = m_handler.m_concEffects;
                GameLiving  caster  = (GameLiving)m_actionSource;

                lock (effects)
                {
                    if (effects.Count <= 0)
                    {
                        Stop();                         // all effects were canceled, stop the timer
                        return;
                    }

                    ArrayList disableEffects = null;
                    ArrayList enableEffects  = null;
                    foreach (DictionaryEntry de in effects)
                    {
                        GameSpellEffect effect      = (GameSpellEffect)de.Key;
                        GameLiving      effectOwner = effect.Owner;
                        if (caster == effectOwner)
                        {
                            continue;
                        }
//						DOLConsole.WriteLine(Caster.Name+" to "+effectOwner.Name+" range="+range);

                        if (!caster.IsWithinRadius(effectOwner, CONC_MAX_RANGE))
                        {
                            if (de.Value != null)
                            {
                                // owner is out of range and effect is still active, disable it
                                if (disableEffects == null)
                                {
                                    disableEffects = new ArrayList(1);
                                }
                                disableEffects.Add(effect);
                            }
                        }
                        else if (de.Value == null)
                        {
                            // owner entered the range and effect was disabled, enable it now
                            if (enableEffects == null)
                            {
                                enableEffects = new ArrayList(1);
                            }
                            enableEffects.Add(effect);
                        }
                    }

                    if (enableEffects != null)
                    {
                        foreach (GameSpellEffect fx in enableEffects)
                        {
                            m_handler.EnableEffect(fx);
                        }
                    }

                    if (disableEffects != null)
                    {
                        foreach (GameSpellEffect fx in disableEffects)
                        {
                            m_handler.DisableEffect(fx);
                        }
                    }
                }
            }
Beispiel #30
0
		/// <summary>
		/// Send spell effect animation on caster and send messages
		/// </summary>
		/// <param name="caster"></param>
		/// <param name="spellEffect"></param>
		/// <param name="success"></param>
		public virtual void SendCasterSpellEffectAndCastMessage(GameLiving caster, ushort spellEffect, bool success)
		{
			foreach (GamePlayer player in caster.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
			{
				player.Out.SendSpellEffectAnimation(caster, caster, spellEffect, 0, false, success ? (byte)1 : (byte)0);

				if ( caster.IsWithinRadius( player, WorldMgr.INFO_DISTANCE ) )
				{
					if (player == caster)
					{
						player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client, "RealmAbility.SendCasterSpellEffectAndCastMessage.You", m_name), eChatType.CT_Spell, eChatLoc.CL_SystemWindow);
					}
					else
					{
						player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client, "RealmAbility.SendCasterSpellEffectAndCastMessage.Caster", caster.Name), eChatType.CT_Spell, eChatLoc.CL_SystemWindow);
					}
				}
			}
		}
Beispiel #31
0
		/// <summary>
		/// Sends cast message to environment
		/// </summary>
		protected virtual void SendCastMessage(GameLiving caster)
		{
			foreach (GamePlayer player in caster.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
			{
				if ( caster.IsWithinRadius( player, WorldMgr.INFO_DISTANCE ) )
				{
					if (player == caster)
					{
						player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client, "RealmAbility.SendCastMessage.YouCast", m_name), eChatType.CT_Spell, eChatLoc.CL_SystemWindow);
					}
					else
					{
						player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client, "RealmAbility.SendCastMessage.PlayerCasts", player.Name), eChatType.CT_Spell, eChatLoc.CL_SystemWindow);
					}
				}
			}
		}