*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, 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 // Spell Attributes definitions
// *********************************** // ***********************************
+9
View File
@@ -90,6 +90,15 @@ uint32 GetSpellCastTime(SpellEntry const* spellInfo, Spell const* spell)
return (castTime > 0) ? uint32(castTime) : 0; 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) bool IsPassiveSpell(uint32 spellId)
{ {
+1 -1
View File
@@ -272,7 +272,7 @@ SpellSpecific GetSpellSpecific(uint32 spellId);
// Different spell properties // Different spell properties
inline float GetSpellRadius(SpellRadiusEntry const *radius) { return (radius ? radius->Radius : 0); } inline float GetSpellRadius(SpellRadiusEntry const *radius) { return (radius ? radius->Radius : 0); }
uint32 GetSpellCastTime(SpellEntry const* spellInfo, Spell const* spell = NULL); 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 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; } inline uint32 GetSpellRecoveryTime(SpellEntry const *spellInfo) { return spellInfo->RecoveryTime > spellInfo->CategoryRecoveryTime ? spellInfo->RecoveryTime : spellInfo->CategoryRecoveryTime; }
int32 GetSpellDuration(SpellEntry const *spellInfo); int32 GetSpellDuration(SpellEntry const *spellInfo);
+1
View File
@@ -686,6 +686,7 @@ struct SpellRangeEntry
uint32 ID; uint32 ID;
float minRange; float minRange;
float maxRange; float maxRange;
uint32 flags;
}; };
struct SpellShapeshiftEntry struct SpellShapeshiftEntry
+1 -1
View File
@@ -71,7 +71,7 @@ const char SpellFocusObjectfmt[]="nxxxxxxxxxxxxxxxxx";
const char SpellItemEnchantmentfmt[]="niiiiiixxxiiissssssssssssssssxiiii"; const char SpellItemEnchantmentfmt[]="niiiiiixxxiiissssssssssssssssxiiii";
const char SpellItemEnchantmentConditionfmt[]="nbbbbbxxxxxbbbbbbbbbbiiiiiXXXXX"; const char SpellItemEnchantmentConditionfmt[]="nbbbbbxxxxxbbbbbbbbbbiiiiiXXXXX";
const char SpellRadiusfmt[]="nfxf"; const char SpellRadiusfmt[]="nfxf";
const char SpellRangefmt[]="nffxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; const char SpellRangefmt[]="nffixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
const char SpellShapeshiftfmt[]="nxxxxxxxxxxxxxxxxxxiixixxxxxxxxxxxx"; const char SpellShapeshiftfmt[]="nxxxxxxxxxxxxxxxxxxiixixxxxxxxxxxxx";
const char StableSlotPricesfmt[] = "ni"; const char StableSlotPricesfmt[] = "ni";
const char TalentEntryfmt[]="niiiiiiiixxxxixxixxxi"; const char TalentEntryfmt[]="niiiiiiiixxxxixxixxxi";