aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQAston <none@none>2008-11-30 22:38:37 +0100
committerQAston <none@none>2008-11-30 22:38:37 +0100
commit22af4b1c96642dfff4fa8621f64736e845584f72 (patch)
treeb069e92209d48bbaa831f8c7a2210227956164e3
parentd963119433ac732923427362cd2f8c35ccd63eaf (diff)
*Implemented range flag from SpellRange.dbc
--HG-- branch : trunk
-rw-r--r--src/game/SharedDefines.h7
-rw-r--r--src/game/SpellMgr.cpp9
-rw-r--r--src/game/SpellMgr.h2
-rw-r--r--src/shared/Database/DBCStructure.h1
-rw-r--r--src/shared/Database/DBCfmt.cpp2
5 files changed, 19 insertions, 2 deletions
diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h
index 6f7cf4a6b9a..e57c4caf1d0 100644
--- a/src/game/SharedDefines.h
+++ b/src/game/SharedDefines.h
@@ -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
// ***********************************
diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp
index 8d17d94ec8e..5c42aa8d4ea 100644
--- a/src/game/SpellMgr.cpp
+++ b/src/game/SpellMgr.cpp
@@ -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)
{
diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h
index 53c70a6164f..303f1378c32 100644
--- a/src/game/SpellMgr.h
+++ b/src/game/SpellMgr.h
@@ -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);
diff --git a/src/shared/Database/DBCStructure.h b/src/shared/Database/DBCStructure.h
index dde32406b94..a84b119664d 100644
--- a/src/shared/Database/DBCStructure.h
+++ b/src/shared/Database/DBCStructure.h
@@ -686,6 +686,7 @@ struct SpellRangeEntry
uint32 ID;
float minRange;
float maxRange;
+ uint32 flags;
};
struct SpellShapeshiftEntry
diff --git a/src/shared/Database/DBCfmt.cpp b/src/shared/Database/DBCfmt.cpp
index fe8d3cdb400..57a81921d62 100644
--- a/src/shared/Database/DBCfmt.cpp
+++ b/src/shared/Database/DBCfmt.cpp
@@ -71,7 +71,7 @@ const char SpellFocusObjectfmt[]="nxxxxxxxxxxxxxxxxx";
const char SpellItemEnchantmentfmt[]="niiiiiixxxiiissssssssssssssssxiiii";
const char SpellItemEnchantmentConditionfmt[]="nbbbbbxxxxxbbbbbbbbbbiiiiiXXXXX";
const char SpellRadiusfmt[]="nfxf";
-const char SpellRangefmt[]="nffxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
+const char SpellRangefmt[]="nffixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
const char SpellShapeshiftfmt[]="nxxxxxxxxxxxxxxxxxxiixixxxxxxxxxxxx";
const char StableSlotPricesfmt[] = "ni";
const char TalentEntryfmt[]="niiiiiiiixxxxixxixxxi";