aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2016-04-25 22:03:34 +0200
committerShauren <shauren.trinity@gmail.com>2016-05-20 23:49:53 +0200
commit70102f32fe38ae7d49acbd5ddee0239602d3cb94 (patch)
tree22dcecc33942c7f60e2edb5402f6f7feaf559ece /src/server/scripts
parent885d9b53c38662e00e3b4977b82e9cf36d197f94 (diff)
Core/DataStores: Updated opcodes and db2 to 7.0.3.21414
Diffstat (limited to 'src/server/scripts')
-rw-r--r--src/server/scripts/Commands/cs_character.cpp2
-rw-r--r--src/server/scripts/Commands/cs_debug.cpp6
-rw-r--r--src/server/scripts/Commands/cs_go.cpp2
-rw-r--r--src/server/scripts/Commands/cs_lookup.cpp97
-rw-r--r--src/server/scripts/Commands/cs_misc.cpp10
-rw-r--r--src/server/scripts/Commands/cs_modify.cpp4
-rw-r--r--src/server/scripts/ScriptPCH.h3
-rw-r--r--src/server/scripts/Spells/spell_item.cpp1
-rw-r--r--src/server/scripts/Spells/spell_mage.cpp2
-rw-r--r--src/server/scripts/Spells/spell_pet.cpp24
10 files changed, 79 insertions, 72 deletions
diff --git a/src/server/scripts/Commands/cs_character.cpp b/src/server/scripts/Commands/cs_character.cpp
index f9aca4b607b..b482716e059 100644
--- a/src/server/scripts/Commands/cs_character.cpp
+++ b/src/server/scripts/Commands/cs_character.cpp
@@ -559,7 +559,7 @@ public:
{
FactionState const& faction = itr->second;
FactionEntry const* factionEntry = sFactionStore.LookupEntry(faction.ID);
- char const* factionName = factionEntry ? factionEntry->Name_lang : "#Not found#";
+ char const* factionName = factionEntry ? factionEntry->Name->Str[loc] : "#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 59eb97d1476..245aa60b846 100644
--- a/src/server/scripts/Commands/cs_debug.cpp
+++ b/src/server/scripts/Commands/cs_debug.cpp
@@ -1540,11 +1540,11 @@ public:
if (difficulty == -1)
for (uint8 diff = 0; diff < MAX_DIFFICULTY; ++diff)
{
- if (GetMapDifficultyData(mEntry->ID, Difficulty(diff)))
- sInstanceSaveMgr->ForceGlobalReset(mEntry->ID, Difficulty(diff));
+ if (sDB2Manager.GetMapDifficultyData(map, Difficulty(diff)))
+ sInstanceSaveMgr->ForceGlobalReset(map, Difficulty(diff));
}
else
- sInstanceSaveMgr->ForceGlobalReset(mEntry->ID, Difficulty(difficulty));
+ sInstanceSaveMgr->ForceGlobalReset(map, Difficulty(difficulty));
return true;
}
};
diff --git a/src/server/scripts/Commands/cs_go.cpp b/src/server/scripts/Commands/cs_go.cpp
index dd048ce3c57..05b6a5c9713 100644
--- a/src/server/scripts/Commands/cs_go.cpp
+++ b/src/server/scripts/Commands/cs_go.cpp
@@ -509,7 +509,7 @@ public:
return false;
}
- Zone2MapCoordinates(x, y, areaEntry->ParentAreaID ? uint32(areaEntry->ParentAreaID) : areaId);
+ sDB2Manager.Zone2MapCoordinates(areaEntry->ParentAreaID ? uint32(areaEntry->ParentAreaID) : areaId, x, y);
if (!MapManager::IsValidMapCoord(zoneEntry->MapID, x, y))
{
diff --git a/src/server/scripts/Commands/cs_lookup.cpp b/src/server/scripts/Commands/cs_lookup.cpp
index 2b3752c00be..01844aa937e 100644
--- a/src/server/scripts/Commands/cs_lookup.cpp
+++ b/src/server/scripts/Commands/cs_lookup.cpp
@@ -309,58 +309,77 @@ public:
for (uint32 id = 0; id < sFactionStore.GetNumRows(); ++id)
{
- if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(id))
+ FactionEntry const* factionEntry = sFactionStore.LookupEntry(id);
+ if (factionEntry)
{
FactionState const* factionState = target ? target->GetReputationMgr().GetState(factionEntry) : NULL;
- std::string name = factionEntry->Name_lang;
+ int locale = handler->GetSessionDbcLocale();
+ std::string name = factionEntry->Name->Str[locale];
if (name.empty())
continue;
if (!Utf8FitTo(name, wNamePart))
- continue;
-
- if (maxResults && count++ == maxResults)
{
- handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
- return true;
- }
+ locale = 0;
+ for (; locale < TOTAL_LOCALES; ++locale)
+ {
+ if (locale == handler->GetSessionDbcLocale())
+ continue;
- // 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;
+ name = factionEntry->Name->Str[locale];
+ if (name.empty())
+ continue;
- 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);
+ if (Utf8FitTo(name, wNamePart))
+ break;
+ }
}
- else
- ss << handler->GetTrinityString(LANG_FACTION_NOREPUTATION);
- handler->SendSysMessage(ss.str().c_str());
+ if (locale < TOTAL_LOCALES)
+ {
+ if (maxResults && count++ == maxResults)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
+ return true;
+ }
- if (!found)
- found = 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];
+
+ 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());
+
+ if (!found)
+ found = true;
+ }
}
}
diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp
index d66a6d24cc2..236197b84c9 100644
--- a/src/server/scripts/Commands/cs_misc.cpp
+++ b/src/server/scripts/Commands/cs_misc.cpp
@@ -207,7 +207,7 @@ public:
float zoneX = object->GetPositionX();
float zoneY = object->GetPositionY();
- Map2ZoneCoordinates(zoneX, zoneY, zoneId);
+ sDB2Manager.Map2ZoneCoordinates(zoneId, zoneX, zoneY);
Map const* map = object->GetMap();
float groundZ = map->GetHeight(object->GetPhaseMask(), object->GetPositionX(), object->GetPositionY(), MAX_HEIGHT);
@@ -1168,10 +1168,10 @@ public:
if (itemNameStr && itemNameStr[0])
{
std::string itemName = itemNameStr+1;
- auto itr = std::find_if(sItemSparseStore.begin(), sItemSparseStore.end(), [&itemName](std::pair<uint32, ItemSparseEntry const*> kv)
+ auto itr = std::find_if(sItemSparseStore.begin(), sItemSparseStore.end(), [&itemName](ItemSparseEntry const* sparse)
{
for (uint32 i = 0; i < MAX_LOCALES; ++i)
- if (itemName == kv.second->Name->Str[i])
+ if (itemName == sparse->Name->Str[i])
return true;
return false;
});
@@ -1183,7 +1183,7 @@ public:
return false;
}
- itemId = itr->first;
+ itemId = itr->ID;
}
else
return false;
@@ -1795,7 +1795,7 @@ public:
// Output XI. LANG_PINFO_CHR_RACE
raceStr = DB2Manager::GetChrRaceName(raceid, locale);
- classStr = GetClassName(classid, locale);
+ classStr = DB2Manager::GetClassName(classid, locale);
handler->PSendSysMessage(LANG_PINFO_CHR_RACE, (gender == 0 ? handler->GetTrinityString(LANG_CHARACTER_GENDER_MALE) : handler->GetTrinityString(LANG_CHARACTER_GENDER_FEMALE)), raceStr.c_str(), classStr.c_str());
// Output XII. LANG_PINFO_CHR_ALIVE
diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp
index 47f1212f80a..435c3c74231 100644
--- a/src/server/scripts/Commands/cs_modify.cpp
+++ b/src/server/scripts/Commands/cs_modify.cpp
@@ -1008,14 +1008,14 @@ public:
if (factionEntry->ReputationIndex < 0)
{
- handler->PSendSysMessage(LANG_COMMAND_FACTION_NOREP_ERROR, factionEntry->Name_lang, factionId);
+ handler->PSendSysMessage(LANG_COMMAND_FACTION_NOREP_ERROR, factionEntry->Name->Str[handler->GetSessionDbcLocale()], factionId);
handler->SetSentErrorMessage(true);
return false;
}
target->GetReputationMgr().SetOneFactionReputation(factionEntry, amount, false);
target->GetReputationMgr().SendState(target->GetReputationMgr().GetState(factionEntry));
- handler->PSendSysMessage(LANG_COMMAND_MODIFY_REP, factionEntry->Name_lang, factionId,
+ handler->PSendSysMessage(LANG_COMMAND_MODIFY_REP, factionEntry->Name->Str[handler->GetSessionDbcLocale()], factionId,
handler->GetNameLink(target).c_str(), target->GetReputationMgr().GetReputation(factionEntry));
return true;
}
diff --git a/src/server/scripts/ScriptPCH.h b/src/server/scripts/ScriptPCH.h
index 1cd25309055..cf31742f830 100644
--- a/src/server/scripts/ScriptPCH.h
+++ b/src/server/scripts/ScriptPCH.h
@@ -19,8 +19,7 @@
#include "CombatAI.h"
#include "PassiveAI.h"
#include "Chat.h"
-#include "DBCStructure.h"
-#include "DBCStores.h"
+#include "DB2Stores.h"
#include "ObjectMgr.h"
#include "SpellScript.h"
#include "SpellAuraEffects.h"
diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp
index 7dcd3a4fbb9..6619a108009 100644
--- a/src/server/scripts/Spells/spell_item.cpp
+++ b/src/server/scripts/Spells/spell_item.cpp
@@ -29,7 +29,6 @@
#include "SpellHistory.h"
#include "SkillDiscovery.h"
#include "Battleground.h"
-#include "DBCStores.h"
// Generic script for handling item dummy effects which trigger another spell.
class spell_item_trigger_spell : public SpellScriptLoader
diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp
index a13d6da8fae..31c20ccece9 100644
--- a/src/server/scripts/Spells/spell_mage.cpp
+++ b/src/server/scripts/Spells/spell_mage.cpp
@@ -745,6 +745,8 @@ class spell_mage_living_bomb : public SpellScriptLoader
bool Validate(SpellInfo const* spellInfo) override
{
+ if (!spellInfo->GetEffect(EFFECT_1))
+ return false;
if (!sSpellMgr->GetSpellInfo(uint32(spellInfo->GetEffect(EFFECT_1)->CalcValue())))
return false;
return true;
diff --git a/src/server/scripts/Spells/spell_pet.cpp b/src/server/scripts/Spells/spell_pet.cpp
index 7852043a796..a56001cfe6a 100644
--- a/src/server/scripts/Spells/spell_pet.cpp
+++ b/src/server/scripts/Spells/spell_pet.cpp
@@ -107,9 +107,7 @@ class spell_gen_pet_calculate : public SpellScriptLoader
if (Player* owner = GetCaster()->GetOwner()->ToPlayer())
{
// For others recalculate it from:
- float CritSpell = 0.0f;
- // Crit from Intellect
- CritSpell += owner->GetSpellCritFromIntellect();
+ float CritSpell = 5.0f;
// Increase crit from SPELL_AURA_MOD_SPELL_CRIT_CHANCE
CritSpell += owner->GetTotalAuraModifier(SPELL_AURA_MOD_SPELL_CRIT_CHANCE);
// Increase crit from SPELL_AURA_MOD_CRIT_PCT
@@ -126,9 +124,7 @@ class spell_gen_pet_calculate : public SpellScriptLoader
if (Player* owner = GetCaster()->GetOwner()->ToPlayer())
{
// For others recalculate it from:
- float CritMelee = 0.0f;
- // Crit from Agility
- CritMelee += owner->GetMeleeCritFromAgility();
+ float CritMelee = 5.0f;
// Increase crit from SPELL_AURA_MOD_WEAPON_CRIT_PERCENT
CritMelee += owner->GetTotalAuraModifier(SPELL_AURA_MOD_WEAPON_CRIT_PERCENT);
// Increase crit from SPELL_AURA_MOD_CRIT_PCT
@@ -676,9 +672,7 @@ public:
if (Player* owner = GetCaster()->GetOwner()->ToPlayer())
{
// For others recalculate it from:
- float CritSpell = 0.0f;
- // Crit from Intellect
- CritSpell += owner->GetSpellCritFromIntellect();
+ float CritSpell = 5.0f;
// Increase crit from SPELL_AURA_MOD_SPELL_CRIT_CHANCE
CritSpell += owner->GetTotalAuraModifier(SPELL_AURA_MOD_SPELL_CRIT_CHANCE);
// Increase crit from SPELL_AURA_MOD_CRIT_PCT
@@ -698,9 +692,7 @@ public:
if (Player* owner = GetCaster()->GetOwner()->ToPlayer())
{
// For others recalculate it from:
- float CritMelee = 0.0f;
- // Crit from Agility
- CritMelee += owner->GetMeleeCritFromAgility();
+ float CritMelee = 5.0f;
// Increase crit from SPELL_AURA_MOD_WEAPON_CRIT_PERCENT
CritMelee += owner->GetTotalAuraModifier(SPELL_AURA_MOD_WEAPON_CRIT_PERCENT);
// Increase crit from SPELL_AURA_MOD_CRIT_PCT
@@ -1266,9 +1258,7 @@ public:
if (GetCaster()->GetOwner()->ToPlayer())
{
// For others recalculate it from:
- float CritSpell = 0.0f;
- // Crit from Intellect
- // CritSpell += owner->GetSpellCritFromIntellect();
+ float CritSpell = 5.0f;
// Increase crit from SPELL_AURA_MOD_SPELL_CRIT_CHANCE
// CritSpell += owner->GetTotalAuraModifier(SPELL_AURA_MOD_SPELL_CRIT_CHANCE);
// Increase crit from SPELL_AURA_MOD_CRIT_PCT
@@ -1287,9 +1277,7 @@ public:
if (GetCaster()->GetOwner()->ToPlayer())
{
// For others recalculate it from:
- float CritMelee = 0.0f;
- // Crit from Agility
- // CritMelee += owner->GetMeleeCritFromAgility();
+ float CritMelee = 5.0f;
// Increase crit from SPELL_AURA_MOD_WEAPON_CRIT_PERCENT
// CritMelee += owner->GetTotalAuraModifier(SPELL_AURA_MOD_WEAPON_CRIT_PERCENT);
// Increase crit from SPELL_AURA_MOD_CRIT_PCT