Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- npc_kobold
- */
- enum
- {
- SAY_1 = -280000,
- SAY_2 = -280001,
- SAY_3 = -280002,
- SPELL_FIREBALL = 31262,
- SPELL_HEAL = 66112,
- GOBJECT_1 = 22250,
- NPC_HELP = 33950
- };
- class npc_kobold : public CreatureScript
- {
- public:
- npc_kobold() : CreatureScript("npc_kobold") { }
- CreatureAI* GetAI(Creature* pCreature) const
- {
- return new npc_koboldAI (pCreature);
- }
- struct npc_koboldAI : public ScriptedAI
- {
- uint32 firebal;
- uint32 heal;
- bool help;
- bool seat;
- npc_koboldAI(Creature *c) : ScriptedAI(c) {}
- void Reset()
- {
- firebal = 5000;
- heal = 10000;
- help = false;
- seat = false;
- }
- void Aggro(Unit *pCreature, Player *pPlayer)
- {
- pCreature->CastSpell(pPlayer,SPELL_FIREBALL,true);
- DoScriptText(SAY_1,pCreature);
- }
- void UpdateAI(const uint32 diff)
- {
- if (me->HealthAbovePct(50))
- {
- me->SummonCreature(NPC_HELP,0.0f, 0.0f, 0.0f, 0.0f,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT);
- help = true;
- }
- if (help == true)
- {
- DoScriptText(SAY_2,me);
- }
- if (me->HealthAbovePct(20))
- {
- me->CastSpell(me,SPELL_HEAL,true);
- }
- }
- void SummonedCreatureDies(Creature *me, Creature* /*unit*/, Unit* /*killer*/)
- {
- me->SummonGameObject(GOBJECT_1,0.0f, 0.0f, 0.0f, 0.0f,0,0,0,0,15000);
- }
- };
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement