Bonjour,
Un simple PNJ Anti PVP
[code=cpp]
#include "ScriptPCH.h"
#define bump 42435
class garde_anti_pvp : public CreatureScript
{
public:
garde_anti_pvp() : CreatureScript("garde_anti_pvp") { }
struct garde_anti_pvpAI : public ScriptedAI
{
garde_anti_pvpAI (Creature *c) : ScriptedAI© {Reset();}
uint32 bump_Timer;
void Reset()
{
bump_Timer = 1000 ;
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (bump_Timer < diff)
{
DoCast(me->getVictim(),bump);
bump_Timer = 1000;
}else bump_Timer -= diff;
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI (Creature* pCreature) const
{
return new garde_anti_pvpAI (pCreature);
}
};
void AddSC_garde_anti_pvp ()
{
new garde_anti_pvp();
}[/code]
Le code n'est pas de moi.
Il trainait sur mon PC
Auteur : Dorian
Cordialement,
Nerice