*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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user