aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormegamage <none@none>2009-08-24 19:12:22 -0500
committermegamage <none@none>2009-08-24 19:12:22 -0500
commit8871c2952ae13a814da3f42f72b7f32371a7556a (patch)
treed7898e0bdf235181830aa7e4ec0f5eb3627458ad
parent978d139932955fd8657f396f4774578bdaf337c9 (diff)
*Some better check of well-fed buff. Source: Mangos
--HG-- branch : trunk
-rw-r--r--sql/FULL/world_spell_full.sql9
-rw-r--r--sql/characters.sql2
-rw-r--r--sql/updates/5352_8399_world_spell_elixir.sql12
-rw-r--r--src/game/SharedDefines.h2
-rw-r--r--src/game/SpellMgr.cpp34
-rw-r--r--src/game/SpellMgr.h11
-rw-r--r--src/game/Unit.h2
7 files changed, 52 insertions, 20 deletions
diff --git a/sql/FULL/world_spell_full.sql b/sql/FULL/world_spell_full.sql
index 27a833b40d9..3a9d13eca74 100644
--- a/sql/FULL/world_spell_full.sql
+++ b/sql/FULL/world_spell_full.sql
@@ -1971,7 +1971,14 @@ INSERT INTO `spell_elixir` (`entry`, `mask`) VALUES
(60345, 0x1),
(60346, 0x1),
(60347, 0x2),
-(62380, 0x3);
+(62380, 0x3),
+(18191,0x10),
+(18192,0x10),
+(18193,0x10),
+(18194,0x10),
+(18222,0x10),
+(22730,0x10),
+(25661,0x10);
-- --------
-- Death Knight
diff --git a/sql/characters.sql b/sql/characters.sql
index aa37e0021f8..ac92557d07d 100644
--- a/sql/characters.sql
+++ b/sql/characters.sql
@@ -23,7 +23,7 @@
DROP TABLE IF EXISTS `character_db_version`;
CREATE TABLE `character_db_version` (
- `required_8339_02_characters_character_battleground_data` bit(1) default NULL
+ `required_8397_03_characters_character_spell` bit(1) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Last applied sql update to DB';
--
diff --git a/sql/updates/5352_8399_world_spell_elixir.sql b/sql/updates/5352_8399_world_spell_elixir.sql
new file mode 100644
index 00000000000..64d250c8fe1
--- /dev/null
+++ b/sql/updates/5352_8399_world_spell_elixir.sql
@@ -0,0 +1,12 @@
+-- ALTER TABLE db_version CHANGE COLUMN required_8397_02_mangos_spell_threat required_8399_01_mangos_spell_elixir bit;
+
+-- Well Fed (SPELLFAMILY_POTION)
+DELETE FROM spell_elixir WHERE entry IN (18191, 18192, 18193, 18194, 18222, 22730, 25661);
+INSERT INTO spell_elixir (entry, mask) VALUES
+(18191,0x10),
+(18192,0x10),
+(18193,0x10),
+(18194,0x10),
+(18222,0x10),
+(22730,0x10),
+(25661,0x10);
diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h
index 6a2a9ff334e..4a97f397e00 100644
--- a/src/game/SharedDefines.h
+++ b/src/game/SharedDefines.h
@@ -316,7 +316,7 @@ enum SpellCategory
#define SPELL_ATTR_EX2_UNK28 0x10000000 // 28 no breaks stealth if it fails??
#define SPELL_ATTR_EX2_CANT_CRIT 0x20000000 // 29 Spell can't crit
#define SPELL_ATTR_EX2_TRIGGERED_CAN_TRIGGER 0x40000000 // 30 spell can trigger even if triggered
-#define SPELL_ATTR_EX2_FOOD 0x80000000 // 31 food, well-fed, and a few others
+#define SPELL_ATTR_EX2_FOOD_BUFF 0x80000000 // 31 Food or Drink Buff (like Well Fed)
#define SPELL_ATTR_EX3_UNK0 0x00000001 // 0
#define SPELL_ATTR_EX3_UNK1 0x00000002 // 1
diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp
index c0a1d4bdd37..d9a5aec6529 100644
--- a/src/game/SpellMgr.cpp
+++ b/src/game/SpellMgr.cpp
@@ -472,7 +472,7 @@ SpellSpecific GetSpellSpecific(uint32 spellId)
//food/drink
if (spellInfo->AuraInterruptFlags & AURA_INTERRUPT_FLAG_NOT_SEATED)
{
- for(int i = 0; i < 3; i++)
+ for(int i = 0; i < 3; ++i)
if( spellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_POWER_REGEN
|| spellInfo->EffectApplyAuraName[i] == SPELL_AURA_OBS_MOD_ENERGY)
return SPELL_DRINK;
@@ -480,10 +480,14 @@ SpellSpecific GetSpellSpecific(uint32 spellId)
|| spellInfo->EffectApplyAuraName[i] == SPELL_AURA_OBS_MOD_HEALTH)
return SPELL_FOOD;
}
- // this may be a hack
- else if((spellInfo->AttributesEx2 & SPELL_ATTR_EX2_FOOD)
- && !spellInfo->Category)
+ // Well Fed buffs (must be exclusive with Food / Drink replenishment effects, or else Well Fed will cause them to be removed)
+ // SpellIcon 2560 is Spell 46687, does not have this flag
+ else if (spellInfo->AttributesEx2 & SPELL_ATTR_EX2_FOOD_BUFF || spellInfo->SpellIconID == 2560)
return SPELL_WELL_FED;
+ // this may be a hack
+ //else if((spellInfo->AttributesEx2 & SPELL_ATTR_EX2_FOOD_BUFF)
+ // && !spellInfo->Category)
+ // return SPELL_WELL_FED;
// scrolls effects
else
{
@@ -519,14 +523,6 @@ SpellSpecific GetSpellSpecific(uint32 spellId)
break;
}
- case SPELLFAMILY_PRIEST:
- {
- // Divine Spirit and Prayer of Spirit
- if (spellInfo->SpellFamilyFlags[0] & 0x20)
- return SPELL_PRIEST_DIVINE_SPIRIT;
-
- break;
- }
case SPELLFAMILY_WARRIOR:
{
if (spellInfo->SpellFamilyFlags[1] & 0x000080 || spellInfo->SpellFamilyFlags[0] & 0x10000)
@@ -551,6 +547,20 @@ SpellSpecific GetSpellSpecific(uint32 spellId)
return SPELL_WARLOCK_CORRUPTION;
break;
}
+ case SPELLFAMILY_PRIEST:
+ {
+ // "Well Fed" buff from Blessed Sunfruit, Blessed Sunfruit Juice, Alterac Spring Water
+ if ((spellInfo->Attributes & SPELL_ATTR_CASTABLE_WHILE_SITTING) &&
+ (spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_AUTOATTACK) &&
+ (spellInfo->SpellIconID == 52 || spellInfo->SpellIconID == 79))
+ return SPELL_WELL_FED;
+
+ // Divine Spirit and Prayer of Spirit
+ if (spellInfo->SpellFamilyFlags[0] & 0x20)
+ return SPELL_PRIEST_DIVINE_SPIRIT;
+
+ break;
+ }
case SPELLFAMILY_HUNTER:
{
// only hunter stings have this
diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h
index 4a3a4329b44..4b5de9287ac 100644
--- a/src/game/SpellMgr.h
+++ b/src/game/SpellMgr.h
@@ -582,11 +582,12 @@ struct SpellEnchantProcEntry
typedef UNORDERED_MAP<uint32, SpellEnchantProcEntry> SpellEnchantProcEventMap;
typedef UNORDERED_MAP<uint32, SpellBonusEntry> SpellBonusMap;
-#define ELIXIR_BATTLE_MASK 0x1
-#define ELIXIR_GUARDIAN_MASK 0x2
+#define ELIXIR_BATTLE_MASK 0x01
+#define ELIXIR_GUARDIAN_MASK 0x02
#define ELIXIR_FLASK_MASK (ELIXIR_BATTLE_MASK|ELIXIR_GUARDIAN_MASK)
-#define ELIXIR_UNSTABLE_MASK 0x4
-#define ELIXIR_SHATTRATH_MASK 0x8
+#define ELIXIR_UNSTABLE_MASK 0x04
+#define ELIXIR_SHATTRATH_MASK 0x08
+#define ELIXIR_WELL_FED 0x10 // Some foods have SPELLFAMILY_POTION
typedef std::map<uint32, uint8> SpellElixirMap;
typedef std::map<uint32, uint16> SpellThreatMap;
@@ -823,6 +824,8 @@ class SpellMgr
return SPELL_BATTLE_ELIXIR;
else if(mask & ELIXIR_GUARDIAN_MASK)
return SPELL_GUARDIAN_ELIXIR;
+ else if(mask & ELIXIR_WELL_FED)
+ return SPELL_WELL_FED;
else
return SPELL_NORMAL;
}
diff --git a/src/game/Unit.h b/src/game/Unit.h
index 1da17785c8f..cf38b1527e7 100644
--- a/src/game/Unit.h
+++ b/src/game/Unit.h
@@ -79,7 +79,7 @@ enum SpellAuraInterruptFlags
AURA_INTERRUPT_FLAG_TRANSFORM = 0x00008000, // 15 removed by transform?
AURA_INTERRUPT_FLAG_UNK16 = 0x00010000, // 16
AURA_INTERRUPT_FLAG_MOUNT = 0x00020000, // 17 misdirect, aspect, swim speed
- AURA_INTERRUPT_FLAG_NOT_SEATED = 0x00040000, // 18 removed by standing up
+ AURA_INTERRUPT_FLAG_NOT_SEATED = 0x00040000, // 18 removed by standing up (used by food and drink mostly and sleep/Fake Death like)
AURA_INTERRUPT_FLAG_CHANGE_MAP = 0x00080000, // 19 leaving map/getting teleported
AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION = 0x00100000, // 20 removed by auras that make you invulnerable, or make other to loose selection on you
AURA_INTERRUPT_FLAG_UNK21 = 0x00200000, // 21