Exemple #1
0
 private static bool Blastenheimer5000Used(GameObject go, Character user)
 {
     var cast = user.SpellCast;
     cast.Start(CannonPrepId);
     user.IncMechanicCount(SpellMechanic.Rooted);
     switch (go.EntryId)
     {
         case (uint)Blastenheimer5000ElwynnId:
             {
                 user.TeleportTo(ElwynnTelePosition, ElwynnTeleOrientation);
             } break;
         case (uint)Blastenheimer5000TerokkarId:
             {
                 user.TeleportTo(TerokkarTelePosition, TerokkarTeleOrientation);
             } break;
         case (uint)Blastenheimer5000MulgoreId:
             {
                 user.TeleportTo(MulgoreTelePosition, MulgoreTeleOrientation);
             } break;
         default:
             {
                 user.DecMechanicCount(SpellMechanic.Rooted);
                 return false;
             }
     }
     go.PlaySound(8476);
     
     user.CallDelayed(2000, obj => FireCannon(user));
     return true;
 }
Exemple #2
0
        private static bool Blastenheimer5000Used(GameObject go, Character user)
        {
            var cast = user.SpellCast;
            var target = go.GetNearbyGO(CannonTarget, 1000);
            if(target != null)
            {
                var dist = go.GetDistance(target);
            }
            
            switch (go.EntryId)
            {
                case (uint)Blastenheimer5000ElwynnId:
                    {
                        cast.Start(CannonPrepId);
                        user.StandState = StandState.Sit;
                        user.IncMechanicCount(SpellMechanic.Rooted);
                        var facing = target != null ? go.GetAngleTowards(target) : ElwynnTeleOrientation;
                        user.TeleportTo(ElwynnTelePosition, facing);

                    } break;
                case (uint)Blastenheimer5000TerokkarId:
                    {
                        cast.Start(CannonPrepId);
                        user.StandState = StandState.Sit;
                        user.IncMechanicCount(SpellMechanic.Rooted);
                        var facing = target != null ? go.GetAngleTowards(target) : TerokkarTeleOrientation;
                        user.TeleportTo(TerokkarTelePosition, facing);
                    } break;
                case (uint)Blastenheimer5000MulgoreId:
                    {
                        cast.Start(CannonPrepMulgore);
                        user.StandState = StandState.Sit;
                        user.IncMechanicCount(SpellMechanic.Rooted);
                        var facing = target != null ? go.GetAngleTowards(target) : MulgoreTeleOrientation;
                        user.TeleportTo(MulgoreTelePosition, facing);
                    } break;
                default:
                    {
                        user.DecMechanicCount(SpellMechanic.Rooted);
                        return false;
                    }
            }
            go.PlaySound(8476);
            
            user.CallDelayed(2000, obj => FireCannon(user));
            return true;
        }
Exemple #3
0
		private static void Teleport(GameObject go, Character chr)
		{
			if (go.Handler.CanBeUsedBy(chr))
			{
				// We need to enqueue a message when moving/removing/adding Objects in this method
				var portal = (Portal)go;
				chr.AddMessage(() => chr.TeleportTo(portal.Target));
			}
		}
Exemple #4
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());
 }
Exemple #5
0
		private static bool OnUse(GameObject go, Character chr)
		{
			var portal = (Portal)go;
			chr.TeleportTo(portal.Target);
			return true;
		}
Exemple #6
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;
		}
Exemple #7
0
		/// <summary>
		/// Sends the given Character on the given Path.
		/// </summary>
		/// <param name="chr">The Character to fly around.</param>
		/// <param name="destinations">An array of destination TaxiNodes.</param>
		/// <returns>Whether the client was sent on its way.</returns>
		internal static bool TryFly(Character chr, NPC vendor, PathNode[] destinations)
		{
			var client = chr.Client;

			if (vendor == null && chr.Role.IsStaff)
			{
				var dest = destinations.LastOrDefault();
				if (dest != null)
				{
					chr.TeleportTo(dest);
					return true;
				}
				return false;
			}

			if (vendor == null || !vendor.CheckVendorInteraction(chr))
			{
				TaxiHandler.SendActivateTaxiReply(client, TaxiActivateResponse.NotAvailable);
			}
			else if (PreFlightCheatChecks(client, destinations) &&
				PreFlightValidPathCheck(client, destinations) &&
				(client.ActiveCharacter.GodMode || PreFlightMoneyCheck(client)))
			{
				// All good, send an "All Good" reply to the client.
				TaxiHandler.SendActivateTaxiReply(client, TaxiActivateResponse.Ok);

				// PvP flag is auto-cleared when starting a taxi-flight
				chr.UpdatePvPState(false, true);

				FlyUnit(chr, true);
				return true;
			}
			return false;
		}
Exemple #8
0
		public override void TeleportInside(Character chr)
		{
			var invite = chr.Battlegrounds.Invitation;
			BattlegroundTeam team;

			if (invite != null)
			{
				team = invite.Team;
			}
			else
			{
				// joins without invitiation
				team = GetTeam(chr.FactionGroup.GetBattlegroundSide());
			}

			chr.TeleportTo(this, team.StartPosition, team.StartOrientation);
		}