Fixed Carrion Feeder pet talent

Removed useless code for Wolverine Bite

--HG--
branch : trunk
This commit is contained in:
Shauren
2010-08-04 12:12:58 +02:00
parent dc6c3f96b1
commit 705de07e7e
7 changed files with 96 additions and 5 deletions
+2 -1
View File
@@ -14694,8 +14694,9 @@ INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
( 53271, 'spell_hun_masters_call'), ( 53271, 'spell_hun_masters_call'),
( 53478, 'spell_hun_last_stand_pet'), ( 53478, 'spell_hun_last_stand_pet'),
( 55709, 'spell_hun_pet_heart_of_the_phoenix'), ( 55709, 'spell_hun_pet_heart_of_the_phoenix'),
( 54044, 'spell_hun_pet_carrion_feeder'),
-- rogue -- rogue
( 5938, 'spell_rog_shiv'), ( 5938, 'spell_rog_shiv'),
( 14185, 'spell_rog_preparation'), ( 14185, 'spell_rog_preparation'),
( 31231, 'spell_rog_cheat_death'), ( 31231, 'spell_rog_cheat_death'),
( 51662, 'spell_rog_hunger_for_blood'), ( 51662, 'spell_rog_hunger_for_blood'),
@@ -0,0 +1,3 @@
DELETE FROM `spell_script_names` WHERE `spell_id`=54044 AND `ScriptName`='spell_hun_pet_carrion_feeder';
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
(54044, 'spell_hun_pet_carrion_feeder');
@@ -349,5 +349,22 @@ bool CannibalizeObjectCheck::operator()(Corpse* u)
return false; return false;
} }
bool CarrionFeederObjectCheck::operator()(Corpse* u)
{
// ignore bones
if (u->GetType() == CORPSE_BONES)
return false;
Player* owner = ObjectAccessor::FindPlayer(u->GetOwnerGUID());
if (!owner || i_funit->IsFriendlyTo(owner))
return false;
if (i_funit->IsWithinDistInMap(u, i_range))
return true;
return false;
}
template void ObjectUpdater::Visit<GameObject>(GameObjectMapType &); template void ObjectUpdater::Visit<GameObject>(GameObjectMapType &);
template void ObjectUpdater::Visit<DynamicObject>(DynamicObjectMapType &); template void ObjectUpdater::Visit<DynamicObject>(DynamicObjectMapType &);
@@ -562,6 +562,32 @@ namespace Trinity
float i_range; float i_range;
}; };
class CarrionFeederObjectCheck
{
public:
CarrionFeederObjectCheck(Unit* funit, float range) : i_funit(funit), i_range(range) {}
bool operator()(Player* u)
{
if (i_funit->IsFriendlyTo(u) || u->isAlive() || u->isInFlight())
return false;
return i_funit->IsWithinDistInMap(u, i_range);
}
bool operator()(Corpse* u);
bool operator()(Creature* u)
{
if (i_funit->IsFriendlyTo(u) || u->isAlive() || u->isInFlight() ||
(u->GetCreatureTypeMask() & CREATURE_TYPEMASK_MECHANICAL_OR_ELEMENTAL) != 0)
return false;
return i_funit->IsWithinDistInMap(u, i_range);
}
template<class NOT_INTERESTED> bool operator()(NOT_INTERESTED*) { return false; }
private:
Unit* const i_funit;
float i_range;
};
// WorldObject do classes // WorldObject do classes
class RespawnDo class RespawnDo
+6 -1
View File
@@ -542,8 +542,13 @@ void Spell::SelectSpellTargets()
switch(m_spellInfo->Id) switch(m_spellInfo->Id)
{ {
case 20577: // Cannibalize case 20577: // Cannibalize
case 54044: // Carrion Feeder
{ {
WorldObject* result = FindCorpseUsing<Trinity::CannibalizeObjectCheck> (); WorldObject* result = NULL;
if (m_spellInfo->Id == 20577)
result = FindCorpseUsing<Trinity::CannibalizeObjectCheck>();
else
result = FindCorpseUsing<Trinity::CarrionFeederObjectCheck>();
if (result) if (result)
{ {
-3
View File
@@ -715,10 +715,7 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
damage += m_caster->ToPlayer()->GetAmmoDPS()*item->GetProto()->Delay*0.001f; damage += m_caster->ToPlayer()->GetAmmoDPS()*item->GetProto()->Delay*0.001f;
} }
} }
} }
else if (m_spellInfo->Id == 53508)
damage *= m_caster->getLevel();
break; break;
} }
case SPELLFAMILY_PALADIN: case SPELLFAMILY_PALADIN:
@@ -31,6 +31,7 @@ enum HunterSpells
HUNTER_PET_HEART_OF_THE_PHOENIX = 55709, HUNTER_PET_HEART_OF_THE_PHOENIX = 55709,
HUNTER_PET_HEART_OF_THE_PHOENIX_TRIGGERED = 54114, HUNTER_PET_HEART_OF_THE_PHOENIX_TRIGGERED = 54114,
HUNTER_PET_HEART_OF_THE_PHOENIX_DEBUFF = 55711, HUNTER_PET_HEART_OF_THE_PHOENIX_DEBUFF = 55711,
HUNTER_PET_SPELL_CARRION_FEEDER_TRIGGERED = 54045,
}; };
class spell_hun_last_stand_pet_SpellScript : public SpellScript class spell_hun_last_stand_pet_SpellScript : public SpellScript
@@ -163,6 +164,42 @@ SpellScript * GetSpellScript_spell_hun_pet_heart_of_the_phoenix()
return new spell_hun_pet_heart_of_the_phoenix(); return new spell_hun_pet_heart_of_the_phoenix();
} }
class spell_hun_pet_carrion_feeder : public SpellScript
{
bool Validate(SpellEntry const * spellEntry)
{
if (!sSpellStore.LookupEntry(HUNTER_PET_SPELL_CARRION_FEEDER_TRIGGERED))
return false;
return true;
}
void HandleDummy(SpellEffIndex effIndex)
{
if (!GetHitUnit())
return;
Unit *caster = GetCaster();
caster->CastSpell(caster, HUNTER_PET_SPELL_CARRION_FEEDER_TRIGGERED, false);
}
void Register()
{
// add dummy effect spell handler to pet's Last Stand
EffectHandlers += EffectHandlerFn(spell_hun_pet_carrion_feeder::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
bool Load()
{
if (!GetCaster()->isPet())
return false;
return true;
}
};
SpellScript * GetSpellScript_spell_hun_pet_carrion_feeder()
{
return new spell_hun_pet_carrion_feeder();
}
void AddSC_hunter_spell_scripts() void AddSC_hunter_spell_scripts()
{ {
Script *newscript; Script *newscript;
@@ -186,4 +223,9 @@ void AddSC_hunter_spell_scripts()
newscript->Name = "spell_hun_pet_heart_of_the_phoenix"; newscript->Name = "spell_hun_pet_heart_of_the_phoenix";
newscript->GetSpellScript = &GetSpellScript_spell_hun_pet_heart_of_the_phoenix; newscript->GetSpellScript = &GetSpellScript_spell_hun_pet_heart_of_the_phoenix;
newscript->RegisterSelf(); newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "spell_hun_pet_carrion_feeder";
newscript->GetSpellScript = &GetSpellScript_spell_hun_pet_carrion_feeder;
newscript->RegisterSelf();
} }