* Rename InstanceData to InstanceScript

* Rename *mgr to their new names in scripts project
* Mass convert all the scripts (NEEDS THOROUGH TESTING, because it was done automatically) Please, report bugs on issue tracker.

--HG--
branch : trunk
rename : src/server/game/Instances/InstanceData.cpp => src/server/game/Instances/InstanceScript.cpp
rename : src/server/game/Instances/InstanceData.h => src/server/game/Instances/InstanceScript.h
This commit is contained in:
azazel
2010-08-08 22:54:58 +06:00
parent 8a69e50d6a
commit 590199d8e1
482 changed files with 84476 additions and 82697 deletions
+51 -49
View File
@@ -36,69 +36,71 @@ enum LazyPeon
SPELL_BUFF_SLEEP = 17743,
SPELL_AWAKEN_PEON = 19938
};
struct npc_lazy_peonAI : public ScriptedAI
␍class npc_lazy_peon : public CreatureScript
{
npc_lazy_peonAI(Creature *c) : ScriptedAI(c) {}
public:
npc_lazy_peon() : CreatureScript("npc_lazy_peon") { }
uint64 uiPlayerGUID;
uint32 m_uiRebuffTimer;
bool work;
void Reset ()
CreatureAI* GetAI(Creature* pCreature) const
{
uiPlayerGUID = 0;
work = false;
return new npc_lazy_peonAI(pCreature);
}
void MovementInform(uint32 /*type*/, uint32 id)
struct npc_lazy_peonAI : public ScriptedAI
{
if (id == 1)
work = true;
}
npc_lazy_peonAI(Creature *c) : ScriptedAI(c) {}
void SpellHit(Unit *caster, const SpellEntry *spell)
{
if (spell->Id == SPELL_AWAKEN_PEON && caster->GetTypeId() == TYPEID_PLAYER
&& CAST_PLR(caster)->GetQuestStatus(QUEST_LAZY_PEONS) == QUEST_STATUS_INCOMPLETE)
uint64 uiPlayerGUID;
uint32 m_uiRebuffTimer;
bool work;
void Reset ()
{
caster->ToPlayer()->KilledMonsterCredit(me->GetEntry(),me->GetGUID());
DoScriptText(SAY_SPELL_HIT, me, caster);
me->RemoveAllAuras();
if (GameObject* Lumberpile = me->FindNearestGameObject(GO_LUMBERPILE, 20))
me->GetMotionMaster()->MovePoint(1,Lumberpile->GetPositionX()-1,Lumberpile->GetPositionY(),Lumberpile->GetPositionZ());
uiPlayerGUID = 0;
work = false;
}
}
void UpdateAI(const uint32 uiDiff)
{
if (work == true)
me->HandleEmoteCommand(466);
if (m_uiRebuffTimer <= uiDiff)
void MovementInform(uint32 /*type*/, uint32 id)
{
DoCast(me, SPELL_BUFF_SLEEP);
m_uiRebuffTimer = 300000; //Rebuff agian in 5 minutes
if (id == 1)
work = true;
}
else
m_uiRebuffTimer -= uiDiff;
if (!UpdateVictim())
return;
DoMeleeAttackIfReady();
}
void SpellHit(Unit *caster, const SpellEntry *spell)
{
if (spell->Id == SPELL_AWAKEN_PEON && caster->GetTypeId() == TYPEID_PLAYER
&& CAST_PLR(caster)->GetQuestStatus(QUEST_LAZY_PEONS) == QUEST_STATUS_INCOMPLETE)
{
caster->ToPlayer()->KilledMonsterCredit(me->GetEntry(),me->GetGUID());
DoScriptText(SAY_SPELL_HIT, me, caster);
me->RemoveAllAuras();
if (GameObject* Lumberpile = me->FindNearestGameObject(GO_LUMBERPILE, 20))
me->GetMotionMaster()->MovePoint(1,Lumberpile->GetPositionX()-1,Lumberpile->GetPositionY(),Lumberpile->GetPositionZ());
}
}
void UpdateAI(const uint32 uiDiff)
{
if (work == true)
me->HandleEmoteCommand(466);
if (m_uiRebuffTimer <= uiDiff)
{
DoCast(me, SPELL_BUFF_SLEEP);
m_uiRebuffTimer = 300000; //Rebuff agian in 5 minutes
}
else
m_uiRebuffTimer -= uiDiff;
if (!UpdateVictim())
return;
DoMeleeAttackIfReady();
}
};
};
CreatureAI* GetAI_npc_lazy_peon(Creature* pCreature)
{
return new npc_lazy_peonAI(pCreature);
}
void AddSC_durotar()
{
Script* newscript;
newscript = new Script;
newscript->Name = "npc_lazy_peon";
newscript->GetAI = &GetAI_npc_lazy_peon;
newscript->RegisterSelf();
}
new npc_lazy_peon();
}