*Implemented range flag from SpellRange.dbc

--HG--
branch : trunk
This commit is contained in:
QAston
2008-11-30 22:38:37 +01:00
parent d963119433
commit 22af4b1c96
5 changed files with 19 additions and 2 deletions
+7
View File
@@ -200,6 +200,13 @@ enum SpellCategory
SPELL_CATEGORY_DRINK = 59,
};
enum SpellRangeFlag
{
SPELL_RANGE_DEFAULT = 0,
SPELL_RANGE_MEELE = 1, //unused
SPELL_RANGE_RANGED = 2, //hunters' shoots, auto shoot, shoot, deadly throw, throw
};
// ***********************************
// Spell Attributes definitions
// ***********************************
+9
View File
@@ -90,6 +90,15 @@ uint32 GetSpellCastTime(SpellEntry const* spellInfo, Spell const* spell)
return (castTime > 0) ? uint32(castTime) : 0;
}
float GetSpellMinRange(SpellRangeEntry const *range)
{
if (!range)
return 0;
if (!range->minRange)
if (range->flags==SPELL_RANGE_RANGED)
return 5.0;
return range->minRange;
}
bool IsPassiveSpell(uint32 spellId)
{
+1 -1
View File
@@ -272,7 +272,7 @@ SpellSpecific GetSpellSpecific(uint32 spellId);
// Different spell properties
inline float GetSpellRadius(SpellRadiusEntry const *radius) { return (radius ? radius->Radius : 0); }
uint32 GetSpellCastTime(SpellEntry const* spellInfo, Spell const* spell = NULL);
inline float GetSpellMinRange(SpellRangeEntry const *range) { return (range ? range->minRange : 0); }
float GetSpellMinRange(SpellRangeEntry const *range);
inline float GetSpellMaxRange(SpellRangeEntry const *range) { return (range ? range->maxRange : 0); }
inline uint32 GetSpellRecoveryTime(SpellEntry const *spellInfo) { return spellInfo->RecoveryTime > spellInfo->CategoryRecoveryTime ? spellInfo->RecoveryTime : spellInfo->CategoryRecoveryTime; }
int32 GetSpellDuration(SpellEntry const *spellInfo);