Hello . i got a question how can i add on my script (its an creature)
an respawn time when its killed ??
an respawn time when its killed ??
Code:
/*
By aleks
*/
#include "Stdarx.h"
#include "Setup.h"
#define Creature World Boss
class CreatureAI : public ArcscriptCreatureAI
(
ARSCRIPT_FACTORY_FUNCTION(CreatureAI, ArcScriptCreatureAI) ;
CreatureAI(Creature *pCreature) : ArcScriptCreatureAI (pCreature)
(
AddEmote (Event_OnCombatStart, "You Die", Text_Yell) ;
AddEmote (Event_OnTargetDied, "You Fool", Text_Yell) ;
AddEmote (Event_OnDied, "I can't Belive pigs killed me.", Text_Yell)
void SetupCreatureAI (ScriptMgr *mgr)
(
mgr->register_creature_script(Creature, AI::Create) ;
)
class npc_boss_died : public CreatureScript
{
public:
npc_boss_died() : CreatureScript("npc_boss_died") { }
struct npc_boss_diedAI : public ScriptedAI
{
npc_boss_diedAI(Creature* creature) : ScriptedAI(creature) { }
void JustDied(Unit* killer)
{
std::ostringstream ss;
if (killer->GetTypeId() == TYPEID_PLAYER)
{
ss << killer->ToPlayer()->GetName()
<< " has killed "
<< me->GetName()
<< " a Rare Boss!";
sWorld->SendGlobalText(ss.str().c_str(), NULL);
}
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new npc_boss_diedAI(creature);
}
};
void AddSC_rare_boss()
{
new npc_boss_died;
}