*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
This commit is contained in:
Rat
2010-04-09 10:47:11 +02:00
parent 1f46c1150d
commit cbbe587817
11 changed files with 110 additions and 4 deletions
+6 -1
View File
@@ -22,6 +22,7 @@
#include "Platform/Define.h"
#include "TemporarySummon.h"
#include "CreatureAI.h"
#include "SpellMgr.h"
template<class T>
inline
@@ -592,11 +593,15 @@ inline bool CreatureAI::_EnterEvadeMode()
return true;
}
inline void UnitAI::DoCast(Unit* victim, uint32 spellId, bool triggered)
inline void UnitAI::DoCast(Unit* victim, uint32 spellId, bool triggered, bool useMode)
{
if (!victim || (me->hasUnitState(UNIT_STAT_CASTING) && !triggered))
return;
//search for instance mode spell
if(useMode && me->ToCreature())
spellId = me->ToCreature()->GetSpellIdForDifficulty(spellId);
me->CastSpell(victim, spellId, triggered);
}