aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSpp <spp@jorge.gr>2012-02-27 14:58:47 +0100
committerSpp <spp@jorge.gr>2012-02-27 14:58:47 +0100
commitd38bc3a17857c36a3ab871deac57b314987194bb (patch)
treee5c88ec17e7741db46eb6f6de6148ce039a1918b /src
parent3e622ee7ac36de3a1e137c12b03417c3880ba342 (diff)
Core: Rename GetCreatureInfo to GetCreatureTemplate and minor cleanup here and there
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/AI/CreatureAISelector.cpp2
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp4
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp6
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.cpp4
-rwxr-xr-xsrc/server/game/Battlegrounds/ArenaTeam.cpp24
-rwxr-xr-xsrc/server/game/Entities/Creature/Creature.cpp64
-rwxr-xr-xsrc/server/game/Entities/Creature/Creature.h22
-rwxr-xr-xsrc/server/game/Entities/Item/Item.cpp26
-rwxr-xr-xsrc/server/game/Entities/Object/Object.cpp2
-rwxr-xr-xsrc/server/game/Entities/Pet/Pet.cpp22
-rwxr-xr-xsrc/server/game/Entities/Player/Player.cpp73
-rwxr-xr-xsrc/server/game/Entities/Player/Player.h14
-rwxr-xr-xsrc/server/game/Entities/Unit/StatSystem.cpp4
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.cpp52
-rwxr-xr-xsrc/server/game/Entities/Vehicle/Vehicle.cpp2
-rwxr-xr-xsrc/server/game/Events/GameEventMgr.cpp2
-rwxr-xr-xsrc/server/game/Groups/Group.cpp3
-rwxr-xr-xsrc/server/game/Handlers/ItemHandler.cpp1
-rwxr-xr-xsrc/server/game/Handlers/LootHandler.cpp25
-rwxr-xr-xsrc/server/game/Handlers/MiscHandler.cpp34
-rwxr-xr-xsrc/server/game/Handlers/NPCHandler.cpp4
-rwxr-xr-xsrc/server/game/Handlers/QuestHandler.cpp2
-rwxr-xr-xsrc/server/game/Loot/LootMgr.cpp162
-rwxr-xr-xsrc/server/game/Miscellaneous/Formulas.h4
-rwxr-xr-xsrc/server/game/Spells/Auras/SpellAuraEffects.cpp6
-rwxr-xr-xsrc/server/game/Spells/Spell.cpp4
-rwxr-xr-xsrc/server/game/Spells/SpellEffects.cpp6
-rw-r--r--src/server/scripts/Commands/cs_learn.cpp2
-rw-r--r--src/server/scripts/Commands/cs_npc.cpp6
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp2
-rwxr-xr-xsrc/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp4
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp2
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp2
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp10
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp2
-rw-r--r--src/server/scripts/Northrend/borean_tundra.cpp2
-rw-r--r--src/server/scripts/Northrend/zuldrak.cpp4
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_illidan.cpp2
-rw-r--r--src/server/scripts/Outland/blades_edge_mountains.cpp2
-rw-r--r--src/server/scripts/Spells/spell_dk.cpp2
-rw-r--r--src/server/scripts/World/mob_generic_creature.cpp2
-rw-r--r--src/server/scripts/World/npcs_special.cpp2
47 files changed, 318 insertions, 318 deletions
diff --git a/src/server/game/AI/CreatureAISelector.cpp b/src/server/game/AI/CreatureAISelector.cpp
index ab616d78a8c..f64bb320542 100755
--- a/src/server/game/AI/CreatureAISelector.cpp
+++ b/src/server/game/AI/CreatureAISelector.cpp
@@ -102,7 +102,7 @@ namespace FactorySelector
MovementGenerator* selectMovementGenerator(Creature* creature)
{
MovementGeneratorRegistry& mv_registry(*MovementGeneratorRepository::instance());
- ASSERT(creature->GetCreatureInfo() != NULL);
+ ASSERT(creature->GetCreatureTemplate() != NULL);
const MovementGeneratorCreator* mv_factory = mv_registry.GetRegistryItem(creature->GetDefaultMovementType());
/* if (mv_factory == NULL)
diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
index 01e13b29f19..1e0c3f5c1fc 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
@@ -57,7 +57,7 @@ bool npc_escortAI::AssistPlayerInCombat(Unit* who)
return false;
//experimental (unknown) flag not present
- if (!(me->GetCreatureInfo()->type_flags & CREATURE_TYPEFLAGS_AID_PLAYERS))
+ if (!(me->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_AID_PLAYERS))
return false;
//not a player
@@ -150,7 +150,7 @@ void npc_escortAI::JustRespawned()
//add a small delay before going to first waypoint, normal in near all cases
m_uiWPWaitTimer = 2500;
- if (me->getFaction() != me->GetCreatureInfo()->faction_A)
+ if (me->getFaction() != me->GetCreatureTemplate()->faction_A)
me->RestoreFaction();
Reset();
diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
index d83ad9b756c..e0fe12082f1 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
@@ -55,7 +55,7 @@ bool FollowerAI::AssistPlayerInCombat(Unit* who)
return false;
//experimental (unknown) flag not present
- if (!(me->GetCreatureInfo()->type_flags & CREATURE_TYPEFLAGS_AID_PLAYERS))
+ if (!(me->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_AID_PLAYERS))
return false;
//not a player
@@ -150,8 +150,8 @@ void FollowerAI::JustRespawned()
if (!IsCombatMovementAllowed())
SetCombatMovement(true);
- if (me->getFaction() != me->GetCreatureInfo()->faction_A)
- me->setFaction(me->GetCreatureInfo()->faction_A);
+ if (me->getFaction() != me->GetCreatureTemplate()->faction_A)
+ me->setFaction(me->GetCreatureTemplate()->faction_A);
Reset();
}
diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp
index 8776090c86f..50c7aba0360 100644
--- a/src/server/game/AI/SmartScripts/SmartAI.cpp
+++ b/src/server/game/AI/SmartScripts/SmartAI.cpp
@@ -524,7 +524,7 @@ bool SmartAI::AssistPlayerInCombat(Unit* who)
return false;
//experimental (unknown) flag not present
- if (!(me->GetCreatureInfo()->type_flags & CREATURE_TYPEFLAGS_AID_PLAYERS))
+ if (!(me->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_AID_PLAYERS))
return false;
//not a player
@@ -561,7 +561,7 @@ void SmartAI::JustRespawned()
mDespawnState = 0;
mEscortState = SMART_ESCORT_NONE;
me->SetVisible(true);
- if (me->getFaction() != me->GetCreatureInfo()->faction_A)
+ if (me->getFaction() != me->GetCreatureTemplate()->faction_A)
me->RestoreFaction();
GetScript()->ProcessEventsFor(SMART_EVENT_RESPAWN);
Reset();
diff --git a/src/server/game/Battlegrounds/ArenaTeam.cpp b/src/server/game/Battlegrounds/ArenaTeam.cpp
index a5c34e4b7ee..05fef44f676 100755
--- a/src/server/game/Battlegrounds/ArenaTeam.cpp
+++ b/src/server/game/Battlegrounds/ArenaTeam.cpp
@@ -154,18 +154,18 @@ bool ArenaTeam::AddMember(uint64 playerGuid)
Player::RemovePetitionsAndSigns(playerGuid, GetType());
// Feed data to the struct
- ArenaTeamMember newmember;
- newmember.Name = playerName;
- newmember.Guid = playerGuid;
- newmember.Class = playerClass;
- newmember.SeasonGames = 0;
- newmember.WeekGames = 0;
- newmember.SeasonWins = 0;
- newmember.WeekWins = 0;
- newmember.PersonalRating = personalRating;
- newmember.MatchMakerRating = matchMakerRating;
-
- Members.push_back(newmember);
+ ArenaTeamMember newMember;
+ newMember.Name = playerName;
+ newMember.Guid = playerGuid;
+ newMember.Class = playerClass;
+ newMember.SeasonGames = 0;
+ newMember.WeekGames = 0;
+ newMember.SeasonWins = 0;
+ newMember.WeekWins = 0;
+ newMember.PersonalRating = personalRating;
+ newMember.MatchMakerRating = matchMakerRating;
+
+ Members.push_back(newMember);
// Save player's arena team membership to db
stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_ARENA_TEAM_MEMBER);
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp
index 20bcfc8f41c..0fe2016950b 100755
--- a/src/server/game/Entities/Creature/Creature.cpp
+++ b/src/server/game/Entities/Creature/Creature.cpp
@@ -303,7 +303,7 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData* data
return false;
}
- uint32 displayID = sObjectMgr->ChooseDisplayId(0, GetCreatureInfo(), data);
+ uint32 displayID = sObjectMgr->ChooseDisplayId(0, GetCreatureTemplate(), data);
CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelRandomGender(&displayID);
if (!minfo) // Cancel load if no model defined
{
@@ -342,7 +342,7 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData* data
m_defaultMovementType = IDLE_MOTION_TYPE;
for (uint8 i=0; i < CREATURE_MAX_SPELLS; ++i)
- m_spells[i] = GetCreatureInfo()->spells[i];
+ m_spells[i] = GetCreatureTemplate()->spells[i];
return true;
}
@@ -352,14 +352,14 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData* data)
if (!InitEntry(Entry, team, data))
return false;
- CreatureTemplate const* cInfo = GetCreatureInfo();
+ CreatureTemplate const* cInfo = GetCreatureTemplate();
m_regenHealth = cInfo->RegenHealth;
// creatures always have melee weapon ready if any
SetSheath(SHEATH_STATE_MELEE);
- SelectLevel(GetCreatureInfo());
+ SelectLevel(GetCreatureTemplate());
if (team == HORDE)
setFaction(cInfo->faction_H);
else
@@ -754,7 +754,7 @@ bool Creature::Create(uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry,
if (!CreateFromProto(guidlow, Entry, vehId, team, data))
return false;
- switch (GetCreatureInfo()->rank)
+ switch (GetCreatureTemplate()->rank)
{
case CREATURE_ELITE_RARE:
m_corpseDelay = sWorld->getIntConfig(CONFIG_CORPSE_DECAY_RARE);
@@ -783,7 +783,7 @@ bool Creature::Create(uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry,
SetByteValue(UNIT_FIELD_BYTES_0, 2, minfo->gender);
}
- if (GetCreatureInfo()->InhabitType & INHABIT_AIR)
+ if (GetCreatureTemplate()->InhabitType & INHABIT_AIR)
{
if (GetDefaultMovementType() == IDLE_MOTION_TYPE)
AddUnitMovementFlag(MOVEMENTFLAG_CAN_FLY);
@@ -791,10 +791,10 @@ bool Creature::Create(uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry,
SetFlying(true);
}
- if (GetCreatureInfo()->InhabitType & INHABIT_WATER)
+ if (GetCreatureTemplate()->InhabitType & INHABIT_WATER)
AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING);
- LastUsedScriptID = GetCreatureInfo()->ScriptID;
+ LastUsedScriptID = GetCreatureTemplate()->ScriptID;
// TODO: Replace with spell, handle from DB
if (isSpiritHealer() || isSpiritGuide())
@@ -816,22 +816,22 @@ bool Creature::isCanTrainingOf(Player* player, bool msg) const
TrainerSpellData const* trainer_spells = GetTrainerSpells();
- if ((!trainer_spells || trainer_spells->spellList.empty()) && GetCreatureInfo()->trainer_type != TRAINER_TYPE_PETS)
+ if ((!trainer_spells || trainer_spells->spellList.empty()) && GetCreatureTemplate()->trainer_type != TRAINER_TYPE_PETS)
{
sLog->outErrorDb("Creature %u (Entry: %u) have UNIT_NPC_FLAG_TRAINER but have empty trainer spell list.",
GetGUIDLow(), GetEntry());
return false;
}
- switch (GetCreatureInfo()->trainer_type)
+ switch (GetCreatureTemplate()->trainer_type)
{
case TRAINER_TYPE_CLASS:
- if (player->getClass() != GetCreatureInfo()->trainer_class)
+ if (player->getClass() != GetCreatureTemplate()->trainer_class)
{
if (msg)
{
player->PlayerTalkClass->ClearMenus();
- switch (GetCreatureInfo()->trainer_class)
+ switch (GetCreatureTemplate()->trainer_class)
{
case CLASS_DRUID: player->PlayerTalkClass->SendGossipMenu(4913, GetGUID()); break;
case CLASS_HUNTER: player->PlayerTalkClass->SendGossipMenu(10090, GetGUID()); break;
@@ -856,12 +856,12 @@ bool Creature::isCanTrainingOf(Player* player, bool msg) const
}
break;
case TRAINER_TYPE_MOUNTS:
- if (GetCreatureInfo()->trainer_race && player->getRace() != GetCreatureInfo()->trainer_race)
+ if (GetCreatureTemplate()->trainer_race && player->getRace() != GetCreatureTemplate()->trainer_race)
{
if (msg)
{
player->PlayerTalkClass->ClearMenus();
- switch (GetCreatureInfo()->trainer_class)
+ switch (GetCreatureTemplate()->trainer_class)
{
case RACE_DWARF: player->PlayerTalkClass->SendGossipMenu(5865, GetGUID()); break;
case RACE_GNOME: player->PlayerTalkClass->SendGossipMenu(4881, GetGUID()); break;
@@ -879,7 +879,7 @@ bool Creature::isCanTrainingOf(Player* player, bool msg) const
}
break;
case TRAINER_TYPE_TRADESKILLS:
- if (GetCreatureInfo()->trainer_spell && !player->HasSpell(GetCreatureInfo()->trainer_spell))
+ if (GetCreatureTemplate()->trainer_spell && !player->HasSpell(GetCreatureTemplate()->trainer_spell))
{
if (msg)
{
@@ -930,8 +930,8 @@ bool Creature::isCanInteractWithBattleMaster(Player* player, bool msg) const
bool Creature::isCanTrainingAndResetTalentsOf(Player* player) const
{
return player->getLevel() >= 10
- && GetCreatureInfo()->trainer_type == TRAINER_TYPE_CLASS
- && player->getClass() == GetCreatureInfo()->trainer_class;
+ && GetCreatureTemplate()->trainer_type == TRAINER_TYPE_CLASS
+ && player->getClass() == GetCreatureTemplate()->trainer_class;
}
void Creature::AI_SendMoveToPacket(float x, float y, float z, uint32 time, uint32 /*MovementFlags*/, uint8 /*type*/)
@@ -1040,7 +1040,7 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
uint32 dynamicflags = GetUInt32Value(UNIT_DYNAMIC_FLAGS);
// check if it's a custom model and if not, use 0 for displayId
- CreatureTemplate const* cinfo = GetCreatureInfo();
+ CreatureTemplate const* cinfo = GetCreatureTemplate();
if (cinfo)
{
if (displayId == cinfo->Modelid1 || displayId == cinfo->Modelid2 ||
@@ -1302,7 +1302,7 @@ bool Creature::LoadCreatureFromDB(uint32 guid, Map* map, bool addToMap)
curhealth = data->curhealth;
if (curhealth)
{
- curhealth = uint32(curhealth*_GetHealthMod(GetCreatureInfo()->rank));
+ curhealth = uint32(curhealth*_GetHealthMod(GetCreatureTemplate()->rank));
if (curhealth < 1)
curhealth = 1;
}
@@ -1502,8 +1502,8 @@ void Creature::setDeathState(DeathState s)
setActive(false);
- if (!isPet() && GetCreatureInfo()->SkinLootId)
- if (LootTemplates_Skinning.HaveLootFor(GetCreatureInfo()->SkinLootId))
+ if (!isPet() && GetCreatureTemplate()->SkinLootId)
+ if (LootTemplates_Skinning.HaveLootFor(GetCreatureTemplate()->SkinLootId))
if (hasLootRecipient())
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
@@ -1529,11 +1529,11 @@ void Creature::setDeathState(DeathState s)
SetFullHealth();
SetLootRecipient(NULL);
ResetPlayerDamageReq();
- CreatureTemplate const* cinfo = GetCreatureInfo();
+ CreatureTemplate const* cinfo = GetCreatureTemplate();
SetWalk(true);
- if (GetCreatureInfo()->InhabitType & INHABIT_AIR)
+ if (GetCreatureTemplate()->InhabitType & INHABIT_AIR)
AddUnitMovementFlag(MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_FLYING);
- if (GetCreatureInfo()->InhabitType & INHABIT_WATER)
+ if (GetCreatureTemplate()->InhabitType & INHABIT_WATER)
AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING);
SetUInt32Value(UNIT_NPC_FLAGS, cinfo->npcflag);
ClearUnitState(uint32(UNIT_STATE_ALL_STATE));
@@ -1573,7 +1573,7 @@ void Creature::Respawn(bool force)
if (m_originalEntry != GetEntry())
UpdateEntry(m_originalEntry);
- CreatureTemplate const* cinfo = GetCreatureInfo();
+ CreatureTemplate const* cinfo = GetCreatureTemplate();
SelectLevel(cinfo);
setDeathState(JUST_ALIVED);
@@ -1634,11 +1634,11 @@ bool Creature::IsImmunedToSpell(SpellInfo const* spellInfo)
return false;
// Spells that don't have effectMechanics.
- if (!spellInfo->HasAnyEffectMechanic() && GetCreatureInfo()->MechanicImmuneMask & (1 << (spellInfo->Mechanic - 1)))
+ if (!spellInfo->HasAnyEffectMechanic() && GetCreatureTemplate()->MechanicImmuneMask & (1 << (spellInfo->Mechanic - 1)))
return true;
- // This check must be done instead of 'if (GetCreatureInfo()->MechanicImmuneMask & (1 << (spellInfo->Mechanic - 1)))' for not break
- // the check of mechanic immunity on DB (tested) because GetCreatureInfo()->MechanicImmuneMask and m_spellImmune[IMMUNITY_MECHANIC] don't have same data.
+ // This check must be done instead of 'if (GetCreatureTemplate()->MechanicImmuneMask & (1 << (spellInfo->Mechanic - 1)))' for not break
+ // the check of mechanic immunity on DB (tested) because GetCreatureTemplate()->MechanicImmuneMask and m_spellImmune[IMMUNITY_MECHANIC] don't have same data.
bool immunedToAllEffects = true;
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
if (!IsImmunedToSpellEffect(spellInfo, i))
@@ -1654,10 +1654,10 @@ bool Creature::IsImmunedToSpell(SpellInfo const* spellInfo)
bool Creature::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) const
{
- if (GetCreatureInfo()->MechanicImmuneMask & (1 << (spellInfo->Effects[index].Mechanic - 1)))
+ if (GetCreatureTemplate()->MechanicImmuneMask & (1 << (spellInfo->Effects[index].Mechanic - 1)))
return true;
- if (GetCreatureInfo()->type == CREATURE_TYPE_MECHANICAL && spellInfo->Effects[index].Effect == SPELL_EFFECT_HEAL)
+ if (GetCreatureTemplate()->type == CREATURE_TYPE_MECHANICAL && spellInfo->Effects[index].Effect == SPELL_EFFECT_HEAL)
return true;
return Unit::IsImmunedToSpellEffect(spellInfo, index);
@@ -2015,7 +2015,7 @@ CreatureAddon const* Creature::GetCreatureAddon() const
}
// dependent from difficulty mode entry
- return sObjectMgr->GetCreatureTemplateAddon(GetCreatureInfo()->Entry);
+ return sObjectMgr->GetCreatureTemplateAddon(GetCreatureTemplate()->Entry);
}
//creature_addon table
@@ -2236,7 +2236,7 @@ void Creature::AllLootRemovedFromCorpse()
return;
float decayRate;
- CreatureTemplate const* cinfo = GetCreatureInfo();
+ CreatureTemplate const* cinfo = GetCreatureTemplate();
decayRate = sWorld->getRate(RATE_CORPSE_DECAY_LOOTED);
uint32 diff = uint32((m_corpseRemoveTime - now) * decayRate);
diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h
index 40477de7c75..f986e09e7cb 100755
--- a/src/server/game/Entities/Creature/Creature.h
+++ b/src/server/game/Entities/Creature/Creature.h
@@ -457,17 +457,17 @@ class Creature : public Unit, public GridObject<Creature>, public MapCreature
void Update(uint32 time); // overwrited Unit::Update
void GetRespawnPosition(float &x, float &y, float &z, float* ori = NULL, float* dist =NULL) const;
- uint32 GetEquipmentId() const { return GetCreatureInfo()->equipmentId; }
+ uint32 GetEquipmentId() const { return GetCreatureTemplate()->equipmentId; }
void SetCorpseDelay(uint32 delay) { m_corpseDelay = delay; }
uint32 GetCorpseDelay() const { return m_corpseDelay; }
- bool isRacialLeader() const { return GetCreatureInfo()->RacialLeader; }
- bool isCivilian() const { return GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_CIVILIAN; }
- bool isTrigger() const { return GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_TRIGGER; }
- bool isGuard() const { return GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_GUARD; }
- bool canWalk() const { return GetCreatureInfo()->InhabitType & INHABIT_GROUND; }
- bool canSwim() const { return GetCreatureInfo()->InhabitType & INHABIT_WATER; }
- //bool canFly() const { return GetCreatureInfo()->InhabitType & INHABIT_AIR; }
+ bool isRacialLeader() const { return GetCreatureTemplate()->RacialLeader; }
+ bool isCivilian() const { return GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_CIVILIAN; }
+ bool isTrigger() const { return GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_TRIGGER; }
+ bool isGuard() const { return GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_GUARD; }
+ bool canWalk() const { return GetCreatureTemplate()->InhabitType & INHABIT_GROUND; }
+ bool canSwim() const { return GetCreatureTemplate()->InhabitType & INHABIT_WATER; }
+ //bool canFly() const { return GetCreatureTemplate()->InhabitType & INHABIT_AIR; }
void SetReactState(ReactStates st) { m_reactState = st; }
ReactStates GetReactState() { return m_reactState; }
@@ -496,7 +496,7 @@ class Creature : public Unit, public GridObject<Creature>, public MapCreature
if (isPet())
return false;
- uint32 rank = GetCreatureInfo()->rank;
+ uint32 rank = GetCreatureTemplate()->rank;
return rank != CREATURE_ELITE_NORMAL && rank != CREATURE_ELITE_RARE;
}
@@ -505,7 +505,7 @@ class Creature : public Unit, public GridObject<Creature>, public MapCreature
if (isPet())
return false;
- return GetCreatureInfo()->rank == CREATURE_ELITE_WORLDBOSS;
+ return GetCreatureTemplate()->rank == CREATURE_ELITE_WORLDBOSS;
}
bool IsDungeonBoss() const;
@@ -558,7 +558,7 @@ class Creature : public Unit, public GridObject<Creature>, public MapCreature
TrainerSpellData const* GetTrainerSpells() const;
- CreatureTemplate const* GetCreatureInfo() const { return m_creatureInfo; }
+ CreatureTemplate const* GetCreatureTemplate() const { return m_creatureInfo; }
CreatureData const* GetCreatureData() const { return m_creatureData; }
CreatureAddon const* GetCreatureAddon() const;
diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp
index 70b81593b56..0fc53a65258 100755
--- a/src/server/game/Entities/Item/Item.cpp
+++ b/src/server/game/Entities/Item/Item.cpp
@@ -56,8 +56,7 @@ void AddItemsSetItem(Player* player, Item* item)
if (!eff)
{
- eff = new ItemSetEffect;
- memset(eff, 0, sizeof(ItemSetEffect));
+ eff = new ItemSetEffect();
eff->setid = setid;
size_t x = 0;
@@ -780,20 +779,18 @@ bool Item::CanBeTraded(bool mail, bool trade) const
bool Item::HasEnchantRequiredSkill(const Player* player) const
{
-
- // Check all enchants for required skill
- for (uint32 enchant_slot = PERM_ENCHANTMENT_SLOT; enchant_slot < MAX_ENCHANTMENT_SLOT; ++enchant_slot)
- if (uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot)))
- if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id))
- if (enchantEntry->requiredSkill && player->GetSkillValue(enchantEntry->requiredSkill) < enchantEntry->requiredSkillValue)
- return false;
+ // Check all enchants for required skill
+ for (uint32 enchant_slot = PERM_ENCHANTMENT_SLOT; enchant_slot < MAX_ENCHANTMENT_SLOT; ++enchant_slot)
+ if (uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot)))
+ if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id))
+ if (enchantEntry->requiredSkill && player->GetSkillValue(enchantEntry->requiredSkill) < enchantEntry->requiredSkillValue)
+ return false;
return true;
}
uint32 Item::GetEnchantRequiredLevel() const
{
-
uint32 level = 0;
// Check all enchants for required level
@@ -861,7 +858,7 @@ bool Item::IsFitToSpellRequirements(SpellInfo const* spellInfo) const
// Special case - accept weapon type for main and offhand requirements
if (proto->InventoryType == INVTYPE_WEAPON &&
(spellInfo->EquippedItemInventoryTypeMask & (1 << INVTYPE_WEAPONMAINHAND) ||
- spellInfo->EquippedItemInventoryTypeMask & (1 << INVTYPE_WEAPONOFFHAND)))
+ spellInfo->EquippedItemInventoryTypeMask & (1 << INVTYPE_WEAPONOFFHAND)))
return true;
else if ((spellInfo->EquippedItemInventoryTypeMask & (1 << proto->InventoryType)) == 0)
return false; // inventory type not present in mask
@@ -1001,12 +998,13 @@ bool Item::IsLimitedToAnotherMapOrZone(uint32 cur_mapId, uint32 cur_zoneId) cons
// time.
void Item::SendTimeUpdate(Player* owner)
{
- if (!GetUInt32Value(ITEM_FIELD_DURATION))
+ uint32 duration = GetUInt32Value(ITEM_FIELD_DURATION);
+ if (!duration)
return;
WorldPacket data(SMSG_ITEM_TIME_UPDATE, (8+4));
- data << (uint64)GetGUID();
- data << (uint32)GetUInt32Value(ITEM_FIELD_DURATION);
+ data << uint64(GetGUID());
+ data << uint32(duration);
owner->GetSession()->SendPacket(&data);
}
diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp
index c98364ecb2d..c1ecc3b74e7 100755
--- a/src/server/game/Entities/Object/Object.cpp
+++ b/src/server/game/Entities/Object/Object.cpp
@@ -541,7 +541,7 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask*
{
if (GetTypeId() == TYPEID_UNIT)
{
- CreatureTemplate const* cinfo = ToCreature()->GetCreatureInfo();
+ CreatureTemplate const* cinfo = ToCreature()->GetCreatureTemplate();
// this also applies for transform auras
if (SpellInfo const* transform = sSpellMgr->GetSpellInfo(ToUnit()->getTransForm()))
diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp
index 566ee06218e..e7103e2cb70 100755
--- a/src/server/game/Entities/Pet/Pet.cpp
+++ b/src/server/game/Entities/Pet/Pet.cpp
@@ -180,7 +180,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c
setFaction(owner->getFaction());
SetUInt32Value(UNIT_CREATED_BY_SPELL, summon_spell_id);
- CreatureTemplate const* cinfo = GetCreatureInfo();
+ CreatureTemplate const* cinfo = GetCreatureTemplate();
if (cinfo->type == CREATURE_TYPE_CRITTER)
{
map->AddToMap(this->ToCreature());
@@ -692,7 +692,7 @@ bool Pet::CreateBaseAtCreature(Creature* creature)
{
ASSERT(creature);
- if (!CreateBaseAtTamed(creature->GetCreatureInfo(), creature->GetMap(), creature->GetPhaseMask()))
+ if (!CreateBaseAtTamed(creature->GetCreatureTemplate(), creature->GetMap(), creature->GetPhaseMask()))
return false;
Relocate(creature->GetPositionX(), creature->GetPositionY(), creature->GetPositionZ(), creature->GetOrientation());
@@ -704,7 +704,7 @@ bool Pet::CreateBaseAtCreature(Creature* creature)
return false;
}
- CreatureTemplate const* cinfo = GetCreatureInfo();
+ CreatureTemplate const* cinfo = GetCreatureTemplate();
if (!cinfo)
{
sLog->outError("CreateBaseAtCreature() failed, creatureInfo is missing!");
@@ -763,7 +763,7 @@ bool Pet::CreateBaseAtTamed(CreatureTemplate const* cinfo, Map* map, uint32 phas
// TODO: Move stat mods code to pet passive auras
bool Guardian::InitStatsForLevel(uint8 petlevel)
{
- CreatureTemplate const* cinfo = GetCreatureInfo();
+ CreatureTemplate const* cinfo = GetCreatureTemplate();
ASSERT(cinfo);
SetLevel(petlevel);
@@ -997,7 +997,7 @@ bool Pet::HaveInDiet(ItemTemplate const* item) const
if (!item->FoodType)
return false;
- CreatureTemplate const* cInfo = GetCreatureInfo();
+ CreatureTemplate const* cInfo = GetCreatureTemplate();
if (!cInfo)
return false;
@@ -1405,7 +1405,7 @@ void Pet::InitLevelupSpellsForLevel()
{
uint8 level = getLevel();
- if (PetLevelupSpellSet const* levelupSpells = GetCreatureInfo()->family ? sSpellMgr->GetPetLevelupSpellList(GetCreatureInfo()->family) : NULL)
+ if (PetLevelupSpellSet const* levelupSpells = GetCreatureTemplate()->family ? sSpellMgr->GetPetLevelupSpellList(GetCreatureTemplate()->family) : NULL)
{
// PetLevelupSpellSet ordered by levels, process in reversed order
for (PetLevelupSpellSet::const_reverse_iterator itr = levelupSpells->rbegin(); itr != levelupSpells->rend(); ++itr)
@@ -1419,7 +1419,7 @@ void Pet::InitLevelupSpellsForLevel()
}
}
- int32 petSpellsId = GetCreatureInfo()->PetSpellDataId ? -(int32)GetCreatureInfo()->PetSpellDataId : GetEntry();
+ int32 petSpellsId = GetCreatureTemplate()->PetSpellDataId ? -(int32)GetCreatureTemplate()->PetSpellDataId : GetEntry();
// default spells (can be not learned if pet level (as owner level decrease result for example) less first possible in normal game)
if (PetDefaultSpellsEntry const* defSpells = sSpellMgr->GetPetDefaultSpellsEntry(petSpellsId))
@@ -1543,7 +1543,7 @@ bool Pet::resetTalents()
if (owner->ToPlayer()->HasAtLoginFlag(AT_LOGIN_RESET_PET_TALENTS))
owner->ToPlayer()->RemoveAtLoginFlag(AT_LOGIN_RESET_PET_TALENTS, true);
- CreatureTemplate const* ci = GetCreatureInfo();
+ CreatureTemplate const* ci = GetCreatureTemplate();
if (!ci)
return false;
// Check pet talent type
@@ -1771,9 +1771,9 @@ bool Pet::IsPermanentPetFor(Player* owner)
switch (owner->getClass())
{
case CLASS_WARLOCK:
- return GetCreatureInfo()->type == CREATURE_TYPE_DEMON;
+ return GetCreatureTemplate()->type == CREATURE_TYPE_DEMON;
case CLASS_DEATH_KNIGHT:
- return GetCreatureInfo()->type == CREATURE_TYPE_UNDEAD;
+ return GetCreatureTemplate()->type == CREATURE_TYPE_UNDEAD;
default:
return false;
}
@@ -1812,7 +1812,7 @@ bool Pet::HasSpell(uint32 spell) const
// Get all passive spells in our skill line
void Pet::LearnPetPassives()
{
- CreatureTemplate const* cInfo = GetCreatureInfo();
+ CreatureTemplate const* cInfo = GetCreatureTemplate();
if (!cInfo)
return;
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index f5b7d487219..857ae4d845b 100755
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -143,10 +143,8 @@ static uint32 copseReclaimDelay[MAX_DEATH_COUNT] = { 30, 60, 120 };
// == PlayerTaxi ================================================
PlayerTaxi::PlayerTaxi()
-{
- // Taxi nodes
- memset(m_taximask, 0, sizeof(m_taximask));
-}
+ : m_taximask()
+{ }
void PlayerTaxi::InitTaxiNodesForLevel(uint32 race, uint32 chrClass, uint8 level)
{
@@ -540,7 +538,7 @@ inline void KillRewarder::_RewardKillCredit(Player* player)
// 4.4. Give kill credit (player must not be in group, or he must be alive or without corpse).
if (!_group || player->isAlive() || !player->GetCorpse())
if (_victim->GetTypeId() == TYPEID_UNIT)
- player->KilledMonster(_victim->ToCreature()->GetCreatureInfo(), _victim->GetGUID());
+ player->KilledMonster(_victim->ToCreature()->GetCreatureTemplate(), _victim->GetGUID());
}
void KillRewarder::_RewardPlayer(Player* player, bool isDungeon)
@@ -1123,10 +1121,10 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo)
if (oEntry->ItemId[j] <= 0)
continue;
- uint32 item_id = oEntry->ItemId[j];
+ uint32 itemId = oEntry->ItemId[j];
// just skip, reported in ObjectMgr::LoadItemTemplates
- ItemTemplate const* iProto = sObjectMgr->GetItemTemplate(item_id);
+ ItemTemplate const* iProto = sObjectMgr->GetItemTemplate(itemId);
if (!iProto)
continue;
@@ -1148,7 +1146,7 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo)
if (iProto->GetMaxStackSize() < count)
count = iProto->GetMaxStackSize();
}
- StoreNewItemInBestSlots(item_id, count);
+ StoreNewItemInBestSlots(itemId, count);
}
}
@@ -1589,14 +1587,14 @@ void Player::Update(uint32 p_time)
if (HasUnitState(UNIT_STATE_MELEE_ATTACKING) && !HasUnitState(UNIT_STATE_CASTING))
{
- if (Unit* pVictim = getVictim())
+ if (Unit* victim = getVictim())
{
// default combat reach 10
// TODO add weapon, skill check
if (isAttackReady(BASE_ATTACK))
{
- if (!IsWithinMeleeRange(pVictim))
+ if (!IsWithinMeleeRange(victim))
{
setAttackTimer(BASE_ATTACK, 100);
if (m_swingErrorMsg != 1) // send single time (client auto repeat)
@@ -1606,7 +1604,7 @@ void Player::Update(uint32 p_time)
}
}
//120 degrees of radiant range
- else if (!HasInArc(2*M_PI/3, pVictim))
+ else if (!HasInArc(2*M_PI/3, victim))
{
setAttackTimer(BASE_ATTACK, 100);
if (m_swingErrorMsg != 2) // send single time (client auto repeat)
@@ -1625,16 +1623,16 @@ void Player::Update(uint32 p_time)
setAttackTimer(OFF_ATTACK, ATTACK_DISPLAY_DELAY);
// do attack
- AttackerStateUpdate(pVictim, BASE_ATTACK);
+ AttackerStateUpdate(victim, BASE_ATTACK);
resetAttackTimer(BASE_ATTACK);
}
}
if (haveOffhandWeapon() && isAttackReady(OFF_ATTACK))
{
- if (!IsWithinMeleeRange(pVictim))
+ if (!IsWithinMeleeRange(victim))
setAttackTimer(OFF_ATTACK, 100);
- else if (!HasInArc(2*M_PI/3, pVictim))
+ else if (!HasInArc(2*M_PI/3, victim))
setAttackTimer(OFF_ATTACK, 100);
else
{
@@ -1643,13 +1641,13 @@ void Player::Update(uint32 p_time)
setAttackTimer(BASE_ATTACK, ATTACK_DISPLAY_DELAY);
// do attack
- AttackerStateUpdate(pVictim, OFF_ATTACK);
+ AttackerStateUpdate(victim, OFF_ATTACK);
resetAttackTimer(OFF_ATTACK);
}
}
- /*Unit* owner = pVictim->GetOwner();
- Unit* u = owner ? owner : pVictim;
+ /*Unit* owner = victim->GetOwner();
+ Unit* u = owner ? owner : victim;
if (u->IsPvP() && (!duel || duel->opponent != u))
{
UpdatePvP(true);
@@ -2687,11 +2685,11 @@ Creature* Player::GetNPCIfCanInteractWith(uint64 guid, uint32 npcflagmask)
return NULL;
// Deathstate checks
- if (!isAlive() && !(creature->GetCreatureInfo()->type_flags & CREATURE_TYPEFLAGS_GHOST))
+ if (!isAlive() && !(creature->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_GHOST))
return NULL;
// alive or spirit healer
- if (!creature->isAlive() && !(creature->GetCreatureInfo()->type_flags & CREATURE_TYPEFLAGS_DEAD_INTERACT))
+ if (!creature->isAlive() && !(creature->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_DEAD_INTERACT))
return NULL;
// appropriate npc type
@@ -4458,7 +4456,7 @@ bool Player::resetTalents(bool no_cost)
/* when prev line will dropped use next line
if (Pet* pet = GetPet())
{
- if (pet->getPetType() == HUNTER_PET && !pet->GetCreatureInfo()->isTameable(CanTameExoticPets()))
+ if (pet->getPetType() == HUNTER_PET && !pet->GetCreatureTemplate()->isTameable(CanTameExoticPets()))
RemovePet(NULL, PET_SAVE_NOT_IN_SLOT, true);
}
*/
@@ -6222,7 +6220,7 @@ void Player::UpdateWeaponSkill(WeaponAttackType attType)
if (GetShapeshiftForm() == FORM_TREE)
return; // use weapon but not skill up
- if (victim && victim->GetTypeId() == TYPEID_UNIT && (victim->ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_SKILLGAIN))
+ if (victim && victim->GetTypeId() == TYPEID_UNIT && (victim->ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_SKILLGAIN))
return;
uint32 weapon_skill_gain = sWorld->getIntConfig(CONFIG_SKILL_GAIN_WEAPON);
@@ -6922,7 +6920,7 @@ void Player::RewardReputation(Unit* pVictim, float rate)
if (pVictim->ToCreature()->IsReputationGainDisabled())
return;
- ReputationOnKillEntry const* Rep = sObjectMgr->GetReputationOnKilEntry(pVictim->ToCreature()->GetCreatureInfo()->Entry);
+ ReputationOnKillEntry const* Rep = sObjectMgr->GetReputationOnKilEntry(pVictim->ToCreature()->GetCreatureTemplate()->Entry);
if (!Rep)
return;
@@ -8845,7 +8843,7 @@ void Player::SendLoot(uint64 guid, LootType loot_type)
creature->lootForPickPocketed = true;
loot->clear();
- if (uint32 lootid = creature->GetCreatureInfo()->pickpocketLootId)
+ if (uint32 lootid = creature->GetCreatureTemplate()->pickpocketLootId)
loot->FillLoot(lootid, LootTemplates_Pickpocketing, this, true);
// Generate extra money for pick pocket loot
@@ -8892,7 +8890,7 @@ void Player::SendLoot(uint64 guid, LootType loot_type)
if (loot_type == LOOT_SKINNING)
{
loot->clear();
- loot->FillLoot(creature->GetCreatureInfo()->SkinLootId, LootTemplates_Skinning, this, true);
+ loot->FillLoot(creature->GetCreatureTemplate()->SkinLootId, LootTemplates_Skinning, this, true);
permission = OWNER_PERMISSION;
}
// set group rights only for loot_type != LOOT_SKINNING
@@ -12007,7 +12005,7 @@ Item* Player::StoreNewItem(ItemPosCountVec const& dest, uint32 item, bool update
{
pItem->SetSoulboundTradeable(allowedLooters);
pItem->SetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME, GetTotalPlayedTime());
- m_itemSoulboundTradeable.push_back(pItem);
+ AddTradeableItem(pItem);
// save data
std::ostringstream ss;
@@ -12450,7 +12448,7 @@ void Player::MoveItemToInventory(ItemPosCountVec const& dest, Item* pItem, bool
}
if (pLastItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE))
- m_itemSoulboundTradeable.push_back(pLastItem);
+ AddTradeableItem(pLastItem);
}
void Player::DestroyItem(uint8 bag, uint8 slot, bool update)
@@ -13449,6 +13447,11 @@ void Player::UpdateSoulboundTradeItems()
}
}
+void Player::AddTradeableItem(Item* item)
+{
+ m_itemSoulboundTradeable.push_back(item);
+}
+
//TODO: should never allow an item to be added to m_itemSoulboundTradeable twice
void Player::RemoveTradeableItem(Item* item)
{
@@ -14133,7 +14136,7 @@ void Player::PrepareGossipMenu(WorldObject* source, uint32 menuId /*= 0*/, bool
canTalk = false;
break;
case GOSSIP_OPTION_UNLEARNPETTALENTS:
- if (!GetPet() || GetPet()->getPetType() != HUNTER_PET || GetPet()->m_spells.size() <= 1 || creature->GetCreatureInfo()->trainer_type != TRAINER_TYPE_PETS || creature->GetCreatureInfo()->trainer_class != CLASS_HUNTER)
+ if (!GetPet() || GetPet()->getPetType() != HUNTER_PET || GetPet()->m_spells.size() <= 1 || creature->GetCreatureTemplate()->trainer_type != TRAINER_TYPE_PETS || creature->GetCreatureTemplate()->trainer_class != CLASS_HUNTER)
canTalk = false;
break;
case GOSSIP_OPTION_TAXIVENDOR:
@@ -14406,7 +14409,7 @@ uint32 Player::GetDefaultGossipMenuForSource(WorldObject* source)
switch (source->GetTypeId())
{
case TYPEID_UNIT:
- return source->ToCreature()->GetCreatureInfo()->GossipMenuId;
+ return source->ToCreature()->GetCreatureTemplate()->GossipMenuId;
case TYPEID_GAMEOBJECT:
return source->ToGameObject()->GetGOInfo()->GetGossipMenuId();
default:
@@ -17578,7 +17581,7 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F
for (Tokens::iterator itr = GUIDlist.begin(); itr != GUIDlist.end(); ++itr)
looters.insert(atol(*itr));
item->SetSoulboundTradeable(looters);
- m_itemSoulboundTradeable.push_back(item);
+ AddTradeableItem(item);
}
else
{
@@ -19759,7 +19762,7 @@ void Player::PetSpellInitialize()
WorldPacket data(SMSG_PET_SPELLS, 8+2+4+4+4*MAX_UNIT_ACTION_BAR_INDEX+1+1);
data << uint64(pet->GetGUID());
- data << uint16(pet->GetCreatureInfo()->family); // creature family (required for pet talents)
+ data << uint16(pet->GetCreatureTemplate()->family); // creature family (required for pet talents)
data << uint32(0);
data << uint8(pet->GetReactState()) << uint8(charmInfo->GetCommandState()) << uint16(0);
@@ -19853,7 +19856,7 @@ void Player::VehicleSpellInitialize()
WorldPacket data(SMSG_PET_SPELLS, 8 + 2 + 4 + 4 + 4 * 10 + 1 + 1 + cooldownCount * (4 + 2 + 4 + 4));
data << uint64(veh->GetGUID());
- data << uint16(veh->GetCreatureInfo()->family);
+ data << uint16(veh->GetCreatureTemplate()->family);
data << uint32(0);
// The following three segments are read as one uint32
data << uint8(veh->GetReactState());
@@ -19939,7 +19942,7 @@ void Player::CharmSpellInitialize()
uint8 addlist = 0;
if (charm->GetTypeId() != TYPEID_PLAYER)
{
- //CreatureInfo const* cinfo = charm->ToCreature()->GetCreatureInfo();
+ //CreatureInfo const* cinfo = charm->ToCreature()->GetCreatureTemplate();
//if (cinfo && cinfo->type == CREATURE_TYPE_DEMON && getClass() == CLASS_WARLOCK)
{
for (uint32 i = 0; i < MAX_SPELL_CHARM; ++i)
@@ -22641,7 +22644,7 @@ bool Player::isHonorOrXPTarget(Unit* pVictim)
{
if (pVictim->ToCreature()->isTotem() ||
pVictim->ToCreature()->isPet() ||
- pVictim->ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_XP_AT_KILL)
+ pVictim->ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_XP_AT_KILL)
return false;
}
return true;
@@ -24001,7 +24004,7 @@ void Player::LearnPetTalent(uint64 petGuid, uint32 talentId, uint32 talentRank)
if (!talentTabInfo)
return;
- CreatureTemplate const* ci = pet->GetCreatureInfo();
+ CreatureTemplate const* ci = pet->GetCreatureTemplate();
if (!ci)
return;
@@ -24262,7 +24265,7 @@ void Player::BuildPetTalentsInfoData(WorldPacket* data)
data->put<uint32>(pointsPos, unspentTalentPoints); // put real points
- CreatureTemplate const* ci = pet->GetCreatureInfo();
+ CreatureTemplate const* ci = pet->GetCreatureTemplate();
if (!ci)
return;
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
index 82bbd1b38d5..db055088808 100755
--- a/src/server/game/Entities/Player/Player.h
+++ b/src/server/game/Entities/Player/Player.h
@@ -1337,6 +1337,7 @@ class Player : public Unit, public GridObject<Player>
void UpdateEnchantTime(uint32 time);
void UpdateSoulboundTradeItems();
+ void AddTradeableItem(Item* item);
void RemoveTradeableItem(Item* item);
void UpdateItemDuration(uint32 time, bool realtimeonly = false);
void AddEnchantmentDurations(Item* item);
@@ -1982,7 +1983,7 @@ class Player : public Unit, public GridObject<Player>
void UpdateDefense();
void UpdateWeaponSkill (WeaponAttackType attType);
- void UpdateCombatSkills(Unit* pVictim, WeaponAttackType attType, bool defence);
+ void UpdateCombatSkills(Unit* victim, WeaponAttackType attType, bool defence);
void SetSkill(uint16 id, uint16 step, uint16 currVal, uint16 maxVal);
uint16 GetMaxSkillValue(uint32 skill) const; // max + perm. bonus + temp bonus
@@ -2015,9 +2016,9 @@ class Player : public Unit, public GridObject<Player>
bool IsAtGroupRewardDistance(WorldObject const* pRewardSource) const;
bool IsAtRecruitAFriendDistance(WorldObject const* pOther) const;
- void RewardPlayerAndGroupAtKill(Unit* pVictim, bool isBattleGround);
+ void RewardPlayerAndGroupAtKill(Unit* victim, bool isBattleGround);
void RewardPlayerAndGroupAtEvent(uint32 creature_id, WorldObject* pRewardSource);
- bool isHonorOrXPTarget(Unit* pVictim);
+ bool isHonorOrXPTarget(Unit* victim);
bool GetsRecruitAFriendBonus(bool forXP);
uint8 GetGrantableLevels() { return m_grantableLevels; }
@@ -2026,7 +2027,7 @@ class Player : public Unit, public GridObject<Player>
ReputationMgr& GetReputationMgr() { return m_reputationMgr; }
ReputationMgr const& GetReputationMgr() const { return m_reputationMgr; }
ReputationRank GetReputationRank(uint32 faction_id) const;
- void RewardReputation(Unit* pVictim, float rate);
+ void RewardReputation(Unit* victim, float rate);
void RewardReputation(Quest const* quest);
void UpdateSkillsForLevel();
@@ -2037,7 +2038,7 @@ class Player : public Unit, public GridObject<Player>
/*** PVP SYSTEM ***/
/*********************************************************/
void UpdateHonorFields();
- bool RewardHonor(Unit* pVictim, uint32 groupsize, int32 honor = -1, bool pvptoken = false);
+ bool RewardHonor(Unit* victim, uint32 groupsize, int32 honor = -1, bool pvptoken = false);
uint32 GetHonorPoints() const { return GetUInt32Value(PLAYER_FIELD_HONOR_CURRENCY); }
uint32 GetArenaPoints() const { return GetUInt32Value(PLAYER_FIELD_ARENA_CURRENCY); }
void ModifyHonorPoints(int32 value, SQLTransaction* trans = NULL); //! If trans is specified, honor save query will be added to trans
@@ -2331,7 +2332,7 @@ class Player : public Unit, public GridObject<Player>
void UpdateTriggerVisibility();
template<class T>
- void UpdateVisibilityOf(T* target, UpdateData& data, std::set<Unit*>& visibleNow);
+ void UpdateVisibilityOf(T* target, UpdateData& data, std::set<Unit*>& visibleNow);
uint8 m_forced_speed_changes[MAX_MOVE_TYPE];
@@ -2414,6 +2415,7 @@ class Player : public Unit, public GridObject<Player>
void SetAuraUpdateMaskForRaid(uint8 slot) { m_auraRaidUpdateMask |= (uint64(1) << slot); }
Player* GetNextRandomRaidMember(float radius);
PartyResult CanUninviteFromGroup() const;
+
// Battleground Group System
void SetBattlegroundRaid(Group* group, int8 subgroup = -1);
void RemoveFromBattlegroundRaid();
diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp
index c0bd5cb95a6..283ab2c9cf6 100755
--- a/src/server/game/Entities/Unit/StatSystem.cpp
+++ b/src/server/game/Entities/Unit/StatSystem.cpp
@@ -1019,12 +1019,12 @@ void Creature::UpdateDamagePhysical(WeaponAttackType attType)
float weapon_maxdamage = GetWeaponDamageRange(attType, MAXDAMAGE);
/* difference in AP between current attack power and base value from DB */
- float att_pwr_change = GetTotalAttackPowerValue(attType) - GetCreatureInfo()->attackpower;
+ float att_pwr_change = GetTotalAttackPowerValue(attType) - GetCreatureTemplate()->attackpower;
float base_value = GetModifierValue(unitMod, BASE_VALUE) + (att_pwr_change * GetAPMultiplier(attType, false) / 14.0f);
float base_pct = GetModifierValue(unitMod, BASE_PCT);
float total_value = GetModifierValue(unitMod, TOTAL_VALUE);
float total_pct = GetModifierValue(unitMod, TOTAL_PCT);
- float dmg_multiplier = GetCreatureInfo()->dmg_multiplier;
+ float dmg_multiplier = GetCreatureTemplate()->dmg_multiplier;
if (!CanUseAttackType(attType))
{
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index f006b4c07c0..3af6d388ba9 100755
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -2014,7 +2014,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackT
else
parry_chance -= GetTotalAuraModifier(SPELL_AURA_MOD_EXPERTISE) * 25;
- if (victim->GetTypeId() == TYPEID_PLAYER || !(victim->ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_PARRY))
+ if (victim->GetTypeId() == TYPEID_PLAYER || !(victim->ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_PARRY))
{
int32 tmp2 = int32(parry_chance);
if (tmp2 > 0 // check if unit _can_ parry
@@ -2026,7 +2026,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackT
}
}
- if (victim->GetTypeId() == TYPEID_PLAYER || !(victim->ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_BLOCK))
+ if (victim->GetTypeId() == TYPEID_PLAYER || !(victim->ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_BLOCK))
{
tmp = block_chance;
if (tmp > 0 // check if unit _can_ block
@@ -2045,7 +2045,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackT
if (tmp > 0 && roll < (sum += tmp))
{
sLog->outStaticDebug ("RollMeleeOutcomeAgainst: CRIT <%d, %d)", sum-tmp, sum);
- if (GetTypeId() == TYPEID_UNIT && (ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_CRIT))
+ if (GetTypeId() == TYPEID_UNIT && (ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_CRIT))
sLog->outStaticDebug ("RollMeleeOutcomeAgainst: CRIT DISABLED)");
else
return MELEE_HIT_CRIT;
@@ -2075,7 +2075,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackT
if (getLevelForTarget(victim) >= victim->getLevelForTarget(this) + 4 &&
// can be from by creature (if can) or from controlled player that considered as creature
!IsControlledByPlayer() &&
- !(GetTypeId() == TYPEID_UNIT && ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_CRUSH))
+ !(GetTypeId() == TYPEID_UNIT && ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_CRUSH))
{
// when their weapon skill is 15 or more above victim's defense skill
tmp = victimDefenseSkill;
@@ -2189,7 +2189,7 @@ bool Unit::isSpellBlocked(Unit* victim, SpellInfo const* spellProto, WeaponAttac
{
// Check creatures flags_extra for disable block
if (victim->GetTypeId() == TYPEID_UNIT &&
- victim->ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_BLOCK)
+ victim->ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_BLOCK)
return false;
float blockChance = victim->GetUnitBlockChance();
@@ -2327,7 +2327,7 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit* victim, SpellInfo const* spell)
// Check creatures flags_extra for disable parry
if (victim->GetTypeId() == TYPEID_UNIT)
{
- uint32 flagEx = victim->ToCreature()->GetCreatureInfo()->flags_extra;
+ uint32 flagEx = victim->ToCreature()->GetCreatureTemplate()->flags_extra;
if (flagEx & CREATURE_FLAG_EXTRA_NO_PARRY)
canParry = false;
// Check creatures flags_extra for disable block
@@ -9178,7 +9178,7 @@ FactionTemplateEntry const* Unit::getFactionTemplateEntry() const
if (Player const* player = ToPlayer())
sLog->outError("Player %s has invalid faction (faction template id) #%u", player->GetName(), getFaction());
else if (Creature const* creature = ToCreature())
- sLog->outError("Creature (template id: %u) has invalid faction (faction template id) #%u", creature->GetCreatureInfo()->Entry, getFaction());
+ sLog->outError("Creature (template id: %u) has invalid faction (faction template id) #%u", creature->GetCreatureTemplate()->Entry, getFaction());
else
sLog->outError("Unit (name=%s, type=%u) has invalid faction (faction template id) #%u", GetName(), uint32(GetTypeId()), getFaction());
@@ -10235,7 +10235,7 @@ uint32 Unit::SpellDamageBonus(Unit* victim, SpellInfo const* spellProto, uint32
// ..done
// Pet damage?
if (GetTypeId() == TYPEID_UNIT && !ToCreature()->isPet())
- DoneTotalMod *= ToCreature()->GetSpellDamageMod(ToCreature()->GetCreatureInfo()->rank);
+ DoneTotalMod *= ToCreature()->GetSpellDamageMod(ToCreature()->GetCreatureTemplate()->rank);
AuraEffectList const& mModDamagePercentDone = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE);
for (AuraEffectList::const_iterator i = mModDamagePercentDone.begin(); i != mModDamagePercentDone.end(); ++i)
@@ -12032,7 +12032,7 @@ void Unit::SetInCombatState(bool PvP, Unit* enemy)
UpdateSpeed(MOVE_FLIGHT, true);
}
- if (!(creature->GetCreatureInfo()->type_flags & CREATURE_TYPEFLAGS_MOUNTED_COMBAT))
+ if (!(creature->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_MOUNTED_COMBAT))
Dismount();
}
@@ -12051,12 +12051,12 @@ void Unit::ClearInCombat()
// Player's state will be cleared in Player::UpdateContestedPvP
if (Creature* creature = ToCreature())
{
- if (creature->GetCreatureInfo() && creature->GetCreatureInfo()->unit_flags & UNIT_FLAG_IMMUNE_TO_PC)
+ if (creature->GetCreatureTemplate() && creature->GetCreatureTemplate()->unit_flags & UNIT_FLAG_IMMUNE_TO_PC)
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); // set immunity state to the one from db on evade
ClearUnitState(UNIT_STATE_ATTACK_PLAYER);
if (HasFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_TAPPED))
- SetUInt32Value(UNIT_DYNAMIC_FLAGS, creature->GetCreatureInfo()->dynamicflags);
+ SetUInt32Value(UNIT_DYNAMIC_FLAGS, creature->GetCreatureTemplate()->dynamicflags);
if (creature->isPet())
{
@@ -12171,7 +12171,7 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell) co
}
Creature const* creatureAttacker = ToCreature();
- if (creatureAttacker && creatureAttacker->GetCreatureInfo()->type_flags & CREATURE_TYPEFLAGS_UNK26)
+ if (creatureAttacker && creatureAttacker->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_UNK26)
return false;
Player const* playerAffectingAttacker = HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE) ? GetAffectingPlayer() : NULL;
@@ -12258,7 +12258,7 @@ bool Unit::_IsValidAssistTarget(Unit const* target, SpellInfo const* bySpell) co
// can't assist non-friendly targets
if (GetReactionTo(target) <= REP_NEUTRAL
&& target->GetReactionTo(this) <= REP_NEUTRAL
- && (!ToCreature() || !(ToCreature()->GetCreatureInfo()->type_flags & CREATURE_TYPEFLAGS_UNK26)))
+ && (!ToCreature() || !(ToCreature()->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_UNK26)))
return false;
// PvP case
@@ -12292,7 +12292,7 @@ bool Unit::_IsValidAssistTarget(Unit const* target, SpellInfo const* bySpell) co
&& !((target->GetByteValue(UNIT_FIELD_BYTES_2, 1) & UNIT_BYTE2_FLAG_PVP)))
{
if (Creature const* creatureTarget = target->ToCreature())
- return creatureTarget->GetCreatureInfo()->type_flags & CREATURE_TYPEFLAGS_UNK26 || creatureTarget->GetCreatureInfo()->type_flags & CREATURE_TYPEFLAGS_AID_PLAYERS;
+ return creatureTarget->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_UNK26 || creatureTarget->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_AID_PLAYERS;
}
return true;
}
@@ -12514,7 +12514,7 @@ void Unit::UpdateSpeed(UnitMoveType mtype, bool forced)
{
// Set creature speed rate from CreatureInfo
if (GetTypeId() == TYPEID_UNIT)
- speed *= ToCreature()->GetCreatureInfo()->speed_walk;
+ speed *= ToCreature()->GetCreatureTemplate()->speed_walk;
// Normalize speed by 191 aura SPELL_AURA_USE_NORMAL_MOVEMENT_SPEED if need
// TODO: possible affect only on MOVE_RUN
@@ -13200,7 +13200,7 @@ float Unit::ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration,
Unit const* source = casterOwner ? casterOwner : caster;
if ((target->GetTypeId() == TYPEID_PLAYER
- || ((Creature*)target)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_ALL_DIMINISH)
+ || ((Creature*)target)->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_ALL_DIMINISH)
&& source->GetTypeId() == TYPEID_PLAYER)
duration = limitduration;
}
@@ -13209,7 +13209,7 @@ float Unit::ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration,
if (group == DIMINISHING_TAUNT)
{
- if (GetTypeId() == TYPEID_UNIT && (ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_TAUNT_DIMINISH))
+ if (GetTypeId() == TYPEID_UNIT && (ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_TAUNT_DIMINISH))
{
DiminishingLevels diminish = Level;
switch (diminish)
@@ -13226,7 +13226,7 @@ float Unit::ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration,
// Some diminishings applies to mobs too (for example, Stun)
else if ((GetDiminishingReturnsGroupType(group) == DRTYPE_PLAYER
&& ((targetOwner ? (targetOwner->GetTypeId() == TYPEID_PLAYER) : (GetTypeId() == TYPEID_PLAYER))
- || (GetTypeId() == TYPEID_UNIT && ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_ALL_DIMINISH)))
+ || (GetTypeId() == TYPEID_UNIT && ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_ALL_DIMINISH)))
|| GetDiminishingReturnsGroupType(group) == DRTYPE_ALL)
{
DiminishingLevels diminish = Level;
@@ -13310,7 +13310,7 @@ uint32 Unit::GetCreatureType() const
return CREATURE_TYPE_HUMANOID;
}
else
- return ToCreature()->GetCreatureInfo()->type;
+ return ToCreature()->GetCreatureTemplate()->type;
}
/*#######################################
@@ -15393,10 +15393,10 @@ void Unit::Kill(Unit* victim, bool durabilityLoss)
creature->lootForPickPocketed = false;
loot->clear();
- if (uint32 lootid = creature->GetCreatureInfo()->lootid)
+ if (uint32 lootid = creature->GetCreatureTemplate()->lootid)
loot->FillLoot(lootid, LootTemplates_Creature, looter, false, false, creature->GetLootMode());
- loot->generateMoneyLoot(creature->GetCreatureInfo()->mingold, creature->GetCreatureInfo()->maxgold);
+ loot->generateMoneyLoot(creature->GetCreatureTemplate()->mingold, creature->GetCreatureTemplate()->maxgold);
}
player->RewardPlayerAndGroupAtKill(victim, false);
@@ -15497,7 +15497,7 @@ void Unit::Kill(Unit* victim, bool durabilityLoss)
if (!creature->isPet())
{
creature->DeleteThreatList();
- CreatureTemplate const* cInfo = creature->GetCreatureInfo();
+ CreatureTemplate const* cInfo = creature->GetCreatureTemplate();
if (cInfo && (cInfo->lootid || cInfo->maxgold > 0))
creature->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
}
@@ -15526,7 +15526,7 @@ void Unit::Kill(Unit* victim, bool durabilityLoss)
{
if (instanceMap->IsRaidOrHeroicDungeon())
{
- if (creature->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_INSTANCE_BIND)
+ if (creature->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_INSTANCE_BIND)
((InstanceMap*)instanceMap)->PermBindAllPlayers(creditedPlayer);
}
else
@@ -15935,7 +15935,7 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
case CHARM_TYPE_CHARM:
if (GetTypeId() == TYPEID_UNIT && charmer->getClass() == CLASS_WARLOCK)
{
- CreatureTemplate const* cinfo = ToCreature()->GetCreatureInfo();
+ CreatureTemplate const* cinfo = ToCreature()->GetCreatureTemplate();
if (cinfo && cinfo->type == CREATURE_TYPE_DEMON)
{
// to prevent client crash
@@ -16039,7 +16039,7 @@ void Unit::RemoveCharmedBy(Unit* charmer)
case CHARM_TYPE_CHARM:
if (GetTypeId() == TYPEID_UNIT && charmer->getClass() == CLASS_WARLOCK)
{
- CreatureTemplate const* cinfo = ToCreature()->GetCreatureInfo();
+ CreatureTemplate const* cinfo = ToCreature()->GetCreatureTemplate();
if (cinfo && cinfo->type == CREATURE_TYPE_DEMON)
{
SetByteValue(UNIT_FIELD_BYTES_0, 1, uint8(cinfo->unit_class));
@@ -16078,7 +16078,7 @@ void Unit::RestoreFaction()
}
}
- if (CreatureTemplate const* cinfo = ToCreature()->GetCreatureInfo()) // normal creature
+ if (CreatureTemplate const* cinfo = ToCreature()->GetCreatureTemplate()) // normal creature
{
FactionTemplateEntry const* faction = getFactionTemplateEntry();
setFaction((faction && faction->friendlyMask & 0x004) ? cinfo->faction_H : cinfo->faction_A);
diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp
index 348ce132da8..6693af5c91f 100755
--- a/src/server/game/Entities/Vehicle/Vehicle.cpp
+++ b/src/server/game/Entities/Vehicle/Vehicle.cpp
@@ -146,7 +146,7 @@ void Vehicle::ApplyAllImmunities()
_me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK_DEST, true);
// Mechanical units & vehicles ( which are not Bosses, they have own immunities in DB ) should be also immune on healing ( exceptions in switch below )
- if (_me->ToCreature() && _me->ToCreature()->GetCreatureInfo()->type == CREATURE_TYPE_MECHANICAL && !_me->ToCreature()->isWorldBoss())
+ if (_me->ToCreature() && _me->ToCreature()->GetCreatureTemplate()->type == CREATURE_TYPE_MECHANICAL && !_me->ToCreature()->isWorldBoss())
{
// Heal & dispel ...
_me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_HEAL, true);
diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp
index 6f5dc0e511e..808da1ac791 100755
--- a/src/server/game/Events/GameEventMgr.cpp
+++ b/src/server/game/Events/GameEventMgr.cpp
@@ -1174,7 +1174,7 @@ void GameEventMgr::UpdateEventNPCFlags(uint16 event_id)
if (cr)
{
uint32 npcflag = GetNPCFlag(cr);
- if (const CreatureTemplate* ci = cr->GetCreatureInfo())
+ if (const CreatureTemplate* ci = cr->GetCreatureTemplate())
npcflag |= ci->npcflag;
cr->SetUInt32Value(UNIT_NPC_FLAGS, npcflag);
// reset gossip options, since the flag change might have added / removed some
diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp
index b24b5be014a..9879ef7ff3b 100755
--- a/src/server/game/Groups/Group.cpp
+++ b/src/server/game/Groups/Group.cpp
@@ -41,6 +41,7 @@ totalPlayersRolling(0), totalNeed(0), totalGreed(0), totalPass(0), itemSlot(0),
rollVoteMask(ROLL_ALL_TYPE_NO_DISENCHANT)
{
}
+
Roll::~Roll()
{
}
@@ -1727,7 +1728,7 @@ bool Group::InCombatToInstance(uint32 instanceId)
Player* player = itr->getSource();
if (player && !player->getAttackers().empty() && player->GetInstanceId() == instanceId && (player->GetMap()->IsRaidOrHeroicDungeon()))
for (std::set<Unit*>::const_iterator i = player->getAttackers().begin(); i != player->getAttackers().end(); ++i)
- if ((*i) && (*i)->GetTypeId() == TYPEID_UNIT && (*i)->ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_INSTANCE_BIND)
+ if ((*i) && (*i)->GetTypeId() == TYPEID_UNIT && (*i)->ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_INSTANCE_BIND)
return true;
}
return false;
diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp
index 802597e14eb..2434ba6eaa7 100755
--- a/src/server/game/Handlers/ItemHandler.cpp
+++ b/src/server/game/Handlers/ItemHandler.cpp
@@ -1262,7 +1262,6 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data)
}
}
}
-
}
}
diff --git a/src/server/game/Handlers/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp
index 6508f08dc22..496eae34133 100755
--- a/src/server/game/Handlers/LootHandler.cpp
+++ b/src/server/game/Handlers/LootHandler.cpp
@@ -386,8 +386,8 @@ void WorldSession::DoLootRelease(uint64 lguid)
{
Creature* creature = GetPlayer()->GetMap()->GetCreature(lguid);
- bool ok_loot = creature && creature->isAlive() == (player->getClass() == CLASS_ROGUE && creature->lootForPickPocketed);
- if (!ok_loot || !creature->IsWithinDistInMap(_player, INTERACTION_DISTANCE))
+ bool lootAllowed = creature && creature->isAlive() == (player->getClass() == CLASS_ROGUE && creature->lootForPickPocketed);
+ if (!lootAllowed || !creature->IsWithinDistInMap(_player, INTERACTION_DISTANCE))
return;
loot = &creature->loot;
@@ -448,7 +448,7 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket & recv_data)
if (_player->GetLootGUID() != lootguid)
return;
- Loot* pLoot = NULL;
+ Loot* loot = NULL;
if (IS_CRE_OR_VEH_GUID(GetPlayer()->GetLootGUID()))
{
@@ -456,7 +456,7 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket & recv_data)
if (!creature)
return;
- pLoot = &creature->loot;
+ loot = &creature->loot;
}
else if (IS_GAMEOBJECT_GUID(GetPlayer()->GetLootGUID()))
{
@@ -464,19 +464,19 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket & recv_data)
if (!pGO)
return;
- pLoot = &pGO->loot;
+ loot = &pGO->loot;
}
- if (!pLoot)
+ if (!loot)
return;
- if (slotid > pLoot->items.size())
+ if (slotid > loot->items.size())
{
- sLog->outDebug(LOG_FILTER_LOOT, "MasterLootItem: Player %s might be using a hack! (slot %d, size %lu)", GetPlayer()->GetName(), slotid, (unsigned long)pLoot->items.size());
+ sLog->outDebug(LOG_FILTER_LOOT, "MasterLootItem: Player %s might be using a hack! (slot %d, size %lu)", GetPlayer()->GetName(), slotid, (unsigned long)loot->items.size());
return;
}
- LootItem& item = pLoot->items[slotid];
+ LootItem& item = loot->items[slotid];
ItemPosCountVec dest;
InventoryResult msg = target->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, item.itemid, item.count);
@@ -495,14 +495,13 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket & recv_data)
Item* newitem = target->StoreNewItem(dest, item.itemid, true, item.randomPropertyId, looters);
target->SendNewItem(newitem, uint32(item.count), false, false, true);
target->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM, item.itemid, item.count);
- target->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE, pLoot->loot_type, item.count);
+ target->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE, loot->loot_type, item.count);
target->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_EPIC_ITEM, item.itemid, item.count);
// mark as looted
item.count=0;
item.is_looted=true;
- pLoot->NotifyItemRemoved(slotid);
- --pLoot->unlootedCount;
+ loot->NotifyItemRemoved(slotid);
+ --loot->unlootedCount;
}
-
diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp
index f220be7d2b5..aaa41ec3519 100755
--- a/src/server/game/Handlers/MiscHandler.cpp
+++ b/src/server/game/Handlers/MiscHandler.cpp
@@ -125,11 +125,11 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data)
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
- if ((unit && unit->GetCreatureInfo()->ScriptID != unit->LastUsedScriptID) || (go && go->GetGOInfo()->ScriptId != go->LastUsedScriptID))
+ if ((unit && unit->GetCreatureTemplate()->ScriptID != unit->LastUsedScriptID) || (go && go->GetGOInfo()->ScriptId != go->LastUsedScriptID))
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleGossipSelectOptionOpcode - Script reloaded while in use, ignoring and set new scipt id");
if (unit)
- unit->LastUsedScriptID = unit->GetCreatureInfo()->ScriptID;
+ unit->LastUsedScriptID = unit->GetCreatureTemplate()->ScriptID;
if (go)
go->LastUsedScriptID = go->GetGOInfo()->ScriptId;
_player->PlayerTalkClass->SendCloseGossip();
@@ -811,7 +811,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recv_data)
Player* player = GetPlayer();
if (player->isInFlight())
{
- sLog->outDebug(LOG_FILTER_NETWORKIO, "Player '%s' (GUID: %u) in flight, ignore Area Trigger ID:%u",
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "HandleAreaTriggerOpcode: Player '%s' (GUID: %u) in flight, ignore Area Trigger ID:%u",
player->GetName(), player->GetGUIDLow(), triggerId);
return;
}
@@ -819,14 +819,14 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recv_data)
AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(triggerId);
if (!atEntry)
{
- sLog->outDebug(LOG_FILTER_NETWORKIO, "Player '%s' (GUID: %u) send unknown (by DBC) Area Trigger ID:%u",
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "HandleAreaTriggerOpcode: Player '%s' (GUID: %u) send unknown (by DBC) Area Trigger ID:%u",
player->GetName(), player->GetGUIDLow(), triggerId);
return;
}
if (player->GetMapId() != atEntry->mapid)
{
- sLog->outDebug(LOG_FILTER_NETWORKIO, "Player '%s' (GUID: %u) too far (trigger map: %u player map: %u), ignore Area Trigger ID: %u",
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "HandleAreaTriggerOpcode: Player '%s' (GUID: %u) too far (trigger map: %u player map: %u), ignore Area Trigger ID: %u",
player->GetName(), atEntry->mapid, player->GetMapId(), player->GetGUIDLow(), triggerId);
return;
}
@@ -840,7 +840,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recv_data)
float dist = player->GetDistance(atEntry->x, atEntry->y, atEntry->z);
if (dist > atEntry->radius + delta)
{
- sLog->outDebug(LOG_FILTER_NETWORKIO, "Player '%s' (GUID: %u) too far (radius: %f distance: %f), ignore Area Trigger ID: %u",
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "HandleAreaTriggerOpcode: Player '%s' (GUID: %u) too far (radius: %f distance: %f), ignore Area Trigger ID: %u",
player->GetName(), player->GetGUIDLow(), atEntry->radius, dist, triggerId);
return;
}
@@ -871,7 +871,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recv_data)
(fabs(dy) > atEntry->box_y / 2 + delta) ||
(fabs(dz) > atEntry->box_z / 2 + delta))
{
- sLog->outDebug(LOG_FILTER_NETWORKIO, "Player '%s' (GUID: %u) too far (1/2 box X: %f 1/2 box Y: %f 1/2 box Z: %f rotatedPlayerX: %f rotatedPlayerY: %f dZ:%f), ignore Area Trigger ID: %u",
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "HandleAreaTriggerOpcode: Player '%s' (GUID: %u) too far (1/2 box X: %f 1/2 box Y: %f 1/2 box Z: %f rotatedPlayerX: %f rotatedPlayerY: %f dZ:%f), ignore Area Trigger ID: %u",
player->GetName(), player->GetGUIDLow(), atEntry->box_x/2, atEntry->box_y/2, atEntry->box_z/2, rotPlayerX, rotPlayerY, dz, triggerId);
return;
}
@@ -1325,7 +1325,7 @@ void WorldSession::HandleWhoisOpcode(WorldPacket& recv_data)
WorldPacket data(SMSG_WHOIS, msg.size()+1);
data << msg;
- _player->GetSession()->SendPacket(&data);
+ SendPacket(&data);
sLog->outDebug(LOG_FILTER_NETWORKIO, "Received whois command from player %s for character %s", GetPlayer()->GetName(), charname.c_str());
}
@@ -1501,16 +1501,16 @@ void WorldSession::HandleSetDungeonDifficultyOpcode(WorldPacket & recv_data)
{
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
{
- Player* pGroupGuy = itr->getSource();
- if (!pGroupGuy)
+ Player* groupGuy = itr->getSource();
+ if (!groupGuy)
continue;
- if (!pGroupGuy->IsInMap(pGroupGuy))
+ if (!groupGuy->IsInMap(groupGuy))
return;
- if (pGroupGuy->GetMap()->IsNonRaidDungeon())
+ if (groupGuy->GetMap()->IsNonRaidDungeon())
{
- sLog->outError("WorldSession::HandleSetDungeonDifficultyOpcode: player %d tried to reset the instance while group member (Name: %s, GUID: %u) is inside!", _player->GetGUIDLow(), pGroupGuy->GetName(), pGroupGuy->GetGUIDLow());
+ sLog->outError("WorldSession::HandleSetDungeonDifficultyOpcode: player %d tried to reset the instance while group member (Name: %s, GUID: %u) is inside!", _player->GetGUIDLow(), groupGuy->GetName(), groupGuy->GetGUIDLow());
return;
}
}
@@ -1558,14 +1558,14 @@ void WorldSession::HandleSetRaidDifficultyOpcode(WorldPacket & recv_data)
{
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
{
- Player* pGroupGuy = itr->getSource();
- if (!pGroupGuy)
+ Player* groupGuy = itr->getSource();
+ if (!groupGuy)
continue;
- if (!pGroupGuy->IsInMap(pGroupGuy))
+ if (!groupGuy->IsInMap(groupGuy))
return;
- if (pGroupGuy->GetMap()->IsRaid())
+ if (groupGuy->GetMap()->IsRaid())
{
sLog->outError("WorldSession::HandleSetRaidDifficultyOpcode: player %d tried to reset the instance while inside!", _player->GetGUIDLow());
return;
diff --git a/src/server/game/Handlers/NPCHandler.cpp b/src/server/game/Handlers/NPCHandler.cpp
index 6a44c7ae5e2..5479791d341 100755
--- a/src/server/game/Handlers/NPCHandler.cpp
+++ b/src/server/game/Handlers/NPCHandler.cpp
@@ -135,7 +135,7 @@ void WorldSession::SendTrainerList(uint64 guid, const std::string& strTitle)
if (!unit->isCanTrainingOf(_player, true))
return;
- CreatureTemplate const* ci = unit->GetCreatureInfo();
+ CreatureTemplate const* ci = unit->GetCreatureTemplate();
if (!ci)
{
@@ -337,7 +337,7 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket & recv_data)
if (!sScriptMgr->OnGossipHello(_player, unit))
{
// _player->TalkedToCreature(unit->GetEntry(), unit->GetGUID());
- _player->PrepareGossipMenu(unit, unit->GetCreatureInfo()->GossipMenuId, true);
+ _player->PrepareGossipMenu(unit, unit->GetCreatureTemplate()->GossipMenuId, true);
_player->SendPreparedGossip(unit);
}
unit->AI()->sGossipHello(_player);
diff --git a/src/server/game/Handlers/QuestHandler.cpp b/src/server/game/Handlers/QuestHandler.cpp
index 05d945d3a93..6725992b48a 100755
--- a/src/server/game/Handlers/QuestHandler.cpp
+++ b/src/server/game/Handlers/QuestHandler.cpp
@@ -103,7 +103,7 @@ void WorldSession::HandleQuestgiverHelloOpcode(WorldPacket & recv_data)
if (sScriptMgr->OnGossipHello(_player, creature))
return;
- _player->PrepareGossipMenu(creature, creature->GetCreatureInfo()->GossipMenuId, true);
+ _player->PrepareGossipMenu(creature, creature->GetCreatureTemplate()->GossipMenuId, true);
_player->SendPreparedGossip(creature);
creature->AI()->sGossipHello(_player);
diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp
index 64e9b9a27e4..3522571775c 100755
--- a/src/server/game/Loot/LootMgr.cpp
+++ b/src/server/game/Loot/LootMgr.cpp
@@ -147,7 +147,6 @@ uint32 LootStore::LoadLootTable()
// Adds current row to the template
tab->second->AddEntry(storeitem);
++count;
-
}
while (result->NextRow());
@@ -205,12 +204,12 @@ LootTemplate* LootStore::GetLootForConditionFill(uint32 loot_id)
return tab->second;
}
-uint32 LootStore::LoadAndCollectLootIds(LootIdSet& ids_set)
+uint32 LootStore::LoadAndCollectLootIds(LootIdSet& lootIdSet)
{
uint32 count = LoadLootTable();
for (LootTemplateMap::const_iterator tab = m_LootTemplates.begin(); tab != m_LootTemplates.end(); ++tab)
- ids_set.insert(tab->first);
+ lootIdSet.insert(tab->first);
return count;
}
@@ -221,16 +220,16 @@ void LootStore::CheckLootRefs(LootIdSet* ref_set) const
ltItr->second->CheckLootRefs(m_LootTemplates, ref_set);
}
-void LootStore::ReportUnusedIds(LootIdSet const& ids_set) const
+void LootStore::ReportUnusedIds(LootIdSet const& lootIdSet) const
{
// all still listed ids isn't referenced
- for (LootIdSet::const_iterator itr = ids_set.begin(); itr != ids_set.end(); ++itr)
+ for (LootIdSet::const_iterator itr = lootIdSet.begin(); itr != lootIdSet.end(); ++itr)
sLog->outErrorDb("Table '%s' entry %d isn't %s and not referenced from loot, and then useless.", GetName(), *itr, GetEntryName());
}
void LootStore::ReportNotExistedId(uint32 id) const
{
- sLog->outErrorDb("Table '%s' entry %d (%s) not exist but used as loot id in DB.", GetName(), id, GetEntryName());
+ sLog->outErrorDb("Table '%s' entry %d (%s) does not exist but used as loot id in DB.", GetName(), id, GetEntryName());
}
//
@@ -296,7 +295,6 @@ bool LootStoreItem::IsValid(LootStore const& store, uint32 entry) const
sLog->outErrorDb("Table '%s' entry %d item %d: max count (%u) less that min count (%i) - skipped", store.GetName(), entry, itemid, int32(maxcount), mincountOrRef);
return false;
}
-
}
else // mincountOrRef < 0
{
@@ -1420,8 +1418,8 @@ void LoadLootTemplates_Creature()
uint32 oldMSTime = getMSTime();
- LootIdSet ids_set, ids_setUsed;
- uint32 count = LootTemplates_Creature.LoadAndCollectLootIds(ids_set);
+ LootIdSet lootIdSet, lootIdSetUsed;
+ uint32 count = LootTemplates_Creature.LoadAndCollectLootIds(lootIdSet);
// Remove real entries and check loot existence
CreatureTemplateContainer const* ctc = sObjectMgr->GetCreatureTemplates();
@@ -1429,18 +1427,18 @@ void LoadLootTemplates_Creature()
{
if (uint32 lootid = itr->second.lootid)
{
- if (ids_set.find(lootid) == ids_set.end())
+ if (lootIdSet.find(lootid) == lootIdSet.end())
LootTemplates_Creature.ReportNotExistedId(lootid);
else
- ids_setUsed.insert(lootid);
+ lootIdSetUsed.insert(lootid);
}
}
- for (LootIdSet::const_iterator itr = ids_setUsed.begin(); itr != ids_setUsed.end(); ++itr)
- ids_set.erase(*itr);
+ for (LootIdSet::const_iterator itr = lootIdSetUsed.begin(); itr != lootIdSetUsed.end(); ++itr)
+ lootIdSet.erase(*itr);
// output error for any still listed (not referenced from appropriate table) ids
- LootTemplates_Creature.ReportUnusedIds(ids_set);
+ LootTemplates_Creature.ReportUnusedIds(lootIdSet);
if (count)
sLog->outString(">> Loaded %u creature loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
@@ -1456,7 +1454,7 @@ void LoadLootTemplates_Disenchant()
uint32 oldMSTime = getMSTime();
- LootIdSet lootIdSet, loodIdSetUsed;
+ LootIdSet lootIdSet, lootIdSetUsed;
uint32 count = LootTemplates_Disenchant.LoadAndCollectLootIds(lootIdSet);
ItemTemplateContainer const* its = sObjectMgr->GetItemTemplateStore();
@@ -1467,11 +1465,11 @@ void LoadLootTemplates_Disenchant()
if (lootIdSet.find(lootid) == lootIdSet.end())
LootTemplates_Disenchant.ReportNotExistedId(lootid);
else
- loodIdSetUsed.insert(lootid);
+ lootIdSetUsed.insert(lootid);
}
}
- for (LootIdSet::const_iterator itr = loodIdSetUsed.begin(); itr != loodIdSetUsed.end(); ++itr)
+ for (LootIdSet::const_iterator itr = lootIdSetUsed.begin(); itr != lootIdSetUsed.end(); ++itr)
lootIdSet.erase(*itr);
// output error for any still listed (not referenced from appropriate table) ids
@@ -1490,17 +1488,17 @@ void LoadLootTemplates_Fishing()
uint32 oldMSTime = getMSTime();
- LootIdSet ids_set;
- uint32 count = LootTemplates_Fishing.LoadAndCollectLootIds(ids_set);
+ LootIdSet lootIdSet;
+ uint32 count = LootTemplates_Fishing.LoadAndCollectLootIds(lootIdSet);
// remove real entries and check existence loot
for (uint32 i = 1; i < sAreaStore.GetNumRows(); ++i)
if (AreaTableEntry const* areaEntry = sAreaStore.LookupEntry(i))
- if (ids_set.find(areaEntry->ID) != ids_set.end())
- ids_set.erase(areaEntry->ID);
+ if (lootIdSet.find(areaEntry->ID) != lootIdSet.end())
+ lootIdSet.erase(areaEntry->ID);
// output error for any still listed (not referenced from appropriate table) ids
- LootTemplates_Fishing.ReportUnusedIds(ids_set);
+ LootTemplates_Fishing.ReportUnusedIds(lootIdSet);
if (count)
sLog->outString(">> Loaded %u fishing loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
@@ -1516,8 +1514,8 @@ void LoadLootTemplates_Gameobject()
uint32 oldMSTime = getMSTime();
- LootIdSet ids_set, ids_setUsed;
- uint32 count = LootTemplates_Gameobject.LoadAndCollectLootIds(ids_set);
+ LootIdSet lootIdSet, lootIdSetUsed;
+ uint32 count = LootTemplates_Gameobject.LoadAndCollectLootIds(lootIdSet);
// remove real entries and check existence loot
GameObjectTemplateContainer const* gotc = sObjectMgr->GetGameObjectTemplates();
@@ -1525,18 +1523,18 @@ void LoadLootTemplates_Gameobject()
{
if (uint32 lootid = itr->second.GetLootId())
{
- if (sObjectMgr->IsGoOfSpecificEntrySpawned(itr->second.entry) && ids_set.find(lootid) == ids_set.end())
+ if (sObjectMgr->IsGoOfSpecificEntrySpawned(itr->second.entry) && lootIdSet.find(lootid) == lootIdSet.end())
LootTemplates_Gameobject.ReportNotExistedId(lootid);
else
- ids_setUsed.insert(lootid);
+ lootIdSetUsed.insert(lootid);
}
}
- for (LootIdSet::const_iterator itr = ids_setUsed.begin(); itr != ids_setUsed.end(); ++itr)
- ids_set.erase(*itr);
+ for (LootIdSet::const_iterator itr = lootIdSetUsed.begin(); itr != lootIdSetUsed.end(); ++itr)
+ lootIdSet.erase(*itr);
// output error for any still listed (not referenced from appropriate table) ids
- LootTemplates_Gameobject.ReportUnusedIds(ids_set);
+ LootTemplates_Gameobject.ReportUnusedIds(lootIdSet);
if (count)
sLog->outString(">> Loaded %u gameobject loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
@@ -1552,17 +1550,17 @@ void LoadLootTemplates_Item()
uint32 oldMSTime = getMSTime();
- LootIdSet ids_set;
- uint32 count = LootTemplates_Item.LoadAndCollectLootIds(ids_set);
+ LootIdSet lootIdSet;
+ uint32 count = LootTemplates_Item.LoadAndCollectLootIds(lootIdSet);
// remove real entries and check existence loot
ItemTemplateContainer const* its = sObjectMgr->GetItemTemplateStore();
for (ItemTemplateContainer::const_iterator itr = its->begin(); itr != its->end(); ++itr)
- if (ids_set.find(itr->second.ItemId) != ids_set.end() && itr->second.Flags & ITEM_PROTO_FLAG_OPENABLE)
- ids_set.erase(itr->second.ItemId);
+ if (lootIdSet.find(itr->second.ItemId) != lootIdSet.end() && itr->second.Flags & ITEM_PROTO_FLAG_OPENABLE)
+ lootIdSet.erase(itr->second.ItemId);
// output error for any still listed (not referenced from appropriate table) ids
- LootTemplates_Item.ReportUnusedIds(ids_set);
+ LootTemplates_Item.ReportUnusedIds(lootIdSet);
if (count)
sLog->outString(">> Loaded %u prospecting loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
@@ -1578,8 +1576,8 @@ void LoadLootTemplates_Milling()
uint32 oldMSTime = getMSTime();
- LootIdSet ids_set;
- uint32 count = LootTemplates_Milling.LoadAndCollectLootIds(ids_set);
+ LootIdSet lootIdSet;
+ uint32 count = LootTemplates_Milling.LoadAndCollectLootIds(lootIdSet);
// remove real entries and check existence loot
ItemTemplateContainer const* its = sObjectMgr->GetItemTemplateStore();
@@ -1588,12 +1586,12 @@ void LoadLootTemplates_Milling()
if (!(itr->second.Flags & ITEM_PROTO_FLAG_MILLABLE))
continue;
- if (ids_set.find(itr->second.ItemId) != ids_set.end())
- ids_set.erase(itr->second.ItemId);
+ if (lootIdSet.find(itr->second.ItemId) != lootIdSet.end())
+ lootIdSet.erase(itr->second.ItemId);
}
// output error for any still listed (not referenced from appropriate table) ids
- LootTemplates_Milling.ReportUnusedIds(ids_set);
+ LootTemplates_Milling.ReportUnusedIds(lootIdSet);
if (count)
sLog->outString(">> Loaded %u milling loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
@@ -1609,8 +1607,8 @@ void LoadLootTemplates_Pickpocketing()
uint32 oldMSTime = getMSTime();
- LootIdSet ids_set, ids_setUsed;
- uint32 count = LootTemplates_Pickpocketing.LoadAndCollectLootIds(ids_set);
+ LootIdSet lootIdSet, lootIdSetUsed;
+ uint32 count = LootTemplates_Pickpocketing.LoadAndCollectLootIds(lootIdSet);
// Remove real entries and check loot existence
CreatureTemplateContainer const* ctc = sObjectMgr->GetCreatureTemplates();
@@ -1618,18 +1616,18 @@ void LoadLootTemplates_Pickpocketing()
{
if (uint32 lootid = itr->second.pickpocketLootId)
{
- if (ids_set.find(lootid) == ids_set.end())
+ if (lootIdSet.find(lootid) == lootIdSet.end())
LootTemplates_Pickpocketing.ReportNotExistedId(lootid);
else
- ids_setUsed.insert(lootid);
+ lootIdSetUsed.insert(lootid);
}
}
- for (LootIdSet::const_iterator itr = ids_setUsed.begin(); itr != ids_setUsed.end(); ++itr)
- ids_set.erase(*itr);
+ for (LootIdSet::const_iterator itr = lootIdSetUsed.begin(); itr != lootIdSetUsed.end(); ++itr)
+ lootIdSet.erase(*itr);
// output error for any still listed (not referenced from appropriate table) ids
- LootTemplates_Pickpocketing.ReportUnusedIds(ids_set);
+ LootTemplates_Pickpocketing.ReportUnusedIds(lootIdSet);
if (count)
sLog->outString(">> Loaded %u pickpocketing loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
@@ -1645,8 +1643,8 @@ void LoadLootTemplates_Prospecting()
uint32 oldMSTime = getMSTime();
- LootIdSet ids_set;
- uint32 count = LootTemplates_Prospecting.LoadAndCollectLootIds(ids_set);
+ LootIdSet lootIdSet;
+ uint32 count = LootTemplates_Prospecting.LoadAndCollectLootIds(lootIdSet);
// remove real entries and check existence loot
ItemTemplateContainer const* its = sObjectMgr->GetItemTemplateStore();
@@ -1655,12 +1653,12 @@ void LoadLootTemplates_Prospecting()
if (!(itr->second.Flags & ITEM_PROTO_FLAG_PROSPECTABLE))
continue;
- if (ids_set.find(itr->second.ItemId) != ids_set.end())
- ids_set.erase(itr->second.ItemId);
+ if (lootIdSet.find(itr->second.ItemId) != lootIdSet.end())
+ lootIdSet.erase(itr->second.ItemId);
}
// output error for any still listed (not referenced from appropriate table) ids
- LootTemplates_Prospecting.ReportUnusedIds(ids_set);
+ LootTemplates_Prospecting.ReportUnusedIds(lootIdSet);
if (count)
sLog->outString(">> Loaded %u prospecting loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
@@ -1676,17 +1674,17 @@ void LoadLootTemplates_Mail()
uint32 oldMSTime = getMSTime();
- LootIdSet ids_set;
- uint32 count = LootTemplates_Mail.LoadAndCollectLootIds(ids_set);
+ LootIdSet lootIdSet;
+ uint32 count = LootTemplates_Mail.LoadAndCollectLootIds(lootIdSet);
// remove real entries and check existence loot
for (uint32 i = 1; i < sMailTemplateStore.GetNumRows(); ++i)
if (sMailTemplateStore.LookupEntry(i))
- if (ids_set.find(i) != ids_set.end())
- ids_set.erase(i);
+ if (lootIdSet.find(i) != lootIdSet.end())
+ lootIdSet.erase(i);
// output error for any still listed (not referenced from appropriate table) ids
- LootTemplates_Mail.ReportUnusedIds(ids_set);
+ LootTemplates_Mail.ReportUnusedIds(lootIdSet);
if (count)
sLog->outString(">> Loaded %u mail loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
@@ -1702,8 +1700,8 @@ void LoadLootTemplates_Skinning()
uint32 oldMSTime = getMSTime();
- LootIdSet ids_set, ids_setUsed;
- uint32 count = LootTemplates_Skinning.LoadAndCollectLootIds(ids_set);
+ LootIdSet lootIdSet, lootIdSetUsed;
+ uint32 count = LootTemplates_Skinning.LoadAndCollectLootIds(lootIdSet);
// remove real entries and check existence loot
CreatureTemplateContainer const* ctc = sObjectMgr->GetCreatureTemplates();
@@ -1711,18 +1709,18 @@ void LoadLootTemplates_Skinning()
{
if (uint32 lootid = itr->second.SkinLootId)
{
- if (ids_set.find(lootid) == ids_set.end())
+ if (lootIdSet.find(lootid) == lootIdSet.end())
LootTemplates_Skinning.ReportNotExistedId(lootid);
else
- ids_setUsed.insert(lootid);
+ lootIdSetUsed.insert(lootid);
}
}
- for (LootIdSet::const_iterator itr = ids_setUsed.begin(); itr != ids_setUsed.end(); ++itr)
- ids_set.erase(*itr);
+ for (LootIdSet::const_iterator itr = lootIdSetUsed.begin(); itr != lootIdSetUsed.end(); ++itr)
+ lootIdSet.erase(*itr);
// output error for any still listed (not referenced from appropriate table) ids
- LootTemplates_Skinning.ReportUnusedIds(ids_set);
+ LootTemplates_Skinning.ReportUnusedIds(lootIdSet);
if (count)
sLog->outString(">> Loaded %u skinning loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
@@ -1738,8 +1736,8 @@ void LoadLootTemplates_Spell()
uint32 oldMSTime = getMSTime();
- LootIdSet ids_set;
- uint32 count = LootTemplates_Spell.LoadAndCollectLootIds(ids_set);
+ LootIdSet lootIdSet;
+ uint32 count = LootTemplates_Spell.LoadAndCollectLootIds(lootIdSet);
// remove real entries and check existence loot
for (uint32 spell_id = 1; spell_id < sSpellMgr->GetSpellInfoStoreSize(); ++spell_id)
@@ -1752,7 +1750,7 @@ void LoadLootTemplates_Spell()
if (!spellInfo->IsLootCrafting())
continue;
- if (ids_set.find(spell_id) == ids_set.end())
+ if (lootIdSet.find(spell_id) == lootIdSet.end())
{
// not report about not trainable spells (optionally supported by DB)
// ignore 61756 (Northrend Inscription Research (FAST QA VERSION) for example
@@ -1762,11 +1760,11 @@ void LoadLootTemplates_Spell()
}
}
else
- ids_set.erase(spell_id);
+ lootIdSet.erase(spell_id);
}
// output error for any still listed (not referenced from appropriate table) ids
- LootTemplates_Spell.ReportUnusedIds(ids_set);
+ LootTemplates_Spell.ReportUnusedIds(lootIdSet);
if (count)
sLog->outString(">> Loaded %u spell loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
@@ -1781,24 +1779,24 @@ void LoadLootTemplates_Reference()
uint32 oldMSTime = getMSTime();
- LootIdSet ids_set;
- LootTemplates_Reference.LoadAndCollectLootIds(ids_set);
+ LootIdSet lootIdSet;
+ LootTemplates_Reference.LoadAndCollectLootIds(lootIdSet);
// check references and remove used
- LootTemplates_Creature.CheckLootRefs(&ids_set);
- LootTemplates_Fishing.CheckLootRefs(&ids_set);
- LootTemplates_Gameobject.CheckLootRefs(&ids_set);
- LootTemplates_Item.CheckLootRefs(&ids_set);
- LootTemplates_Milling.CheckLootRefs(&ids_set);
- LootTemplates_Pickpocketing.CheckLootRefs(&ids_set);
- LootTemplates_Skinning.CheckLootRefs(&ids_set);
- LootTemplates_Disenchant.CheckLootRefs(&ids_set);
- LootTemplates_Prospecting.CheckLootRefs(&ids_set);
- LootTemplates_Mail.CheckLootRefs(&ids_set);
- LootTemplates_Reference.CheckLootRefs(&ids_set);
+ LootTemplates_Creature.CheckLootRefs(&lootIdSet);
+ LootTemplates_Fishing.CheckLootRefs(&lootIdSet);
+ LootTemplates_Gameobject.CheckLootRefs(&lootIdSet);
+ LootTemplates_Item.CheckLootRefs(&lootIdSet);
+ LootTemplates_Milling.CheckLootRefs(&lootIdSet);
+ LootTemplates_Pickpocketing.CheckLootRefs(&lootIdSet);
+ LootTemplates_Skinning.CheckLootRefs(&lootIdSet);
+ LootTemplates_Disenchant.CheckLootRefs(&lootIdSet);
+ LootTemplates_Prospecting.CheckLootRefs(&lootIdSet);
+ LootTemplates_Mail.CheckLootRefs(&lootIdSet);
+ LootTemplates_Reference.CheckLootRefs(&lootIdSet);
// output error for any still listed ids (not referenced from any loot table)
- LootTemplates_Reference.ReportUnusedIds(ids_set);
+ LootTemplates_Reference.ReportUnusedIds(lootIdSet);
sLog->outString(">> Loaded refence loot templates in %u ms", GetMSTimeDiffToNow(oldMSTime));
sLog->outString();
diff --git a/src/server/game/Miscellaneous/Formulas.h b/src/server/game/Miscellaneous/Formulas.h
index 4faacc1f7b7..bf00514000e 100755
--- a/src/server/game/Miscellaneous/Formulas.h
+++ b/src/server/game/Miscellaneous/Formulas.h
@@ -162,8 +162,8 @@ namespace Trinity
if (u->GetTypeId() == TYPEID_UNIT &&
(((Creature*)u)->isTotem() || ((Creature*)u)->isPet() ||
- (((Creature*)u)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_XP_AT_KILL) ||
- ((Creature*)u)->GetCreatureInfo()->type == CREATURE_TYPE_CRITTER))
+ (((Creature*)u)->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_XP_AT_KILL) ||
+ ((Creature*)u)->GetCreatureTemplate()->type == CREATURE_TYPE_CRITTER))
gain = 0;
else
{
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index cb79bd00776..8403bc3deb7 100755
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -5912,15 +5912,15 @@ void AuraEffect::HandlePeriodicTriggerSpellAuraTick(Unit* target, Unit* caster)
// move loot to player inventory and despawn target
if (caster && caster->GetTypeId() == TYPEID_PLAYER &&
target->GetTypeId() == TYPEID_UNIT &&
- target->ToCreature()->GetCreatureInfo()->type == CREATURE_TYPE_GAS_CLOUD)
+ target->ToCreature()->GetCreatureTemplate()->type == CREATURE_TYPE_GAS_CLOUD)
{
Player* player = caster->ToPlayer();
Creature* creature = target->ToCreature();
// missing lootid has been reported on startup - just return
- if (!creature->GetCreatureInfo()->SkinLootId)
+ if (!creature->GetCreatureTemplate()->SkinLootId)
return;
- player->AutoStoreLoot(creature->GetCreatureInfo()->SkinLootId, LootTemplates_Skinning, true);
+ player->AutoStoreLoot(creature->GetCreatureTemplate()->SkinLootId, LootTemplates_Skinning, true);
creature->DespawnOrUnsummon();
}
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index e2cd360b844..4f4de7c72cd 100755
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -5098,7 +5098,7 @@ SpellCastResult Spell::CheckCast(bool strict)
if (creature->GetCreatureType() != CREATURE_TYPE_CRITTER && !creature->loot.isLooted())
return SPELL_FAILED_TARGET_NOT_LOOTED;
- uint32 skill = creature->GetCreatureInfo()->GetRequiredLootSkill();
+ uint32 skill = creature->GetCreatureTemplate()->GetRequiredLootSkill();
int32 skillValue = m_caster->ToPlayer()->GetSkillValue(skill);
int32 TargetLevel = m_targets.GetUnitTarget()->getLevel();
@@ -5366,7 +5366,7 @@ SpellCastResult Spell::CheckCast(bool strict)
return SPELL_FAILED_HIGHLEVEL;
// use SMSG_PET_TAME_FAILURE?
- if (!target->GetCreatureInfo()->isTameable (m_caster->ToPlayer()->CanTameExoticPets()))
+ if (!target->GetCreatureTemplate()->isTameable (m_caster->ToPlayer()->CanTameExoticPets()))
return SPELL_FAILED_BAD_TARGETS;
if (m_caster->GetPetGUID())
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 2f04099f86b..511d2877f24 100755
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -2438,8 +2438,8 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
if (!summon || !summon->HasUnitTypeMask(UNIT_MASK_MINION))
return;
- summon->SelectLevel(summon->GetCreatureInfo()); // some summoned creaters have different from 1 DB data for level/hp
- summon->SetUInt32Value(UNIT_NPC_FLAGS, summon->GetCreatureInfo()->npcflag);
+ summon->SelectLevel(summon->GetCreatureTemplate()); // some summoned creaters have different from 1 DB data for level/hp
+ summon->SetUInt32Value(UNIT_NPC_FLAGS, summon->GetCreatureTemplate()->npcflag);
summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
@@ -5521,7 +5521,7 @@ void Spell::EffectSkinning(SpellEffIndex /*effIndex*/)
Creature* creature = unitTarget->ToCreature();
int32 targetLevel = creature->getLevel();
- uint32 skill = creature->GetCreatureInfo()->GetRequiredLootSkill();
+ uint32 skill = creature->GetCreatureTemplate()->GetRequiredLootSkill();
m_caster->ToPlayer()->SendLoot(creature->GetGUID(), LOOT_SKINNING);
creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
diff --git a/src/server/scripts/Commands/cs_learn.cpp b/src/server/scripts/Commands/cs_learn.cpp
index fcabaaa7e5b..ae573577d7e 100644
--- a/src/server/scripts/Commands/cs_learn.cpp
+++ b/src/server/scripts/Commands/cs_learn.cpp
@@ -248,7 +248,7 @@ public:
return false;
}
- CreatureTemplate const* creatureInfo = pet->GetCreatureInfo();
+ CreatureTemplate const* creatureInfo = pet->GetCreatureTemplate();
if (!creatureInfo)
{
handler->SendSysMessage(LANG_WRONG_PET_TYPE);
diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp
index 57932ef56c6..67ac6f8ff76 100644
--- a/src/server/scripts/Commands/cs_npc.cpp
+++ b/src/server/scripts/Commands/cs_npc.cpp
@@ -462,7 +462,7 @@ public:
// Faction is set in creature_template - not inside creature
// Update in memory..
- if (CreatureTemplate const* cinfo = creature->GetCreatureInfo())
+ if (CreatureTemplate const* cinfo = creature->GetCreatureTemplate())
{
const_cast<CreatureTemplate*>(cinfo)->faction_A = factionId;
const_cast<CreatureTemplate*>(cinfo)->faction_H = factionId;
@@ -547,7 +547,7 @@ public:
uint32 displayid = target->GetDisplayId();
uint32 nativeid = target->GetNativeDisplayId();
uint32 Entry = target->GetEntry();
- CreatureTemplate const* cInfo = target->GetCreatureInfo();
+ CreatureTemplate const* cInfo = target->GetCreatureTemplate();
int64 curRespawnDelay = target->GetRespawnTimeEx()-time(NULL);
if (curRespawnDelay < 0)
@@ -1148,7 +1148,7 @@ public:
return false;
}
- CreatureTemplate const* cInfo = creatureTarget->GetCreatureInfo();
+ CreatureTemplate const* cInfo = creatureTarget->GetCreatureTemplate();
if (!cInfo->isTameable (player->CanTameExoticPets()))
{
diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp
index 0d8cabcf89c..22f3513b157 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp
@@ -117,7 +117,7 @@ public:
// Interrupt any spell casting
me->InterruptNonMeleeSpells(false);
// Gyth model
- me->SetDisplayId(me->GetCreatureInfo()->Modelid1);
+ me->SetDisplayId(me->GetCreatureTemplate()->Modelid1);
me->SummonCreature(NPC_WARCHIEF_REND_BLACKHAND, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 900 * IN_MILLISECONDS);
events.ScheduleEvent(EVENT_CORROSIVE_ACID, 8 * IN_MILLISECONDS);
events.ScheduleEvent(EVENT_FREEZE, 11 * IN_MILLISECONDS);
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp
index 14add92fd16..35a9f854d58 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp
@@ -297,7 +297,7 @@ public:
SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE);
//damage
- const CreatureTemplate* cinfo = me->GetCreatureInfo();
+ const CreatureTemplate* cinfo = me->GetCreatureTemplate();
me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, cinfo->mindmg);
me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, cinfo->maxdmg);
me->UpdateDamagePhysical(BASE_ATTACK);
@@ -420,7 +420,7 @@ public:
SetEquipmentSlots(false, EQUIP_ID_AXE, EQUIP_ID_AXE, EQUIP_NO_CHANGE);
//damage
- const CreatureTemplate* cinfo = me->GetCreatureInfo();
+ const CreatureTemplate* cinfo = me->GetCreatureTemplate();
me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, 2*cinfo->mindmg);
me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, 2*cinfo->maxdmg);
me->UpdateDamagePhysical(BASE_ATTACK);
diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp
index 342c0d18dc9..a264c7afa98 100644
--- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp
@@ -108,7 +108,7 @@ public:
if (!me->GetEquipmentId())
if (const CreatureTemplate* info = sObjectMgr->GetCreatureTemplate(28406))
if (info->equipmentId)
- const_cast<CreatureTemplate*>(me->GetCreatureInfo())->equipmentId = info->equipmentId;
+ const_cast<CreatureTemplate*>(me->GetCreatureTemplate())->equipmentId = info->equipmentId;
}
uint64 playerGUID;
@@ -878,7 +878,7 @@ public:
npc_scarlet_miner_cartAI(Creature* c) : PassiveAI(c), minerGUID(0)
{
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
- me->SetDisplayId(me->GetCreatureInfo()->Modelid1); // Modelid2 is a horse.
+ me->SetDisplayId(me->GetCreatureTemplate()->Modelid1); // Modelid2 is a horse.
}
uint64 minerGUID;
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp
index 27ddc215543..737a8fade57 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp
@@ -237,7 +237,7 @@ class boss_arlokk : public CreatureScript
me->SetDisplayId(MODEL_ID_PANTHER);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- const CreatureTemplate* cinfo = me->GetCreatureInfo();
+ const CreatureTemplate* cinfo = me->GetCreatureTemplate();
me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35)));
me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35)));
me->UpdateDamagePhysical(BASE_ATTACK);
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp
index 38d9be78f2a..d0f1aea21ba 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp
@@ -156,7 +156,7 @@ class boss_marli : public CreatureScript
{
DoScriptText(SAY_TRANSFORM, me);
DoCast(me, SPELL_SPIDER_FORM);
- const CreatureTemplate* cinfo = me->GetCreatureInfo();
+ const CreatureTemplate* cinfo = me->GetCreatureTemplate();
me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35)));
me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35)));
me->UpdateDamagePhysical(BASE_ATTACK);
@@ -196,7 +196,7 @@ class boss_marli : public CreatureScript
if (TransformBack_Timer <= diff)
{
me->SetDisplayId(15220);
- const CreatureTemplate* cinfo = me->GetCreatureInfo();
+ const CreatureTemplate* cinfo = me->GetCreatureTemplate();
me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 1)));
me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 1)));
me->UpdateDamagePhysical(BASE_ATTACK);
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp
index 4185ba2f3e7..dc9521b028b 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp
@@ -201,7 +201,7 @@ class boss_thekal : public CreatureScript
me->SetStandState(UNIT_STAND_STATE_STAND);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetFullHealth();
- const CreatureTemplate* cinfo = me->GetCreatureInfo();
+ const CreatureTemplate* cinfo = me->GetCreatureTemplate();
me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 40)));
me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 40)));
me->UpdateDamagePhysical(BASE_ATTACK);
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp
index a9e41d90899..7dcdaa28879 100755
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp
@@ -572,7 +572,7 @@ class mob_frost_sphere : public CreatureScript
_isFalling = false;
me->SetReactState(REACT_PASSIVE);
me->SetFlying(true);
- me->SetDisplayId(me->GetCreatureInfo()->Modelid2);
+ me->SetDisplayId(me->GetCreatureTemplate()->Modelid2);
me->SetSpeed(MOVE_RUN, 0.5f, false);
me->GetMotionMaster()->MoveRandom(20.0f);
DoCast(SPELL_FROST_SPHERE);
@@ -604,7 +604,7 @@ class mob_frost_sphere : public CreatureScript
{
case POINT_FALL_GROUND:
me->RemoveAurasDueToSpell(SPELL_FROST_SPHERE);
- me->SetDisplayId(me->GetCreatureInfo()->Modelid1);
+ me->SetDisplayId(me->GetCreatureTemplate()->Modelid1);
DoCast(SPELL_PERMAFROST_VISUAL);
DoCast(SPELL_PERMAFROST);
me->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.0f);
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp
index 7ca371d1c82..e0fa0e2b75a 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp
@@ -1222,7 +1222,7 @@ class npc_tirion_fordring_tft : public CreatureScript
void sGossipSelect(Player* /*player*/, uint32 sender, uint32 action)
{
- if (me->GetCreatureInfo()->GossipMenuId == sender && !action)
+ if (me->GetCreatureTemplate()->GossipMenuId == sender && !action)
{
_events.SetPhase(PHASE_INTRO);
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp
index aae1995e204..408ebf3cc96 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp
@@ -577,7 +577,7 @@ class boss_flame_leviathan_seat : public CreatureScript
{
ASSERT(vehicle);
me->SetReactState(REACT_PASSIVE);
- me->SetDisplayId(me->GetCreatureInfo()->Modelid2);
+ me->SetDisplayId(me->GetCreatureTemplate()->Modelid2);
instance = creature->GetInstanceScript();
}
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp
index 33f50d0b3de..60c4ec68e82 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp
@@ -179,7 +179,7 @@ class npc_flash_freeze : public CreatureScript
npc_flash_freezeAI(Creature* creature) : ScriptedAI(creature)
{
instance = me->GetInstanceScript();
- me->SetDisplayId(me->GetCreatureInfo()->Modelid2);
+ me->SetDisplayId(me->GetCreatureTemplate()->Modelid2);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_STUNNED | UNIT_FLAG_PACIFIED);
}
@@ -246,7 +246,7 @@ class npc_ice_block : public CreatureScript
npc_ice_blockAI(Creature* creature) : ScriptedAI(creature)
{
instance = me->GetInstanceScript();
- me->SetDisplayId(me->GetCreatureInfo()->Modelid2);
+ me->SetDisplayId(me->GetCreatureTemplate()->Modelid2);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_STUNNED | UNIT_FLAG_PACIFIED);
targetGUID = 0;
}
@@ -512,7 +512,7 @@ class npc_icicle : public CreatureScript
{
npc_icicleAI(Creature* creature) : ScriptedAI(creature)
{
- me->SetDisplayId(me->GetCreatureInfo()->Modelid1);
+ me->SetDisplayId(me->GetCreatureTemplate()->Modelid1);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_PACIFIED | UNIT_FLAG_NOT_SELECTABLE);
me->SetReactState(REACT_PASSIVE);
}
@@ -560,7 +560,7 @@ class npc_snowpacked_icicle : public CreatureScript
{
npc_snowpacked_icicleAI(Creature* creature) : ScriptedAI(creature)
{
- me->SetDisplayId(me->GetCreatureInfo()->Modelid2);
+ me->SetDisplayId(me->GetCreatureTemplate()->Modelid2);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PACIFIED);
me->SetReactState(REACT_PASSIVE);
}
@@ -881,7 +881,7 @@ class npc_toasty_fire : public CreatureScript
{
npc_toasty_fireAI(Creature* creature) : ScriptedAI(creature)
{
- me->SetDisplayId(me->GetCreatureInfo()->Modelid2);
+ me->SetDisplayId(me->GetCreatureTemplate()->Modelid2);
}
void Reset()
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp
index 7ad859e3e8d..d245c77b9df 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp
@@ -177,7 +177,7 @@ class boss_razorscale_controller : public CreatureScript
{
boss_razorscale_controllerAI(Creature* creature) : BossAI(creature, DATA_RAZORSCALE_CONTROL)
{
- me->SetDisplayId(me->GetCreatureInfo()->Modelid2);
+ me->SetDisplayId(me->GetCreatureTemplate()->Modelid2);
}
void Reset()
diff --git a/src/server/scripts/Northrend/borean_tundra.cpp b/src/server/scripts/Northrend/borean_tundra.cpp
index a8fcd6139da..e97cc5e205b 100644
--- a/src/server/scripts/Northrend/borean_tundra.cpp
+++ b/src/server/scripts/Northrend/borean_tundra.cpp
@@ -139,7 +139,7 @@ public:
case 7:
DoCast(me, SPELL_EXPLODE_CART, true);
if (Player* caster = Unit::GetPlayer(*me, casterGuid))
- caster->KilledMonster(me->GetCreatureInfo(), me->GetGUID());
+ caster->KilledMonster(me->GetCreatureTemplate(), me->GetGUID());
uiPhaseTimer = 5000;
Phase = 8;
break;
diff --git a/src/server/scripts/Northrend/zuldrak.cpp b/src/server/scripts/Northrend/zuldrak.cpp
index 1bf04bc624c..835ad144501 100644
--- a/src/server/scripts/Northrend/zuldrak.cpp
+++ b/src/server/scripts/Northrend/zuldrak.cpp
@@ -92,7 +92,7 @@ public:
if (Creature* pRageclaw = Unit::GetCreature(*me, RageclawGUID))
{
UnlockRageclaw(pCaster);
- pCaster->ToPlayer()->KilledMonster(pRageclaw->GetCreatureInfo(), RageclawGUID);
+ pCaster->ToPlayer()->KilledMonster(pRageclaw->GetCreatureTemplate(), RageclawGUID);
me->DisappearAndDie();
}
else
@@ -156,7 +156,7 @@ public:
me->RemoveAurasDueToSpell(SPELL_KNEEL);
- me->setFaction(me->GetCreatureInfo()->faction_H);
+ me->setFaction(me->GetCreatureTemplate()->faction_H);
DoCast(me, SPELL_UNSHACKLED, true);
me->MonsterSay(SAY_RAGECLAW, LANG_UNIVERSAL, 0);
diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp
index b0a42614ee3..de9ef5cd67f 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp
@@ -502,7 +502,7 @@ public:
void SummonedCreatureDespawn(Creature* summon)
{
- if (summon->GetCreatureInfo()->Entry == FLAME_OF_AZZINOTH)
+ if (summon->GetCreatureTemplate()->Entry == FLAME_OF_AZZINOTH)
{
for (uint8 i = 0; i < 2; ++i)
if (summon->GetGUID() == FlameGUID[i])
diff --git a/src/server/scripts/Outland/blades_edge_mountains.cpp b/src/server/scripts/Outland/blades_edge_mountains.cpp
index f99851f013e..bd23b06a5ea 100644
--- a/src/server/scripts/Outland/blades_edge_mountains.cpp
+++ b/src/server/scripts/Outland/blades_edge_mountains.cpp
@@ -523,7 +523,7 @@ public:
me->GetMotionMaster()->MoveTargetedHome();
Creature* Credit = me->FindNearestCreature(NPC_QUEST_CREDIT, 50, true);
if (player && Credit)
- player->KilledMonster(Credit->GetCreatureInfo(), Credit->GetGUID());
+ player->KilledMonster(Credit->GetCreatureTemplate(), Credit->GetGUID());
}
}
diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp
index eb42b377128..ee554f4875a 100644
--- a/src/server/scripts/Spells/spell_dk.cpp
+++ b/src/server/scripts/Spells/spell_dk.cpp
@@ -341,7 +341,7 @@ class spell_dk_death_pact : public SpellScriptLoader
{
if ((*itr)->GetTypeId() == TYPEID_UNIT
&& (*itr)->GetOwnerGUID() == GetCaster()->GetGUID()
- && (*itr)->ToCreature()->GetCreatureInfo()->type == CREATURE_TYPE_UNDEAD)
+ && (*itr)->ToCreature()->GetCreatureTemplate()->type == CREATURE_TYPE_UNDEAD)
{
unit_to_add = (*itr);
break;
diff --git a/src/server/scripts/World/mob_generic_creature.cpp b/src/server/scripts/World/mob_generic_creature.cpp
index 3a61b9f9e18..ce8b0a2de14 100644
--- a/src/server/scripts/World/mob_generic_creature.cpp
+++ b/src/server/scripts/World/mob_generic_creature.cpp
@@ -105,7 +105,7 @@ public:
else info = SelectSpell(me->getVictim(), 0, 0, SELECT_TARGET_ANY_ENEMY, 0, 0, 0, 0, SELECT_EFFECT_DONTCARE);
//50% chance if elite or higher, 20% chance if not, to replace our white hit with a spell
- if (info && (rand() % (me->GetCreatureInfo()->rank > 1 ? 2 : 5) == 0) && !GlobalCooldown)
+ if (info && (rand() % (me->GetCreatureTemplate()->rank > 1 ? 2 : 5) == 0) && !GlobalCooldown)
{
//Cast the spell
if (Healing)DoCastSpell(me, info);
diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp
index 8513eae5876..10bc722fc1b 100644
--- a/src/server/scripts/World/npcs_special.cpp
+++ b/src/server/scripts/World/npcs_special.cpp
@@ -1650,7 +1650,7 @@ public:
{
SpellTimer = 0;
- CreatureTemplate const* Info = me->GetCreatureInfo();
+ CreatureTemplate const* Info = me->GetCreatureTemplate();
IsViper = Info->Entry == C_VIPER ? true : false;