Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "ScriptPCH.h"
- #define spell_cleave 845
- #define spell_death_coil 6789
- class my_patchwerk : public CreatureScript
- {
- public:
- my_patchwerk() : CreatureScript("my_patchwerk") { }
- struct my_patchwerkAI : public ScriptedAI
- {
- my_patchwerkAI(Creature *c) : ScriptedAI(c) {}
- uint32 tcleave;
- uint32 tdeathcoil;
- void Reset()
- {
- tcleave = 15000;
- tdeathcoil = 30000;
- }
- void EnterCombat(Unit* /*who*/)
- {
- me->MonsterYell("I yelled on combat", LANG_UNIVERSAL, NULL);
- }
- void JustDied(Unit* /*killer*/)
- {
- me->MonsterYell("I yelled on death", LANG_UNIVERSAL, NULL);
- }
- void KilledUnit(Unit* /*victim*/)
- {
- me->MonsterYell("I yelled when killing someone", LANG_UNIVERSAL, NULL);
- }
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
- return;
- if (tcleave <= diff)
- {
- DoCast(me->getVictim(), spell_cleave, true);
- tcleave = 15000;
- }
- else
- tcleave -= diff;
- if (tdeathcoil <= diff)
- {
- DoCast(me->getVictim(), spell_death_coil, true);
- me->MonsterYell("Eat This !", LANG_UNIVERSAL, NULL);
- tdeathcoil = 30000;
- }
- else
- tdeathcoil -= diff;
- DoMeleeAttackIfReady();
- }
- };
- CreatureAI* GetAI(Creature* pCreature) const
- {
- return new my_patchwerkAI (pCreature);
- }
- };
- void AddSC_my_patchwerk()
- {
- new my_patchwerk();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement