Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "ScriptPCH.h"
- class Resurrect_creature : public CreatureScript
- {
- public:
- Resurrect_creature() : CreatureScript("Resurrect_creature") { }
- struct Resurrect_creatureAI : public ScriptedAI
- {
- Resurrect_creatureAI(Creature* creature) : ScriptedAI(creature) {}
- void MoveInLineOfSight(Unit* who)
- {
- if(!me->IsWithinDistInMap(who, 50.0f)) // limit range
- return;
- if(who->GetTypeId() != TYPEID_PLAYER) // check that the unit is player
- return;
- Player* player = who->ToPlayer(); // transform unit to player type
- if(player->isDead()) // check if he is dead
- player->ResurrectPlayer(100); // resurrect without sickness to 100%
- }
- };
- CreatureAI* GetAI(Creature* creature) const
- {
- return new Resurrect_creatureAI(creature);
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement