Core/Commands: Cleanups
This commit is contained in:
@@ -20,7 +20,7 @@ using System;
|
||||
|
||||
namespace Game.Chat
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Method)]
|
||||
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
|
||||
public class CommandAttribute : Attribute
|
||||
{
|
||||
public CommandAttribute(string command, RBACPermissions rbac, bool allowConsole = false)
|
||||
|
||||
@@ -396,7 +396,7 @@ namespace Game.Chat
|
||||
class SetCommands
|
||||
{
|
||||
[Command("password", RBACPermissions.CommandAccountSetPassword, true)]
|
||||
static bool HandleSetPasswordCommand(StringArguments args, CommandHandler handler)
|
||||
static bool HandleAccountSetPasswordCommand(StringArguments args, CommandHandler handler)
|
||||
{
|
||||
if (args.Empty())
|
||||
{
|
||||
@@ -450,7 +450,7 @@ namespace Game.Chat
|
||||
}
|
||||
|
||||
[Command("addon", RBACPermissions.CommandAccountSetAddon, true)]
|
||||
static bool HandleSetAddonCommand(StringArguments args, CommandHandler handler)
|
||||
static bool HandleAccountSetAddonCommand(StringArguments args, CommandHandler handler)
|
||||
{
|
||||
if (args.Empty())
|
||||
return false;
|
||||
@@ -511,8 +511,9 @@ namespace Game.Chat
|
||||
return true;
|
||||
}
|
||||
|
||||
[Command("gmlevel", RBACPermissions.CommandAccountSetSecLevel, true)]
|
||||
[Command("seclevel", RBACPermissions.CommandAccountSetSecLevel, true)]
|
||||
static bool HandleSetSecLevelCommand(StringArguments args, CommandHandler handler)
|
||||
static bool HandleAccountSetSecLevelCommand(StringArguments args, CommandHandler handler)
|
||||
{
|
||||
if (args.Empty())
|
||||
{
|
||||
@@ -610,7 +611,7 @@ namespace Game.Chat
|
||||
class SetSecCommands
|
||||
{
|
||||
[Command("email", RBACPermissions.CommandAccountSetSecEmail, true)]
|
||||
static bool HandleSetEmailCommand(StringArguments args, CommandHandler handler)
|
||||
static bool HandleAccountSetEmailCommand(StringArguments args, CommandHandler handler)
|
||||
{
|
||||
if (args.Empty())
|
||||
return false;
|
||||
@@ -666,7 +667,7 @@ namespace Game.Chat
|
||||
}
|
||||
|
||||
[Command("regmail", RBACPermissions.CommandAccountSetSecRegmail, true)]
|
||||
static bool HandleSetRegEmailCommand(StringArguments args, CommandHandler handler)
|
||||
static bool HandleAccountSetRegEmailCommand(StringArguments args, CommandHandler handler)
|
||||
{
|
||||
if (args.Empty())
|
||||
return false;
|
||||
|
||||
@@ -846,17 +846,6 @@ namespace Game.Chat
|
||||
return true;
|
||||
}
|
||||
|
||||
[CommandNonGroup("wpgps", RBACPermissions.CommandWpgps)]
|
||||
static bool HandleWPGPSCommand(StringArguments args, CommandHandler handler)
|
||||
{
|
||||
Player player = handler.GetSession().GetPlayer();
|
||||
|
||||
Log.outInfo(LogFilter.SqlDev, "(@PATH, XX, {0}, {1}, {2}, 0, 0, 0, 100, 0),", player.GetPositionX(), player.GetPositionY(), player.GetPositionZ());
|
||||
|
||||
handler.SendSysMessage("Waypoint SQL written to SQL Developer log");
|
||||
return true;
|
||||
}
|
||||
|
||||
[Command("worldstate", RBACPermissions.CommandDebug)]
|
||||
static bool HandleDebugWorldStateCommand(StringArguments args, CommandHandler handler)
|
||||
{
|
||||
@@ -890,6 +879,17 @@ namespace Game.Chat
|
||||
return true;
|
||||
}
|
||||
|
||||
[CommandNonGroup("wpgps", RBACPermissions.CommandWpgps)]
|
||||
static bool HandleWPGPSCommand(StringArguments args, CommandHandler handler)
|
||||
{
|
||||
Player player = handler.GetSession().GetPlayer();
|
||||
|
||||
Log.outInfo(LogFilter.SqlDev, "(@PATH, XX, {0}, {1}, {2}, 0, 0, 0, 100, 0),", player.GetPositionX(), player.GetPositionY(), player.GetPositionZ());
|
||||
|
||||
handler.SendSysMessage("Waypoint SQL written to SQL Developer log");
|
||||
return true;
|
||||
}
|
||||
|
||||
[Command("wsexpression", RBACPermissions.CommandDebug)]
|
||||
static bool HandleDebugWSExpressionCommand(StringArguments args, CommandHandler handler)
|
||||
{
|
||||
@@ -922,6 +922,135 @@ namespace Game.Chat
|
||||
return true;
|
||||
}
|
||||
|
||||
[CommandGroup("play", RBACPermissions.CommandDebugPlay)]
|
||||
class PlayCommands
|
||||
{
|
||||
[Command("cinematic", RBACPermissions.CommandDebugPlayCinematic)]
|
||||
static bool HandleDebugPlayCinematicCommand(StringArguments args, CommandHandler handler)
|
||||
{
|
||||
// USAGE: .debug play cinematic #cinematicid
|
||||
// #cinematicid - ID decimal number from CinemaicSequences.dbc (1st column)
|
||||
if (args.Empty())
|
||||
{
|
||||
handler.SendSysMessage(CypherStrings.BadValue);
|
||||
return false;
|
||||
}
|
||||
|
||||
uint cinematicId = args.NextUInt32();
|
||||
|
||||
CinematicSequencesRecord cineSeq = CliDB.CinematicSequencesStorage.LookupByKey(cinematicId);
|
||||
if (cineSeq == null)
|
||||
{
|
||||
handler.SendSysMessage(CypherStrings.CinematicNotExist, cinematicId);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Dump camera locations
|
||||
var list = M2Storage.GetFlyByCameras(cineSeq.Camera[0]);
|
||||
if (list != null)
|
||||
{
|
||||
handler.SendSysMessage("Waypoints for sequence {0}, camera {1}", cinematicId, cineSeq.Camera[0]);
|
||||
uint count = 1;
|
||||
foreach (FlyByCamera cam in list)
|
||||
{
|
||||
handler.SendSysMessage("{0} - {1}ms [{2}, {3}, {4}] Facing {5} ({6} degrees)", count, cam.timeStamp, cam.locations.X, cam.locations.Y, cam.locations.Z, cam.locations.W, cam.locations.W * (180 / Math.PI));
|
||||
count++;
|
||||
}
|
||||
handler.SendSysMessage("{0} waypoints dumped", list.Count);
|
||||
}
|
||||
|
||||
handler.GetSession().GetPlayer().SendCinematicStart(cinematicId);
|
||||
return true;
|
||||
}
|
||||
|
||||
[Command("movie", RBACPermissions.CommandDebugPlayMovie)]
|
||||
static bool HandleDebugPlayMovieCommand(StringArguments args, CommandHandler handler)
|
||||
{
|
||||
// USAGE: .debug play movie #movieid
|
||||
// #movieid - ID decimal number from Movie.dbc (1st column)
|
||||
if (args.Empty())
|
||||
{
|
||||
handler.SendSysMessage(CypherStrings.BadValue);
|
||||
return false;
|
||||
}
|
||||
|
||||
uint movieId = args.NextUInt32();
|
||||
|
||||
if (!CliDB.MovieStorage.ContainsKey(movieId))
|
||||
{
|
||||
handler.SendSysMessage(CypherStrings.MovieNotExist, movieId);
|
||||
return false;
|
||||
}
|
||||
|
||||
handler.GetSession().GetPlayer().SendMovieStart(movieId);
|
||||
return true;
|
||||
}
|
||||
|
||||
[Command("music", RBACPermissions.CommandDebugPlayMusic)]
|
||||
static bool HandleDebugPlayMusicCommand(StringArguments args, CommandHandler handler)
|
||||
{
|
||||
// USAGE: .debug play music #musicId
|
||||
// #musicId - ID decimal number from SoundEntries.dbc (1st column)
|
||||
if (args.Empty())
|
||||
{
|
||||
handler.SendSysMessage(CypherStrings.BadValue);
|
||||
return false;
|
||||
}
|
||||
|
||||
uint musicId = args.NextUInt32();
|
||||
if (!CliDB.SoundKitStorage.ContainsKey(musicId))
|
||||
{
|
||||
handler.SendSysMessage(CypherStrings.SoundNotExist, musicId);
|
||||
return false;
|
||||
}
|
||||
|
||||
Player player = handler.GetSession().GetPlayer();
|
||||
|
||||
player.PlayDirectMusic(musicId, player);
|
||||
|
||||
handler.SendSysMessage(CypherStrings.YouHearSound, musicId);
|
||||
return true;
|
||||
}
|
||||
|
||||
[Command("sound", RBACPermissions.CommandDebugPlaySound)]
|
||||
static bool HandleDebugPlaySoundCommand(StringArguments args, CommandHandler handler)
|
||||
{
|
||||
// USAGE: .debug playsound #soundid
|
||||
// #soundid - ID decimal number from SoundEntries.dbc (1st column)
|
||||
if (args.Empty())
|
||||
{
|
||||
handler.SendSysMessage(CypherStrings.BadValue);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
uint soundId = args.NextUInt32();
|
||||
|
||||
if (!CliDB.SoundKitStorage.ContainsKey(soundId))
|
||||
{
|
||||
handler.SendSysMessage(CypherStrings.SoundNotExist, soundId);
|
||||
return false;
|
||||
}
|
||||
|
||||
Player player = handler.GetSession().GetPlayer();
|
||||
|
||||
Unit unit = handler.GetSelectedUnit();
|
||||
if (!unit)
|
||||
{
|
||||
handler.SendSysMessage(CypherStrings.SelectCharOrCreature);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!player.GetTarget().IsEmpty())
|
||||
unit.PlayDistanceSound(soundId, player);
|
||||
else
|
||||
unit.PlayDirectSound(soundId, player);
|
||||
|
||||
handler.SendSysMessage(CypherStrings.YouHearSound, soundId);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[CommandGroup("send", RBACPermissions.CommandDebugSend)]
|
||||
class SendCommands
|
||||
{
|
||||
@@ -1078,134 +1207,5 @@ namespace Game.Chat
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[CommandGroup("play", RBACPermissions.CommandDebugPlay)]
|
||||
class PlayCommands
|
||||
{
|
||||
[Command("cinematic", RBACPermissions.CommandDebugPlayCinematic)]
|
||||
static bool HandleDebugPlayCinematicCommand(StringArguments args, CommandHandler handler)
|
||||
{
|
||||
// USAGE: .debug play cinematic #cinematicid
|
||||
// #cinematicid - ID decimal number from CinemaicSequences.dbc (1st column)
|
||||
if (args.Empty())
|
||||
{
|
||||
handler.SendSysMessage(CypherStrings.BadValue);
|
||||
return false;
|
||||
}
|
||||
|
||||
uint cinematicId = args.NextUInt32();
|
||||
|
||||
CinematicSequencesRecord cineSeq = CliDB.CinematicSequencesStorage.LookupByKey(cinematicId);
|
||||
if (cineSeq == null)
|
||||
{
|
||||
handler.SendSysMessage(CypherStrings.CinematicNotExist, cinematicId);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Dump camera locations
|
||||
var list = M2Storage.GetFlyByCameras(cineSeq.Camera[0]);
|
||||
if (list != null)
|
||||
{
|
||||
handler.SendSysMessage("Waypoints for sequence {0}, camera {1}", cinematicId, cineSeq.Camera[0]);
|
||||
uint count = 1;
|
||||
foreach (FlyByCamera cam in list)
|
||||
{
|
||||
handler.SendSysMessage("{0} - {1}ms [{2}, {3}, {4}] Facing {5} ({6} degrees)", count, cam.timeStamp, cam.locations.X, cam.locations.Y, cam.locations.Z, cam.locations.W, cam.locations.W * (180 / Math.PI));
|
||||
count++;
|
||||
}
|
||||
handler.SendSysMessage("{0} waypoints dumped", list.Count);
|
||||
}
|
||||
|
||||
handler.GetSession().GetPlayer().SendCinematicStart(cinematicId);
|
||||
return true;
|
||||
}
|
||||
|
||||
[Command("movie", RBACPermissions.CommandDebugPlayMovie)]
|
||||
static bool HandleDebugPlayMovieCommand(StringArguments args, CommandHandler handler)
|
||||
{
|
||||
// USAGE: .debug play movie #movieid
|
||||
// #movieid - ID decimal number from Movie.dbc (1st column)
|
||||
if (args.Empty())
|
||||
{
|
||||
handler.SendSysMessage(CypherStrings.BadValue);
|
||||
return false;
|
||||
}
|
||||
|
||||
uint movieId = args.NextUInt32();
|
||||
|
||||
if (!CliDB.MovieStorage.ContainsKey(movieId))
|
||||
{
|
||||
handler.SendSysMessage(CypherStrings.MovieNotExist, movieId);
|
||||
return false;
|
||||
}
|
||||
|
||||
handler.GetSession().GetPlayer().SendMovieStart(movieId);
|
||||
return true;
|
||||
}
|
||||
|
||||
[Command("music", RBACPermissions.CommandDebugPlayMusic)]
|
||||
static bool HandleDebugPlayMusicCommand(StringArguments args, CommandHandler handler)
|
||||
{
|
||||
// USAGE: .debug play music #musicId
|
||||
// #musicId - ID decimal number from SoundEntries.dbc (1st column)
|
||||
if (args.Empty())
|
||||
{
|
||||
handler.SendSysMessage(CypherStrings.BadValue);
|
||||
return false;
|
||||
}
|
||||
|
||||
uint musicId = args.NextUInt32();
|
||||
if (!CliDB.SoundKitStorage.ContainsKey(musicId))
|
||||
{
|
||||
handler.SendSysMessage(CypherStrings.SoundNotExist, musicId);
|
||||
return false;
|
||||
}
|
||||
|
||||
Player player = handler.GetSession().GetPlayer();
|
||||
|
||||
player.PlayDirectMusic(musicId, player);
|
||||
|
||||
handler.SendSysMessage(CypherStrings.YouHearSound, musicId);
|
||||
return true;
|
||||
}
|
||||
|
||||
[Command("sound", RBACPermissions.CommandDebugPlaySound)]
|
||||
static bool HandleDebugPlaySoundCommand(StringArguments args, CommandHandler handler)
|
||||
{
|
||||
// USAGE: .debug playsound #soundid
|
||||
// #soundid - ID decimal number from SoundEntries.dbc (1st column)
|
||||
if (args.Empty())
|
||||
{
|
||||
handler.SendSysMessage(CypherStrings.BadValue);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
uint soundId = args.NextUInt32();
|
||||
|
||||
if (!CliDB.SoundKitStorage.ContainsKey(soundId))
|
||||
{
|
||||
handler.SendSysMessage(CypherStrings.SoundNotExist, soundId);
|
||||
return false;
|
||||
}
|
||||
|
||||
Player player = handler.GetSession().GetPlayer();
|
||||
|
||||
Unit unit = handler.GetSelectedUnit();
|
||||
if (!unit)
|
||||
{
|
||||
handler.SendSysMessage(CypherStrings.SelectCharOrCreature);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!player.GetTarget().IsEmpty())
|
||||
unit.PlayDistanceSound(soundId, player);
|
||||
else
|
||||
unit.PlayDirectSound(soundId, player);
|
||||
|
||||
handler.SendSysMessage(CypherStrings.YouHearSound, soundId);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,6 +101,100 @@ namespace Game.Chat
|
||||
return true;
|
||||
}
|
||||
|
||||
[Command("despawngroup", RBACPermissions.CommandGobjectDespawngroup)]
|
||||
static bool HandleGameObjectDespawnGroup(StringArguments args, CommandHandler handler)
|
||||
{
|
||||
return NPCCommands.HandleNpcDespawnGroup(args, handler);
|
||||
}
|
||||
|
||||
[Command("info", RBACPermissions.CommandGobjectInfo)]
|
||||
static bool HandleGameObjectInfoCommand(StringArguments args, CommandHandler handler)
|
||||
{
|
||||
if (args.Empty())
|
||||
return false;
|
||||
|
||||
string param1 = handler.ExtractKeyFromLink(args, "Hgameobject_entry");
|
||||
if (param1.IsEmpty())
|
||||
return false;
|
||||
|
||||
uint entry;
|
||||
if (param1.Equals("guid"))
|
||||
{
|
||||
string cValue = handler.ExtractKeyFromLink(args, "Hgameobject");
|
||||
if (cValue.IsEmpty())
|
||||
return false;
|
||||
|
||||
if (!ulong.TryParse(cValue, out ulong guidLow))
|
||||
return false;
|
||||
|
||||
GameObjectData data = Global.ObjectMgr.GetGameObjectData(guidLow);
|
||||
if (data == null)
|
||||
return false;
|
||||
entry = data.Id;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!uint.TryParse(param1, out entry))
|
||||
return false;
|
||||
}
|
||||
|
||||
GameObjectTemplate gameObjectInfo = Global.ObjectMgr.GetGameObjectTemplate(entry);
|
||||
if (gameObjectInfo == null)
|
||||
return false;
|
||||
|
||||
GameObject thisGO = null;
|
||||
if (handler.GetSession().GetPlayer())
|
||||
thisGO = handler.GetSession().GetPlayer().FindNearestGameObject(entry, 30);
|
||||
else if (handler.GetSelectedObject() != null && handler.GetSelectedObject().IsTypeId(TypeId.GameObject))
|
||||
thisGO = handler.GetSelectedObject().ToGameObject();
|
||||
|
||||
GameObjectTypes type = gameObjectInfo.type;
|
||||
uint displayId = gameObjectInfo.displayId;
|
||||
string name = gameObjectInfo.name;
|
||||
uint lootId = gameObjectInfo.GetLootId();
|
||||
|
||||
// If we have a real object, send some info about it
|
||||
if (thisGO != null)
|
||||
{
|
||||
handler.SendSysMessage(CypherStrings.SpawninfoGuidinfo, thisGO.GetGUID().ToString());
|
||||
handler.SendSysMessage(CypherStrings.SpawninfoSpawnidLocation, thisGO.GetSpawnId(), thisGO.GetPositionX(), thisGO.GetPositionY(), thisGO.GetPositionZ());
|
||||
Player player = handler.GetSession().GetPlayer();
|
||||
if (player != null)
|
||||
{
|
||||
Position playerPos = player.GetPosition();
|
||||
float dist = thisGO.GetExactDist(playerPos);
|
||||
handler.SendSysMessage(CypherStrings.SpawninfoDistancefromplayer, dist);
|
||||
}
|
||||
}
|
||||
handler.SendSysMessage(CypherStrings.GoinfoEntry, entry);
|
||||
handler.SendSysMessage(CypherStrings.GoinfoType, type);
|
||||
handler.SendSysMessage(CypherStrings.GoinfoLootid, lootId);
|
||||
handler.SendSysMessage(CypherStrings.GoinfoDisplayid, displayId);
|
||||
WorldObject obj = handler.GetSelectedObject();
|
||||
if (obj != null)
|
||||
{
|
||||
if (obj.IsGameObject() && obj.ToGameObject().GetGameObjectData() != null && obj.ToGameObject().GetGameObjectData().spawnGroupData.groupId != 0)
|
||||
{
|
||||
SpawnGroupTemplateData groupData = obj.ToGameObject().GetGameObjectData().spawnGroupData;
|
||||
handler.SendSysMessage(CypherStrings.SpawninfoGroupId, groupData.name, groupData.groupId, groupData.flags, groupData.isActive);
|
||||
}
|
||||
if (obj.IsGameObject())
|
||||
handler.SendSysMessage(CypherStrings.SpawninfoCompatibilityMode, obj.ToGameObject().GetRespawnCompatibilityMode());
|
||||
}
|
||||
handler.SendSysMessage(CypherStrings.GoinfoName, name);
|
||||
handler.SendSysMessage(CypherStrings.GoinfoSize, gameObjectInfo.size);
|
||||
|
||||
GameObjectTemplateAddon addon = Global.ObjectMgr.GetGameObjectTemplateAddon(entry);
|
||||
if (addon != null)
|
||||
handler.SendSysMessage(CypherStrings.GoinfoAddon, addon.faction, addon.flags);
|
||||
|
||||
GameObjectDisplayInfoRecord modelInfo = CliDB.GameObjectDisplayInfoStorage.LookupByKey(displayId);
|
||||
if (modelInfo != null)
|
||||
handler.SendSysMessage(CypherStrings.GoinfoModel, modelInfo.GeoBoxMax.X, modelInfo.GeoBoxMax.Y, modelInfo.GeoBoxMax.Z, modelInfo.GeoBoxMin.X, modelInfo.GeoBoxMin.Y, modelInfo.GeoBoxMin.Z);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
[Command("move", RBACPermissions.CommandGobjectMove)]
|
||||
static bool HandleGameObjectMoveCommand(StringArguments args, CommandHandler handler)
|
||||
{
|
||||
@@ -211,6 +305,12 @@ namespace Game.Chat
|
||||
return true;
|
||||
}
|
||||
|
||||
[Command("spawngroup", RBACPermissions.CommandGobjectSpawngroup)]
|
||||
static bool HandleGameObjectSpawnGroup(StringArguments args, CommandHandler handler)
|
||||
{
|
||||
return NPCCommands.HandleNpcSpawnGroup(args, handler);
|
||||
}
|
||||
|
||||
[Command("target", RBACPermissions.CommandGobjectTarget)]
|
||||
static bool HandleGameObjectTargetCommand(StringArguments args, CommandHandler handler)
|
||||
{
|
||||
@@ -392,93 +492,7 @@ namespace Game.Chat
|
||||
return true;
|
||||
}
|
||||
|
||||
[Command("info", RBACPermissions.CommandGobjectInfo)]
|
||||
static bool HandleGameObjectInfoCommand(StringArguments args, CommandHandler handler)
|
||||
{
|
||||
if (args.Empty())
|
||||
return false;
|
||||
|
||||
string param1 = handler.ExtractKeyFromLink(args, "Hgameobject_entry");
|
||||
if (param1.IsEmpty())
|
||||
return false;
|
||||
|
||||
uint entry;
|
||||
if (param1.Equals("guid"))
|
||||
{
|
||||
string cValue = handler.ExtractKeyFromLink(args, "Hgameobject");
|
||||
if (cValue.IsEmpty())
|
||||
return false;
|
||||
|
||||
if (!ulong.TryParse(cValue, out ulong guidLow))
|
||||
return false;
|
||||
|
||||
GameObjectData data = Global.ObjectMgr.GetGameObjectData(guidLow);
|
||||
if (data == null)
|
||||
return false;
|
||||
entry = data.Id;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!uint.TryParse(param1, out entry))
|
||||
return false;
|
||||
}
|
||||
|
||||
GameObjectTemplate gameObjectInfo = Global.ObjectMgr.GetGameObjectTemplate(entry);
|
||||
if (gameObjectInfo == null)
|
||||
return false;
|
||||
|
||||
GameObject thisGO = null;
|
||||
if (handler.GetSession().GetPlayer())
|
||||
thisGO = handler.GetSession().GetPlayer().FindNearestGameObject(entry, 30);
|
||||
else if (handler.GetSelectedObject() != null && handler.GetSelectedObject().IsTypeId(TypeId.GameObject))
|
||||
thisGO = handler.GetSelectedObject().ToGameObject();
|
||||
|
||||
GameObjectTypes type = gameObjectInfo.type;
|
||||
uint displayId = gameObjectInfo.displayId;
|
||||
string name = gameObjectInfo.name;
|
||||
uint lootId = gameObjectInfo.GetLootId();
|
||||
|
||||
// If we have a real object, send some info about it
|
||||
if (thisGO != null)
|
||||
{
|
||||
handler.SendSysMessage(CypherStrings.SpawninfoGuidinfo, thisGO.GetGUID().ToString());
|
||||
handler.SendSysMessage(CypherStrings.SpawninfoSpawnidLocation, thisGO.GetSpawnId(), thisGO.GetPositionX(), thisGO.GetPositionY(), thisGO.GetPositionZ());
|
||||
Player player = handler.GetSession().GetPlayer();
|
||||
if (player != null)
|
||||
{
|
||||
Position playerPos = player.GetPosition();
|
||||
float dist = thisGO.GetExactDist(playerPos);
|
||||
handler.SendSysMessage(CypherStrings.SpawninfoDistancefromplayer, dist);
|
||||
}
|
||||
}
|
||||
handler.SendSysMessage(CypherStrings.GoinfoEntry, entry);
|
||||
handler.SendSysMessage(CypherStrings.GoinfoType, type);
|
||||
handler.SendSysMessage(CypherStrings.GoinfoLootid, lootId);
|
||||
handler.SendSysMessage(CypherStrings.GoinfoDisplayid, displayId);
|
||||
WorldObject obj = handler.GetSelectedObject();
|
||||
if (obj != null)
|
||||
{
|
||||
if (obj.IsGameObject() && obj.ToGameObject().GetGameObjectData() != null && obj.ToGameObject().GetGameObjectData().spawnGroupData.groupId != 0)
|
||||
{
|
||||
SpawnGroupTemplateData groupData = obj.ToGameObject().GetGameObjectData().spawnGroupData;
|
||||
handler.SendSysMessage(CypherStrings.SpawninfoGroupId, groupData.name, groupData.groupId, groupData.flags, groupData.isActive);
|
||||
}
|
||||
if (obj.IsGameObject())
|
||||
handler.SendSysMessage(CypherStrings.SpawninfoCompatibilityMode, obj.ToGameObject().GetRespawnCompatibilityMode());
|
||||
}
|
||||
handler.SendSysMessage(CypherStrings.GoinfoName, name);
|
||||
handler.SendSysMessage(CypherStrings.GoinfoSize, gameObjectInfo.size);
|
||||
|
||||
GameObjectTemplateAddon addon = Global.ObjectMgr.GetGameObjectTemplateAddon(entry);
|
||||
if (addon != null)
|
||||
handler.SendSysMessage(CypherStrings.GoinfoAddon, addon.faction, addon.flags);
|
||||
|
||||
GameObjectDisplayInfoRecord modelInfo = CliDB.GameObjectDisplayInfoStorage.LookupByKey(displayId);
|
||||
if (modelInfo != null)
|
||||
handler.SendSysMessage(CypherStrings.GoinfoModel, modelInfo.GeoBoxMax.X, modelInfo.GeoBoxMax.Y, modelInfo.GeoBoxMax.Z, modelInfo.GeoBoxMin.X, modelInfo.GeoBoxMin.Y, modelInfo.GeoBoxMin.Z);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
[CommandGroup("add", RBACPermissions.CommandGobjectAdd)]
|
||||
class AddCommands
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace Game.Chat
|
||||
class NPCCommands
|
||||
{
|
||||
[Command("despawngroup", RBACPermissions.CommandNpcDespawngroup)]
|
||||
static bool HandleNpcDespawnGroup(StringArguments args, CommandHandler handler)
|
||||
public static bool HandleNpcDespawnGroup(StringArguments args, CommandHandler handler)
|
||||
{
|
||||
if (args.Empty())
|
||||
return false;
|
||||
@@ -419,7 +419,7 @@ namespace Game.Chat
|
||||
}
|
||||
|
||||
[Command("spawngroup", RBACPermissions.CommandNpcSpawngroup)]
|
||||
static bool HandleNpcSpawnGroup(StringArguments args, CommandHandler handler)
|
||||
public static bool HandleNpcSpawnGroup(StringArguments args, CommandHandler handler)
|
||||
{
|
||||
if (args.Empty())
|
||||
return false;
|
||||
|
||||
@@ -26,14 +26,20 @@ namespace Game.Chat
|
||||
class ServerCommands
|
||||
{
|
||||
[Command("corpses", RBACPermissions.CommandServerCorpses, true)]
|
||||
static bool Corpses(StringArguments args, CommandHandler handler)
|
||||
static bool HandleServerCorpsesCommand(StringArguments args, CommandHandler handler)
|
||||
{
|
||||
Global.WorldMgr.RemoveOldCorpses();
|
||||
return true;
|
||||
}
|
||||
|
||||
[Command("debug", RBACPermissions.CommandServerCorpses, true)]
|
||||
static bool HandleServerDebugCommand(StringArguments args, CommandHandler handler)
|
||||
{
|
||||
return false;//todo fix me
|
||||
}
|
||||
|
||||
[Command("exit", RBACPermissions.CommandServerExit, true)]
|
||||
static bool Exit(StringArguments args, CommandHandler handler)
|
||||
static bool HandleServerExitCommand(StringArguments args, CommandHandler handler)
|
||||
{
|
||||
handler.SendSysMessage(CypherStrings.CommandExit);
|
||||
Global.WorldMgr.StopNow(ShutdownExitCode.Shutdown);
|
||||
@@ -41,7 +47,7 @@ namespace Game.Chat
|
||||
}
|
||||
|
||||
[Command("info", RBACPermissions.CommandServerInfo, true)]
|
||||
static bool Info(StringArguments args, CommandHandler handler)
|
||||
static bool HandleServerInfoCommand(StringArguments args, CommandHandler handler)
|
||||
{
|
||||
uint playersNum = Global.WorldMgr.GetPlayerCount();
|
||||
uint maxPlayersNum = Global.WorldMgr.GetMaxPlayerCount();
|
||||
@@ -64,7 +70,7 @@ namespace Game.Chat
|
||||
}
|
||||
|
||||
[Command("motd", RBACPermissions.CommandServerMotd, true)]
|
||||
static bool Motd(StringArguments args, CommandHandler handler)
|
||||
static bool HandleServerMotdCommand(StringArguments args, CommandHandler handler)
|
||||
{
|
||||
string motd = "";
|
||||
foreach (var line in Global.WorldMgr.GetMotd())
|
||||
@@ -75,7 +81,7 @@ namespace Game.Chat
|
||||
}
|
||||
|
||||
[Command("plimit", RBACPermissions.CommandServerPlimit, true)]
|
||||
static bool PLimit(StringArguments args, CommandHandler handler)
|
||||
static bool HandleServerPLimitCommand(StringArguments args, CommandHandler handler)
|
||||
{
|
||||
if (!args.Empty())
|
||||
{
|
||||
@@ -234,9 +240,11 @@ namespace Game.Chat
|
||||
}
|
||||
|
||||
[Command("cancel", RBACPermissions.CommandServerIdlerestartCancel, true)]
|
||||
static bool Cancel(StringArguments args, CommandHandler handler)
|
||||
static bool HandleServerShutDownCancelCommand(StringArguments args, CommandHandler handler)
|
||||
{
|
||||
Global.WorldMgr.ShutdownCancel();
|
||||
uint timer = Global.WorldMgr.ShutdownCancel();
|
||||
if (timer != 0)
|
||||
handler.SendSysMessage(CypherStrings.ShutdownCancelled, timer);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -251,9 +259,11 @@ namespace Game.Chat
|
||||
}
|
||||
|
||||
[Command("cancel", RBACPermissions.CommandServerIdleshutdownCancel, true)]
|
||||
static bool Cancel(StringArguments args, CommandHandler handler)
|
||||
static bool HandleServerShutDownCancelCommand(StringArguments args, CommandHandler handler)
|
||||
{
|
||||
Global.WorldMgr.ShutdownCancel();
|
||||
uint timer = Global.WorldMgr.ShutdownCancel();
|
||||
if (timer != 0)
|
||||
handler.SendSysMessage(CypherStrings.ShutdownCancelled, timer);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -269,9 +279,11 @@ namespace Game.Chat
|
||||
}
|
||||
|
||||
[Command("cancel", RBACPermissions.CommandServerRestartCancel, true)]
|
||||
static bool HandleServerRestartCancelCommand(StringArguments args, CommandHandler handler)
|
||||
static bool HandleServerShutDownCancelCommand(StringArguments args, CommandHandler handler)
|
||||
{
|
||||
Global.WorldMgr.ShutdownCancel();
|
||||
uint timer = Global.WorldMgr.ShutdownCancel();
|
||||
if (timer != 0)
|
||||
handler.SendSysMessage(CypherStrings.ShutdownCancelled, timer);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2101,7 +2101,8 @@ namespace Game.Spells
|
||||
// for delayed spells ignore negative spells (after duel end) for friendly targets
|
||||
// @todo this cause soul transfer bugged
|
||||
// 63881 - Malady of the Mind jump spell (Yogg-Saron)
|
||||
if (m_spellInfo.HasHitDelay() && unit.IsTypeId(TypeId.Player) && !m_spellInfo.IsPositive() && m_spellInfo.Id != 63881)
|
||||
// 45034 - Curse of Boundless Agony jump spell (Kalecgos)
|
||||
if (m_spellInfo.HasHitDelay() && unit.IsPlayer() && !m_spellInfo.IsPositive() && m_spellInfo.Id != 63881 && m_spellInfo.Id != 45034)
|
||||
return SpellMissInfo.Evade;
|
||||
|
||||
// assisting case, healing and resurrection
|
||||
|
||||
Reference in New Issue
Block a user