Guest User

Untitled

a guest
Jun 25th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. class miniboss40 : public CreatureScript
  2. {
  3. public:
  4. miniboss40() : CreatureScript("miniboss40") { }
  5.  
  6. struct minibossAI : public ScriptedAI
  7. {
  8. void EnterCombat(Unit* /*who*/)
  9. {
  10. me->MonsterYell(MINI40_SAY_START, LANG_UNIVERSAL, 0);
  11. }
  12.  
  13. void UpdateAI(uint32 const diff)
  14. {
  15. Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 200.0f, true);
  16.  
  17. if(!UpdateVictim())
  18. return;
  19.  
  20. if(me->GetHealth() <= me->GetMaxHealth() * 0.5)
  21. {
  22. me->MonsterSay(MINI40_SAY_HALF, LANG_UNIVERSAL, 0);
  23. }
  24. if(me->GetHealth() <= me->GetMaxHealth() * 0.25)
  25. {
  26. me->MonsterSay(MINI40_SAY_CORDER, LANG_UNIVERSAL, 0);
  27. me->CastSpell(target, SPELL_LIGHTNING_BOLT);
  28. }
  29. }
  30.  
  31. void JustDied(Player* pPlayer, Creature* pKilledCreature)
  32. {
  33. if(!pKilledCreature->isAlive())
  34. pKilledCreature->MonsterSay(MINI40_SAY_END, LANG_UNIVERSAL, 0);
  35. }
  36.  
  37. void KilledUnit(Unit* victim)
  38. {
  39. if (victim->GetTypeId() == TYPEID_PLAYER)
  40. me->MonsterSay(MINI40_SAY_FAIL, LANG_UNIVERSAL, 0);
  41. }
  42. };
  43. };
Add Comment
Please, Sign In to add comment