Пример #1
0
		protected virtual int EndCast(RegionTimer timer)
		{
			if (player.IsMezzed || player.IsStunned || player.IsSitting)
				return 0;
			Statics.ThornweedFieldBase twf = new Statics.ThornweedFieldBase(dmgValue);
			twf.CreateStatic(player, player.GroundTarget, duration, 3, 500);
			DisableSkill(player);
			timer.Stop();
			timer = null;
			return 0;
		}
Пример #2
0
 private void StopDecay()
 {
     lock (m_decayTimerLock)
     {
         if (m_decayTimer == null)
         {
             return;
         }
         m_decayTimer.Stop();
         m_decayTimer = null;
     }
 }
Пример #3
0
 /// <summary>
 /// Starts the "signalising effect" sequence on the carrier.
 /// </summary>
 /// <param name="player">Player to set the timer on. Timer stops if param is null</param>
 protected virtual void StartPlayerTimer(GamePlayer player)
 {
     if (player != null)
     {
         if (m_currentCarrierTimer != null)
         {
             log.Warn("GameRelic: PlayerTimer already set on a player, stopping timer!");
             m_currentCarrierTimer.Stop();
             m_currentCarrierTimer = null;
         }
         m_currentCarrierTimer = new RegionTimer(player, new RegionTimerCallback(CarrierTimerTick));
         m_currentCarrierTimer.Start(RelicEffectInterval);
     }
     else
     {
         if (m_currentCarrierTimer != null)
         {
             m_currentCarrierTimer.Stop();
             m_currentCarrierTimer = null;
         }
     }
 }
Пример #4
0
        /// <summary>
        /// The callback that will respawn this object
        /// </summary>
        /// <param name="respawnTimer">the timer calling this callback</param>
        /// <returns>the new interval</returns>
        protected virtual int RespawnTimerCallback(RegionTimer respawnTimer)
        {
            lock (m_respawnTimerLock)
            {
                if (m_respawnTimer != null)
                {
                    m_respawnTimer.Stop();
                    m_respawnTimer = null;
                    AddToWorld();
                }
            }

            return(0);
        }
Пример #5
0
        /// <summary>
        /// Called when the Relic has reached 0 XP and drops
        /// </summary>
        public virtual void RelicDispose()
        {
            if (timer != null)
            {
                timer.Dispose();
                timer = null;
            }

            if (Owner != null)
            {
                PlayerLoosesRelic(Owner, true);
            }

            RemoveFromWorld();

            if (respawntimer != null)
            {
                respawntimer.Stop();
                respawntimer = null;
            }
            respawntimer = new RegionTimer(this, new RegionTimerCallback(RespawnTimerCallback),
                                           Util.Random(MinotaurRelicManager.MIN_RESPAWN_TIMER, MinotaurRelicManager.MAX_RESPAWN_TIMER));
        }
Пример #6
0
		protected virtual int EndCast(RegionTimer timer)
		{
            bool castWasSuccess = player.TempProperties.getProperty(NM_CAST_SUCCESS, false);
            player.TempProperties.removeProperty(IS_CASTING);
            GameEventMgr.RemoveHandler(player, GamePlayerEvent.Moving, new DOLEventHandler(CastInterrupted));
            GameEventMgr.RemoveHandler(player, GamePlayerEvent.AttackFinished, new DOLEventHandler(CastInterrupted));
            GameEventMgr.RemoveHandler(player, GamePlayerEvent.Dying, new DOLEventHandler(CastInterrupted));
            if (player.IsMezzed || player.IsStunned || player.IsSitting)
                return 0;
            if (!castWasSuccess)
                return 0;
			Statics.NegativeMaelstromBase nm = new Statics.NegativeMaelstromBase(dmgValue);
			nm.CreateStatic(player, player.GroundTarget, duration, 5, 350);
            DisableSkill(player); 
			timer.Stop();
			timer = null;
			return 0;
		}
Пример #7
0
		public int ShowEffect(RegionTimer timer)
		{
			if (base.IsAlive)
			{
				foreach (GamePlayer player in this.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
				{
					player.Out.SendSpellEffectAnimation(this, this, 4321, 0, false, 1);
				}
				foreach (GamePlayer player in this.GetPlayersInRadius(WorldMgr.INFO_DISTANCE))
				{

					player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "GuardCaster.SkinsHardens", this.Name), eChatType.CT_Spell, eChatLoc.CL_SystemWindow);

				}
			}
			timer.Stop();
			timer = null;
			return 0;
		}
Пример #8
0
        protected virtual int PulseTimer(RegionTimer timer)
        {
            if (currentTick >= m_lifeTime || m_caster == null)
            {
                this.RemoveFromWorld();
                timer.Stop();
                timer=null;
                return 0;
            }
            if (currentTick%m_pulseFrequency==0){
                currentPulse++;
                foreach(GamePlayer target in this.GetPlayersInRadius(m_radius))
                {
                    CastSpell(target);
                }
                foreach (GameNPC npc in this.GetNPCsInRadius(m_radius))
                {
                    CastSpell(npc);
                }
            }

            currentTick++;
            return 1000;
        }
Пример #9
0
        protected virtual int EndCast(RegionTimer timer)
        {
            if (m_caster.TargetObject == null)
            {
                m_caster.Out.SendMessage("You need a target for this ability!", eChatType.CT_System, eChatLoc.CL_SystemWindow);
                m_caster.DisableSkill(this, 3 * 1000);
                return 0;
            }

            if ( !m_caster.IsWithinRadius( m_caster.TargetObject, (int)( 1500 * m_caster.GetModified( eProperty.SpellRange ) * 0.01 ) ) )
            {
                m_caster.Out.SendMessage(m_caster.TargetObject + " is too far away.", eChatType.CT_Spell, eChatLoc.CL_SystemWindow);
                return 0;
            }

            foreach (GamePlayer player in m_caster.TargetObject.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
            {
                player.Out.SendSpellEffectAnimation(m_caster, (m_caster.TargetObject as GameLiving), 7025, 0, false, 1);
            }

            foreach (GameNPC mob in m_caster.TargetObject.GetNPCsInRadius(500))
            {
                if (!GameServer.ServerRules.IsAllowedToAttack(m_caster, mob, true))
                    continue;

                mob.TakeDamage(m_caster, eDamageType.Heat, m_dmgValue, 0);
                m_caster.Out.SendMessage("You hit the " + mob.Name + " for " + m_dmgValue + " damage.", eChatType.CT_YouHit, eChatLoc.CL_SystemWindow);
                foreach (GamePlayer player2 in m_caster.TargetObject.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
                {
                    player2.Out.SendSpellEffectAnimation(m_caster, mob, 7025, 0, false, 1);
                }
            }

            foreach (GamePlayer aeplayer in m_caster.TargetObject.GetPlayersInRadius(500))
            {
                if (!GameServer.ServerRules.IsAllowedToAttack(m_caster, aeplayer, true))
                    continue;

                aeplayer.TakeDamage(m_caster, eDamageType.Heat, m_dmgValue, 0);
                m_caster.Out.SendMessage("You hit " + aeplayer.Name + " for " + m_dmgValue + " damage.", eChatType.CT_YouHit, eChatLoc.CL_SystemWindow);
                aeplayer.Out.SendMessage(m_caster.Name + " hits you for " + m_dmgValue + " damage.", eChatType.CT_YouWereHit, eChatLoc.CL_SystemWindow);
                foreach (GamePlayer player3 in m_caster.TargetObject.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
                {
                    player3.Out.SendSpellEffectAnimation(m_caster, aeplayer, 7025, 0, false, 1);
                }
            }

            DisableSkill(m_caster);
            timer.Stop();
            timer = null;
            return 0;
        }
Пример #10
0
		protected virtual int RootExpires(RegionTimer timer)
		{
			GameLiving living = timer.Owner as GameLiving;
			if (living != null)
			{
				living.BuffBonusMultCategory1.Remove((int)eProperty.MaxSpeed, this);
				SendUpdates(living);
			}
			timer.Stop();
			timer = null;
			return 0;
		}
Пример #11
0
		protected virtual int EndCast(RegionTimer timer)
		{
			if (caster.TargetObject == null)
			{
				caster.Out.SendMessage("You need a target for this ability!", eChatType.CT_System, eChatLoc.CL_SystemWindow);
				caster.DisableSkill(this, 3 * 1000);
				return 0;
			}

			if (caster.IsMoving)
			{
				caster.Out.SendMessage("You move and interrupt your spellcast!", eChatType.CT_Say, eChatLoc.CL_SystemWindow);
				caster.DisableSkill(this, 3000);
				return 0;
			}

			if ( !caster.IsWithinRadius( caster.TargetObject, 1875 ) )
			{
				caster.Out.SendMessage(caster.TargetObject.Name + " is too far away.", eChatType.CT_Spell, eChatLoc.CL_SystemWindow);
				caster.DisableSkill(this, 3 * 1000);
				return 0;
			}

			GameLiving living = caster.TargetObject as GameLiving;
			
			if(living==null)
			{
				timer.Stop();
				timer = null;
				return 0;
			}

			if (living.EffectList.GetOfType<ChargeEffect>() == null && living.EffectList.GetOfType<SpeedOfSoundEffect>() != null)
			{
				living.BuffBonusMultCategory1.Set((int)eProperty.MaxSpeed, this, 1.0 - 99 * 0.01);
				m_rootExpire = new RegionTimer(living, new RegionTimerCallback(RootExpires), duration);
				GameEventMgr.AddHandler(living, GameLivingEvent.AttackedByEnemy, new DOLEventHandler(OnAttacked));
				SendUpdates(living);
			}

			foreach (GamePlayer player in living.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
			{
				player.Out.SendSpellEffectAnimation(caster, (caster.TargetObject as GameLiving), 7029, 0, false, 1);
			}

			foreach (GameNPC mob in living.GetNPCsInRadius(500))
			{
				if (!GameServer.ServerRules.IsAllowedToAttack(caster, mob, true))
					continue;

				if (mob.HasAbility(Abilities.CCImmunity) || mob.HasAbility(Abilities.RootImmunity) || mob.HasAbility(Abilities.DamageImmunity))
					continue;
				
				GameSpellEffect mez = SpellHandler.FindEffectOnTarget(mob, "Mesmerize");
				if (mez != null)
					mez.Cancel(false);
				
				mob.TakeDamage(caster, eDamageType.Spirit, dmgValue, 0);

				if (mob.EffectList.GetOfType<ChargeEffect>() == null && mob.EffectList.GetOfType<SpeedOfSoundEffect>() == null)
				{
					mob.BuffBonusMultCategory1.Set((int)eProperty.MaxSpeed, this, 1.0 - 99 * 0.01);
					m_rootExpire = new RegionTimer(mob, new RegionTimerCallback(RootExpires), duration);
					GameEventMgr.AddHandler(mob, GameLivingEvent.AttackedByEnemy, new DOLEventHandler(OnAttacked));
					SendUpdates(mob);
				}

				caster.Out.SendMessage("You hit the " + mob.Name + " for " + dmgValue + " damage.", eChatType.CT_YouHit, eChatLoc.CL_SystemWindow);

				foreach (GamePlayer player2 in living.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
				{
					player2.Out.SendSpellEffectAnimation(caster, mob, 7029, 0, false, 1);
				}
			}

			foreach (GamePlayer aeplayer in living.GetPlayersInRadius(500))
			{
				if (!GameServer.ServerRules.IsAllowedToAttack(caster, aeplayer, true))
					continue;

				GameSpellEffect mez = SpellHandler.FindEffectOnTarget(aeplayer, "Mesmerize");
				if (mez != null)
					mez.Cancel(false);
				aeplayer.TakeDamage(caster, eDamageType.Spirit, dmgValue, 0);
				aeplayer.StartInterruptTimer(3000, AttackData.eAttackType.Spell, caster);

				if (aeplayer.EffectList.GetOfType<ChargeEffect>() == null && aeplayer.EffectList.GetOfType<SpeedOfSoundEffect>() == null)
				{
					(aeplayer as GameLiving).BuffBonusMultCategory1.Set((int)eProperty.MaxSpeed, this, 1.0 - 99 * 0.01);
					m_rootExpire = new RegionTimer(aeplayer, new RegionTimerCallback(RootExpires), duration);
					GameEventMgr.AddHandler(aeplayer, GameLivingEvent.AttackedByEnemy, new DOLEventHandler(OnAttacked));
					SendUpdates(aeplayer);
				}

				caster.Out.SendMessage("You hit " + aeplayer.Name + " for " + dmgValue + " damage.", eChatType.CT_YouHit, eChatLoc.CL_SystemWindow);

				foreach (GamePlayer player3 in living.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
				{
					player3.Out.SendSpellEffectAnimation(caster, aeplayer, 7029, 0, false, 1);
				}
			}

			DisableSkill(caster);
			timer.Stop();
			timer = null;
			return 0;
		}
Пример #12
0
        public void Start()
        {
            if (m_player.Group != null)
            {
                if (m_player != null)
                {
                    bool groupHasBanner = false;

                    foreach (GamePlayer groupPlayer in m_player.Group.GetPlayersInTheGroup())
                    {
                        if (groupPlayer.GuildBanner != null)
                        {
                            groupHasBanner = true;
                            break;
                        }
                    }

                    if (groupHasBanner == false)
                    {
                        if (m_item == null)
                        {
                            GuildBannerItem item = new GuildBannerItem(GuildBannerTemplate);

                            item.OwnerGuild   = m_player.Guild;
                            item.SummonPlayer = m_player;
                            m_item            = item;
                        }

                        m_player.GuildBanner = this;
                        m_player.Stealth(false);
                        AddHandlers();

                        if (m_timer != null)
                        {
                            m_timer.Stop();
                            m_timer = null;
                        }

                        m_timer = new RegionTimer(m_player, new RegionTimerCallback(TimerTick));
                        m_timer.Start(1);
                    }
                    else
                    {
                        m_player.Out.SendMessage("Someone in your group already has a guild banner active!", eChatType.CT_Loot, eChatLoc.CL_SystemWindow);
                    }
                }
                else
                {
                    if (m_timer != null)
                    {
                        m_timer.Stop();
                        m_timer = null;
                    }
                }
            }
            else if (m_player.Client.Account.PrivLevel == (int)ePrivLevel.Player)
            {
                m_player.Out.SendMessage("You have left the group and your guild banner disappears!", eChatType.CT_Loot, eChatLoc.CL_SystemWindow);
                m_player.GuildBanner = null;
                if (m_timer != null)
                {
                    m_timer.Stop();
                    m_timer = null;
                }
            }
        }
Пример #13
0
        /// <summary>
        /// This method is called from the Interaction with the GameStaticItem
        /// </summary>
        /// <param name="player"></param>
        protected virtual void PlayerTakesRelic(GamePlayer player)
        {
            if (player.TempProperties.getProperty <object>(PLAYER_CARRY_RELIC_WEAK, null) != null)
            {
                player.Out.SendMessage("You are already carrying a relic.", eChatType.CT_System, eChatLoc.CL_SystemWindow);
                return;
            }

            if (player.IsStealthed)
            {
                player.Out.SendMessage("You cannot carry a relic while stealthed.", eChatType.CT_System, eChatLoc.CL_SystemWindow);
                return;
            }

            if (!player.IsAlive)
            {
                player.Out.SendMessage("You are dead!", eChatType.CT_System, eChatLoc.CL_SystemWindow);
                return;
            }

            if (IsMounted)
            {
                AbstractGameKeep keep = GameServer.KeepManager.GetKeepCloseToSpot(m_currentRelicPad.CurrentRegionID, m_currentRelicPad, WorldMgr.VISIBILITY_DISTANCE);

                log.DebugFormat("keep {0}", keep);

                if (keep != null && keep.Realm != player.Realm)
                {
                    player.Out.SendMessage("You must capture this keep before taking a relic.", eChatType.CT_System, eChatLoc.CL_SystemWindow);
                    return;
                }
            }

            if (player.Inventory.AddItem(eInventorySlot.FirstEmptyBackpack, m_item))
            {
                if (m_item == null)
                {
                    log.Warn("GameRelic: Could not retrive " + Name + " as InventoryItem on player " + player.Name);
                }

                InventoryLogging.LogInventoryAction(this, player, eInventoryActionType.Other, m_item.Template, m_item.Count);

                m_currentCarrier = player;
                player.TempProperties.setProperty(PLAYER_CARRY_RELIC_WEAK, this);
                player.Out.SendUpdateMaxSpeed();

                if (IsMounted)
                {
                    m_currentRelicPad.RemoveRelic(this);
                    ReturnRelicPad    = m_currentRelicPad;
                    LastRealm         = m_currentRelicPad.Realm; // save who owned this in case of server restart while relic is off pad
                    m_currentRelicPad = null;
                }

                RemoveFromWorld();
                SaveIntoDatabase();
                Realm = 0;
                SetHandlers(player, true);
                StartPlayerTimer(player);
                if (m_returnRelicTimer != null)
                {
                    m_returnRelicTimer.Stop();
                    m_returnRelicTimer = null;
                }
            }
            else
            {
                player.Out.SendMessage("You dont have enough space in your backpack to carry this.", eChatType.CT_System, eChatLoc.CL_SystemWindow);
            }
        }