Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "ScriptPCH.h"
- enum Spells
- {
- SPELL_DIVINE_SHIELD = 40733
- };
- enum Speech
- {
- SAY_DEFAULT = -1608000,
- };
- class test_npc : public CreatureScript
- {
- public:
- test_npc()
- : CreatureScript("test_npc") { }
- struct test_npcAI : public ScriptedAI
- {
- test_npcAI(Creature *c) : ScriptedAI(c)
- {
- pInstance = c->GetInstanceScript();
- }
- uint32 m_uiSayTimer;
- uint32 m_uiRebuffTimer;
- void Reset()
- {
- m_uiSayTimer = 10000;
- m_uiRebuffTimer = 15000;
- me->RestoreFaction(); // ???????????????????????????
- }
- void EnterCombat(Unit* /*who*/)
- {
- DoScriptText(SAY_DEFAULT, me);
- }
- void MoveInLineOfSight(Unit* /*who*/) {}
- void UpdateAI(const uint32 diff)
- {
- //Out of combat timers
- if (!me->getVictim())
- {
- //Rebuff timer
- if (m_uiRebuffTimer <= uiDiff)
- {
- DoCast(me, SPELL_DIVINE_SHIELD);
- m_uiRebuffTimer = 15000; //Rebuff agian in 15 sec
- }
- else
- m_uiRebuffTimer -= uiDiff;
- }
- }
- };
- };
- void AddSC_test_npc()
- {
- new test_npc();
- }
Advertisement
Add Comment
Please, Sign In to add comment