/// <summary> /// Get's the currentscenariostep /// </summary> public static uint StartEvent(uint cid, uint EventId) { Console.WriteLine("Start event: {0}", EventId); Character value; if (LifeCycle.TryGetById(cid, out value)) { SMSG_SCENARIOEVENTBEGIN spkt = new SMSG_SCENARIOEVENTBEGIN(); spkt.ActorId = value.id; spkt.Event = EventId; value._Event = EventId; Regiontree tree = value.currentzone.Regiontree; foreach (Character regionObject in tree.SearchActors(value, SearchFlags.Characters)) { if (value.currentzone.IsInSightRangeByRadius(value.Position, regionObject.Position)) { spkt.SessionId = regionObject.id; regionObject.client.Send((byte[])spkt); } } while (value._Event > 0) { Thread.Sleep(0); } } return(0); }
/// <summary> /// Get's the currentscenariostep /// </summary> public static uint GetCurrentStep(uint cid, uint QID, uint EventId) { Character value; if (LifeCycle.TryGetById(cid, out value)) { SMSG_SCENARIOEVENTBEGIN spkt = new SMSG_SCENARIOEVENTBEGIN(); spkt.ActorId = value.id; spkt.Event = EventId; Regiontree tree = value.currentzone.Regiontree; foreach (Character regionObject in tree.SearchActors(value, SearchFlags.Characters)) { if (value.currentzone.IsInSightRangeByRadius(value.Position, regionObject.Position)) { spkt.SessionId = regionObject.id; regionObject.client.Send((byte[])spkt); } } } return 0; }
/// <summary> /// Get's the currentscenariostep /// </summary> public static uint GetCurrentStep(uint cid, uint QID, uint EventId) { Character value; if (LifeCycle.TryGetById(cid, out value)) { SMSG_SCENARIOEVENTBEGIN spkt = new SMSG_SCENARIOEVENTBEGIN(); spkt.ActorId = value.id; spkt.Event = EventId; Regiontree tree = value.currentzone.Regiontree; foreach (Character regionObject in tree.SearchActors(value, SearchFlags.Characters)) { if (value.currentzone.IsInSightRangeByRadius(value.Position, regionObject.Position)) { spkt.SessionId = regionObject.id; regionObject.client.Send((byte[])spkt); } } } return(0); }
public override void ShowObject(Character character) { //HELPER VARIABLES Rag2Item item; //STRUCTIRIZE GENERAL INFORMATION SMSG_CHARACTERINFO spkt = new SMSG_CHARACTERINFO(); spkt.race = 0; spkt.Gender = this.gender; spkt.Name = this.Name; spkt.X = this.Position.x; spkt.Y = this.Position.y; spkt.Z = this.Position.z; spkt.ActorID = this.id; spkt.face = this.FaceDetails; spkt.AugeSkillID = this.ComputeAugeSkill(); spkt.yaw = this.Yaw; spkt.Job = this.job; spkt.Stance = this.stance; //STRUCTURIZE EQUIPMENT INFORMATION item = this.Equipment[0]; if (item != null && item.active > 0) { spkt.SetHeadTop(item.info.item, item.dyecolor); } item = this.Equipment[1]; if (item != null && item.active > 0) { spkt.SetHeadMiddle(item.info.item, item.dyecolor); } item = this.Equipment[2]; if (item != null && item.active > 0) { spkt.SetHeadBottom(item.info.item, item.dyecolor); } item = this.Equipment[14]; if (item != null && item.active > 0) { spkt.SetShield(item.info.item, item.dyecolor); } item = this.Equipment[8]; if (item != null && item.active > 0) { spkt.SetBack(item.info.item, item.dyecolor); } item = this.Equipment[3]; if (item != null && item.active > 0) { spkt.SetShirt(item.info.item, item.dyecolor); } item = this.Equipment[4]; if (item != null && item.active > 0) { spkt.SetPants(item.info.item, item.dyecolor); } item = this.Equipment[5]; if (item != null && item.active > 0) { spkt.SetGloves(item.info.item, item.dyecolor); } item = this.Equipment[6]; if (item != null && item.active > 0) { spkt.SetFeet(item.info.item, item.dyecolor); } foreach (AdditionState state in this._additions) { spkt.SetWeapon(state.Addition, state.Lifetime); } lock (character) { spkt.SessionId = character.id; character.client.Send((byte[])spkt); if (this._Event > 0) { SMSG_SCENARIOEVENTBEGIN spkt2 = new SMSG_SCENARIOEVENTBEGIN(); spkt2.Event = this._Event; spkt2.ActorId = this.id; spkt2.SessionId = character.id; character.client.Send((byte[])spkt2); } } }
public override void ShowObject(Character character) { //HELPER VARIABLES Rag2Item item; //STRUCTIRIZE GENERAL INFORMATION SMSG_CHARACTERINFO spkt = new SMSG_CHARACTERINFO(); spkt.race = 0; spkt.Gender = this.gender; spkt.Name = this.Name; spkt.X = this.Position.x; spkt.Y = this.Position.y; spkt.Z = this.Position.z; spkt.ActorID = this.id; spkt.face = this.FaceDetails; spkt.AugeSkillID = this.ComputeAugeSkill(); spkt.yaw = this.Yaw; spkt.Job = this.job; spkt.Stance = this.stance; //STRUCTURIZE EQUIPMENT INFORMATION item = this.Equipment[0]; if (item != null && item.active > 0) spkt.SetHeadTop(item.info.item, item.dyecolor); item = this.Equipment[1]; if (item != null && item.active > 0) spkt.SetHeadMiddle(item.info.item, item.dyecolor); item = this.Equipment[2]; if (item != null && item.active > 0) spkt.SetHeadBottom(item.info.item, item.dyecolor); item = this.Equipment[14]; if (item != null && item.active > 0) spkt.SetShield(item.info.item, item.dyecolor); item = this.Equipment[8]; if (item != null && item.active > 0) spkt.SetBack(item.info.item, item.dyecolor); item = this.Equipment[3]; if (item != null && item.active > 0) spkt.SetShirt(item.info.item, item.dyecolor); item = this.Equipment[4]; if (item != null && item.active > 0) spkt.SetPants(item.info.item, item.dyecolor); item = this.Equipment[5]; if (item != null && item.active > 0) spkt.SetGloves(item.info.item, item.dyecolor); item = this.Equipment[6]; if (item != null && item.active > 0) spkt.SetFeet(item.info.item, item.dyecolor); foreach (AdditionState state in this._additions) spkt.SetWeapon(state.Addition, state.Lifetime); lock (character) { spkt.SessionId = character.id; character.client.Send((byte[])spkt); if (this._Event > 0) { SMSG_SCENARIOEVENTBEGIN spkt2 = new SMSG_SCENARIOEVENTBEGIN(); spkt2.Event = this._Event; spkt2.ActorId = this.id; spkt2.SessionId = character.id; character.client.Send((byte[])spkt2); } } }
/// <summary> /// Get's the currentscenariostep /// </summary> public static uint StartEvent(uint cid, uint EventId) { Console.WriteLine("Start event: {0}", EventId); Character value; if (LifeCycle.TryGetById(cid, out value)) { SMSG_SCENARIOEVENTBEGIN spkt = new SMSG_SCENARIOEVENTBEGIN(); spkt.ActorId = value.id; spkt.Event = EventId; value._Event = EventId; Regiontree tree = value.currentzone.Regiontree; foreach (Character regionObject in tree.SearchActors(value, SearchFlags.Characters)) { if (value.currentzone.IsInSightRangeByRadius(value.Position, regionObject.Position)) { spkt.SessionId = regionObject.id; regionObject.client.Send((byte[])spkt); } } while (value._Event > 0) { Thread.Sleep(0); } } return 0; }