/// <summary> /// Occurs when confirming or decling to show love you've /// recieve from a person. /// </summary> /// <param name="cpkt"></param> private void CM_CHARACTER_CONFIRMSHOWLOVE(CMSG_SHOWLOVECONFIRM cpkt) { Character target; if (LifeCycle.TryGetById(this.character._ShowLoveDialog, out target)) { if (cpkt.Response == 0) { SMSG_ACTORCHANGESTATE spkt3 = new SMSG_ACTORCHANGESTATE(); spkt3.ActorID = this.character.id; spkt3.State = 0; spkt3.Stance = (byte)StancePosition.VALENTINE_LAY; spkt3.TargetActor = target.id; SMSG_ACTORCHANGESTATE spkt2 = new SMSG_ACTORCHANGESTATE(); spkt2.ActorID = target.id; spkt2.State = 0; spkt2.Stance = (byte)StancePosition.VALENTINE_SIT; spkt2.TargetActor = this.character.id; foreach (MapObject myObject in this.character.currentzone.GetObjectsInRegionalRange(this.character)) { if (this.character.currentzone.IsInSightRangeBySquare(this.character.Position, myObject.Position)) { if (MapObject.IsPlayer(myObject)) { Character current = myObject as Character; if (current.client != null && current.client.isloaded == true) { spkt3.SessionId = current.id; spkt2.SessionId = current.id; current.client.Send((byte[])spkt3); current.client.Send((byte[])spkt2); } } } } } else { character._ShowLoveDialog = 0; } if (target.client != null) { SMSG_RESPONSESHOWLOVE spkt = new SMSG_RESPONSESHOWLOVE(); spkt.Result = cpkt.Response; spkt.SessionId = target.id; target.client.Send((byte[])spkt); } } }
/// <summary> /// Occurs when requesting to show love to somebody. It forwards a packet to the /// desired end-user. /// </summary> /// <param name="cpkt"></param> private void CM_CHARACTER_SHOWLOVE(CMSG_SHOWLOVE cpkt) { Character target; bool isfound = LifeCycle.TryGetById(cpkt.ActorId, out target); if (isfound && target._ShowLoveDialog == 0) { SMSG_REQUESTSHOWLOVE spkt = new SMSG_REQUESTSHOWLOVE(); spkt.ActorID = this.character.id; spkt.SessionId = target.id; target._ShowLoveDialog = this.character.id; this.character._ShowLoveDialog = target.id; if (target.client != null) target.client.Send((byte[])spkt); } else if (isfound && target._ShowLoveDialog > 0) { SMSG_RESPONSESHOWLOVE spkt = new SMSG_RESPONSESHOWLOVE(); spkt.Result = 3; spkt.SessionId = this.character.id; this.Send((byte[])spkt); } //PLAYER DOES NOT EXISTS else { SMSG_RESPONSESHOWLOVE spkt = new SMSG_RESPONSESHOWLOVE(); spkt.Result = 2; spkt.SessionId = this.character.id; this.Send((byte[])spkt); } }