Example #1
0
		/// <summary>
		/// Teleports into an instance
		/// </summary>
		/// <param name="chr"></param>
		/// <param name="trigger"></param>
		/// <returns></returns>
		public static bool HandleTeleport(Character chr, AreaTrigger trigger)
		{
			var regionInfo = World.GetRegionTemplate(trigger.Template.TargetMap);
#if DEBUG
			chr.SendSystemMessage("Target location: {0}", trigger.Template.TargetMap);
#endif

			if (regionInfo.IsInstance)
			{
				if (regionInfo.Type == MapType.Normal)
				{
					InstanceMgr.LeaveInstance(chr, regionInfo, trigger.Template.TargetPos);
					return true;
				}
				else
				{
					return InstanceMgr.EnterInstance(chr, regionInfo, trigger.Template.TargetPos);
				}
			}
			else if (regionInfo.BGTemplate == null)
			{
				var rgn = World.GetRegion(regionInfo.Id);
				if (rgn != null)
				{
					chr.TeleportTo(rgn, trigger.Template.TargetPos, trigger.Template.TargetOrientation);
					return true;
				}
				else
				{
					ContentMgr.OnInvalidDBData("Invalid Region: " + rgn);
				}
			}
			return true;
		}
Example #2
0
 public void TeleportInside(Character chr, Vector3 pos)
 {
     chr.TeleportTo(this, ref pos);
     chr.SendSystemMessage("Welcome to {0} #{1} (created at {2})", Name, InstanceId, m_creationTime.ToString());
 }
Example #3
0
		public static void SendPetitionList(this NPC petitioner, Character chr)
		{
			using (
				var packet = new RealmPacketOut(RealmServerOpCode.SMSG_PETITION_SHOWLIST, 8 + 4 * 6))
			{
				packet.Write(petitioner.EntityId);
				if (petitioner.IsGuildPetitioner)
				{
					// Guild petitioner
					packet.Write(1);
					packet.Write((uint)PetitionerEntry.GuildPetitionEntry.ItemId);
					packet.Write(PetitionerEntry.GuildPetitionEntry.DisplayId);
					packet.Write(PetitionerEntry.GuildPetitionEntry.Cost);
					packet.Write(0);
					packet.Write(PetitionerEntry.GuildPetitionEntry.RequiredSignatures);
				}
				else if (petitioner.IsArenaPetitioner)
				{
					// Arena petitioner
					chr.SendSystemMessage("Building arena packet.");
					//packet.Write(3);

					packet.Write((uint)PetitionerEntry.ArenaPetition2v2Entry.Index);
					packet.Write((uint)PetitionerEntry.ArenaPetition2v2Entry.ItemId);
					packet.Write((uint)PetitionerEntry.ArenaPetition2v2Entry.DisplayId);
					packet.Write((uint)PetitionerEntry.ArenaPetition2v2Entry.Cost);
					//packet.Write((uint)PetitionerEntry.ArenaPetition5v5Entry.RequiredSignatures);
					//packet.Write(0);
					packet.Write((uint)PetitionerEntry.ArenaPetition2v2Entry.RequiredSignatures);

					packet.Write((uint)PetitionerEntry.ArenaPetition3v3Entry.Index);
					packet.Write((uint)PetitionerEntry.ArenaPetition3v3Entry.ItemId);
					packet.Write((uint)PetitionerEntry.ArenaPetition3v3Entry.DisplayId);
					packet.Write((uint)PetitionerEntry.ArenaPetition3v3Entry.Cost);
					//packet.Write((uint)PetitionerEntry.ArenaPetition5v5Entry.RequiredSignatures);
					//packet.Write(0);
					packet.Write((uint)PetitionerEntry.ArenaPetition3v3Entry.RequiredSignatures);

					packet.Write((uint)PetitionerEntry.ArenaPetition5v5Entry.Index);
					packet.Write((uint)PetitionerEntry.ArenaPetition5v5Entry.ItemId);
					packet.Write((uint)PetitionerEntry.ArenaPetition5v5Entry.DisplayId);
					packet.Write((uint)PetitionerEntry.ArenaPetition5v5Entry.Cost);
					//packet.Write((uint)PetitionerEntry.ArenaPetition5v5Entry.RequiredSignatures);
					//packet.Write(0);
					packet.Write((uint)PetitionerEntry.ArenaPetition5v5Entry.RequiredSignatures);
				}
				chr.Client.Send(packet);
				chr.SendSystemMessage("Sent arena packet.");
			}
		}