Ejemplo n.º 1
0
        public override int CalcValue(GameLiving living, eProperty property)
        {
            int debuff = living.DebuffCategory[(int)property];

            if (debuff > 0)
            {
                GameSpellEffect nsreduction = SpellHandler.FindEffectOnTarget(living, "NearsightReduction");
                if (nsreduction != null)
                {
                    debuff *= (int)(1.00 - nsreduction.Spell.Value * 0.01);
                }
            }

            int item = Math.Max(0, 100 - debuff + Math.Min(10, living.ItemBonus[(int)property])); // http://www.camelotherald.com/more/1325.shtml

            int ra = 0;

            if (living.RangedAttackType == GameLiving.eRangedAttackType.Long)
            {
                ra = 50;

                IGameEffect effect = living.EffectList.GetOfType <TrueshotEffect>();
                effect?.Cancel(false);
            }

            return(item + ra);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Create the pet and transfer stats.
        /// </summary>
        /// <param name="target">Target that gets the effect</param>
        /// <param name="effectiveness">Factor from 0..1 (0%-100%)</param>
        public override void ApplyEffectOnTarget(GameLiving target, double effectiveness)
        {
            base.ApplyEffectOnTarget(target, effectiveness);

            (Caster as GamePlayer)?.Shade(true);

            // Cancel RR5 Call of Darkness if on caster.
            IGameEffect callOfDarkness = FindStaticEffectOnTarget(Caster, typeof(CallOfDarknessEffect));

            callOfDarkness?.Cancel(false);
        }
 /// <summary>
 /// Stop the effect on target
 /// </summary>
 public override void Stop()
 {
     if (m_player.HasAbility(Abilities.Camouflage))
     {
         IGameEffect camouflage = m_player.EffectList.GetOfType <CamouflageEffect>();
         if (camouflage != null)
         {
             camouflage.Cancel(false);
         }
     }
     m_player.EffectList.Remove(this);
 }
Ejemplo n.º 4
0
        private void PlayerAction(DOLEvent e, object sender, EventArgs args)
        {
            GamePlayer player = (GamePlayer)sender;

            if (player == null)
            {
                return;
            }

            MessageToLiving(player, "You are moving. Your concentration fades!", eChatType.CT_SpellResisted);
            GameSpellEffect effect = FindEffectOnTarget(m_target, "Loockout");

            effect?.Cancel(false);

            IGameEffect effect2 = FindStaticEffectOnTarget(Caster, typeof(LoockoutOwner));

            effect2?.Cancel(false);

            OnEffectExpires(effect, true);
        }
Ejemplo n.º 5
0
            /// <summary>
            /// Called on every timer tick
            /// </summary>
            protected override void OnTick()
            {
                GamePlayer player = (GamePlayer)m_actionSource;

                IGameEffect found = null;

                lock (player.EffectList)
                {
                    foreach (IGameEffect effect in player.EffectList)
                    {
                        if (effect.InternalID == _effectId)
                        {
                            found = effect;
                            break;
                        }
                    }
                }

                found?.Cancel(true);
            }
Ejemplo n.º 6
0
            /// <summary>
            /// Called on every timer tick
            /// </summary>
            protected override void OnTick()
            {
                GamePlayer player = (GamePlayer)m_actionSource;

                IGameEffect found = null;

                lock (player.EffectList)
                {
                    foreach (IGameEffect effect in player.EffectList)
                    {
                        if (effect is GameSpellEffect && ((GameSpellEffect)effect).Spell.InternalID == m_effectId)
                        {
                            found = effect;
                            break;
                        }
                    }
                }
                if (found != null)
                {
                    found.Cancel(true);
                }
            }