Saphrilion
Bonjour, voilà un autre boss custom ! Celui ci est extrêmement dur, je vous laisse découvrir Smile

[code=cpp]
/* ScriptData
SDName: Saphrilion
SD%Complete: 100
SDCategory: Boss
Phases : 4*/
[/code]

[code=cpp]
#include "ScriptedPch.h"


struct SaphrilionAI : public ScriptedAI
{
SaphrilionAI(Creature *c) : ScriptedAI©
{
}

uint32 spell1_phase1_Timer;
uint32 spell2_phase1_Timer;
uint32 spell3_phase1_Timer;
uint32 spell1_phase2_Timer;
uint32 spell1_phase3_Timer;
uint32 spell1_phase4_Timer;
uint32 spell2_phase4_Timer;
uint32 spell3_phase4_Timer;
uint32 phase1_Percent;
uint32 phase2_Percent;
uint32 phase3_Percent;
uint32 phase4_Percent;
uint32 phase5_Percent;
uint32 phase;

void Reset()
{
spell1_phase1_Timer = 15000+rand()%5000;
spell2_phase1_Timer = 20000+rand()%5000;
spell3_phase1_Timer = 5000+rand()%13000;
spell1_phase2_Timer = 19000+rand()%15000;
spell1_phase3_Timer = 10000+rand()%10000;
spell1_phase4_Timer = 40000+rand()%10000;
spell2_phase4_Timer = 25000+rand()%11000;
spell3_phase4_Timer = 10000+rand()%24000;
phase1_Percent = 90;
phase2_Percent = 60;
phase3_Percent = 45;
phase4_Percent = 35;
phase5_Percent = 25;
phase = 0;
m_creature->ApplySpellImmune(57994, IMMUNITY_DAMAGE, 0, true);
m_creature->ApplySpellImmune(5116, IMMUNITY_DAMAGE, 0, true);
m_creature->ApplySpellImmune(1499, IMMUNITY_DAMAGE, 0, true);
m_creature->ApplySpellImmune(13809, IMMUNITY_DAMAGE, 0, true);
m_creature->ApplySpellImmune(47528, IMMUNITY_DAMAGE, 0, true);
m_creature->ApplySpellImmune(45524, IMMUNITY_DAMAGE, 0, true);
m_creature->ApplySpellImmune(23920, IMMUNITY_DAMAGE, 0, true);
m_creature->ApplySpellImmune(10308, IMMUNITY_DAMAGE, 0, true);
m_creature->ApplySpellImmune(42917, IMMUNITY_DAMAGE, 0, true);
m_creature->ApplySpellImmune(2139, IMMUNITY_DAMAGE, 0, true);
}

void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;

if ((m_creature->GetHealth() * 100 / m_creature->GetMaxHealth() <= 90) && phase == 0)
{
phase = 1;
m_creature->MonsterYell("Souffre de lave !", LANG_UNIVERSAL, NULL);
}

if ((m_creature->GetHealth() * 100 / m_creature->GetMaxHealth() <= 60) && phase == 1)
{
phase = 2;
m_creature->MonsterYell("Votre mort arrive, c'est une question de temps", LANG_UNIVERSAL, NULL);
}

if ((m_creature->GetHealth() * 100 / m_creature->GetMaxHealth() <= 45) && phase == 2)
{
phase = 3;
m_creature->MonsterYell("AAAAAARRRRR", LANG_UNIVERSAL, NULL);
}

if ((m_creature->GetHealth() * 100 / m_creature->GetMaxHealth() <= 35) && phase == 3)
{
phase = 4;
m_creature->MonsterSay("In'thalar Okrtar", LANG_UNIVERSAL, NULL);
}

if ((m_creature->GetHealth() * 100 / m_creature->GetMaxHealth() <= 25) && phase == 4)
{
phase = 5;
m_creature->MonsterSay("Contre Sort !", LANG_UNIVERSAL, NULL);
}

if (phase == 1)
{

if (spell1_phase1_Timer <= diff)
{
DoCast(m_creature->getVictim(), 74395);
spell1_phase1_Timer = 15000+rand()%5000;
} else spell1_phase1_Timer -= diff;

if (spell2_phase1_Timer <= diff)
{
DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true), 74392);
spell2_phase1_Timer = 20000+rand()%5000;
} else spell2_phase1_Timer -= diff;

if (spell3_phase1_Timer <= diff)
{
DoCast(m_creature->getVictim(), 13737);
spell3_phase1_Timer = 5000+rand()%13000;
} else spell3_phase1_Timer -= diff;
}

if (phase == 2)
{

if (spell1_phase2_Timer <= diff)
{
DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true), 74502);
spell1_phase2_Timer = 19000+rand()%15000;
} else spell1_phase2_Timer -= diff;
}

if (phase == 3)
{

if (spell1_phase3_Timer <= diff)
{
DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true), 75125);
spell1_phase3_Timer = 10000+rand()%10000;
} else spell1_phase3_Timer -= diff;
}

if (phase == 4)
{

if (spell1_phase4_Timer <= diff)
{
DoCast(m_creature->getVictim(), 40504);
spell1_phase4_Timer = 40000+rand()%10000;
} else spell1_phase4_Timer -= diff;

if (spell2_phase4_Timer <= diff)
{
DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true), 18392);
spell2_phase4_Timer = 25000+rand()%11000;
} else spell2_phase4_Timer -= diff;

if (spell3_phase4_Timer <= diff)
{
DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true), 67519);
spell3_phase4_Timer = 10000+rand()%24000;
} else spell3_phase4_Timer -= diff;
}

if (phase == 5)
{
}

DoMeleeAttackIfReady();
}
};

CreatureAI* GetAISaphrilion(Creature* pCreature)
{
return new SaphrilionAI (pCreature);
}

void AddSC_Saphrilion()
{
Script *newscript;
newscript = new Script;
newscript->Name = "npc_Saphrilion";
newscript->GetAI = &GetAISaphrilion;
newscript->RegisterSelf();
}
[/code]

Le SQL :
[code=sql]
-- N'oublié pas de crée un PNJ en 1er !
UPDATE `creature_template` SET ScriptName='npc_Saphrilion' WHERE `entry`=11112;
[/code]
GG a toi.

Merci du Partage
merci

Retourner en haut Accueil