diff options
author | Rat <none@none> | 2010-04-09 10:47:11 +0200 |
---|---|---|
committer | Rat <none@none> | 2010-04-09 10:47:11 +0200 |
commit | cbbe587817f9d635338c1efc309418a9a6575d76 (patch) | |
tree | ab4db09b5c7fe4491fd6f6542c45a8c0ef9a18bb /src/game/Creature.cpp | |
parent | 1f46c1150d8d04d5d3e72f27c475062cc320d545 (diff) |
*added code for loading Spelldifficulty.dbc + Custom Spelldifficulty from Database
*added spell searcher based on creature's map difficulty, usage is optional and only for scipts for now
*added new table spelldifficulty_dbc
--HG--
branch : trunk
Diffstat (limited to 'src/game/Creature.cpp')
-rw-r--r-- | src/game/Creature.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index 66400709036..4dd05fbaf87 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -2211,6 +2211,18 @@ void Creature::GetRespawnCoord(float &x, float &y, float &z, float* ori, float* *dist = 0; } +uint32 Creature::GetSpellIdForDifficulty(uint32 spellId) +{ + //search for instance mode spell + if (GetMap() && GetMap()->IsDungeon()) + { + spellId = spellmgr.GetSpellIdForDifficultyFromSpellid(spellId, Difficulty(GetMap()->GetSpawnMode())); + } + else + sLog.outDebug("Unit::GetSpellIdForDifficulty called for non-instanced creature"); + return spellId; +} + void Creature::AllLootRemovedFromCorpse() { if (!HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE)) |