Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class miniboss40 : public CreatureScript
- {
- public:
- miniboss40() : CreatureScript("miniboss40") { }
- struct minibossAI : public ScriptedAI
- {
- void EnterCombat(Unit* /*who*/)
- {
- me->MonsterYell(MINI40_SAY_START, LANG_UNIVERSAL, 0);
- }
- void UpdateAI(uint32 const diff)
- {
- Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 200.0f, true);
- if(!UpdateVictim())
- return;
- if(me->GetHealth() <= me->GetMaxHealth() * 0.5)
- {
- me->MonsterSay(MINI40_SAY_HALF, LANG_UNIVERSAL, 0);
- }
- if(me->GetHealth() <= me->GetMaxHealth() * 0.25)
- {
- me->MonsterSay(MINI40_SAY_CORDER, LANG_UNIVERSAL, 0);
- me->CastSpell(target, SPELL_LIGHTNING_BOLT);
- }
- }
- void JustDied(Player* pPlayer, Creature* pKilledCreature)
- {
- if(!pKilledCreature->isAlive())
- pKilledCreature->MonsterSay(MINI40_SAY_END, LANG_UNIVERSAL, 0);
- }
- void KilledUnit(Unit* victim)
- {
- if (victim->GetTypeId() == TYPEID_PLAYER)
- me->MonsterSay(MINI40_SAY_FAIL, LANG_UNIVERSAL, 0);
- }
- };
- };
Add Comment
Please, Sign In to add comment