[6860] Implement correct effects stacking and zone limitations for item 34537.

Signed-off-by: Malah <Backbone@getmangos.com>

C++ code part rewrited for more correct work.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
Malah 2008-11-30 04:07:37 +03:00 committed by VladimirMangos
parent eef8369ed6
commit 5f33f4abf4
6 changed files with 41 additions and 25 deletions

View file

@ -22,7 +22,7 @@
DROP TABLE IF EXISTS `db_version`; DROP TABLE IF EXISTS `db_version`;
CREATE TABLE `db_version` ( CREATE TABLE `db_version` (
`version` varchar(120) default NULL, `version` varchar(120) default NULL,
`required_2008_11_29_01_mangos_spell_proc_event` bit(1) default NULL `required_2008_11_29_02_mangos_spell_elixir` bit(1) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes'; ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';
-- --
@ -13741,6 +13741,7 @@ INSERT INTO `spell_elixir` VALUES
(41610,0xB), (41610,0xB),
(41611,0xB), (41611,0xB),
(42735,0x3), (42735,0x3),
(45373,0x1),
(46837,0xB), (46837,0xB),
(46839,0xB); (46839,0xB);
/*!40000 ALTER TABLE `spell_elixir` ENABLE KEYS */; /*!40000 ALTER TABLE `spell_elixir` ENABLE KEYS */;

View file

@ -0,0 +1,5 @@
ALTER TABLE db_version CHANGE COLUMN required_2008_11_29_01_mangos_spell_proc_event required_2008_11_29_02_mangos_spell_elixir bit;
DELETE FROM `spell_elixir` WHERE `entry` = 45373;
INSERT INTO `spell_elixir` VALUES
(45373,0x1);

View file

@ -139,6 +139,7 @@ pkgdata_DATA = \
2008_11_18_02_mangos_mangos_string.sql \ 2008_11_18_02_mangos_mangos_string.sql \
2008_11_27_01_mangos_playercreateinfo_item.sql \ 2008_11_27_01_mangos_playercreateinfo_item.sql \
2008_11_29_01_mangos_spell_proc_event.sql \ 2008_11_29_01_mangos_spell_proc_event.sql \
2008_11_29_02_mangos_spell_elixir.sql \
README README
## Additional files to include when running 'make dist' ## Additional files to include when running 'make dist'
@ -259,4 +260,5 @@ EXTRA_DIST = \
2008_11_18_02_mangos_mangos_string.sql \ 2008_11_18_02_mangos_mangos_string.sql \
2008_11_27_01_mangos_playercreateinfo_item.sql \ 2008_11_27_01_mangos_playercreateinfo_item.sql \
2008_11_29_01_mangos_spell_proc_event.sql \ 2008_11_29_01_mangos_spell_proc_event.sql \
2008_11_29_02_mangos_spell_elixir.sql \
README README

View file

@ -2571,13 +2571,23 @@ void Spell::SendCastResult(uint8 result)
break; break;
case SPELL_FAILED_REQUIRES_AREA: case SPELL_FAILED_REQUIRES_AREA:
// hardcode areas limitation case // hardcode areas limitation case
if( m_spellInfo->Id==41618 || m_spellInfo->Id==41620 ) switch(m_spellInfo->Id)
data << uint32(3842); {
else if( m_spellInfo->Id==41617 || m_spellInfo->Id==41619 ) case 41617: // Cenarion Mana Salve
data << uint32(3905); case 41619: // Cenarion Healing Salve
// normal case data << uint32(3905);
else break;
data << uint32(m_spellInfo->AreaId); case 41618: // Bottled Nethergon Energy
case 41620: // Bottled Nethergon Vapor
data << uint32(3842);
break;
case 45373: // Bloodberry Elixir
data << uint32(4075);
break;
default: // default case
data << uint32(m_spellInfo->AreaId);
break;
}
break; break;
case SPELL_FAILED_TOTEMS: case SPELL_FAILED_TOTEMS:
if(m_spellInfo->Totem[0]) if(m_spellInfo->Totem[0])

View file

@ -2052,6 +2052,11 @@ bool IsSpellAllowedInLocation(SpellEntry const *spellInfo,uint32 map_id,uint32 z
{ {
if(uint32 mask = spellmgr.GetSpellElixirMask(spellInfo->Id)) if(uint32 mask = spellmgr.GetSpellElixirMask(spellInfo->Id))
{ {
if(mask & ELIXIR_BATTLE_MASK)
{
if(spellInfo->Id==45373) // Bloodberry Elixir
return zone_id==4075;
}
if(mask & ELIXIR_UNSTABLE_MASK) if(mask & ELIXIR_UNSTABLE_MASK)
{ {
// in the Blade's Edge Mountains Plateaus and Gruul's Lair. // in the Blade's Edge Mountains Plateaus and Gruul's Lair.
@ -2059,9 +2064,8 @@ bool IsSpellAllowedInLocation(SpellEntry const *spellInfo,uint32 map_id,uint32 z
} }
if(mask & ELIXIR_SHATTRATH_MASK) if(mask & ELIXIR_SHATTRATH_MASK)
{ {
// in Tempest Keep, Serpentshrine Cavern, Caverns of Time: Mount Hyjal, Black Temple // in Tempest Keep, Serpentshrine Cavern, Caverns of Time: Mount Hyjal, Black Temple, Sunwell Plateau
// TODO: and the Sunwell Plateau if(zone_id ==3607 || map_id==534 || map_id==564 || zone_id==4075)
if(zone_id ==3607 || map_id==534 || map_id==564)
return true; return true;
MapEntry const* mapEntry = sMapStore.LookupEntry(map_id); MapEntry const* mapEntry = sMapStore.LookupEntry(map_id);
@ -2079,8 +2083,8 @@ bool IsSpellAllowedInLocation(SpellEntry const *spellInfo,uint32 map_id,uint32 z
// special cases zone check (maps checked by multimap common id) // special cases zone check (maps checked by multimap common id)
switch(spellInfo->Id) switch(spellInfo->Id)
{ {
case 41618: case 41618: // Bottled Nethergon Energy
case 41620: case 41620: // Bottled Nethergon Vapor
{ {
MapEntry const* mapEntry = sMapStore.LookupEntry(map_id); MapEntry const* mapEntry = sMapStore.LookupEntry(map_id);
if(!mapEntry) if(!mapEntry)
@ -2088,9 +2092,8 @@ bool IsSpellAllowedInLocation(SpellEntry const *spellInfo,uint32 map_id,uint32 z
return mapEntry->multimap_id==206; return mapEntry->multimap_id==206;
} }
case 41617: // Cenarion Mana Salve
case 41617: case 41619: // Cenarion Healing Salve
case 41619:
{ {
MapEntry const* mapEntry = sMapStore.LookupEntry(map_id); MapEntry const* mapEntry = sMapStore.LookupEntry(map_id);
if(!mapEntry) if(!mapEntry)
@ -2098,14 +2101,9 @@ bool IsSpellAllowedInLocation(SpellEntry const *spellInfo,uint32 map_id,uint32 z
return mapEntry->multimap_id==207; return mapEntry->multimap_id==207;
} }
// Dragonmaw Illusion case 40216: // Dragonmaw Illusion
case 40216: case 42016: // Dragonmaw Illusion
case 42016: return area_id == 3759 || area_id == 3966 || area_id == 3939;
{
if ( area_id != 3759 && area_id != 3966 && area_id != 3939 )
return false;
break;
}
} }
return true; return true;

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "6859" #define REVISION_NR "6860"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__