*Update castcustomspell(). Allow change other spell values than basepoints.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-04-19 00:54:01 -05:00
parent 60736b1f7d
commit 7f8cf6c5fe
4 changed files with 105 additions and 49 deletions
+18 -9
View File
@@ -23,12 +23,9 @@
#include "GridDefines.h"
class WorldSession;
class Unit;
class DynamicObj;
class Player;
class GameObject;
class Group;
class Aura;
enum SpellCastTargetFlags
@@ -182,6 +179,18 @@ class SpellCastTargets
uint32 m_itemTargetEntry;
};
struct SpellValue
{
explicit SpellValue(SpellEntry const *proto)
{
for(uint32 i = 0; i < 3; ++i)
EffectBasePoints[i] = proto->EffectBasePoints[i];
MaxAffectedTargets = proto->MaxAffectedTargets;
}
int32 EffectBasePoints[3];
uint32 MaxAffectedTargets;
};
enum SpellState
{
SPELL_STATE_NULL = 0,
@@ -208,10 +217,6 @@ enum SpellTargets
SPELL_TARGETS_CHAINHEAL,
};
#define SPELL_SPELL_CHANNEL_UPDATE_INTERVAL 1000
typedef std::multimap<uint64, uint64> SpellTargetTimeMap;
class Spell
{
friend struct Trinity::SpellNotifierCreatureAndPlayer;
@@ -383,7 +388,7 @@ class Spell
void HandleThreatSpells(uint32 spellId);
//void HandleAddAura(Unit* Target);
SpellEntry const* m_spellInfo;
const SpellEntry * const m_spellInfo;
int32 m_currentBasePoints[3]; // cache SpellEntry::EffectBasePoints and use for set custom base points
Item* m_CastItem;
uint64 m_castItemGUID;
@@ -431,11 +436,15 @@ class Spell
void AddTriggeredSpell(SpellEntry const* spell) { m_TriggerSpells.push_back(spell); }
void CleanupTargetList();
void SetSpellValue(SpellValueMod mod, int32 value);
protected:
void SendLoot(uint64 guid, LootType loottype);
Unit* m_caster;
Unit* const m_caster;
SpellValue * const m_spellValue;
uint64 m_originalCasterGUID; // real source of cast (aura caster/etc), used for spell targets selection
// e.g. damage around area spell trigered by victim aura and damage enemies of aura caster