/// <summary> /// Decides whether player can jump to the target point. /// All messages with reasons must be sent here. /// Can change destination too. /// </summary> /// <param name="targetPoint">The jump destination</param> /// <param name="player">The jumping player</param> /// <returns>True if allowed</returns> public bool IsAllowedToJump(ZonePoint targetPoint, GamePlayer player) { StartupLocation loc = StartupLocations.GetNonTutorialLocation(player); if (loc != null) { targetPoint.TargetX = loc.XPos; targetPoint.TargetY = loc.YPos; targetPoint.TargetZ = loc.ZPos; targetPoint.TargetHeading = (ushort)loc.Heading; targetPoint.TargetRegion = (ushort)loc.Region; return(true); } return(false); }
/// <summary> /// Command Handling Tests. /// </summary> /// <param name="client"></param> /// <param name="args"></param> public void OnCommand(GameClient client, string[] args) { // Needs all arguments if (args.Length < 6) { DisplaySyntax(client); return; } // Parse Arguments int version; int regionId; int realmId; int classId; int raceId; if (!int.TryParse(args[1], out version)) { DisplaySyntax(client); return; } if (!int.TryParse(args[2], out regionId)) { DisplaySyntax(client); return; } if (!int.TryParse(args[3], out realmId)) { DisplaySyntax(client); return; } if (!int.TryParse(args[4], out classId)) { DisplaySyntax(client); return; } if (!int.TryParse(args[5], out raceId)) { DisplaySyntax(client); return; } // Build a temp character with given params. var chtmp = new DOLCharacters(); chtmp.AllowAdd = false; chtmp.Region = regionId; chtmp.Realm = realmId; chtmp.Class = classId; chtmp.Race = raceId; // Test params againt database value and return results. var locs = StartupLocations.GetAllStartupLocationForCharacter(chtmp, (GameClient.eClientVersion)version); if (locs.Count < 1) { DisplayMessage(client, "No configuration for startup locations found with these constraints !"); } else { foreach (StartupLocation l in locs) { DisplayMessage(client, string.Format("--- Loc Id:{0}, X:{1}, Y:{2}, Z:{3}, Head:{4}, Region:{5}", l.StartupLoc_ID, l.XPos, l.YPos, l.ZPos, l.Heading, l.Region)); } } }