*Missed World.cpp changes in 729
*Try to fix a crash in eversong_woods.cpp --HG-- branch : trunk
This commit is contained in:
@@ -604,8 +604,9 @@ struct TRINITY_DLL_DECL npc_apprentice_mirvedaAI : public ScriptedAI
|
|||||||
{
|
{
|
||||||
if (PlayerGUID)
|
if (PlayerGUID)
|
||||||
{
|
{
|
||||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||||
((Player*)player)->GroupEventHappens(QUEST_UNEXPECTED_RESULT, m_creature);
|
if(player)
|
||||||
|
((Player*)player)->CompleteQuest(QUEST_UNEXPECTED_RESULT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -671,22 +672,18 @@ struct TRINITY_DLL_DECL npc_infused_crystalAI : public Scripted_NoMovementAI
|
|||||||
|
|
||||||
void Reset()
|
void Reset()
|
||||||
{
|
{
|
||||||
EndTimer = 0;
|
EndTimer = 60000;
|
||||||
WaveTimer = 0;
|
|
||||||
PlayerGUID = 0;
|
|
||||||
Completed = false;
|
Completed = false;
|
||||||
Progress = false;
|
Progress = true;
|
||||||
|
PlayerGUID = 0;
|
||||||
|
WaveTimer = 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Aggro(Unit* who){}
|
void Aggro(Unit* who){}
|
||||||
|
|
||||||
void JustSummoned(Creature *summoned)
|
|
||||||
{
|
|
||||||
summoned->AI()->AttackStart(m_creature);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MoveInLineOfSight(Unit* who)
|
void MoveInLineOfSight(Unit* who)
|
||||||
{
|
{
|
||||||
|
PlayerGUID = who->GetGUID();
|
||||||
error_log("MoveLos");
|
error_log("MoveLos");
|
||||||
if( who->GetTypeId() == TYPEID_PLAYER && !m_creature->canStartAttack(who) )
|
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)
|
void JustDied(Unit* killer)
|
||||||
@@ -726,7 +728,9 @@ struct TRINITY_DLL_DECL npc_infused_crystalAI : public Scripted_NoMovementAI
|
|||||||
if (PlayerGUID)
|
if (PlayerGUID)
|
||||||
{
|
{
|
||||||
Unit* player = Unit::GetUnit((*m_creature), 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->DealDamage(m_creature,m_creature->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||||
m_creature->RemoveCorpse();
|
m_creature->RemoveCorpse();
|
||||||
@@ -735,17 +739,18 @@ struct TRINITY_DLL_DECL npc_infused_crystalAI : public Scripted_NoMovementAI
|
|||||||
|
|
||||||
if(WaveTimer < diff && !Completed && Progress)
|
if(WaveTimer < diff && !Completed && Progress)
|
||||||
{
|
{
|
||||||
uint32 ran = rand()%8;
|
uint32 ran1 = rand()%8;
|
||||||
DoSpawnCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran].x, SpawnLocations[ran].y, SpawnLocations[ran].z, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000);
|
uint32 ran2 = rand()%8;
|
||||||
DoSpawnCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran].x, SpawnLocations[ran].y, SpawnLocations[ran].z, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000);
|
uint32 ran3 = rand()%8;
|
||||||
DoSpawnCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran].x, SpawnLocations[ran].y, SpawnLocations[ran].z, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000);
|
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;
|
WaveTimer = 30000;
|
||||||
error_log("Wave summon");
|
error_log("Wave summon");
|
||||||
}else WaveTimer -= diff;
|
}else WaveTimer -= diff;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
CreatureAI* GetAI_npc_infused_crystalAI(Creature *_Creature)
|
CreatureAI* GetAI_npc_infused_crystalAI(Creature *_Creature)
|
||||||
{
|
{
|
||||||
return new npc_infused_crystalAI (_Creature);
|
return new npc_infused_crystalAI (_Creature);
|
||||||
|
|||||||
+2
-2
@@ -483,7 +483,7 @@ void World::LoadConfigSettings(bool reload)
|
|||||||
sLog.outError("Rate.Talent (%f) mustbe > 0. Using 1 instead.",rate_values[RATE_TALENT]);
|
sLog.outError("Rate.Talent (%f) mustbe > 0. Using 1 instead.",rate_values[RATE_TALENT]);
|
||||||
rate_values[RATE_TALENT] = 1.0f;
|
rate_values[RATE_TALENT] = 1.0f;
|
||||||
}
|
}
|
||||||
rate_values[RATE_CORPSE_DECAY_LOOTED] = sConfig.GetFloatDefault("Rate.Corpse.Decay.Looted",0.1f);
|
rate_values[RATE_CORPSE_DECAY_LOOTED] = sConfig.GetFloatDefault("Rate.Corpse.Decay.Looted",0.5f);
|
||||||
|
|
||||||
rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] = sConfig.GetFloatDefault("TargetPosRecalculateRange",1.5f);
|
rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] = sConfig.GetFloatDefault("TargetPosRecalculateRange",1.5f);
|
||||||
if(rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] < CONTACT_DISTANCE)
|
if(rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] < CONTACT_DISTANCE)
|
||||||
@@ -869,7 +869,7 @@ void World::LoadConfigSettings(bool reload)
|
|||||||
m_configs[CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP] = sConfig.GetBoolDefault("Death.CorpseReclaimDelay.PvP", true);
|
m_configs[CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP] = sConfig.GetBoolDefault("Death.CorpseReclaimDelay.PvP", true);
|
||||||
m_configs[CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE] = sConfig.GetBoolDefault("Death.CorpseReclaimDelay.PvE", true);
|
m_configs[CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE] = sConfig.GetBoolDefault("Death.CorpseReclaimDelay.PvE", true);
|
||||||
|
|
||||||
m_configs[CONFIG_THREAT_RADIUS] = sConfig.GetIntDefault("ThreatRadius", 100);
|
m_configs[CONFIG_THREAT_RADIUS] = sConfig.GetIntDefault("ThreatRadius", 60);
|
||||||
|
|
||||||
// always use declined names in the russian client
|
// always use declined names in the russian client
|
||||||
m_configs[CONFIG_DECLINED_NAMES_USED] =
|
m_configs[CONFIG_DECLINED_NAMES_USED] =
|
||||||
|
|||||||
Reference in New Issue
Block a user