Beispiel #1
0
        public override void ApplyEffectOnTarget(GameLiving target, double effectiveness)
        {
            GameSpellEffect neweffect = CreateSpellEffect(target, effectiveness);

            neweffect.Start(target);

            if (target == null)
            {
                return;
            }

            if (!target.IsAlive || target.ObjectState != GameObject.eObjectState.Active)
            {
                return;
            }

            // spell damage should 25;
            int end = (int)Spell.Damage;

            target.ChangeEndurance(target, GameLiving.eEnduranceChangeType.Spell, -end);

            if (target is GamePlayer)
            {
                ((GamePlayer)target).Out.SendMessage($" You lose {end} endurance!", eChatType.CT_YouWereHit, eChatLoc.CL_SystemWindow);
            }

            (Caster as GamePlayer)?.Out.SendMessage($"{target.Name} loses {end} endurance!", eChatType.CT_YouWereHit, eChatLoc.CL_SystemWindow);
        }
Beispiel #2
0
        public override void OnDirectEffect(GameLiving target, double effectiveness)
        {
            if (target == null)
            {
                return;
            }

            if (!target.IsAlive || target.ObjectState != GameObject.eObjectState.Active)
            {
                return;
            }

            // spell damage should 25;
            int end = (int)Spell.Damage;

            target.ChangeEndurance(target, GameLiving.eEnduranceChangeType.Spell, -end);

            if (target is GamePlayer player)
            {
                player.Out.SendMessage($" You lose {end} endurance!", eChatType.CT_YouWereHit, eChatLoc.CL_SystemWindow);
            }

            (Caster as GamePlayer)?.Out.SendMessage($"{string.Empty}{target.Name} loses {end} endurance!", eChatType.CT_YouWereHit, eChatLoc.CL_SystemWindow);
            target.StartInterruptTimer(target.SpellInterruptDuration, AttackData.eAttackType.Spell, Caster);
        }
Beispiel #3
0
        /// <summary>
        /// Heals hit points of one target and sends needed messages, no spell effects
        /// </summary>
        /// <param name="target"></param>
        /// <param name="amount">amount of hit points to heal</param>
        /// <returns>true if heal was done</returns>
        public virtual bool HealTarget(GameLiving target, int amount)
        {
            if (target == null || target.ObjectState != GameObject.eObjectState.Active)
            {
                return(false);
            }

            // we can't heal people we can attack
            if (GameServer.ServerRules.IsAllowedToAttack(Caster, target, true))
            {
                return(false);
            }

            if (!target.IsAlive)
            {
                // "You cannot heal the dead!" sshot550.tga
                MessageToCaster($"{target.GetName(0, true)} is dead!", eChatType.CT_SpellResisted);
                return(false);
            }

            int heal = target.ChangeEndurance(Caster, GameLiving.eEnduranceChangeType.Spell, amount);

            if (heal == 0)
            {
                if (Spell.Pulse == 0)
                {
                    if (target == Caster)
                    {
                        MessageToCaster("Your endurance is full.", eChatType.CT_SpellResisted);
                    }
                    else
                    {
                        MessageToCaster($"{target.GetName(0, true)} endurance is full.", eChatType.CT_SpellResisted);
                    }
                }

                return(false);
            }

            if (Caster == target)
            {
                MessageToCaster($"You restore {heal} endurance points.", eChatType.CT_Spell);
                if (heal < amount)
                {
                    MessageToCaster("Your endurance is full.", eChatType.CT_Spell);
                }
            }
            else
            {
                MessageToCaster("You restore " + target.GetName(0, false) + " for " + heal + " ednurance points!", eChatType.CT_Spell);
                MessageToLiving(target, "Your endurance was restored by " + Caster.GetName(0, false) + " for " + heal + " points.", eChatType.CT_Spell);
                if (heal < amount)
                {
                    MessageToCaster(target.GetName(0, true) + " endurance is full.", eChatType.CT_Spell);
                }
            }

            return(true);
        }
        protected virtual void GiveEndurance(GameLiving target, int amount)
        {
            if (target.Endurance >= amount)
                amount = target.MaxEndurance - target.Endurance;

            target.ChangeEndurance(target, GameLiving.eEnduranceChangeType.Spell, amount);
            MessageToCaster("You transfer " + amount + " life to Endurance!", eChatType.CT_Spell);
        }
        /// <summary>
        /// Action
        /// </summary>
        /// <param name="living"></param>
        public override void Execute(GameLiving living)
        {
            if (CheckPreconditions(living, DEAD | SITTING | MEZZED | STUNNED)) return;

            int regged = living.ChangeEndurance(living, GameLiving.eEnduranceChangeType.Spell, living.MaxEndurance);

            SendCasterSpellEffectAndCastMessage(living, 7003, regged > 0);

            if (regged > 0) DisableSkill(living);
        }
Beispiel #6
0
        protected virtual void GiveEndurance(GameLiving target, int amount)
        {
            if (target.Endurance >= amount)
            {
                amount = target.MaxEndurance - target.Endurance;
            }

            target.ChangeEndurance(target, GameLiving.eEnduranceChangeType.Spell, amount);
            MessageToCaster("You transfer " + amount + " life to Endurance!", eChatType.CT_Spell);
        }
Beispiel #7
0
        public override void OnDirectEffect(GameLiving target, double effectiveness)
        {
            if (target == null) return;
            if (!target.IsAlive || target.ObjectState != GameLiving.eObjectState.Active) return;
            //spell damage should 25;
            int end = (int)(Spell.Damage);
            target.ChangeEndurance(target, GameLiving.eEnduranceChangeType.Spell, (-end));

            if (target is GamePlayer)
                ((GamePlayer)target).Out.SendMessage(" You lose " + end + " endurance!", eChatType.CT_YouWereHit, eChatLoc.CL_SystemWindow);
            (m_caster as GamePlayer).Out.SendMessage("" + target.Name + " loses " + end + " endurance!", eChatType.CT_YouWereHit, eChatLoc.CL_SystemWindow);

            target.StartInterruptTimer(target.SpellInterruptDuration, AttackData.eAttackType.Spell, Caster);
        }
Beispiel #8
0
        /// <summary>
        /// Action
        /// </summary>
        /// <param name="living"></param>
        public override void Execute(GameLiving living)
        {
            if (CheckPreconditions(living, DEAD | SITTING | MEZZED | STUNNED))
            {
                return;
            }

            int regged = living.ChangeEndurance(living, GameLiving.eEnduranceChangeType.Spell, living.MaxEndurance);

            SendCasterSpellEffectAndCastMessage(living, 7003, regged > 0);

            if (regged > 0)
            {
                DisableSkill(living);
            }
        }
Beispiel #9
0
        public override void OnDirectEffect(GameLiving target, double effectiveness)
        {
            if (target == null)
            {
                return;
            }
            if (!target.IsAlive || target.ObjectState != GameLiving.eObjectState.Active)
            {
                return;
            }
            //spell damage should 25;
            int end = (int)(Spell.Damage);

            target.ChangeEndurance(target, GameLiving.eEnduranceChangeType.Spell, (-end));

            if (target is GamePlayer)
            {
                ((GamePlayer)target).Out.SendMessage(" You lose " + end + " endurance!", eChatType.CT_YouWereHit, eChatLoc.CL_SystemWindow);
            }
            (m_caster as GamePlayer).Out.SendMessage("" + target.Name + " loses " + end + " endurance!", eChatType.CT_YouWereHit, eChatLoc.CL_SystemWindow);

            target.StartInterruptTimer(target.SpellInterruptDuration, AttackData.eAttackType.Spell, Caster);
        }
Beispiel #10
0
        public override void ApplyEffectOnTarget(GameLiving target, double effectiveness)
        {
            GameSpellEffect neweffect = CreateSpellEffect(target, effectiveness);

            neweffect.Start(target);

            if (target == null) return;
            if (!target.IsAlive || target.ObjectState != GameLiving.eObjectState.Active) return;
            //spell damage should 25;
            int end = (int)(Spell.Damage);
            target.ChangeEndurance(target, GameLiving.eEnduranceChangeType.Spell, (-end));

            if (target is GamePlayer)
                ((GamePlayer)target).Out.SendMessage(" You lose " + end + " endurance!", eChatType.CT_YouWereHit, eChatLoc.CL_SystemWindow);
            (m_caster as GamePlayer).Out.SendMessage("" + target.Name + " loses " + end + " endurance!", eChatType.CT_YouWereHit, eChatLoc.CL_SystemWindow);
        }
		/// <summary>
		/// Heals hit points of one target and sends needed messages, no spell effects
		/// </summary>
		/// <param name="target"></param>
		/// <param name="amount">amount of hit points to heal</param>
		/// <returns>true if heal was done</returns>
		public virtual bool HealTarget(GameLiving target, int amount)
		{
			if (target == null || target.ObjectState != GameLiving.eObjectState.Active) return false;

			// we can't heal people we can attack
			if (GameServer.ServerRules.IsAllowedToAttack(Caster, target, true))
				return false;

			if (!target.IsAlive)
			{
				//"You cannot heal the dead!" sshot550.tga
				MessageToCaster(target.GetName(0, true) + " is dead!", eChatType.CT_SpellResisted);
				return false;
			}

			int heal = target.ChangeEndurance(Caster, GameLiving.eEnduranceChangeType.Spell, amount);

			if (heal == 0)
			{
				if (Spell.Pulse == 0)
				{
					if (target == m_caster) MessageToCaster("Your endurance is full.", eChatType.CT_SpellResisted);
					else MessageToCaster(target.GetName(0, true) + " endurance is full.", eChatType.CT_SpellResisted);
				}
				return false;
			}

			if (m_caster == target)
			{
				MessageToCaster("You restore " + heal + " endurance points.", eChatType.CT_Spell);
				if (heal < amount)
					MessageToCaster("Your endurance is full.", eChatType.CT_Spell);
			}
			else
			{
				MessageToCaster("You restore " + target.GetName(0, false) + " for " + heal + " ednurance points!", eChatType.CT_Spell);
				MessageToLiving(target, "Your endurance was restored by " + m_caster.GetName(0, false) + " for " + heal + " points.", eChatType.CT_Spell);
				if (heal < amount)
					MessageToCaster(target.GetName(0, true) + " endurance is full.", eChatType.CT_Spell);
			}
			return true;
		}