* 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
+70 -66
View File
@@ -28,24 +28,30 @@ EndScriptData */
/*######
# at_twilight_grove
######*/
bool AreaTrigger_at_twilight_grove(Player* pPlayer, const AreaTriggerEntry * /*at*/)
␍class at_twilight_grove : public AreaTriggerScript
{
if (pPlayer->HasQuestForItem(21149))
public:
at_twilight_grove() : AreaTriggerScript("at_twilight_grove") { }
bool OnTrigger(Player* pPlayer, const AreaTriggerEntry * /*at*/)
{
if (Unit* TCorrupter = pPlayer->SummonCreature(15625,-10328.16,-489.57,49.95,0,TEMPSUMMON_MANUAL_DESPAWN,60000))
if (pPlayer->HasQuestForItem(21149))
{
TCorrupter->setFaction(14);
TCorrupter->SetMaxHealth(832750);
if (Unit* TCorrupter = pPlayer->SummonCreature(15625,-10328.16,-489.57,49.95,0,TEMPSUMMON_MANUAL_DESPAWN,60000))
{
TCorrupter->setFaction(14);
TCorrupter->SetMaxHealth(832750);
}
if (Unit* CorrupterSpeaker = pPlayer->SummonCreature(1,pPlayer->GetPositionX(),pPlayer->GetPositionY(),pPlayer->GetPositionZ()-1,0,TEMPSUMMON_TIMED_DESPAWN,15000))
{
CorrupterSpeaker->SetName("Twilight Corrupter");
CorrupterSpeaker->SetVisibility(VISIBILITY_ON);
CorrupterSpeaker->MonsterYell("Come, $N. See what the Nightmare brings...",0,pPlayer->GetGUID());
}
}
if (Unit* CorrupterSpeaker = pPlayer->SummonCreature(1,pPlayer->GetPositionX(),pPlayer->GetPositionY(),pPlayer->GetPositionZ()-1,0,TEMPSUMMON_TIMED_DESPAWN,15000))
{
CorrupterSpeaker->SetName("Twilight Corrupter");
CorrupterSpeaker->SetVisibility(VISIBILITY_ON);
CorrupterSpeaker->MonsterYell("Come, $N. See what the Nightmare brings...",0,pPlayer->GetGUID());
}
}
return false;
return false;
};
};
/*######
@@ -55,74 +61,72 @@ bool AreaTrigger_at_twilight_grove(Player* pPlayer, const AreaTriggerEntry * /*a
#define SPELL_SOUL_CORRUPTION 25805
#define SPELL_CREATURE_OF_NIGHTMARE 25806
#define SPELL_LEVEL_UP 24312
struct boss_twilight_corrupterAI : public ScriptedAI
␍class boss_twilight_corrupter : public CreatureScript
{
boss_twilight_corrupterAI(Creature *c) : ScriptedAI(c) {}
public:
boss_twilight_corrupter() : CreatureScript("boss_twilight_corrupter") { }
uint32 SoulCorruption_Timer;
uint32 CreatureOfNightmare_Timer;
uint8 KillCount;
void Reset()
CreatureAI* GetAI(Creature* pCreature) const
{
SoulCorruption_Timer = 15000;
CreatureOfNightmare_Timer = 30000;
KillCount = 0;
}
void EnterCombat(Unit* /*who*/)
{
me->MonsterYell("The Nightmare cannot be stopped!",0,me->GetGUID());
return new boss_twilight_corrupterAI (pCreature);
}
void KilledUnit(Unit* victim)
struct boss_twilight_corrupterAI : public ScriptedAI
{
if (victim->GetTypeId() == TYPEID_PLAYER)
boss_twilight_corrupterAI(Creature *c) : ScriptedAI(c) {}
uint32 SoulCorruption_Timer;
uint32 CreatureOfNightmare_Timer;
uint8 KillCount;
void Reset()
{
++KillCount;
me->MonsterTextEmote("Twilight Corrupter squeezes the last bit of life out of $N and swallows their soul.", victim->GetGUID(),true);
SoulCorruption_Timer = 15000;
CreatureOfNightmare_Timer = 30000;
KillCount = 0;
}
void EnterCombat(Unit* /*who*/)
{
me->MonsterYell("The Nightmare cannot be stopped!",0,me->GetGUID());
}
if (KillCount == 3)
void KilledUnit(Unit* victim)
{
if (victim->GetTypeId() == TYPEID_PLAYER)
{
DoCast(me, SPELL_LEVEL_UP, true);
KillCount = 0;
++KillCount;
me->MonsterTextEmote("Twilight Corrupter squeezes the last bit of life out of $N and swallows their soul.", victim->GetGUID(),true);
if (KillCount == 3)
{
DoCast(me, SPELL_LEVEL_UP, true);
KillCount = 0;
}
}
}
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (SoulCorruption_Timer <= diff)
void UpdateAI(const uint32 diff)
{
DoCast(me->getVictim(), SPELL_SOUL_CORRUPTION);
SoulCorruption_Timer = rand()%4000+15000; //gotta confirm Timers
} else SoulCorruption_Timer-=diff;
if (CreatureOfNightmare_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_CREATURE_OF_NIGHTMARE);
CreatureOfNightmare_Timer = 45000; //gotta confirm Timers
} else CreatureOfNightmare_Timer-=diff;
DoMeleeAttackIfReady();
if (!UpdateVictim())
return;
if (SoulCorruption_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_SOUL_CORRUPTION);
SoulCorruption_Timer = rand()%4000+15000; //gotta confirm Timers
} else SoulCorruption_Timer-=diff;
if (CreatureOfNightmare_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_CREATURE_OF_NIGHTMARE);
CreatureOfNightmare_Timer = 45000; //gotta confirm Timers
} else CreatureOfNightmare_Timer-=diff;
DoMeleeAttackIfReady();
};
};
};
CreatureAI* GetAI_boss_twilight_corrupter(Creature* pCreature)
{
return new boss_twilight_corrupterAI (pCreature);
}
void AddSC_duskwood()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_twilight_corrupter";
newscript->GetAI = &GetAI_boss_twilight_corrupter;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "at_twilight_grove";
newscript->pAreaTrigger = &AreaTrigger_at_twilight_grove;
newscript->RegisterSelf();
new boss_twilight_corrupter();
new at_twilight_grove();
}