Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. /*
  2. npc_kobold
  3. */
  4. enum
  5. {
  6. SAY_1 = -280000,
  7. SAY_2 = -280001,
  8. SAY_3 = -280002,
  9.  
  10. SPELL_FIREBALL = 31262,
  11. SPELL_HEAL = 66112,
  12.  
  13. GOBJECT_1 = 22250,
  14.  
  15. NPC_HELP = 33950
  16. };
  17. class npc_kobold : public CreatureScript
  18. {
  19. public:
  20. npc_kobold() : CreatureScript("npc_kobold") { }
  21.  
  22. CreatureAI* GetAI(Creature* pCreature) const
  23. {
  24. return new npc_koboldAI (pCreature);
  25. }
  26. struct npc_koboldAI : public ScriptedAI
  27. {
  28. uint32 firebal;
  29. uint32 heal;
  30. bool help;
  31. bool seat;
  32.  
  33.  
  34. npc_koboldAI(Creature *c) : ScriptedAI(c) {}
  35.  
  36. void Reset()
  37. {
  38. firebal = 5000;
  39. heal = 10000;
  40. help = false;
  41. seat = false;
  42. }
  43.  
  44. void Aggro(Unit *pCreature, Player *pPlayer)
  45. {
  46. pCreature->CastSpell(pPlayer,SPELL_FIREBALL,true);
  47. DoScriptText(SAY_1,pCreature);
  48. }
  49.  
  50. void UpdateAI(const uint32 diff)
  51. {
  52. if (me->HealthAbovePct(50))
  53. {
  54. me->SummonCreature(NPC_HELP,0.0f, 0.0f, 0.0f, 0.0f,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT);
  55. help = true;
  56. }
  57. if (help == true)
  58. {
  59. DoScriptText(SAY_2,me);
  60. }
  61. if (me->HealthAbovePct(20))
  62. {
  63. me->CastSpell(me,SPELL_HEAL,true);
  64. }
  65. }
  66.  
  67. void SummonedCreatureDies(Creature *me, Creature* /*unit*/, Unit* /*killer*/)
  68. {
  69. me->SummonGameObject(GOBJECT_1,0.0f, 0.0f, 0.0f, 0.0f,0,0,0,0,15000);
  70. }
  71.  
  72. };
  73.  
  74. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement