Skip to content

Commit

Permalink
[6860] Implement correct effects stacking and zone limitations for it…
Browse files Browse the repository at this point in the history
…em 34537.

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

C++ code part rewrited for more correct work.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
  • Loading branch information
Malah authored and VladimirMangos committed Nov 30, 2008
1 parent 7848dda commit cd8d8a3
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 25 deletions.
3 changes: 2 additions & 1 deletion sql/mangos.sql
Expand Up @@ -22,7 +22,7 @@
DROP TABLE IF EXISTS `db_version`;
CREATE TABLE `db_version` (
`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';

--
Expand Down Expand Up @@ -13741,6 +13741,7 @@ INSERT INTO `spell_elixir` VALUES
(41610,0xB),
(41611,0xB),
(42735,0x3),
(45373,0x1),
(46837,0xB),
(46839,0xB);
/*!40000 ALTER TABLE `spell_elixir` ENABLE KEYS */;
Expand Down
5 changes: 5 additions & 0 deletions sql/updates/2008_11_29_02_mangos_spell_elixir.sql
@@ -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);
2 changes: 2 additions & 0 deletions sql/updates/Makefile.am
Expand Up @@ -139,6 +139,7 @@ pkgdata_DATA = \
2008_11_18_02_mangos_mangos_string.sql \
2008_11_27_01_mangos_playercreateinfo_item.sql \
2008_11_29_01_mangos_spell_proc_event.sql \
2008_11_29_02_mangos_spell_elixir.sql \
README

## Additional files to include when running 'make dist'
Expand Down Expand Up @@ -259,4 +260,5 @@ EXTRA_DIST = \
2008_11_18_02_mangos_mangos_string.sql \
2008_11_27_01_mangos_playercreateinfo_item.sql \
2008_11_29_01_mangos_spell_proc_event.sql \
2008_11_29_02_mangos_spell_elixir.sql \
README
24 changes: 17 additions & 7 deletions src/game/Spell.cpp
Expand Up @@ -2571,13 +2571,23 @@ void Spell::SendCastResult(uint8 result)
break;
case SPELL_FAILED_REQUIRES_AREA:
// hardcode areas limitation case
if( m_spellInfo->Id==41618 || m_spellInfo->Id==41620 )
data << uint32(3842);
else if( m_spellInfo->Id==41617 || m_spellInfo->Id==41619 )
data << uint32(3905);
// normal case
else
data << uint32(m_spellInfo->AreaId);
switch(m_spellInfo->Id)
{
case 41617: // Cenarion Mana Salve
case 41619: // Cenarion Healing Salve
data << uint32(3905);
break;
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;
case SPELL_FAILED_TOTEMS:
if(m_spellInfo->Totem[0])
Expand Down
30 changes: 14 additions & 16 deletions src/game/SpellMgr.cpp
Expand Up @@ -2052,16 +2052,20 @@ bool IsSpellAllowedInLocation(SpellEntry const *spellInfo,uint32 map_id,uint32 z
{
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)
{
// in the Blade's Edge Mountains Plateaus and Gruul's Lair.
return zone_id ==3522 || map_id==565;
}
if(mask & ELIXIR_SHATTRATH_MASK)
{
// in Tempest Keep, Serpentshrine Cavern, Caverns of Time: Mount Hyjal, Black Temple
// TODO: and the Sunwell Plateau
if(zone_id ==3607 || map_id==534 || map_id==564)
// in Tempest Keep, Serpentshrine Cavern, Caverns of Time: Mount Hyjal, Black Temple, Sunwell Plateau
if(zone_id ==3607 || map_id==534 || map_id==564 || zone_id==4075)
return true;

MapEntry const* mapEntry = sMapStore.LookupEntry(map_id);
Expand All @@ -2079,33 +2083,27 @@ bool IsSpellAllowedInLocation(SpellEntry const *spellInfo,uint32 map_id,uint32 z
// special cases zone check (maps checked by multimap common id)
switch(spellInfo->Id)
{
case 41618:
case 41620:
case 41618: // Bottled Nethergon Energy
case 41620: // Bottled Nethergon Vapor
{
MapEntry const* mapEntry = sMapStore.LookupEntry(map_id);
if(!mapEntry)
return false;

return mapEntry->multimap_id==206;
}

case 41617:
case 41619:
case 41617: // Cenarion Mana Salve
case 41619: // Cenarion Healing Salve
{
MapEntry const* mapEntry = sMapStore.LookupEntry(map_id);
if(!mapEntry)
return false;

return mapEntry->multimap_id==207;
}
// Dragonmaw Illusion
case 40216:
case 42016:
{
if ( area_id != 3759 && area_id != 3966 && area_id != 3939 )
return false;
break;
}
case 40216: // Dragonmaw Illusion
case 42016: // Dragonmaw Illusion
return area_id == 3759 || area_id == 3966 || area_id == 3939;
}

return true;
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "6859"
#define REVISION_NR "6860"
#endif // __REVISION_NR_H__

0 comments on commit cd8d8a3

Please sign in to comment.