Skip to content

Commit

Permalink
Fixed SPELL_EFFECT_SUMMON_WILD in proper way, realted code (Fire bomb…
Browse files Browse the repository at this point in the history
… trigger) moved to SPELL_EFFECT_SUMMON .
  • Loading branch information
charlie2025 committed Jan 7, 2009
1 parent 885aad8 commit 0212421
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 30 deletions.
2 changes: 1 addition & 1 deletion src/game/SharedDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ enum SpellEffects
SPELL_EFFECT_DISPEL = 38,
SPELL_EFFECT_LANGUAGE = 39,
SPELL_EFFECT_DUAL_WIELD = 40,
SPELL_EFFECT_SUMMON_WILD = 41,
SPELL_EFFECT_JUMP = 41,
SPELL_EFFECT_JUMP2 = 42,
SPELL_EFFECT_TELEPORT_UNITS_FACE_CASTER= 43,
SPELL_EFFECT_SKILL_STEP = 44,
Expand Down
59 changes: 31 additions & 28 deletions src/game/Spell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4215,13 +4215,36 @@ uint8 Spell::CanCast(bool strict)
case SUMMON_TYPE_DEMON:
case SUMMON_TYPE_SUMMON:
{
if(m_caster->GetPetGUID())
return SPELL_FAILED_ALREADY_HAVE_SUMMON;

if(m_caster->GetCharmGUID())
return SPELL_FAILED_ALREADY_HAVE_CHARM;
break;
}
// Outdoor PvP - Trigger FireBomb

// fire bomb trigger, can only be used in halaa opvp when flying on a path from a wyvern roost
// yeah, hacky, I know, but neither item flags, nor spell attributes contained any useable data (or I was unable to find it)
if(m_spellInfo->EffectMiscValue[i] == 18225 && m_caster->GetTypeId() == TYPEID_PLAYER)
{
// if not in halaa or not in flight, cannot be used
if(m_caster->GetAreaId() != 3628 || !m_caster->isInFlight())
return SPELL_FAILED_NOT_HERE;

// if not on one of the specific taxi paths, then cannot be used
uint32 src_node = ((Player*)m_caster)->m_taxi.GetTaxiSource();
if( src_node != 103 &&
src_node != 105 &&
src_node != 107 &&
src_node != 109 )
return SPELL_FAILED_NOT_HERE;
}
// Outdoor PvP - Trigger FireBomb end
else
{
if(m_caster->GetPetGUID())
return SPELL_FAILED_ALREADY_HAVE_SUMMON;

if(m_caster->GetCharmGUID())
return SPELL_FAILED_ALREADY_HAVE_CHARM;
break;
}
break;
}
}
break;
}
Expand All @@ -4236,27 +4259,7 @@ uint8 Spell::CanCast(bool strict)

break;
}
case SPELL_EFFECT_SUMMON_WILD:
{
// fire bomb trigger, can only be used in halaa opvp when flying on a path from a wyvern roost
// yeah, hacky, I know, but neither item flags, nor spell attributes contained any useable data (or I was unable to find it)
if(m_spellInfo->EffectMiscValue[i] == 18225 && m_caster->GetTypeId() == TYPEID_PLAYER)
{
// if not in halaa or not in flight, cannot be used
if(m_caster->GetAreaId() != 3628 || !m_caster->isInFlight())
return SPELL_FAILED_NOT_HERE;

// if not on one of the specific taxi paths, then cannot be used
uint32 src_node = ((Player*)m_caster)->m_taxi.GetTaxiSource();
if( src_node != 103 &&
src_node != 105 &&
src_node != 107 &&
src_node != 109 )
return SPELL_FAILED_NOT_HERE;
}
break;
}
case SPELL_EFFECT_SUMMON_PET:
case SPELL_EFFECT_SUMMON_PET:
{
if(m_caster->GetPetGUID()) //let warlock do a replacement summon
{
Expand Down
2 changes: 1 addition & 1 deletion src/game/SpellEffects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
&Spell::EffectDispel, // 38 SPELL_EFFECT_DISPEL
&Spell::EffectUnused, // 39 SPELL_EFFECT_LANGUAGE
&Spell::EffectDualWield, // 40 SPELL_EFFECT_DUAL_WIELD
&Spell::EffectSummonWild, // 41 SPELL_EFFECT_SUMMON_WILD
&Spell::EffectUnused, // 41 SPELL_EFFECT_JUMP
&Spell::EffectUnused, // 42 SPELL_EFFECT_JUMP2
&Spell::EffectTeleUnitsFaceCaster, // 43 SPELL_EFFECT_TELEPORT_UNITS_FACE_CASTER
&Spell::EffectLearnSkill, // 44 SPELL_EFFECT_SKILL_STEP
Expand Down

0 comments on commit 0212421

Please sign in to comment.