aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/scripts')
-rw-r--r--src/server/scripts/Commands/cs_character.cpp4
-rw-r--r--src/server/scripts/Commands/cs_debug.cpp8
-rw-r--r--src/server/scripts/Commands/cs_gm.cpp9
-rw-r--r--src/server/scripts/Commands/cs_list.cpp2
-rw-r--r--src/server/scripts/Commands/cs_lookup.cpp459
-rw-r--r--src/server/scripts/Commands/cs_misc.cpp10
-rw-r--r--src/server/scripts/Commands/cs_modify.cpp30
-rw-r--r--src/server/scripts/Commands/cs_reload.cpp47
-rw-r--r--src/server/scripts/Commands/cs_reset.cpp7
-rw-r--r--src/server/scripts/Commands/cs_titles.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp6
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp4
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp16
-rwxr-xr-xsrc/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp1
-rwxr-xr-xsrc/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp2
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp1
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp2
-rw-r--r--src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp6
-rw-r--r--src/server/scripts/Spells/spell_druid.cpp2
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp13
-rw-r--r--src/server/scripts/Spells/spell_pet.cpp18
-rw-r--r--src/server/scripts/Spells/spell_rogue.cpp3
-rw-r--r--src/server/scripts/World/npc_professions.cpp6
-rw-r--r--src/server/scripts/World/npcs_special.cpp8
26 files changed, 255 insertions, 421 deletions
diff --git a/src/server/scripts/Commands/cs_character.cpp b/src/server/scripts/Commands/cs_character.cpp
index f5fbfa33cae..87948391500 100644
--- a/src/server/scripts/Commands/cs_character.cpp
+++ b/src/server/scripts/Commands/cs_character.cpp
@@ -275,7 +275,7 @@ public:
if (titleInfo && target->HasTitle(titleInfo))
{
- std::string name = titleInfo->name[loc];
+ std::string name = titleInfo->name;
if (name.empty())
continue;
@@ -471,7 +471,7 @@ public:
{
FactionState const& faction = itr->second;
FactionEntry const* factionEntry = sFactionStore.LookupEntry(faction.ID);
- char const* factionName = factionEntry ? factionEntry->name[loc] : "#Not found#";
+ char const* factionName = factionEntry ? factionEntry->name : "#Not found#";
ReputationRank rank = target->GetReputationMgr().GetRank(factionEntry);
std::string rankName = handler->GetTrinityString(ReputationRankStrIndex[rank]);
std::ostringstream ss;
diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp
index 7f25a11bcdd..67b4d780942 100644
--- a/src/server/scripts/Commands/cs_debug.cpp
+++ b/src/server/scripts/Commands/cs_debug.cpp
@@ -236,7 +236,7 @@ public:
return false;
SellResult msg = SellResult(atoi(args));
- handler->GetSession()->GetPlayer()->SendSellError(msg, 0, 0, 0);
+ handler->GetSession()->GetPlayer()->SendSellError(msg, 0, 0);
return true;
}
@@ -310,7 +310,7 @@ public:
uint32 opcode;
parsedStream >> opcode;
- WorldPacket data(opcode, 0);
+ WorldPacket data(Opcodes(opcode), 0);
while (!parsedStream.eof())
{
@@ -416,7 +416,7 @@ public:
}
sLog->outDebug(LOG_FILTER_NETWORKIO, "Sending opcode %u", data.GetOpcode());
data.hexlike();
- player->GetSession()->SendPacket(&data);
+ player->GetSession()->SendPacket(&data, true);
handler->PSendSysMessage(LANG_COMMAND_OPCODESENT, data.GetOpcode(), unit->GetName());
return true;
}
@@ -1325,7 +1325,7 @@ public:
{
Player* player = handler->GetSession()->GetPlayer();
- sLog->outInfo(LOG_FILTER_SQL_DEV, "(@PATH, XX, %.3f, %.3f, %.5f, 0,0, 0,100, 0),", player->GetPositionX(), player->GetPositionY(), player->GetPositionZ());
+ sLog->outInfo(LOG_FILTER_SQL_DEV, "(@PATH, XX, %.3f, %.3f, %.5f, 0, 0, 0, 100, 0),", player->GetPositionX(), player->GetPositionY(), player->GetPositionZ());
handler->PSendSysMessage("Waypoint SQL written to SQL Developer log");
return true;
diff --git a/src/server/scripts/Commands/cs_gm.cpp b/src/server/scripts/Commands/cs_gm.cpp
index 3dfc6f9c7e8..0230ebcd1e7 100644
--- a/src/server/scripts/Commands/cs_gm.cpp
+++ b/src/server/scripts/Commands/cs_gm.cpp
@@ -96,19 +96,16 @@ public:
if (!target)
target = handler->GetSession()->GetPlayer();
- WorldPacket data(12);
+ WorldPacket data;
if (strncmp(args, "on", 3) == 0)
- data.SetOpcode(SMSG_MOVE_SET_CAN_FLY);
+ target->SendMovementSetCanFly(true);
else if (strncmp(args, "off", 4) == 0)
- data.SetOpcode(SMSG_MOVE_UNSET_CAN_FLY);
+ target->SendMovementSetCanFly(false);
else
{
handler->SendSysMessage(LANG_USE_BOL);
return false;
}
- data.append(target->GetPackGUID());
- data << uint32(0); // unknown
- target->SendMessageToSet(&data, true);
handler->PSendSysMessage(LANG_COMMAND_FLYMODE_STATUS, handler->GetNameLink(target).c_str(), args);
return true;
}
diff --git a/src/server/scripts/Commands/cs_list.cpp b/src/server/scripts/Commands/cs_list.cpp
index 5c16a0963d3..5a0fd28e81a 100644
--- a/src/server/scripts/Commands/cs_list.cpp
+++ b/src/server/scripts/Commands/cs_list.cpp
@@ -435,7 +435,7 @@ public:
AuraApplication const* aurApp = itr->second;
Aura const* aura = aurApp->GetBase();
- char const* name = aura->GetSpellInfo()->SpellName[handler->GetSessionDbcLocale()];
+ char const* name = aura->GetSpellInfo()->SpellName;
std::ostringstream ss_name;
ss_name << "|cffffffff|Hspell:" << aura->GetId() << "|h[" << name << "]|h|r";
diff --git a/src/server/scripts/Commands/cs_lookup.cpp b/src/server/scripts/Commands/cs_lookup.cpp
index 951ebc7714b..3a2ef366ace 100644
--- a/src/server/scripts/Commands/cs_lookup.cpp
+++ b/src/server/scripts/Commands/cs_lookup.cpp
@@ -94,48 +94,30 @@ public:
AreaTableEntry const* areaEntry = sAreaStore.LookupEntry(areaflag);
if (areaEntry)
{
- int locale = handler->GetSessionDbcLocale();
- std::string name = areaEntry->area_name[locale];
+ std::string name = areaEntry->area_name;
if (name.empty())
continue;
if (!Utf8FitTo(name, wNamePart))
- {
- locale = 0;
- for (; locale < TOTAL_LOCALES; ++locale)
- {
- if (locale == handler->GetSessionDbcLocale())
- continue;
-
- name = areaEntry->area_name[locale];
- if (name.empty())
- continue;
-
- if (Utf8FitTo(name, wNamePart))
- break;
- }
- }
+ continue;
- if (locale < TOTAL_LOCALES)
+ if (maxResults && count++ == maxResults)
{
- if (maxResults && count++ == maxResults)
- {
- handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
- return true;
- }
+ handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
+ return true;
+ }
- // send area in "id - [name]" format
- std::ostringstream ss;
- if (handler->GetSession())
- ss << areaEntry->ID << " - |cffffffff|Harea:" << areaEntry->ID << "|h[" << name << ' ' << localeNames[locale]<< "]|h|r";
- else
- ss << areaEntry->ID << " - " << name << ' ' << localeNames[locale];
+ // send area in "id - [name]" format
+ std::ostringstream ss;
+ if (handler->GetSession())
+ ss << areaEntry->ID << " - |cffffffff|Harea:" << areaEntry->ID << "|h[" << name<< "]|h|r";
+ else
+ ss << areaEntry->ID << " - " << name;
- handler->SendSysMessage(ss.str().c_str());
+ handler->SendSysMessage(ss.str().c_str());
- if (!found)
- found = true;
- }
+ if (!found)
+ found = true;
}
}
@@ -301,77 +283,58 @@ public:
for (uint32 id = 0; id < sFactionStore.GetNumRows(); ++id)
{
- FactionEntry const* factionEntry = sFactionStore.LookupEntry(id);
- if (factionEntry)
+ if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(id))
{
FactionState const* factionState = target ? target->GetReputationMgr().GetState(factionEntry) : NULL;
- int locale = handler->GetSessionDbcLocale();
- std::string name = factionEntry->name[locale];
+ std::string name = factionEntry->name;
if (name.empty())
continue;
if (!Utf8FitTo(name, wNamePart))
- {
- locale = 0;
- for (; locale < TOTAL_LOCALES; ++locale)
- {
- if (locale == handler->GetSessionDbcLocale())
- continue;
-
- name = factionEntry->name[locale];
- if (name.empty())
- continue;
-
- if (Utf8FitTo(name, wNamePart))
- break;
- }
- }
+ continue;
- if (locale < TOTAL_LOCALES)
+ if (maxResults && count++ == maxResults)
{
- if (maxResults && count++ == maxResults)
- {
- handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
- return true;
- }
+ handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
+ return true;
+ }
- // send faction in "id - [faction] rank reputation [visible] [at war] [own team] [unknown] [invisible] [inactive]" format
- // or "id - [faction] [no reputation]" format
- std::ostringstream ss;
- if (handler->GetSession())
- ss << id << " - |cffffffff|Hfaction:" << id << "|h[" << name << ' ' << localeNames[locale] << "]|h|r";
- else
- ss << id << " - " << name << ' ' << localeNames[locale];
+ // send faction in "id - [faction] rank reputation [visible] [at war] [own team] [unknown] [invisible] [inactive]" format
+ // or "id - [faction] [no reputation]" format
+ std::ostringstream ss;
+ if (handler->GetSession())
+ ss << id << " - |cffffffff|Hfaction:" << id << "|h[" << name << "]|h|r";
+ else
+ ss << id << " - " << name;
- if (factionState) // and then target != NULL also
- {
- uint32 index = target->GetReputationMgr().GetReputationRankStrIndex(factionEntry);
- std::string rankName = handler->GetTrinityString(index);
-
- ss << ' ' << rankName << "|h|r (" << target->GetReputationMgr().GetReputation(factionEntry) << ')';
-
- if (factionState->Flags & FACTION_FLAG_VISIBLE)
- ss << handler->GetTrinityString(LANG_FACTION_VISIBLE);
- if (factionState->Flags & FACTION_FLAG_AT_WAR)
- ss << handler->GetTrinityString(LANG_FACTION_ATWAR);
- if (factionState->Flags & FACTION_FLAG_PEACE_FORCED)
- ss << handler->GetTrinityString(LANG_FACTION_PEACE_FORCED);
- if (factionState->Flags & FACTION_FLAG_HIDDEN)
- ss << handler->GetTrinityString(LANG_FACTION_HIDDEN);
- if (factionState->Flags & FACTION_FLAG_INVISIBLE_FORCED)
- ss << handler->GetTrinityString(LANG_FACTION_INVISIBLE_FORCED);
- if (factionState->Flags & FACTION_FLAG_INACTIVE)
- ss << handler->GetTrinityString(LANG_FACTION_INACTIVE);
- }
- else
- ss << handler->GetTrinityString(LANG_FACTION_NOREPUTATION);
+ if (factionState) // and then target != NULL also
+ {
+ uint32 index = target->GetReputationMgr().GetReputationRankStrIndex(factionEntry);
+ std::string rankName = handler->GetTrinityString(index);
+
+ ss << ' ' << rankName << "|h|r (" << target->GetReputationMgr().GetReputation(factionEntry) << ')';
+
+ if (factionState->Flags & FACTION_FLAG_VISIBLE)
+ ss << handler->GetTrinityString(LANG_FACTION_VISIBLE);
+ if (factionState->Flags & FACTION_FLAG_AT_WAR)
+ ss << handler->GetTrinityString(LANG_FACTION_ATWAR);
+ if (factionState->Flags & FACTION_FLAG_PEACE_FORCED)
+ ss << handler->GetTrinityString(LANG_FACTION_PEACE_FORCED);
+ if (factionState->Flags & FACTION_FLAG_HIDDEN)
+ ss << handler->GetTrinityString(LANG_FACTION_HIDDEN);
+ if (factionState->Flags & FACTION_FLAG_INVISIBLE_FORCED)
+ ss << handler->GetTrinityString(LANG_FACTION_INVISIBLE_FORCED);
+ if (factionState->Flags & FACTION_FLAG_INACTIVE)
+ ss << handler->GetTrinityString(LANG_FACTION_INACTIVE);
+ }
+ else
+ ss << handler->GetTrinityString(LANG_FACTION_NOREPUTATION);
- handler->SendSysMessage(ss.str().c_str());
+ handler->SendSysMessage(ss.str().c_str());
- if (!found)
- found = true;
- }
+ if (!found)
+ found = true;
}
}
@@ -486,45 +449,27 @@ public:
ItemSetEntry const* set = sItemSetStore.LookupEntry(id);
if (set)
{
- int locale = handler->GetSessionDbcLocale();
- std::string name = set->name[locale];
+ std::string name = set->name;
if (name.empty())
continue;
if (!Utf8FitTo(name, wNamePart))
- {
- locale = 0;
- for (; locale < TOTAL_LOCALES; ++locale)
- {
- if (locale == handler->GetSessionDbcLocale())
- continue;
-
- name = set->name[locale];
- if (name.empty())
- continue;
-
- if (Utf8FitTo(name, wNamePart))
- break;
- }
- }
+ continue;
- if (locale < TOTAL_LOCALES)
+ if (maxResults && count++ == maxResults)
{
- if (maxResults && count++ == maxResults)
- {
- handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
- return true;
- }
+ handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
+ return true;
+ }
- // send item set in "id - [namedlink locale]" format
- if (handler->GetSession())
- handler->PSendSysMessage(LANG_ITEMSET_LIST_CHAT, id, id, name.c_str(), localeNames[locale]);
- else
- handler->PSendSysMessage(LANG_ITEMSET_LIST_CONSOLE, id, name.c_str(), localeNames[locale]);
+ // send item set in "id - [namedlink locale]" format
+ if (handler->GetSession())
+ handler->PSendSysMessage(LANG_ITEMSET_LIST_CHAT, id, id, name.c_str(), "");
+ else
+ handler->PSendSysMessage(LANG_ITEMSET_LIST_CONSOLE, id, name.c_str(), "");
- if (!found)
- found = true;
- }
+ if (!found)
+ found = true;
}
}
if (!found)
@@ -767,59 +712,41 @@ public:
SkillLineEntry const* skillInfo = sSkillLineStore.LookupEntry(id);
if (skillInfo)
{
- int locale = handler->GetSessionDbcLocale();
- std::string name = skillInfo->name[locale];
+ std::string name = skillInfo->name;
if (name.empty())
continue;
if (!Utf8FitTo(name, wNamePart))
- {
- locale = 0;
- for (; locale < TOTAL_LOCALES; ++locale)
- {
- if (locale == handler->GetSessionDbcLocale())
- continue;
-
- name = skillInfo->name[locale];
- if (name.empty())
- continue;
+ continue;
- if (Utf8FitTo(name, wNamePart))
- break;
- }
+ if (maxResults && count++ == maxResults)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
+ return true;
}
- if (locale < TOTAL_LOCALES)
+ char valStr[50] = "";
+ char const* knownStr = "";
+ if (target && target->HasSkill(id))
{
- if (maxResults && count++ == maxResults)
- {
- handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
- return true;
- }
-
- char valStr[50] = "";
- char const* knownStr = "";
- if (target && target->HasSkill(id))
- {
- knownStr = handler->GetTrinityString(LANG_KNOWN);
- uint32 curValue = target->GetPureSkillValue(id);
- uint32 maxValue = target->GetPureMaxSkillValue(id);
- uint32 permValue = target->GetSkillPermBonusValue(id);
- uint32 tempValue = target->GetSkillTempBonusValue(id);
-
- char const* valFormat = handler->GetTrinityString(LANG_SKILL_VALUES);
- snprintf(valStr, 50, valFormat, curValue, maxValue, permValue, tempValue);
- }
+ knownStr = handler->GetTrinityString(LANG_KNOWN);
+ uint32 curValue = target->GetPureSkillValue(id);
+ uint32 maxValue = target->GetPureMaxSkillValue(id);
+ uint32 permValue = target->GetSkillPermBonusValue(id);
+ uint32 tempValue = target->GetSkillTempBonusValue(id);
+
+ char const* valFormat = handler->GetTrinityString(LANG_SKILL_VALUES);
+ snprintf(valStr, 50, valFormat, curValue, maxValue, permValue, tempValue);
+ }
- // send skill in "id - [namedlink locale]" format
- if (handler->GetSession())
- handler->PSendSysMessage(LANG_SKILL_LIST_CHAT, id, id, name.c_str(), localeNames[locale], knownStr, valStr);
- else
- handler->PSendSysMessage(LANG_SKILL_LIST_CONSOLE, id, name.c_str(), localeNames[locale], knownStr, valStr);
+ // send skill in "id - [namedlink locale]" format
+ if (handler->GetSession())
+ handler->PSendSysMessage(LANG_SKILL_LIST_CHAT, id, id, name.c_str(), "", knownStr, valStr);
+ else
+ handler->PSendSysMessage(LANG_SKILL_LIST_CONSOLE, id, name.c_str(), "", knownStr, valStr);
- if (!found)
- found = true;
- }
+ if (!found)
+ found = true;
}
}
if (!found)
@@ -855,83 +782,63 @@ public:
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(id);
if (spellInfo)
{
- int locale = handler->GetSessionDbcLocale();
- std::string name = spellInfo->SpellName[locale];
+ std::string name = spellInfo->SpellName;
if (name.empty())
continue;
if (!Utf8FitTo(name, wNamePart))
- {
- locale = 0;
- for (; locale < TOTAL_LOCALES; ++locale)
- {
- if (locale == handler->GetSessionDbcLocale())
- continue;
-
- name = spellInfo->SpellName[locale];
- if (name.empty())
- continue;
-
- if (Utf8FitTo(name, wNamePart))
- break;
- }
- }
+ continue;
- if (locale < TOTAL_LOCALES)
+ if (maxResults && count++ == maxResults)
{
- if (maxResults && count++ == maxResults)
- {
- handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
- return true;
- }
+ handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
+ return true;
+ }
- bool known = target && target->HasSpell(id);
- bool learn = (spellInfo->Effects[0].Effect == SPELL_EFFECT_LEARN_SPELL);
+ bool known = target && target->HasSpell(id);
+ bool learn = (spellInfo->Effects[0].Effect == SPELL_EFFECT_LEARN_SPELL);
- SpellInfo const* learnSpellInfo = sSpellMgr->GetSpellInfo(spellInfo->Effects[0].TriggerSpell);
+ SpellInfo const* learnSpellInfo = sSpellMgr->GetSpellInfo(spellInfo->Effects[0].TriggerSpell);
- uint32 talentCost = GetTalentSpellCost(id);
+ uint32 talentCost = GetTalentSpellCost(id);
- bool talent = (talentCost > 0);
- bool passive = spellInfo->IsPassive();
- bool active = target && target->HasAura(id);
+ bool talent = (talentCost > 0);
+ bool passive = spellInfo->IsPassive();
+ bool active = target && target->HasAura(id);
- // unit32 used to prevent interpreting uint8 as char at output
- // find rank of learned spell for learning spell, or talent rank
- uint32 rank = talentCost ? talentCost : learn && learnSpellInfo ? learnSpellInfo->GetRank() : spellInfo->GetRank();
+ // unit32 used to prevent interpreting uint8 as char at output
+ // find rank of learned spell for learning spell, or talent rank
+ uint32 rank = talentCost ? talentCost : learn && learnSpellInfo ? learnSpellInfo->GetRank() : spellInfo->GetRank();
- // send spell in "id - [name, rank N] [talent] [passive] [learn] [known]" format
- std::ostringstream ss;
- if (handler->GetSession())
- ss << id << " - |cffffffff|Hspell:" << id << "|h[" << name;
- else
- ss << id << " - " << name;
+ // send spell in "id - [name, rank N] [talent] [passive] [learn] [known]" format
+ std::ostringstream ss;
+ if (handler->GetSession())
+ ss << id << " - |cffffffff|Hspell:" << id << "|h[" << name;
+ else
+ ss << id << " - " << name;
- // include rank in link name
- if (rank)
- ss << handler->GetTrinityString(LANG_SPELL_RANK) << rank;
+ // include rank in link name
+ if (rank)
+ ss << handler->GetTrinityString(LANG_SPELL_RANK) << rank;
- if (handler->GetSession())
- ss << ' ' << localeNames[locale] << "]|h|r";
- else
- ss << ' ' << localeNames[locale];
+ if (handler->GetSession())
+ ss << "]|h|r";
- if (talent)
- ss << handler->GetTrinityString(LANG_TALENT);
- if (passive)
- ss << handler->GetTrinityString(LANG_PASSIVE);
- if (learn)
- ss << handler->GetTrinityString(LANG_LEARN);
- if (known)
- ss << handler->GetTrinityString(LANG_KNOWN);
- if (active)
- ss << handler->GetTrinityString(LANG_ACTIVE);
+ if (talent)
+ ss << handler->GetTrinityString(LANG_TALENT);
+ if (passive)
+ ss << handler->GetTrinityString(LANG_PASSIVE);
+ if (learn)
+ ss << handler->GetTrinityString(LANG_LEARN);
+ if (known)
+ ss << handler->GetTrinityString(LANG_KNOWN);
+ if (active)
+ ss << handler->GetTrinityString(LANG_ACTIVE);
- handler->SendSysMessage(ss.str().c_str());
+ handler->SendSysMessage(ss.str().c_str());
- if (!found)
- found = true;
- }
+ if (!found)
+ found = true;
}
}
if (!found)
@@ -964,47 +871,29 @@ public:
TaxiNodesEntry const* nodeEntry = sTaxiNodesStore.LookupEntry(id);
if (nodeEntry)
{
- int locale = handler->GetSessionDbcLocale();
- std::string name = nodeEntry->name[locale];
+ std::string name = nodeEntry->name;
if (name.empty())
continue;
if (!Utf8FitTo(name, wNamePart))
- {
- locale = 0;
- for (; locale < TOTAL_LOCALES; ++locale)
- {
- if (locale == handler->GetSessionDbcLocale())
- continue;
-
- name = nodeEntry->name[locale];
- if (name.empty())
- continue;
-
- if (Utf8FitTo(name, wNamePart))
- break;
- }
- }
+ continue;
- if (locale < TOTAL_LOCALES)
+ if (maxResults && count++ == maxResults)
{
- if (maxResults && count++ == maxResults)
- {
- handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
- return true;
- }
+ handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
+ return true;
+ }
- // send taxinode in "id - [name] (Map:m X:x Y:y Z:z)" format
- if (handler->GetSession())
- handler->PSendSysMessage(LANG_TAXINODE_ENTRY_LIST_CHAT, id, id, name.c_str(), localeNames[locale],
- nodeEntry->map_id, nodeEntry->x, nodeEntry->y, nodeEntry->z);
- else
- handler->PSendSysMessage(LANG_TAXINODE_ENTRY_LIST_CONSOLE, id, name.c_str(), localeNames[locale],
- nodeEntry->map_id, nodeEntry->x, nodeEntry->y, nodeEntry->z);
+ // send taxinode in "id - [name] (Map:m X:x Y:y Z:z)" format
+ if (handler->GetSession())
+ handler->PSendSysMessage(LANG_TAXINODE_ENTRY_LIST_CHAT, id, id, name.c_str(), "",
+ nodeEntry->map_id, nodeEntry->x, nodeEntry->y, nodeEntry->z);
+ else
+ handler->PSendSysMessage(LANG_TAXINODE_ENTRY_LIST_CONSOLE, id, name.c_str(), "",
+ nodeEntry->map_id, nodeEntry->x, nodeEntry->y, nodeEntry->z);
- if (!found)
- found = true;
- }
+ if (!found)
+ found = true;
}
}
if (!found)
@@ -1101,53 +990,35 @@ public:
CharTitlesEntry const* titleInfo = sCharTitlesStore.LookupEntry(id);
if (titleInfo)
{
- int locale = handler->GetSessionDbcLocale();
- std::string name = titleInfo->name[locale];
+ std::string name = titleInfo->name;
if (name.empty())
continue;
if (!Utf8FitTo(name, wNamePart))
- {
- locale = 0;
- for (; locale < TOTAL_LOCALES; ++locale)
- {
- if (locale == handler->GetSessionDbcLocale())
- continue;
-
- name = titleInfo->name[locale];
- if (name.empty())
- continue;
-
- if (Utf8FitTo(name, wNamePart))
- break;
- }
- }
+ continue;
- if (locale < TOTAL_LOCALES)
+ if (maxResults && counter == maxResults)
{
- if (maxResults && counter == maxResults)
- {
- handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
- return true;
- }
+ handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
+ return true;
+ }
- char const* knownStr = target && target->HasTitle(titleInfo) ? handler->GetTrinityString(LANG_KNOWN) : "";
+ char const* knownStr = target && target->HasTitle(titleInfo) ? handler->GetTrinityString(LANG_KNOWN) : "";
- char const* activeStr = target && target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->bit_index
- ? handler->GetTrinityString(LANG_ACTIVE)
- : "";
+ char const* activeStr = target && target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->bit_index
+ ? handler->GetTrinityString(LANG_ACTIVE)
+ : "";
- char titleNameStr[80];
- snprintf(titleNameStr, 80, name.c_str(), targetName);
+ char titleNameStr[80];
+ snprintf(titleNameStr, 80, name.c_str(), targetName);
- // send title in "id (idx:idx) - [namedlink locale]" format
- if (handler->GetSession())
- handler->PSendSysMessage(LANG_TITLE_LIST_CHAT, id, titleInfo->bit_index, id, titleNameStr, localeNames[locale], knownStr, activeStr);
- else
- handler->PSendSysMessage(LANG_TITLE_LIST_CONSOLE, id, titleInfo->bit_index, titleNameStr, localeNames[locale], knownStr, activeStr);
+ // send title in "id (idx:idx) - [namedlink locale]" format
+ if (handler->GetSession())
+ handler->PSendSysMessage(LANG_TITLE_LIST_CHAT, id, titleInfo->bit_index, id, titleNameStr, "", knownStr, activeStr);
+ else
+ handler->PSendSysMessage(LANG_TITLE_LIST_CONSOLE, id, titleInfo->bit_index, titleNameStr, "", knownStr, activeStr);
- ++counter;
- }
+ ++counter;
}
}
if (counter == 0) // if counter == 0 then we found nth
diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp
index 80847d7dec4..d8026ccd10a 100644
--- a/src/server/scripts/Commands/cs_misc.cpp
+++ b/src/server/scripts/Commands/cs_misc.cpp
@@ -220,9 +220,9 @@ public:
handler->PSendSysMessage("no VMAP available for area info");
handler->PSendSysMessage(LANG_MAP_POSITION,
- object->GetMapId(), (mapEntry ? mapEntry->name[handler->GetSessionDbcLocale()] : "<unknown>"),
- zoneId, (zoneEntry ? zoneEntry->area_name[handler->GetSessionDbcLocale()] : "<unknown>"),
- areaId, (areaEntry ? areaEntry->area_name[handler->GetSessionDbcLocale()] : "<unknown>"),
+ object->GetMapId(), (mapEntry ? mapEntry->name : "<unknown>"),
+ zoneId, (zoneEntry ? zoneEntry->area_name : "<unknown>"),
+ areaId, (areaEntry ? areaEntry->area_name : "<unknown>"),
object->GetPhaseMask(),
object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), object->GetOrientation(),
cell.GridX(), cell.GridY(), cell.CellX(), cell.CellY(), object->GetInstanceId(),
@@ -2212,9 +2212,9 @@ public:
return false;
if (strncmp(args, "on", 3) == 0)
- player->SetMovement(MOVE_WATER_WALK); // ON
+ player->SendMovementSetWaterWalking(true);
else if (strncmp(args, "off", 4) == 0)
- player->SetMovement(MOVE_LAND_WALK); // OFF
+ player->SendMovementSetWaterWalking(false);
else
{
handler->SendSysMessage(LANG_USE_BOL);
diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp
index a88c765c596..dee8a52debd 100644
--- a/src/server/scripts/Commands/cs_modify.cpp
+++ b/src/server/scripts/Commands/cs_modify.cpp
@@ -25,6 +25,7 @@ EndScriptData */
#include "ScriptMgr.h"
#include "ObjectMgr.h"
#include "Chat.h"
+#include <stdlib.h>
class modify_commandscript : public CommandScript
{
@@ -968,14 +969,14 @@ public:
target->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP);
target->Mount(mId);
- WorldPacket data(SMSG_FORCE_RUN_SPEED_CHANGE, (8+4+1+4));
+ WorldPacket data(SMSG_MOVE_SET_RUN_SPEED, (8+4+1+4));
data.append(target->GetPackGUID());
data << (uint32)0;
data << (uint8)0; //new 2.1.0
data << float(speed);
target->SendMessageToSet(&data, true);
- data.Initialize(SMSG_FORCE_SWIM_SPEED_CHANGE, (8+4+4));
+ data.Initialize(SMSG_MOVE_SET_SWIM_SPEED, (8+4+4));
data.append(target->GetPackGUID());
data << (uint32)0;
data << float(speed);
@@ -1004,11 +1005,11 @@ public:
int32 addmoney = atoi((char*)args);
- uint32 moneyuser = target->GetMoney();
+ uint64 moneyuser = target->GetMoney();
if (addmoney < 0)
{
- int32 newmoney = int32(moneyuser) + addmoney;
+ int64 newmoney = int32(moneyuser) + addmoney;
sLog->outDebug(LOG_FILTER_GENERAL, handler->GetTrinityString(LANG_CURRENT_MONEY), moneyuser, addmoney, newmoney);
if (newmoney <= 0)
@@ -1032,18 +1033,17 @@ public:
}
else
{
- handler->PSendSysMessage(LANG_YOU_GIVE_MONEY, addmoney, handler->GetNameLink(target).c_str());
+ handler->PSendSysMessage(LANG_YOU_GIVE_MONEY, uint32(addmoney), handler->GetNameLink(target).c_str());
if (handler->needReportToTarget(target))
- (ChatHandler(target)).PSendSysMessage(LANG_YOURS_MONEY_GIVEN, handler->GetNameLink().c_str(), addmoney);
+ (ChatHandler(target)).PSendSysMessage(LANG_YOURS_MONEY_GIVEN, handler->GetNameLink().c_str(), uint32(addmoney));
if (addmoney >=MAX_MONEY_AMOUNT)
target->SetMoney(MAX_MONEY_AMOUNT);
else
- target->ModifyMoney(addmoney);
+ target->ModifyMoney(int64(addmoney));
}
- sLog->outDebug(LOG_FILTER_GENERAL, handler->GetTrinityString(LANG_NEW_MONEY), moneyuser, addmoney, target->GetMoney());
-
+ sLog->outDebug(LOG_FILTER_GENERAL, handler->GetTrinityString(LANG_NEW_MONEY), moneyuser, uint32(addmoney), target->GetMoney());
return true;
}
@@ -1102,7 +1102,7 @@ public:
return true;
}
- static bool HandleModifyHonorCommand (ChatHandler* handler, const char* args)
+ static bool HandleModifyHonorCommand(ChatHandler* handler, const char* args)
{
if (!*args)
return false;
@@ -1121,9 +1121,9 @@ public:
int32 amount = (uint32)atoi(args);
- target->ModifyHonorPoints(amount);
+ target->ModifyCurrency(CURRENCY_TYPE_HONOR_POINTS, amount);
- handler->PSendSysMessage(LANG_COMMAND_MODIFY_HONOR, handler->GetNameLink(target).c_str(), target->GetHonorPoints());
+ handler->PSendSysMessage(LANG_COMMAND_MODIFY_HONOR, handler->GetNameLink(target).c_str(), target->GetCurrency(CURRENCY_TYPE_HONOR_POINTS));
return true;
}
@@ -1237,7 +1237,7 @@ public:
}
target->GetReputationMgr().SetOneFactionReputation(factionEntry, amount, false);
- handler->PSendSysMessage(LANG_COMMAND_MODIFY_REP, factionEntry->name[handler->GetSessionDbcLocale()], factionId,
+ handler->PSendSysMessage(LANG_COMMAND_MODIFY_REP, factionEntry->name, factionId,
handler->GetNameLink(target).c_str(), target->GetReputationMgr().GetReputation(factionEntry));
return true;
}
@@ -1311,9 +1311,9 @@ public:
int32 amount = (uint32)atoi(args);
- target->ModifyArenaPoints(amount);
+ target->ModifyCurrency(CURRENCY_TYPE_CONQUEST_POINTS, amount);
- handler->PSendSysMessage(LANG_COMMAND_MODIFY_ARENA, handler->GetNameLink(target).c_str(), target->GetArenaPoints());
+ handler->PSendSysMessage(LANG_COMMAND_MODIFY_ARENA, handler->GetNameLink(target).c_str(), target->GetCurrency(CURRENCY_TYPE_CONQUEST_POINTS));
return true;
}
diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp
index 3bb29f8abfe..40b36fb8d52 100644
--- a/src/server/scripts/Commands/cs_reload.cpp
+++ b/src/server/scripts/Commands/cs_reload.cpp
@@ -102,7 +102,6 @@ public:
{ "gossip_menu_option", SEC_ADMINISTRATOR, true, &HandleReloadGossipMenuOptionCommand, "", NULL },
{ "item_enchantment_template", SEC_ADMINISTRATOR, true, &HandleReloadItemEnchantementsCommand, "", NULL },
{ "item_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesItemCommand, "", NULL },
- { "item_set_names", SEC_ADMINISTRATOR, true, &HandleReloadItemSetNamesCommand, "", NULL },
{ "lfg_dungeon_rewards", SEC_ADMINISTRATOR, true, &HandleReloadLfgRewardsCommand, "", NULL },
{ "locales_achievement_reward", SEC_ADMINISTRATOR, true, &HandleReloadLocalesAchievementRewardCommand, "", NULL },
{ "locales_creature", SEC_ADMINISTRATOR, true, &HandleReloadLocalesCreatureCommand, "", NULL },
@@ -110,7 +109,6 @@ public:
{ "locales_gameobject", SEC_ADMINISTRATOR, true, &HandleReloadLocalesGameobjectCommand, "", NULL },
{ "locales_gossip_menu_option", SEC_ADMINISTRATOR, true, &HandleReloadLocalesGossipMenuOptionCommand, "", NULL },
{ "locales_item", SEC_ADMINISTRATOR, true, &HandleReloadLocalesItemCommand, "", NULL },
- { "locales_item_set_name", SEC_ADMINISTRATOR, true, &HandleReloadLocalesItemSetNameCommand, "", NULL },
{ "locales_npc_text", SEC_ADMINISTRATOR, true, &HandleReloadLocalesNpcTextCommand, "", NULL },
{ "locales_page_text", SEC_ADMINISTRATOR, true, &HandleReloadLocalesPageTextCommand, "", NULL },
{ "locales_points_of_interest", SEC_ADMINISTRATOR, true, &HandleReloadLocalesPointsOfInterestCommand, "", NULL },
@@ -503,20 +501,21 @@ public:
cInfo->HoverHeight = fields[67].GetFloat();
cInfo->ModHealth = fields[68].GetFloat();
cInfo->ModMana = fields[69].GetFloat();
- cInfo->ModArmor = fields[70].GetFloat();
- cInfo->RacialLeader = fields[71].GetBool();
- cInfo->questItems[0] = fields[72].GetUInt32();
- cInfo->questItems[1] = fields[73].GetUInt32();
- cInfo->questItems[2] = fields[74].GetUInt32();
- cInfo->questItems[3] = fields[75].GetUInt32();
- cInfo->questItems[4] = fields[76].GetUInt32();
- cInfo->questItems[5] = fields[77].GetUInt32();
- cInfo->movementId = fields[78].GetUInt32();
- cInfo->RegenHealth = fields[79].GetBool();
- cInfo->equipmentId = fields[80].GetUInt32();
- cInfo->MechanicImmuneMask = fields[81].GetUInt32();
- cInfo->flags_extra = fields[82].GetUInt32();
- cInfo->ScriptID = sObjectMgr->GetScriptId(fields[83].GetCString());
+ cInfo->ModManaExtra = fields[70].GetFloat();
+ cInfo->ModArmor = fields[71].GetFloat();
+ cInfo->RacialLeader = fields[72].GetBool();
+ cInfo->questItems[0] = fields[73].GetUInt32();
+ cInfo->questItems[1] = fields[74].GetUInt32();
+ cInfo->questItems[2] = fields[75].GetUInt32();
+ cInfo->questItems[3] = fields[76].GetUInt32();
+ cInfo->questItems[4] = fields[77].GetUInt32();
+ cInfo->questItems[5] = fields[78].GetUInt32();
+ cInfo->movementId = fields[79].GetUInt32();
+ cInfo->RegenHealth = fields[80].GetBool();
+ cInfo->equipmentId = fields[81].GetUInt32();
+ cInfo->MechanicImmuneMask = fields[82].GetUInt32();
+ cInfo->flags_extra = fields[83].GetUInt32();
+ cInfo->ScriptID = sObjectMgr->GetScriptId(fields[84].GetCString());
sObjectMgr->CheckCreatureTemplate(cInfo);
}
@@ -946,14 +945,6 @@ public:
return true;
}
- static bool HandleReloadItemSetNamesCommand(ChatHandler* handler, const char* /*args*/)
- {
- sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Item set names...");
- sObjectMgr->LoadItemSetNames();
- handler->SendGlobalGMSysMessage("DB table `item_set_names` reloaded.");
- return true;
- }
-
static bool HandleReloadGameObjectScriptsCommand(ChatHandler* handler, const char* args)
{
if (sScriptMgr->IsScriptScheduled())
@@ -1208,14 +1199,6 @@ public:
return true;
}
- static bool HandleReloadLocalesItemSetNameCommand(ChatHandler* handler, const char* /*args*/)
- {
- sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Locales Item set name... ");
- sObjectMgr->LoadItemSetNameLocales();
- handler->SendGlobalGMSysMessage("DB table `locales_item_set_name` reloaded.");
- return true;
- }
-
static bool HandleReloadLocalesNpcTextCommand(ChatHandler* handler, const char* /*args*/)
{
sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Locales NPC Text ... ");
diff --git a/src/server/scripts/Commands/cs_reset.cpp b/src/server/scripts/Commands/cs_reset.cpp
index 82fb409faa7..b0bf3e03f58 100644
--- a/src/server/scripts/Commands/cs_reset.cpp
+++ b/src/server/scripts/Commands/cs_reset.cpp
@@ -62,7 +62,7 @@ public:
if (target)
target->GetAchievementMgr().Reset();
else
- AchievementMgr::DeleteFromDB(GUID_LOPART(targetGuid));
+ AchievementMgr<Player>::DeleteFromDB(GUID_LOPART(targetGuid));
return true;
}
@@ -73,11 +73,8 @@ public:
if (!handler->extractPlayerTarget((char*)args, &target))
return false;
- target->SetHonorPoints(0);
target->SetUInt32Value(PLAYER_FIELD_KILLS, 0);
target->SetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS, 0);
- target->SetUInt32Value(PLAYER_FIELD_TODAY_CONTRIBUTION, 0);
- target->SetUInt32Value(PLAYER_FIELD_YESTERDAY_CONTRIBUTION, 0);
target->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EARN_HONORABLE_KILL);
return true;
@@ -234,7 +231,7 @@ public:
if (target)
{
- target->resetTalents(true);
+ target->ResetTalents(true);
target->SendTalentsInfoData(false);
ChatHandler(target).SendSysMessage(LANG_RESET_TALENTS);
if (!handler->GetSession() || handler->GetSession()->GetPlayer() != target)
diff --git a/src/server/scripts/Commands/cs_titles.cpp b/src/server/scripts/Commands/cs_titles.cpp
index f35f6baca98..0a3b430ab2c 100644
--- a/src/server/scripts/Commands/cs_titles.cpp
+++ b/src/server/scripts/Commands/cs_titles.cpp
@@ -138,7 +138,7 @@ public:
char const* targetName = target->GetName();
char titleNameStr[80];
- snprintf(titleNameStr, 80, titleInfo->name[handler->GetSessionDbcLocale()], targetName);
+ snprintf(titleNameStr, 80, titleInfo->name, targetName);
target->SetTitle(titleInfo);
handler->PSendSysMessage(LANG_TITLE_ADD_RES, id, titleNameStr, tNameLink.c_str());
@@ -187,7 +187,7 @@ public:
char const* targetName = target->GetName();
char titleNameStr[80];
- snprintf(titleNameStr, 80, titleInfo->name[handler->GetSessionDbcLocale()], targetName);
+ snprintf(titleNameStr, 80, titleInfo->name, targetName);
handler->PSendSysMessage(LANG_TITLE_REMOVE_RES, id, titleNameStr, tNameLink.c_str());
diff --git a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp
index 8e0fb9ff411..c2dab8d6c9e 100644
--- a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp
+++ b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp
@@ -237,7 +237,7 @@ class instance_deadmines : public InstanceMapScript
void DoPlaySound(GameObject* unit, uint32 sound)
{
- WorldPacket data(4);
+ WorldPacket data;
data.SetOpcode(SMSG_PLAY_SOUND);
data << uint32(sound);
unit->SendMessageToSet(&data, false);
@@ -245,7 +245,7 @@ class instance_deadmines : public InstanceMapScript
void DoPlaySoundCreature(Unit* unit, uint32 sound)
{
- WorldPacket data(4);
+ WorldPacket data;
data.SetOpcode(SMSG_PLAY_SOUND);
data << uint32(sound);
unit->SendMessageToSet(&data, false);
diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp
index bd79cbba628..d1b0e076d9c 100644
--- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp
+++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp
@@ -246,8 +246,7 @@ public:
// Also needs an exception in spell system.
unit->CastSpell(unit, SPELL_GRAVITY_LAPSE_FLY, true, 0, 0, me->GetGUID());
// Use packet hack
- WorldPacket data(12);
- data.SetOpcode(SMSG_MOVE_SET_CAN_FLY);
+ WorldPacket data(SMSG_MOVE_SET_CAN_FLY, 12);
data.append(unit->GetPackGUID());
data << uint32(0);
unit->SendMessageToSet(&data, true);
@@ -266,8 +265,7 @@ public:
unit->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_FLY);
unit->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_DOT);
- WorldPacket data(12);
- data.SetOpcode(SMSG_MOVE_UNSET_CAN_FLY);
+ WorldPacket data(SMSG_MOVE_UNSET_CAN_FLY, 12);
data.append(unit->GetPackGUID());
data << uint32(0);
unit->SendMessageToSet(&data, true);
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp
index 028cf640d21..61df92c18e2 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp
@@ -434,7 +434,7 @@ public:
{
me->SetVisible(false);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- me->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_DISABLE_GRAVITY);
+ me->AddUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY);
me->SetSpeed(MOVE_WALK, 5.0f, true);
wp_reached = false;
count = 0;
@@ -467,7 +467,7 @@ public:
instance->SetData(GAMEOBJECT_PUMPKIN_SHRINE, 0); //hide gameobject
break;
case 19:
- me->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_DISABLE_GRAVITY);
+ me->RemoveUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY);
break;
case 20:
{
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp
index 167f040bbc4..5ca685393ae 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp
@@ -265,7 +265,7 @@ public:
{
OrbsEmpowered = 0;
EmpowerCount = 0;
- me->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_DISABLE_GRAVITY);
+ me->AddUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->setActive(true);
@@ -453,7 +453,7 @@ public:
summoned->CastSpell(summoned, SPELL_SHADOW_CHANNELING, false);
break;
case CREATURE_ANVEENA:
- summoned->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_DISABLE_GRAVITY);
+ summoned->AddUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY);
summoned->CastSpell(summoned, SPELL_ANVEENA_PRISON, true);
summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
break;
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp
index f3b6078d536..0e781c6ddc0 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp
@@ -131,9 +131,9 @@ bool GrandChampionsOutVehicle(Creature* me)
if (pGrandChampion1 && pGrandChampion2 && pGrandChampion3)
{
- if (!pGrandChampion1->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) &&
- !pGrandChampion2->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) &&
- !pGrandChampion3->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT))
+ if (!pGrandChampion1->m_movementInfo.t_guid &&
+ !pGrandChampion2->m_movementInfo.t_guid &&
+ !pGrandChampion3->m_movementInfo.t_guid)
return true;
}
@@ -385,7 +385,7 @@ public:
}
}else uiPhaseTimer -= uiDiff;
- if (!UpdateVictim() || me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT))
+ if (!UpdateVictim() || me->m_movementInfo.t_guid)
return;
if (uiInterceptTimer <= uiDiff)
@@ -529,7 +529,7 @@ public:
uiFireBallTimer = 5000;
} else uiFireBallTimer -= uiDiff;
- if (!UpdateVictim() || me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT))
+ if (!UpdateVictim() || me->m_movementInfo.t_guid)
return;
if (uiFireBallTimer <= uiDiff)
@@ -667,7 +667,7 @@ public:
}
}else uiPhaseTimer -= uiDiff;
- if (!UpdateVictim() || me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT))
+ if (!UpdateVictim() || me->m_movementInfo.t_guid)
return;
if (uiChainLightningTimer <= uiDiff)
@@ -813,7 +813,7 @@ public:
}
}else uiPhaseTimer -= uiDiff;
- if (!UpdateVictim() || me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT))
+ if (!UpdateVictim() || me->m_movementInfo.t_guid)
return;
if (uiLightningArrowsTimer <= uiDiff)
@@ -961,7 +961,7 @@ public:
}
} else uiPhaseTimer -= uiDiff;
- if (!UpdateVictim() || me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT))
+ if (!UpdateVictim() || me->m_movementInfo.t_guid)
return;
if (uiEviscerateTimer <= uiDiff)
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp
index 5d3a6814eb2..9017509781f 100755
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp
@@ -1244,6 +1244,7 @@ class spell_deathbringer_blood_nova_targeting : public SpellScriptLoader
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_deathbringer_blood_nova_targeting_SpellScript::FilterTargetsInitial, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_deathbringer_blood_nova_targeting_SpellScript::FilterTargetsSubsequent, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY);
OnEffectHitTarget += SpellEffectFn(spell_deathbringer_blood_nova_targeting_SpellScript::HandleForceCast, EFFECT_0, SPELL_EFFECT_FORCE_CAST);
+ OnEffectHitTarget += SpellEffectFn(spell_deathbringer_blood_nova_targeting_SpellScript::HandleForceCast, EFFECT_0, SPELL_EFFECT_FORCE_CAST);
}
WorldObject* target;
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp
index e2f9faf6a97..0515ba83480 100755
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp
@@ -357,7 +357,7 @@ class boss_lady_deathwhisper : public CreatureScript
void DamageTaken(Unit* /*damageDealer*/, uint32& damage)
{
// phase transition
- if (events.GetPhaseMask() & PHASE_ONE_MASK && damage > me->GetPower(POWER_MANA))
+ if (events.GetPhaseMask() & PHASE_ONE_MASK && damage > (uint32)me->GetPower(POWER_MANA))
{
Talk(SAY_PHASE_2);
Talk(EMOTE_PHASE_2);
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp
index 7ada42144a8..79e4684f3a6 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp
@@ -965,6 +965,7 @@ class spell_xt002_tympanic_tantrum : public SpellScriptLoader
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_xt002_tympanic_tantrum_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_xt002_tympanic_tantrum_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY);
OnHit += SpellHitFn(spell_xt002_tympanic_tantrum_SpellScript::RecalculateDamage);
+ OnHit += SpellHitFn(spell_xt002_tympanic_tantrum_SpellScript::RecalculateDamage);
}
};
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp
index f2f03ff602b..3a90b6901e3 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp
@@ -339,6 +339,8 @@ public:
me->GetMotionMaster()->MoveLand(0, pos);
me->SetDisableGravity(false, true);
me->SetHover(true);
+ me->SetDisableGravity(false, true);
+ me->SetHover(true);
++introPhase;
introTimer = 3000;
break;
diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp
index f60cc1d188c..cb9f9cbc15c 100644
--- a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp
+++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp
@@ -926,8 +926,7 @@ class boss_kaelthas : public CreatureScript
unit->CastSpell(unit, SPELL_GRAVITY_LAPSE_AURA, true, 0, 0, me->GetGUID());
//Using packet workaround
- WorldPacket data(12);
- data.SetOpcode(SMSG_MOVE_SET_CAN_FLY);
+ WorldPacket data(SMSG_MOVE_SET_CAN_FLY, 12);
data.append(unit->GetPackGUID());
data << uint32(0);
unit->SendMessageToSet(&data, true);
@@ -953,8 +952,7 @@ class boss_kaelthas : public CreatureScript
if (Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid()))
{
//Using packet workaround
- WorldPacket data(12);
- data.SetOpcode(SMSG_MOVE_UNSET_CAN_FLY);
+ WorldPacket data(SMSG_MOVE_UNSET_CAN_FLY, 12);
data.append(unit->GetPackGUID());
data << uint32(0);
unit->SendMessageToSet(&data, true);
diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp
index b213f3df624..0bd7397f1d4 100644
--- a/src/server/scripts/Spells/spell_druid.cpp
+++ b/src/server/scripts/Spells/spell_druid.cpp
@@ -317,7 +317,7 @@ class spell_dru_swift_flight_passive : public SpellScriptLoader
void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
{
if (Player* caster = GetCaster()->ToPlayer())
- if (caster->Has310Flyer(false))
+ if (caster->GetSkillValue(SKILL_RIDING) >= 375)
amount = 310;
}
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index 9cbf81b39af..a35d243593e 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -3027,12 +3027,13 @@ class spell_gen_mount : public SpellScriptLoader
break;
case 300:
if (canFly)
- {
- if (_mount310 && target->Has310Flyer(false))
- mount = _mount310;
- else
- mount = _mount280;
- }
+ mount = _mount280;
+ else
+ mount = _mount100;
+ break;
+ case 375:
+ if (canFly)
+ mount = _mount310;
else
mount = _mount100;
break;
diff --git a/src/server/scripts/Spells/spell_pet.cpp b/src/server/scripts/Spells/spell_pet.cpp
index 7830d46260c..4928ec40abd 100644
--- a/src/server/scripts/Spells/spell_pet.cpp
+++ b/src/server/scripts/Spells/spell_pet.cpp
@@ -1347,24 +1347,6 @@ public:
return;
if (GetCaster()->GetOwner()->ToPlayer())
{
- // Pet's base damage changes depending on happiness
- if (GetCaster()->isPet() && GetCaster()->ToPet()->isHunterPet())
- {
- switch (GetCaster()->ToPet()->GetHappinessState())
- {
- case HAPPY:
- // 125% of normal damage
- amount += 25.0f;
- break;
- case CONTENT:
- // 100% of normal damage, nothing to modify
- break;
- case UNHAPPY:
- // 75% of normal damage
- amount += -25.0f;
- break;
- }
- }
// Cobra Reflexes
if (AuraEffect* cobraReflexes = GetCaster()->GetAuraEffectOfRankedSpell(61682, EFFECT_0))
amount -= cobraReflexes->GetAmount();
diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp
index bb0fd1e73ab..038f3239dbb 100644
--- a/src/server/scripts/Spells/spell_rogue.cpp
+++ b/src/server/scripts/Spells/spell_rogue.cpp
@@ -338,6 +338,9 @@ class spell_rog_deadly_poison : public SpellScriptLoader
// item combat enchantments
for (uint8 slot = 0; slot < MAX_ENCHANTMENT_SLOT; ++slot)
{
+ if (slot > PRISMATIC_ENCHANTMENT_SLOT || slot < PROP_ENCHANTMENT_SLOT_0) // not holding enchantment id
+ continue;
+
SpellItemEnchantmentEntry const* enchant = sSpellItemEnchantmentStore.LookupEntry(item->GetEnchantmentId(EnchantmentSlot(slot)));
if (!enchant)
continue;
diff --git a/src/server/scripts/World/npc_professions.cpp b/src/server/scripts/World/npc_professions.cpp
index 175cfb190d7..74f615a87d1 100644
--- a/src/server/scripts/World/npc_professions.cpp
+++ b/src/server/scripts/World/npc_professions.cpp
@@ -211,7 +211,7 @@ int32 DoLowUnlearnCost(Player* player) //blacksmith
void ProcessCastaction(Player* player, Creature* creature, uint32 spellId, uint32 triggeredSpellId, int32 cost)
{
- if (!(spellId && player->HasSpell(spellId)) && player->HasEnoughMoney(cost))
+ if (!(spellId && player->HasSpell(spellId)) && player->HasEnoughMoney((int64)cost))
{
player->CastSpell(player, triggeredSpellId, true);
player->ModifyMoney(-cost);
@@ -349,11 +349,11 @@ void ProcessUnlearnAction(Player* player, Creature* creature, uint32 spellId, ui
{
if (EquippedOk(player, spellId))
{
- if (player->HasEnoughMoney(cost))
+ if (player->HasEnoughMoney(int64(cost)))
{
player->CastSpell(player, spellId, true);
ProfessionUnlearnSpells(player, spellId);
- player->ModifyMoney(-cost);
+ player->ModifyMoney(-int64(cost));
if (alternativeSpellId)
creature->CastSpell(player, alternativeSpellId, true);
}
diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp
index 5640a84317c..2d0198bfb0e 100644
--- a/src/server/scripts/World/npcs_special.cpp
+++ b/src/server/scripts/World/npcs_special.cpp
@@ -1297,7 +1297,7 @@ public:
case GOSSIP_OPTION_LEARNDUALSPEC:
if (player->GetSpecsCount() == 1 && !(player->getLevel() < sWorld->getIntConfig(CONFIG_MIN_DUALSPEC_LEVEL)))
{
- if (!player->HasEnoughMoney(10000000))
+ if (!player->HasEnoughMoney(UI64LIT(10000000)))
{
player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, 0, 0, 0);
player->PlayerTalkClass->SendCloseGossip();
@@ -1305,7 +1305,7 @@ public:
}
else
{
- player->ModifyMoney(-10000000);
+ player->ModifyMoney(SI64LIT(-10000000));
// Cast spells that teach dual spec
// Both are also ImplicitTarget self and must be cast by player
@@ -2610,11 +2610,11 @@ public:
}
if (doSwitch)
{
- if (!player->HasEnoughMoney(EXP_COST))
+ if (!player->HasEnoughMoney(uint64(EXP_COST)))
player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, 0, 0, 0);
else if (noXPGain)
{
- player->ModifyMoney(-EXP_COST);
+ player->ModifyMoney(-int64(EXP_COST));
player->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN);
}
else if (!noXPGain)