/// <summary> /// Occurs when the character dies /// </summary> /// <returns>Returns always true</returns> public bool OnDie() { //Pronounce my dead to other people if (this.sessionParty != null) { foreach (Character target in this.sessionParty.GetCharacters()) { if (target.id == this.id) { continue; } if (target.client.isloaded == true) { SMSG_PARTYMEMBERDIED spkt = new SMSG_PARTYMEMBERDIED(); spkt.SessionId = target.id; spkt.Index = 1; spkt.ActorId = this.id; target.client.Send((byte[])spkt); } } } // SUBSCRIBE FOR RESPAWN this.ISONBATTLE = false; Respawns.Subscribe(this); return(true); }
/// <summary> /// Add new regions /// </summary> /// <param name="location"></param> public void Add(PointF first, PointF last) { var location = new Location(); location.Left = (int)first.X; location.Top = (int)first.Y; location.Right = (int)last.X; location.Bottom = (int)last.Y; Respawns.Add(location); AddedLocation?.Invoke(this, location); }
/// <summary> /// Add new regions /// </summary> /// <param name="first"></param> /// <param name="last"></param> public void AddRespawn(Vector first, Vector last) { var location = new Respawn { Rectangle = new RectangleVector() { LeftTop = first, RightBottom = last } }; Respawns.Add(location); Added?.Invoke(this, new AddedArgs(location, typeof(Respawn))); }
void Awake(){ instance = this; }
/// <summary> /// Remove respawn nflavor script /// </summary> /// <param name="index"></param> public void RemoveR(int index) { Respawns.RemoveAt(index); Removed?.Invoke(this, new EventArgs()); }
/// <summary> /// Remove respawn nflavor script /// </summary> /// <param name="index"></param> public void RemoveRespawn(int index) { Respawns.RemoveAt(index); Removed?.Invoke(this, new RemovedArgs(index, typeof(Respawn))); }
/// <summary> /// Reinitilize child objet /// </summary> public void Dispose() { Respawns.Clear(); Props.Clear(); Render(); }