Merge remote-tracking branch 'origin/master' into mmaps

Conflicts:
	src/server/game/Maps/Map.cpp
	src/server/game/Movement/MovementGenerator.h
	src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp
	src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h
	src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp
	src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h
	src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp
	src/server/game/Movement/MovementGenerators/HomeMovementGenerator.h
	src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp
	src/server/game/Movement/MovementGenerators/PointMovementGenerator.h
	src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp
	src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h
	src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp
	src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h
	src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp
	src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h
	src/server/game/Spells/SpellEffects.cpp
This commit is contained in:
Nay committed 2012-11-23 23:39:03 +00:00
commit 24cd72c8e1
1062 files changed
+23070 -12592

No files matched your search

+3 -1
View File
@@ -22,9 +22,11 @@ Comment: All account related commands
Category: commandscripts
EndScriptData */
#include "ScriptMgr.h"
#include "AccountMgr.h"
#include "Chat.h"
#include "Language.h"
#include "Player.h"
#include "ScriptMgr.h"
class account_commandscript : public CommandScript
{
@@ -22,8 +22,10 @@ Comment: All achievement related commands
Category: commandscripts
EndScriptData */
#include "ScriptMgr.h"
#include "Chat.h"
#include "Language.h"
#include "Player.h"
#include "ScriptMgr.h"
class achievement_commandscript : public CommandScript
{
+4 -2
View File
@@ -22,11 +22,13 @@ Comment: All ban related commands
Category: commandscripts
EndScriptData */
#include "ScriptMgr.h"
#include "Chat.h"
#include "AccountMgr.h"
#include "Chat.h"
#include "Language.h"
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "ScriptMgr.h"
class ban_commandscript : public CommandScript
{
+3
View File
@@ -24,6 +24,9 @@ EndScriptData */
#include "ScriptMgr.h"
#include "Chat.h"
#include "Creature.h"
#include "Language.h"
#include "Player.h"
class cast_commandscript : public CommandScript
{
+7 -5
View File
@@ -22,11 +22,13 @@ Comment: All character related commands
Category: commandscripts
EndScriptData */
#include "ScriptMgr.h"
#include "Chat.h"
#include "AccountMgr.h"
#include "Chat.h"
#include "ObjectMgr.h"
#include "PlayerDump.h"
#include "Player.h"
#include "ReputationMgr.h"
#include "ScriptMgr.h"
class character_commandscript : public CommandScript
{
@@ -238,11 +240,11 @@ public:
if (handler->needReportToTarget(player))
{
if (oldLevel == newLevel)
ChatHandler(player).PSendSysMessage(LANG_YOURS_LEVEL_PROGRESS_RESET, handler->GetNameLink().c_str());
ChatHandler(player->GetSession()).PSendSysMessage(LANG_YOURS_LEVEL_PROGRESS_RESET, handler->GetNameLink().c_str());
else if (oldLevel < newLevel)
ChatHandler(player).PSendSysMessage(LANG_YOURS_LEVEL_UP, handler->GetNameLink().c_str(), newLevel);
ChatHandler(player->GetSession()).PSendSysMessage(LANG_YOURS_LEVEL_UP, handler->GetNameLink().c_str(), newLevel);
else // if (oldlevel > newlevel)
ChatHandler(player).PSendSysMessage(LANG_YOURS_LEVEL_DOWN, handler->GetNameLink().c_str(), newLevel);
ChatHandler(player->GetSession()).PSendSysMessage(LANG_YOURS_LEVEL_DOWN, handler->GetNameLink().c_str(), newLevel);
}
}
else
+8 -6
View File
@@ -22,9 +22,11 @@ Comment: All cheat related commands
Category: commandscripts
EndScriptData */
#include "ScriptMgr.h"
#include "ObjectMgr.h"
#include "Chat.h"
#include "Language.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "ScriptMgr.h"
class cheat_commandscript : public CommandScript
{
@@ -233,7 +235,7 @@ public:
chr->SetTaxiCheater(true);
handler->PSendSysMessage(LANG_YOU_GIVE_TAXIS, handler->GetNameLink(chr).c_str());
if (handler->needReportToTarget(chr))
ChatHandler(chr).PSendSysMessage(LANG_YOURS_TAXIS_ADDED, handler->GetNameLink().c_str());
ChatHandler(chr->GetSession()).PSendSysMessage(LANG_YOURS_TAXIS_ADDED, handler->GetNameLink().c_str());
return true;
}
@@ -242,7 +244,7 @@ public:
chr->SetTaxiCheater(false);
handler->PSendSysMessage(LANG_YOU_REMOVE_TAXIS, handler->GetNameLink(chr).c_str());
if (handler->needReportToTarget(chr))
ChatHandler(chr).PSendSysMessage(LANG_YOURS_TAXIS_REMOVED, handler->GetNameLink().c_str());
ChatHandler(chr->GetSession()).PSendSysMessage(LANG_YOURS_TAXIS_REMOVED, handler->GetNameLink().c_str());
return true;
}
@@ -271,13 +273,13 @@ public:
{
handler->PSendSysMessage(LANG_YOU_SET_EXPLORE_ALL, handler->GetNameLink(chr).c_str());
if (handler->needReportToTarget(chr))
ChatHandler(chr).PSendSysMessage(LANG_YOURS_EXPLORE_SET_ALL, handler->GetNameLink().c_str());
ChatHandler(chr->GetSession()).PSendSysMessage(LANG_YOURS_EXPLORE_SET_ALL, handler->GetNameLink().c_str());
}
else
{
handler->PSendSysMessage(LANG_YOU_SET_EXPLORE_NOTHING, handler->GetNameLink(chr).c_str());
if (handler->needReportToTarget(chr))
ChatHandler(chr).PSendSysMessage(LANG_YOURS_EXPLORE_SET_NOTHING, handler->GetNameLink().c_str());
ChatHandler(chr->GetSession()).PSendSysMessage(LANG_YOURS_EXPLORE_SET_NOTHING, handler->GetNameLink().c_str());
}
for (uint8 i = 0; i < PLAYER_EXPLORED_ZONES_SIZE; ++i)
+1
View File
@@ -31,6 +31,7 @@ EndScriptData */
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
#include "GossipDef.h"
#include "Language.h"
#include <fstream>
+5 -2
View File
@@ -22,11 +22,14 @@ Comment: All disable related commands
Category: commandscripts
EndScriptData */
#include "ScriptMgr.h"
#include "ObjectMgr.h"
#include "Chat.h"
#include "DisableMgr.h"
#include "Language.h"
#include "ObjectMgr.h"
#include "OutdoorPvP.h"
#include "Player.h"
#include "ScriptMgr.h"
#include "SpellMgr.h"
class disable_commandscript : public CommandScript
{
+4 -2
View File
@@ -22,9 +22,11 @@ Comment: All event related commands
Category: commandscripts
EndScriptData */
#include "ScriptMgr.h"
#include "GameEventMgr.h"
#include "Chat.h"
#include "GameEventMgr.h"
#include "Language.h"
#include "Player.h"
#include "ScriptMgr.h"
class event_commandscript : public CommandScript
{
+3
View File
@@ -26,7 +26,10 @@ EndScriptData */
#include "ObjectMgr.h"
#include "Chat.h"
#include "AccountMgr.h"
#include "Language.h"
#include "World.h"
#include "Player.h"
#include "Opcodes.h"
class gm_commandscript : public CommandScript
{
+2
View File
@@ -27,6 +27,8 @@ EndScriptData */
#include "MapManager.h"
#include "TicketMgr.h"
#include "Chat.h"
#include "Language.h"
#include "Player.h"
class go_commandscript : public CommandScript
{
@@ -28,6 +28,9 @@ EndScriptData */
#include "PoolMgr.h"
#include "MapManager.h"
#include "Chat.h"
#include "Language.h"
#include "Player.h"
#include "Opcodes.h"
class gobject_commandscript : public CommandScript
{
+2 -1
View File
@@ -22,11 +22,12 @@ Comment: All guild related commands
Category: commandscripts
EndScriptData */
#include "ScriptMgr.h"
#include "Chat.h"
#include "Language.h"
#include "Guild.h"
#include "GuildMgr.h"
#include "ObjectAccessor.h"
#include "ScriptMgr.h"
class guild_commandscript : public CommandScript
{
+4 -2
View File
@@ -22,9 +22,11 @@ Comment: All honor related commands
Category: commandscripts
EndScriptData */
#include "ScriptMgr.h"
#include "ObjectMgr.h"
#include "Chat.h"
#include "Language.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "ScriptMgr.h"
class honor_commandscript : public CommandScript
{
@@ -28,6 +28,7 @@ EndScriptData */
#include "InstanceSaveMgr.h"
#include "InstanceScript.h"
#include "MapManager.h"
#include "Player.h"
class instance_commandscript : public CommandScript
{
+3
View File
@@ -25,8 +25,11 @@ EndScriptData */
#include "Chat.h"
#include "ScriptMgr.h"
#include "ObjectMgr.h"
#include "Language.h"
#include "SpellMgr.h"
#include "SpellInfo.h"
#include "Player.h"
#include "Pet.h"
class learn_commandscript : public CommandScript
{
+2
View File
@@ -17,8 +17,10 @@
#include "ScriptMgr.h"
#include "Chat.h"
#include "Language.h"
#include "LFGMgr.h"
#include "Group.h"
#include "Player.h"
void GetPlayerInfo(ChatHandler* handler, Player* player)
{
+2
View File
@@ -25,8 +25,10 @@ EndScriptData */
#include "ScriptMgr.h"
#include "Chat.h"
#include "SpellAuraEffects.h"
#include "Language.h"
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "Player.h"
class list_commandscript : public CommandScript
{
+35 -69
View File
@@ -22,12 +22,15 @@ Comment: All lookup related commands
Category: commandscripts
EndScriptData */
#include "ScriptMgr.h"
#include "Chat.h"
#include "AccountMgr.h"
#include "Chat.h"
#include "GameEventMgr.h"
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "ReputationMgr.h"
#include "ScriptMgr.h"
#include "SpellInfo.h"
class lookup_commandscript : public CommandScript
{
@@ -1156,109 +1159,72 @@ public:
return true;
}
static bool HandleLookupMapCommand(ChatHandler* /*handler*/, char const* args)
static bool HandleLookupMapCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
/*
std::string namePart = args;
std::wstring wNamePart;
// converting string that we try to find to lower case
if (!Utf8toWStr(namePart, wNamePart))
return false;
wstrToLower(wNamePart);
bool found = false;
uint32 counter = 0;
uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
uint8 locale = handler->GetSession() ? handler->GetSession()->GetSessionDbcLocale() : sWorld->GetDefaultDbcLocale();
// search in Map.dbc
for (uint32 id = 0; id < sMapStore.GetNumRows(); id++)
{
MapEntry const* MapInfo = sMapStore.LookupEntry(id);
if (MapInfo)
if (MapEntry const* mapInfo = sMapStore.LookupEntry(id))
{
uint8 locale = handler->GetSession() ? handler->GetSession()->GetSessionDbcLocale() : sWorld->GetDefaultDbcLocale();
std::string name = MapInfo->name[locale];
std::string name = mapInfo->name[locale];
if (name.empty())
continue;
if (!Utf8FitTo(name, wNamePart))
if (Utf8FitTo(name, wNamePart) && locale < TOTAL_LOCALES)
{
locale = LOCALE_enUS;
for (; locale < TOTAL_LOCALES; locale++)
if (maxResults && counter == maxResults)
{
if (handler->GetSession() && locale == handler->GetSession()->GetSessionDbcLocale())
continue;
name = MapInfo->name[locale];
if (name.empty())
continue;
if (Utf8FitTo(name, wNamePart))
break;
handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
return true;
}
}
if (locale < TOTAL_LOCALES)
{
// send map in "id - [name][Continent][Instance/Battleground/Arena][Raid reset time:][Heroic reset time:][Mountable]" format
std::ostringstream ss;
ss << id << " - [" << name << ']';
if (handler->GetSession())
ss << id << " - |cffffffff|Hmap:" << id << "|h[" << name << ']';
else // console
ss << id << " - [" << name << ']';
if (MapInfo->IsContinent())
if (mapInfo->IsContinent())
ss << handler->GetTrinityString(LANG_CONTINENT);
switch (MapInfo->map_type)
switch (mapInfo->map_type)
{
case MAP_INSTANCE: ss << handler->GetTrinityString(LANG_INSTANCE); break;
case MAP_BATTLEGROUND: ss << handler->GetTrinityString(LANG_BATTLEGROUND); break;
case MAP_ARENA: ss << handler->GetTrinityString(LANG_ARENA); break;
case MAP_INSTANCE:
ss << handler->GetTrinityString(LANG_INSTANCE);
break;
case MAP_RAID:
ss << handler->GetTrinityString(LANG_RAID);
break;
case MAP_BATTLEGROUND:
ss << handler->GetTrinityString(LANG_BATTLEGROUND);
break;
case MAP_ARENA:
ss << handler->GetTrinityString(LANG_ARENA);
break;
}
if (MapInfo->IsRaid())
ss << handler->GetTrinityString(LANG_RAID);
handler->SendSysMessage(ss.str().c_str());
if (MapInfo->SupportsHeroicMode())
ss << handler->GetTrinityString(LANG_HEROIC);
uint32 ResetTimeRaid = MapInfo->resetTimeRaid;
std::string ResetTimeRaidStr;
if (ResetTimeRaid)
ResetTimeRaidStr = secsToTimeString(ResetTimeRaid, true, false);
uint32 ResetTimeHeroic = MapInfo->resetTimeHeroic;
std::string ResetTimeHeroicStr;
if (ResetTimeHeroic)
ResetTimeHeroicStr = secsToTimeString(ResetTimeHeroic, true, false);
if (MapInfo->IsMountAllowed())
ss << handler->GetTrinityString(LANG_MOUNTABLE);
if (ResetTimeRaid && !ResetTimeHeroic)
handler->PSendSysMessage(ss.str().c_str(), ResetTimeRaidStr.c_str());
else if (!ResetTimeRaid && ResetTimeHeroic)
handler->PSendSysMessage(ss.str().c_str(), ResetTimeHeroicStr.c_str());
else if (ResetTimeRaid && ResetTimeHeroic)
handler->PSendSysMessage(ss.str().c_str(), ResetTimeRaidStr.c_str(), ResetTimeHeroicStr.c_str());
else
handler->SendSysMessage(ss.str().c_str());
if (!found)
found = true;
++counter;
}
}
}
if (!found)
if (!counter)
handler->SendSysMessage(LANG_COMMAND_NOMAPFOUND);
*/
return true;
}
@@ -25,6 +25,8 @@ EndScriptData */
#include "ScriptMgr.h"
#include "Chat.h"
#include "ChannelMgr.h"
#include "Language.h"
#include "Player.h"
class message_commandscript : public CommandScript
{
+9 -5
View File
@@ -23,12 +23,16 @@
#include "GridNotifiers.h"
#include "Group.h"
#include "InstanceSaveMgr.h"
#include "Language.h"
#include "MovementGenerator.h"
#include "ObjectAccessor.h"
#include "Opcodes.h"
#include "SpellAuras.h"
#include "TargetedMovementGenerator.h"
#include "WeatherMgr.h"
#include "ace/INET_Addr.h"
#include "Player.h"
#include "Pet.h"
class misc_commandscript : public CommandScript
{
@@ -495,7 +499,7 @@ public:
handler->PSendSysMessage(LANG_SUMMONING, nameLink.c_str(), "");
if (handler->needReportToTarget(target))
ChatHandler(target).PSendSysMessage(LANG_SUMMONED_BY, handler->playerLink(_player->GetName()).c_str());
ChatHandler(target->GetSession()).PSendSysMessage(LANG_SUMMONED_BY, handler->playerLink(_player->GetName()).c_str());
// stop flight if need
if (target->isInFlight())
@@ -606,7 +610,7 @@ public:
handler->PSendSysMessage(LANG_SUMMONING, plNameLink.c_str(), "");
if (handler->needReportToTarget(player))
ChatHandler(player).PSendSysMessage(LANG_SUMMONED_BY, handler->GetNameLink().c_str());
ChatHandler(player->GetSession()).PSendSysMessage(LANG_SUMMONED_BY, handler->GetNameLink().c_str());
// stop flight if need
if (player->isInFlight())
@@ -1804,7 +1808,7 @@ public:
int64 muteTime = time(NULL) + notSpeakTime * MINUTE;
target->GetSession()->m_muteTime = muteTime;
stmt->setInt64(0, muteTime);
ChatHandler(target).PSendSysMessage(LANG_YOUR_CHAT_DISABLED, notSpeakTime, muteReasonStr.c_str());
ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOUR_CHAT_DISABLED, notSpeakTime, muteReasonStr.c_str());
}
else
{
@@ -1860,7 +1864,7 @@ public:
LoginDatabase.Execute(stmt);
if (target)
ChatHandler(target).PSendSysMessage(LANG_YOUR_CHAT_ENABLED);
ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOUR_CHAT_ENABLED);
std::string nameLink = handler->playerLink(targetName);
@@ -2137,7 +2141,7 @@ public:
handler->PSendSysMessage(LANG_YOU_REPAIR_ITEMS, handler->GetNameLink(target).c_str());
if (handler->needReportToTarget(target))
ChatHandler(target).PSendSysMessage(LANG_YOUR_ITEMS_REPAIRED, handler->GetNameLink().c_str());
ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOUR_ITEMS_REPAIRED, handler->GetNameLink().c_str());
return true;
}
+24 -19
View File
@@ -22,9 +22,14 @@ Comment: All modify related commands
Category: commandscripts
EndScriptData */
#include "ScriptMgr.h"
#include "ObjectMgr.h"
#include "Chat.h"
#include "ObjectMgr.h"
#include "Opcodes.h"
#include "Pet.h"
#include "Player.h"
#include "ReputationMgr.h"
#include "ScriptMgr.h"
class modify_commandscript : public CommandScript
{
@@ -106,7 +111,7 @@ public:
handler->PSendSysMessage(LANG_YOU_CHANGE_HP, handler->GetNameLink(target).c_str(), hp, hpm);
if (handler->needReportToTarget(target))
(ChatHandler(target)).PSendSysMessage(LANG_YOURS_HP_CHANGED, handler->GetNameLink().c_str(), hp, hpm);
ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_HP_CHANGED, handler->GetNameLink().c_str(), hp, hpm);
target->SetMaxHealth(hpm);
target->SetHealth(hp);
@@ -144,7 +149,7 @@ public:
handler->PSendSysMessage(LANG_YOU_CHANGE_MANA, handler->GetNameLink(target).c_str(), mana, manam);
if (handler->needReportToTarget(target))
(ChatHandler(target)).PSendSysMessage(LANG_YOURS_MANA_CHANGED, handler->GetNameLink().c_str(), mana, manam);
ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_MANA_CHANGED, handler->GetNameLink().c_str(), mana, manam);
target->SetMaxPower(POWER_MANA, manam);
target->SetPower(POWER_MANA, mana);
@@ -193,7 +198,7 @@ public:
handler->PSendSysMessage(LANG_YOU_CHANGE_ENERGY, handler->GetNameLink(target).c_str(), energy/10, energym/10);
if (handler->needReportToTarget(target))
(ChatHandler(target)).PSendSysMessage(LANG_YOURS_ENERGY_CHANGED, handler->GetNameLink().c_str(), energy/10, energym/10);
ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_ENERGY_CHANGED, handler->GetNameLink().c_str(), energy/10, energym/10);
target->SetMaxPower(POWER_ENERGY, energym);
target->SetPower(POWER_ENERGY, energy);
@@ -244,7 +249,7 @@ public:
handler->PSendSysMessage(LANG_YOU_CHANGE_RAGE, handler->GetNameLink(target).c_str(), rage/10, ragem/10);
if (handler->needReportToTarget(target))
(ChatHandler(target)).PSendSysMessage(LANG_YOURS_RAGE_CHANGED, handler->GetNameLink().c_str(), rage/10, ragem/10);
ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_RAGE_CHANGED, handler->GetNameLink().c_str(), rage/10, ragem/10);
target->SetMaxPower(POWER_RAGE, ragem);
target->SetPower(POWER_RAGE, rage);
@@ -278,7 +283,7 @@ public:
handler->PSendSysMessage(LANG_YOU_CHANGE_RUNIC_POWER, handler->GetNameLink(target).c_str(), rune/10, runem/10);
if (handler->needReportToTarget(target))
(ChatHandler(target)).PSendSysMessage(LANG_YOURS_RUNIC_POWER_CHANGED, handler->GetNameLink().c_str(), rune/10, runem/10);
ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_RUNIC_POWER_CHANGED, handler->GetNameLink().c_str(), rune/10, runem/10);
target->SetMaxPower(POWER_RUNIC_POWER, runem);
target->SetPower(POWER_RUNIC_POWER, rune);
@@ -408,7 +413,7 @@ public:
handler->PSendSysMessage(LANG_YOU_CHANGE_SPELLFLATID, spellflatid, val, mark, handler->GetNameLink(target).c_str());
if (handler->needReportToTarget(target))
(ChatHandler(target)).PSendSysMessage(LANG_YOURS_SPELLFLATID_CHANGED, handler->GetNameLink().c_str(), spellflatid, val, mark);
ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_SPELLFLATID_CHANGED, handler->GetNameLink().c_str(), spellflatid, val, mark);
WorldPacket data(SMSG_SET_FLAT_SPELL_MODIFIER, (1+1+2+2));
data << uint8(spellflatid);
@@ -504,7 +509,7 @@ public:
handler->PSendSysMessage(LANG_YOU_CHANGE_ASPEED, ASpeed, targetNameLink.c_str());
if (handler->needReportToTarget(target))
(ChatHandler(target)).PSendSysMessage(LANG_YOURS_ASPEED_CHANGED, handler->GetNameLink().c_str(), ASpeed);
ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_ASPEED_CHANGED, handler->GetNameLink().c_str(), ASpeed);
target->SetSpeed(MOVE_WALK, ASpeed, true);
target->SetSpeed(MOVE_RUN, ASpeed, true);
@@ -552,7 +557,7 @@ public:
handler->PSendSysMessage(LANG_YOU_CHANGE_SPEED, Speed, targetNameLink.c_str());
if (handler->needReportToTarget(target))
(ChatHandler(target)).PSendSysMessage(LANG_YOURS_SPEED_CHANGED, handler->GetNameLink().c_str(), Speed);
ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_SPEED_CHANGED, handler->GetNameLink().c_str(), Speed);
target->SetSpeed(MOVE_RUN, Speed, true);
@@ -597,7 +602,7 @@ public:
handler->PSendSysMessage(LANG_YOU_CHANGE_SWIM_SPEED, Swim, targetNameLink.c_str());
if (handler->needReportToTarget(target))
(ChatHandler(target)).PSendSysMessage(LANG_YOURS_SWIM_SPEED_CHANGED, handler->GetNameLink().c_str(), Swim);
ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_SWIM_SPEED_CHANGED, handler->GetNameLink().c_str(), Swim);
target->SetSpeed(MOVE_SWIM, Swim, true);
@@ -642,7 +647,7 @@ public:
handler->PSendSysMessage(LANG_YOU_CHANGE_BACK_SPEED, BSpeed, targetNameLink.c_str());
if (handler->needReportToTarget(target))
(ChatHandler(target)).PSendSysMessage(LANG_YOURS_BACK_SPEED_CHANGED, handler->GetNameLink().c_str(), BSpeed);
ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_BACK_SPEED_CHANGED, handler->GetNameLink().c_str(), BSpeed);
target->SetSpeed(MOVE_RUN_BACK, BSpeed, true);
@@ -678,7 +683,7 @@ public:
handler->PSendSysMessage(LANG_YOU_CHANGE_FLY_SPEED, FSpeed, handler->GetNameLink(target).c_str());
if (handler->needReportToTarget(target))
(ChatHandler(target)).PSendSysMessage(LANG_YOURS_FLY_SPEED_CHANGED, handler->GetNameLink().c_str(), FSpeed);
ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_FLY_SPEED_CHANGED, handler->GetNameLink().c_str(), FSpeed);
target->SetSpeed(MOVE_FLIGHT, FSpeed, true);
@@ -715,7 +720,7 @@ public:
handler->PSendSysMessage(LANG_YOU_CHANGE_SIZE, Scale, handler->GetNameLink(player).c_str());
if (handler->needReportToTarget(player))
(ChatHandler(player)).PSendSysMessage(LANG_YOURS_SIZE_CHANGED, handler->GetNameLink().c_str(), Scale);
ChatHandler(player->GetSession()).PSendSysMessage(LANG_YOURS_SIZE_CHANGED, handler->GetNameLink().c_str(), Scale);
}
target->SetObjectScale(Scale);
@@ -963,7 +968,7 @@ public:
handler->PSendSysMessage(LANG_YOU_GIVE_MOUNT, handler->GetNameLink(target).c_str());
if (handler->needReportToTarget(target))
(ChatHandler(target)).PSendSysMessage(LANG_MOUNT_GIVED, handler->GetNameLink().c_str());
ChatHandler(target->GetSession()).PSendSysMessage(LANG_MOUNT_GIVED, handler->GetNameLink().c_str());
target->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP);
target->Mount(mId);
@@ -1019,7 +1024,7 @@ public:
{
handler->PSendSysMessage(LANG_YOU_TAKE_ALL_MONEY, handler->GetNameLink(target).c_str());
if (handler->needReportToTarget(target))
(ChatHandler(target)).PSendSysMessage(LANG_YOURS_ALL_MONEY_GONE, handler->GetNameLink().c_str());
ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_ALL_MONEY_GONE, handler->GetNameLink().c_str());
target->SetMoney(0);
}
@@ -1030,7 +1035,7 @@ public:
handler->PSendSysMessage(LANG_YOU_TAKE_MONEY, abs(moneyToAdd), handler->GetNameLink(target).c_str());
if (handler->needReportToTarget(target))
(ChatHandler(target)).PSendSysMessage(LANG_YOURS_MONEY_TAKEN, handler->GetNameLink().c_str(), abs(moneyToAdd));
ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_MONEY_TAKEN, handler->GetNameLink().c_str(), abs(moneyToAdd));
target->SetMoney(newmoney);
}
}
@@ -1038,7 +1043,7 @@ public:
{
handler->PSendSysMessage(LANG_YOU_GIVE_MONEY, moneyToAdd, handler->GetNameLink(target).c_str());
if (handler->needReportToTarget(target))
(ChatHandler(target)).PSendSysMessage(LANG_YOURS_MONEY_GIVEN, handler->GetNameLink().c_str(), moneyToAdd);
ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_MONEY_GIVEN, handler->GetNameLink().c_str(), moneyToAdd);
if (moneyToAdd >= MAX_MONEY_AMOUNT)
target->SetMoney(MAX_MONEY_AMOUNT);
@@ -1378,7 +1383,7 @@ public:
handler->PSendSysMessage(LANG_YOU_CHANGE_GENDER, handler->GetNameLink(target).c_str(), gender_full);
if (handler->needReportToTarget(target))
(ChatHandler(target)).PSendSysMessage(LANG_YOUR_GENDER_CHANGED, gender_full, handler->GetNameLink().c_str());
ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOUR_GENDER_CHANGED, gender_full, handler->GetNameLink().c_str());
return true;
}
+3
View File
@@ -27,8 +27,11 @@ EndScriptData */
#include "Chat.h"
#include "Transport.h"
#include "CreatureGroups.h"
#include "Language.h"
#include "TargetedMovementGenerator.h" // for HandleNpcUnFollowCommand
#include "CreatureAI.h"
#include "Player.h"
#include "Pet.h"
class npc_commandscript : public CommandScript
{
+4 -2
View File
@@ -22,9 +22,11 @@ Comment: All quest related commands
Category: commandscripts
EndScriptData */
#include "ScriptMgr.h"
#include "ObjectMgr.h"
#include "Chat.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "ReputationMgr.h"
#include "ScriptMgr.h"
class quest_commandscript : public CommandScript
{
+13 -21
View File
@@ -22,22 +22,24 @@ Comment: All reload related commands
Category: commandscripts
EndScriptData */
#include "ScriptMgr.h"
#include "ObjectMgr.h"
#include "SpellMgr.h"
#include "TicketMgr.h"
#include "MapManager.h"
#include "CreatureEventAIMgr.h"
#include "DisableMgr.h"
#include "LFGMgr.h"
#include "AchievementMgr.h"
#include "AuctionHouseMgr.h"
#include "Chat.h"
#include "CreatureEventAIMgr.h"
#include "CreatureTextMgr.h"
#include "SmartAI.h"
#include "DisableMgr.h"
#include "Language.h"
#include "LFGMgr.h"
#include "MapManager.h"
#include "ObjectMgr.h"
#include "ScriptMgr.h"
#include "SkillDiscovery.h"
#include "SkillExtraItems.h"
#include "Chat.h"
#include "WaypointManager.h"
#include "SmartAI.h"
#include "SpellMgr.h"
#include "TicketMgr.h"
#include "WardenCheckMgr.h"
#include "WaypointManager.h"
class reload_commandscript : public CommandScript
{
@@ -78,7 +80,6 @@ public:
{ "config", SEC_ADMINISTRATOR, true, &HandleReloadConfigCommand, "", NULL },
{ "creature_text", SEC_ADMINISTRATOR, true, &HandleReloadCreatureText, "", NULL },
{ "creature_ai_scripts", SEC_ADMINISTRATOR, true, &HandleReloadEventAIScriptsCommand, "", NULL },
{ "creature_ai_summons", SEC_ADMINISTRATOR, true, &HandleReloadEventAISummonsCommand, "", NULL },
{ "creature_ai_texts", SEC_ADMINISTRATOR, true, &HandleReloadEventAITextsCommand, "", NULL },
{ "creature_involvedrelation", SEC_ADMINISTRATOR, true, &HandleReloadCreatureQuestInvRelationsCommand, "", NULL },
{ "creature_linked_respawn", SEC_GAMEMASTER, true, &HandleReloadLinkedRespawnCommand, "", NULL },
@@ -276,7 +277,6 @@ public:
static bool HandleReloadAllEventAICommand(ChatHandler* handler, const char* /*args*/)
{
HandleReloadEventAITextsCommand(handler, "a");
HandleReloadEventAISummonsCommand(handler, "a");
HandleReloadEventAIScriptsCommand(handler, "a");
return true;
}
@@ -1037,14 +1037,6 @@ public:
return true;
}
static bool HandleReloadEventAISummonsCommand(ChatHandler* handler, const char* /*args*/)
{
sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Summons from `creature_ai_summons`...");
sEventAIMgr->LoadCreatureEventAI_Summons();
handler->SendGlobalGMSysMessage("DB table `creature_ai_summons` reloaded.");
return true;
}
static bool HandleReloadEventAIScriptsCommand(ChatHandler* handler, const char* /*args*/)
{
sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Scripts from `creature_ai_scripts`...");
+8 -4
View File
@@ -22,9 +22,13 @@ Comment: All reset related commands
Category: commandscripts
EndScriptData */
#include "ScriptMgr.h"
#include "AchievementMgr.h"
#include "Chat.h"
#include "Language.h"
#include "ObjectAccessor.h"
#include "Player.h"
#include "Pet.h"
#include "ScriptMgr.h"
class reset_commandscript : public CommandScript
{
@@ -168,7 +172,7 @@ public:
{
target->resetSpells(/* bool myClassOnly */);
ChatHandler(target).SendSysMessage(LANG_RESET_SPELLS);
ChatHandler(target->GetSession()).SendSysMessage(LANG_RESET_SPELLS);
if (!handler->GetSession() || handler->GetSession()->GetPlayer() != target)
handler->PSendSysMessage(LANG_RESET_SPELLS_ONLINE, handler->GetNameLink(target).c_str());
}
@@ -220,7 +224,7 @@ public:
creature->ToPet()->resetTalents();
owner->ToPlayer()->SendTalentsInfoData(true);
ChatHandler(owner->ToPlayer()).SendSysMessage(LANG_RESET_PET_TALENTS);
ChatHandler(owner->ToPlayer()->GetSession()).SendSysMessage(LANG_RESET_PET_TALENTS);
if (!handler->GetSession() || handler->GetSession()->GetPlayer() != owner->ToPlayer())
handler->PSendSysMessage(LANG_RESET_PET_TALENTS_ONLINE, handler->GetNameLink(owner->ToPlayer()).c_str());
}
@@ -236,7 +240,7 @@ public:
{
target->resetTalents(true);
target->SendTalentsInfoData(false);
ChatHandler(target).SendSysMessage(LANG_RESET_TALENTS);
ChatHandler(target->GetSession()).SendSysMessage(LANG_RESET_TALENTS);
if (!handler->GetSession() || handler->GetSession()->GetPlayer() != target)
handler->PSendSysMessage(LANG_RESET_TALENTS_ONLINE, handler->GetNameLink(target).c_str());
+4 -2
View File
@@ -22,11 +22,13 @@ Comment: All server related commands
Category: commandscripts
EndScriptData */
#include "ScriptMgr.h"
#include "Chat.h"
#include "SystemConfig.h"
#include "Config.h"
#include "Language.h"
#include "ObjectAccessor.h"
#include "Player.h"
#include "ScriptMgr.h"
#include "SystemConfig.h"
class server_commandscript : public CommandScript
{
+7 -5
View File
@@ -22,11 +22,13 @@ Comment: All tele related commands
Category: commandscripts
EndScriptData */
#include "ScriptMgr.h"
#include "ObjectMgr.h"
#include "MapManager.h"
#include "Chat.h"
#include "Group.h"
#include "Language.h"
#include "MapManager.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "ScriptMgr.h"
class tele_commandscript : public CommandScript
{
@@ -178,7 +180,7 @@ public:
handler->PSendSysMessage(LANG_TELEPORTING_TO, chrNameLink.c_str(), "", tele->name.c_str());
if (handler->needReportToTarget(target))
(ChatHandler(target)).PSendSysMessage(LANG_TELEPORTED_TO_BY, handler->GetNameLink().c_str());
ChatHandler(target->GetSession()).PSendSysMessage(LANG_TELEPORTED_TO_BY, handler->GetNameLink().c_str());
// stop flight if need
if (target->isInFlight())
@@ -274,7 +276,7 @@ public:
handler->PSendSysMessage(LANG_TELEPORTING_TO, plNameLink.c_str(), "", tele->name.c_str());
if (handler->needReportToTarget(player))
(ChatHandler(player)).PSendSysMessage(LANG_TELEPORTED_TO_BY, nameLink.c_str());
ChatHandler(player->GetSession()).PSendSysMessage(LANG_TELEPORTED_TO_BY, nameLink.c_str());
// stop flight if need
if (player->isInFlight())
+5 -2
View File
@@ -22,11 +22,14 @@ Comment: All ticket related commands
Category: commandscripts
EndScriptData */
#include "ScriptMgr.h"
#include "Chat.h"
#include "AccountMgr.h"
#include "Chat.h"
#include "Language.h"
#include "ObjectMgr.h"
#include "Opcodes.h"
#include "Player.h"
#include "TicketMgr.h"
#include "ScriptMgr.h"
class ticket_commandscript : public CommandScript
{
+4 -2
View File
@@ -22,9 +22,11 @@ Comment: All titles related commands
Category: commandscripts
EndScriptData */
#include "ScriptMgr.h"
#include "ObjectMgr.h"
#include "Chat.h"
#include "Language.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "ScriptMgr.h"
class titles_commandscript : public CommandScript
{
+6 -4
View File
@@ -22,10 +22,12 @@ Comment: All wp related commands
Category: commandscripts
EndScriptData */
#include "ScriptMgr.h"
#include "ObjectMgr.h"
#include "WaypointManager.h"
#include "Chat.h"
#include "Language.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "ScriptMgr.h"
#include "WaypointManager.h"
class wp_commandscript : public CommandScript
{
@@ -941,7 +943,7 @@ public:
{
wpCreature->SetDisplayId(target->GetDisplayId());
wpCreature->SetObjectScale(0.5f);
wpCreature->SetLevel(point > STRONG_MAX_LEVEL ? STRONG_MAX_LEVEL : point);
wpCreature->SetLevel(std::min<uint32>(point, STRONG_MAX_LEVEL));
}
}
while (result->NextRow());