public override void OnDeregister() { if (LifespanAI.IsSubscribed(this)) { LifespanAI.Unsubscribe(this); } base.OnDeregister(); }
/// <summary> /// Subscribes the monsters moving ai if an /// character appears. /// </summary> /// <param name="character"></param> public override void Appears(Character character) { //ENABLE THE AI if (!LifespanAI.IsSubscribed(this)) { Lifespan.lasttick = Environment.TickCount; LifespanAI.Subscribe(this); } }
/// <summary> /// Unsubscribes the monsters moving ai if the region's player /// count is 0. /// </summary> /// <param name="character"></param> public override void Disappear(Character character) { //DISABLE THE AI if (Regiontree.GetCharacterCount(this) == 0) { LifespanAI.Unsubscribe(this); this.Position = this.DestPosition; } base.Disappear(character); }
/// <summary> /// Subscribes the monsters ai if an the monster is summoned in a crowded /// area. /// </summary> public override void OnRegister() { //First register the mob base.OnRegister(); //Check if start moving the mob if (Regiontree.GetCharacterCount(this) > 0) { LifespanAI.Subscribe(this); } }
/// <summary> /// Occurs when the speciafiec character killed /// our monsters /// </summary> /// <param name="target"></param> /// <returns></returns> public override void OnDie(MapObject target) { //Stop movement lock (this) { LifespanAI.Unsubscribe(this); this.stance = 7; } base.OnDie(target); }
public override void OnRegister() { this.currentzone.Regiontree.Subscribe(this); string filename = Server.SecurePath("~/ships/{0}.xml", this.ModelId); aipath = Path.FromFile(filename, this); if (aipath != null) { aipath.Start(this); LifespanAI.Subscribe(this); } }
public override void OnDeregister() { LifespanAI.Unsubscribe(this); base.OnDeregister(); }
/// <summary> /// Occurs when the speciafiec character killed /// our monsters /// </summary> /// <param name="target"></param> /// <returns></returns> public override void OnDie(MapObject target) { //Stop movement LifespanAI.Unsubscribe(this); base.OnDie(target); }