Beispiel #1
0
        public OneShotObjectUpdateTimer CallDelayed(int millis, Action <WorldObject> callback)
        {
            var action = new OneShotObjectUpdateTimer(millis, callback);

            AddUpdateAction(action);
            return(action);
        }
        public OneShotObjectUpdateTimer(int delayMillis, Action <WorldObject> callback)
        {
            OneShotObjectUpdateTimer objectUpdateTimer = this;

            this.Delay    = delayMillis;
            this.Callback = (Action <WorldObject>)(obj =>
            {
                callback(obj);
                obj.RemoveUpdateAction((ObjectUpdateTimer)objectUpdateTimer);
            });
        }
        public OneShotObjectUpdateTimer(int delayMillis, Action <WorldObject> callback)
        {
            OneShotObjectUpdateTimer objectUpdateTimer = this;

            Delay    = delayMillis;
            Callback = obj =>
            {
                callback(obj);
                obj.RemoveUpdateAction(objectUpdateTimer);
            };
        }
Beispiel #4
0
 public OneShotObjectUpdateTimer CallDelayed(int millis, Action<WorldObject> callback)
 {
     var action = new OneShotObjectUpdateTimer(millis, callback);
     AddUpdateAction(action);
     return action;
 }
		private void TriggerSpell(WorldObject owner)
		{
			timer = null;
			SpellCast.ValidateAndTriggerNew(m_spellEffect.TriggerSpell, m_aura.CasterReference, Owner, Owner,
				m_aura.Controller as SpellChannel, m_aura.UsedItem);
		}
		protected override void Apply()
		{
			timer = Owner.CallDelayed(EffectValue, TriggerSpell);
		}
Beispiel #7
0
		/// <summary>
		/// Picks up this side's flag.
		/// </summary>
		/// <param name="chr">The character picking up the flag.</param>
		public void PickupFlag(Character chr)
		{
			FlagCarrier = chr;

			// Shows the flag on the character. Does all kinds of stuff in the handler.
			chr.Auras.CreateSelf(_flagSpell, true);
			m_DebuffObjectUpdate = chr.CallDelayed(_flagRespawnTime, obj => ApplyFlagCarrierDebuff());

			if (_flag != null)
			{
				_flag.SendDespawn(); // Dispose of the GO.
				_flag.Delete();
				_flag = null;
			}

			_flagPickUpTime = DateTime.Now;
			_isFlagHome = false;

			Instance.Characters.SendSystemMessage(DefaultAddonLocalizer.Instance.GetTranslations(AddonMsgKey.WSPickupFlag), 
                                                                                                                        Name, chr.Name);
			var evt = FlagPickedUp;
			if (evt != null)
			{
				evt(chr);
			}
		}