Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as C++ by - ( 15 years ago )
struct MANGOS_DLL_DECL mob_blood_beastAI : public ScriptedAI
{
mob_blood_beastAI(Creature *pCreature) : ScriptedAI(pCreature)
{
pInstance = (ScriptedInstance*)pCreature->GetInstanceData();
Modus = pCreature->GetMap()->GetDifficulty(); //0=10MannNonhero,1=25MannNonhero,2=10MannHero,3=25MannHero
Reset();
}
ScriptedInstance *pInstance;
uint8 Modus;
void Reset()
{
Creature* pOwner = m_creature->GetMap()->GetCreature(pInstance->GetData64(NPC_DEATHBRINGER_SAURFANG));
}
void KilledUnit(Unit* pVictim)
{
if(Creature* pOwner = m_creature->GetMap()->GetCreature(pInstance->GetData64(NPC_DEATHBRINGER_SAURFANG)))
{
if(pVictim->HasAura(SPELL_MARK))
{
((boss_deathbringer_saurfangAI*)pOwner->AI())->MarkDeathHeal(pVictim);
}
((boss_deathbringer_saurfangAI*)pOwner->AI())->KilledUnit(pVictim);
}
}
void DamageDeal(Unit* pDoneTo, uint32& uiDamage)
{
if(Creature* pOwner = m_creature->GetMap()->GetCreature(pInstance->GetData64(NPC_DEATHBRINGER_SAURFANG)))
{
if(pDoneTo == m_creature->getVictim())
{
//Nonhero
if(Modus == 0 || Modus == 1)
{
debug_log("Blutbestie dobloodpower NONHERO");
((boss_deathbringer_saurfangAI*)pOwner->AI())->doBloodPower(3);
}
//Hero
if(Modus == 2 || Modus == 3)
{
debug_log("Blutbestie dobloodpower HERO");
((boss_deathbringer_saurfangAI*)pOwner->AI())->doBloodPower(5);
}
}
}
}
void UpdateAI(const uint32 uiDiff)
{
if (!pInstance || pInstance->GetData(TYPE_SAURFANG) != IN_PROGRESS)
m_creature->ForcedDespawn();
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
return;
if (!m_creature->HasAura(SPELL_RESISTANT_SKIN)) DoCast(m_creature,SPELL_RESISTANT_SKIN);
if (!m_creature->HasAura(SPELL_BLOOD_LINK_BEAST)) DoCast(m_creature,SPELL_BLOOD_LINK_BEAST);
DoMeleeAttackIfReady();
}
};
Revise this Paste