public OneShotUpdateObjectAction CallDelayedTicks(int ticks, Action<WorldObject> callback) { var action = new OneShotUpdateObjectAction(ticks, callback); CallPeriodically(action); return action; }
public OneShotUpdateObjectAction CallDelayed(int millis, Action<WorldObject> callback) { var ticks = millis / m_Map.UpdateDelay; var action = new OneShotUpdateObjectAction(ticks, callback); CallPeriodically(action); return action; }
/// <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); _debuffUpdate = 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); } }
/// <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.AddSelf(_flagSpell, true); _debuffUpdate = chr.CallDelayed(60 * (int)_flagRespawn * 1000, obj => ApplyFlagCarrierDebuff()); if (_flag != null) { _flag.SendDespawn(); // Dispose of the GO. _flag.Delete(); _flag = null; } _flagPickUpTime = DateTime.Now; _isFlagHome = false; var msg = chr.Name + " has picked up the " + Name + " flag!"; ChatMgr.SendSystemMessage(Instance.Characters, msg); var evt = FlagPickedUp; if (evt != null) { evt(chr); } }
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); }