All pastes #955603 Raw Edit

Miscellany

public text v1 · immutable
#955603 ·published 2008-03-24 19:17 UTC
rendered paste body
#include "../sc_defines.h"
#include <time.h>
#include <ctime>


struct MANGOS_DLL_DECL kinghorde : public ScriptedAI
{

kinghorde(Creature *c) : ScriptedAI(c){EnterEvadeMode();}

void EnterEvadeMode()
{
m_creature->RemoveAllAuras();
m_creature->DeleteThreatList();
m_creature->CombatStop();
m_creature->setFaction(35);
DoGoHome();
}


void MoveInLineOfSight(Unit *who)
{


   struct tm * timeinfo;
   time_t rawtime;
   
    time ( &rawtime );
    timeinfo = localtime ( &rawtime );

if (timeinfo->tm_hour < 22 && timeinfo->tm_hour > 13)
 {
    DoYell("Me nezabijete !", LANG_UNIVERSAL, NULL);
    m_creature->setFaction(76);
    DoYell("EVENT TROPHy Neziskas !", LANG_UNIVERSAL, NULL);
    DoCast(m_creature,40453,true);
 }
else 
  {
  DoYell("Muzes na me utocit pouze od 14 do 22 hodin. V noci spim.", LANG_UNIVERSAL, NULL);
  m_creature->RemoveAllAuras();
  m_creature->DeleteThreatList();
  m_creature->CombatStop();
  m_creature->setFaction(35);
  DoGoHome();
  DoCast(m_creature,25148,true);
  }

}
};

CreatureAI* GetAI_kinghorde(Creature *_Creature)
{
return new kinghorde(_Creature);
}


void AddSC_kinghorde()
{
Script *newscript;
newscript = new Script;
newscript->Name="kinghorde"; 
newscript->GetAI = GetAI_kinghorde;
m_scripts[nrscripts++] = newscript; 
}

void Reset() {}