Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "ScriptPCH.h"
- enum Spells
- {
- HARVESTSOUL = 74325,
- ICEARMOR = 74272,
- };
- class IceMan : public CreatureScript
- {
- public:
- IceMan() : CreatureScript("IceMan"){}
- CreatureAI* GetAI(Creature* pCreature) const
- {
- return new IceManAI(pCreature);
- }
- struct IceManAI : public ScriptedAI
- {
- IceManAI(Creature *c) : ScriptedAI(c) {}
- uint32 Harvestsoul_timer;
- uint32 Armor_timer;
- void Reset()
- {
- Armor_timer = 7000;
- Harvestsoul_timer = 300000;
- }
- void JustDied(Unit * victim)
- {
- me->MonsterSay("Oh No i Died",LANG_UNIVERSAL,NULL);
- }
- void KilledUnit(Unit * victim)
- {
- me->MonsterSay("Haha i killed you",LANG_UNIVERSAL,NULL);
- }
- void EnterCombat(Unit * /*who*/)
- {
- me->MonsterSay("You think you can kill me",LANG_UNIVERSAL,NULL);
- }
- void UpdateAI(const uint32 uiDiff)
- {
- // This will run without any targets
- if (Armor_timer -uiDiff <= 0)
- {
- DoCast(me, ICEARMOR);
- Armor_timer = 300000;
- }
- else
- Armor_timer -= uiDiff;
- if(!UpdateVictim())
- return;
- if (Harvestsoul_timer <= uiDiff)
- {
- Unit * target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true);
- DoCast(target, HARVESTSOUL);
- Harvestsoul_timer = 300000;
- }
- else
- Harvestsoul_timer -= uiDiff;
- DoMeleeAttackIfReady();
- }
- };
- };
- void AddSC_IceMan()
- {
- new IceMan();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement