aboutsummaryrefslogtreecommitdiff
path: root/src/bindings/scripts
diff options
context:
space:
mode:
authorBlaymoira <none@none>2009-01-01 18:21:38 +0100
committerBlaymoira <none@none>2009-01-01 18:21:38 +0100
commit4c201cb62652f95c6a37f5ceed975184fe9e96a7 (patch)
treef07531568a52c78133a6f1a82bb5cecb8fe97ce7 /src/bindings/scripts
parentd968a0457bbaaa277356c05e90f83b88f2d30da9 (diff)
*Missed World.cpp changes in 729
*Try to fix a crash in eversong_woods.cpp --HG-- branch : trunk
Diffstat (limited to 'src/bindings/scripts')
-rw-r--r--src/bindings/scripts/scripts/zone/eversong_woods/eversong_woods.cpp39
1 files changed, 22 insertions, 17 deletions
diff --git a/src/bindings/scripts/scripts/zone/eversong_woods/eversong_woods.cpp b/src/bindings/scripts/scripts/zone/eversong_woods/eversong_woods.cpp
index bfd8a5d51ce..be74291fe3d 100644
--- a/src/bindings/scripts/scripts/zone/eversong_woods/eversong_woods.cpp
+++ b/src/bindings/scripts/scripts/zone/eversong_woods/eversong_woods.cpp
@@ -604,8 +604,9 @@ struct TRINITY_DLL_DECL npc_apprentice_mirvedaAI : public ScriptedAI
{
if (PlayerGUID)
{
- Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
- ((Player*)player)->GroupEventHappens(QUEST_UNEXPECTED_RESULT, m_creature);
+ Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
+ if(player)
+ ((Player*)player)->CompleteQuest(QUEST_UNEXPECTED_RESULT);
}
}
@@ -671,22 +672,18 @@ struct TRINITY_DLL_DECL npc_infused_crystalAI : public Scripted_NoMovementAI
void Reset()
{
- EndTimer = 0;
- WaveTimer = 0;
- PlayerGUID = 0;
+ EndTimer = 60000;
Completed = false;
- Progress = false;
+ Progress = true;
+ PlayerGUID = 0;
+ WaveTimer = 1000;
}
void Aggro(Unit* who){}
- void JustSummoned(Creature *summoned)
- {
- summoned->AI()->AttackStart(m_creature);
- }
-
void MoveInLineOfSight(Unit* who)
{
+ PlayerGUID = who->GetGUID();
error_log("MoveLos");
if( who->GetTypeId() == TYPEID_PLAYER && !m_creature->canStartAttack(who) )
{
@@ -705,6 +702,11 @@ struct TRINITY_DLL_DECL npc_infused_crystalAI : public Scripted_NoMovementAI
}
}
}
+ }
+
+ void JustSummoned(Creature *summoned)
+ {
+ summoned->AI()->AttackStart(m_creature);
}
void JustDied(Unit* killer)
@@ -726,7 +728,9 @@ struct TRINITY_DLL_DECL npc_infused_crystalAI : public Scripted_NoMovementAI
if (PlayerGUID)
{
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
- ((Player*)player)->GroupEventHappens(QUEST_POWERING_OUR_DEFENSES, m_creature);
+ if(player)
+ ((Player*)player)->CompleteQuest(QUEST_POWERING_OUR_DEFENSES);
+ error_log("quest complete");
}
m_creature->DealDamage(m_creature,m_creature->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
m_creature->RemoveCorpse();
@@ -735,17 +739,18 @@ struct TRINITY_DLL_DECL npc_infused_crystalAI : public Scripted_NoMovementAI
if(WaveTimer < diff && !Completed && Progress)
{
- uint32 ran = rand()%8;
- DoSpawnCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran].x, SpawnLocations[ran].y, SpawnLocations[ran].z, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000);
- DoSpawnCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran].x, SpawnLocations[ran].y, SpawnLocations[ran].z, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000);
- DoSpawnCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran].x, SpawnLocations[ran].y, SpawnLocations[ran].z, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000);
+ uint32 ran1 = rand()%8;
+ uint32 ran2 = rand()%8;
+ uint32 ran3 = rand()%8;
+ m_creature->SummonCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran1].x, SpawnLocations[ran1].y, SpawnLocations[ran1].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000);
+ m_creature->SummonCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran2].x, SpawnLocations[ran2].y, SpawnLocations[ran2].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000);
+ m_creature->SummonCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran3].x, SpawnLocations[ran3].y, SpawnLocations[ran3].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000);
WaveTimer = 30000;
error_log("Wave summon");
}else WaveTimer -= diff;
}
};
-
CreatureAI* GetAI_npc_infused_crystalAI(Creature *_Creature)
{
return new npc_infused_crystalAI (_Creature);