Merge [SD2]

r1321 Add support for quest 863.
      Some cleanup in existing script.
r1322 Correct database info for current supported Mangos revision (8273+) (Windows may use from 8190+) - skip
r1323 Make escortAI function IsPlayerOrGroupInRange and move existing code to this.
r1324 Fixed IsEncounterInProgress for Arcatraz, The Eye and Shadow Labyrinth
r1325 Renamed aunchindoun to auchindoun. Fixed comment typos.

--HG--
branch : trunk
This commit is contained in:
Kudlaty
2009-08-16 22:21:57 +02:00
parent 91f3d69edf
commit 5d2d8d8074
25 changed files with 362 additions and 101 deletions

View File

@@ -405,20 +405,20 @@ SET(trinityscript_LIB_SRCS
scripts/northrend/sholazar_basin.cpp
scripts/northrend/wintergrasp.cpp
scripts/northrend/zuldrak.cpp
scripts/outland/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp
scripts/outland/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp
scripts/outland/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp
scripts/outland/aunchindoun/mana_tombs/boss_pandemonius.cpp
scripts/outland/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp
scripts/outland/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp
scripts/outland/aunchindoun/sethekk_halls/def_sethekk_halls.h
scripts/outland/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp
scripts/outland/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp
scripts/outland/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp
scripts/outland/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp
scripts/outland/aunchindoun/shadow_labyrinth/boss_murmur.cpp
scripts/outland/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h
scripts/outland/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp
scripts/outland/auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp
scripts/outland/auchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp
scripts/outland/auchindoun/mana_tombs/boss_nexusprince_shaffar.cpp
scripts/outland/auchindoun/mana_tombs/boss_pandemonius.cpp
scripts/outland/auchindoun/sethekk_halls/boss_darkweaver_syth.cpp
scripts/outland/auchindoun/sethekk_halls/boss_tailonking_ikiss.cpp
scripts/outland/auchindoun/sethekk_halls/def_sethekk_halls.h
scripts/outland/auchindoun/sethekk_halls/instance_sethekk_halls.cpp
scripts/outland/auchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp
scripts/outland/auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp
scripts/outland/auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp
scripts/outland/auchindoun/shadow_labyrinth/boss_murmur.cpp
scripts/outland/auchindoun/shadow_labyrinth/def_shadow_labyrinth.h
scripts/outland/auchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp
scripts/outland/black_temple/black_temple.cpp
scripts/outland/black_temple/boss_bloodboil.cpp
scripts/outland/black_temple/boss_illidan.cpp

View File

@@ -2172,11 +2172,11 @@
Name="Auchenai Crypts"
>
<File
RelativePath="..\scripts\outland\aunchindoun\auchenai_crypts\boss_exarch_maladaar.cpp"
RelativePath="..\scripts\outland\auchindoun\auchenai_crypts\boss_exarch_maladaar.cpp"
>
</File>
<File
RelativePath="..\scripts\outland\aunchindoun\auchenai_crypts\boss_shirrak_the_dead_watcher.cpp"
RelativePath="..\scripts\outland\auchindoun\auchenai_crypts\boss_shirrak_the_dead_watcher.cpp"
>
</File>
</Filter>
@@ -2184,11 +2184,11 @@
Name="Mana Tombs"
>
<File
RelativePath="..\scripts\outland\aunchindoun\mana_tombs\boss_nexusprince_shaffar.cpp"
RelativePath="..\scripts\outland\auchindoun\mana_tombs\boss_nexusprince_shaffar.cpp"
>
</File>
<File
RelativePath="..\scripts\outland\aunchindoun\mana_tombs\boss_pandemonius.cpp"
RelativePath="..\scripts\outland\auchindoun\mana_tombs\boss_pandemonius.cpp"
>
</File>
</Filter>
@@ -2196,19 +2196,19 @@
Name="Sethekk Halls"
>
<File
RelativePath="..\scripts\outland\aunchindoun\sethekk_halls\boss_darkweaver_syth.cpp"
RelativePath="..\scripts\outland\auchindoun\sethekk_halls\boss_darkweaver_syth.cpp"
>
</File>
<File
RelativePath="..\scripts\outland\aunchindoun\sethekk_halls\boss_tailonking_ikiss.cpp"
RelativePath="..\scripts\outland\auchindoun\sethekk_halls\boss_tailonking_ikiss.cpp"
>
</File>
<File
RelativePath="..\scripts\outland\aunchindoun\sethekk_halls\def_sethekk_halls.h"
RelativePath="..\scripts\outland\auchindoun\sethekk_halls\def_sethekk_halls.h"
>
</File>
<File
RelativePath="..\scripts\outland\aunchindoun\sethekk_halls\instance_sethekk_halls.cpp"
RelativePath="..\scripts\outland\auchindoun\sethekk_halls\instance_sethekk_halls.cpp"
>
</File>
</Filter>
@@ -2216,27 +2216,27 @@
Name="Shadow Labyrinth"
>
<File
RelativePath="..\scripts\outland\aunchindoun\shadow_labyrinth\boss_ambassador_hellmaw.cpp"
RelativePath="..\scripts\outland\auchindoun\shadow_labyrinth\boss_ambassador_hellmaw.cpp"
>
</File>
<File
RelativePath="..\scripts\outland\aunchindoun\shadow_labyrinth\boss_blackheart_the_inciter.cpp"
RelativePath="..\scripts\outland\auchindoun\shadow_labyrinth\boss_blackheart_the_inciter.cpp"
>
</File>
<File
RelativePath="..\scripts\outland\aunchindoun\shadow_labyrinth\boss_grandmaster_vorpil.cpp"
RelativePath="..\scripts\outland\auchindoun\shadow_labyrinth\boss_grandmaster_vorpil.cpp"
>
</File>
<File
RelativePath="..\scripts\outland\aunchindoun\shadow_labyrinth\boss_murmur.cpp"
RelativePath="..\scripts\outland\auchindoun\shadow_labyrinth\boss_murmur.cpp"
>
</File>
<File
RelativePath="..\scripts\outland\aunchindoun\shadow_labyrinth\def_shadow_labyrinth.h"
RelativePath="..\scripts\outland\auchindoun\shadow_labyrinth\def_shadow_labyrinth.h"
>
</File>
<File
RelativePath="..\scripts\outland\aunchindoun\shadow_labyrinth\instance_shadow_labyrinth.cpp"
RelativePath="..\scripts\outland\auchindoun\shadow_labyrinth\instance_shadow_labyrinth.cpp"
>
</File>
</Filter>

View File

@@ -2169,11 +2169,11 @@
Name="Auchenai Crypts"
>
<File
RelativePath="..\scripts\outland\aunchindoun\auchenai_crypts\boss_exarch_maladaar.cpp"
RelativePath="..\scripts\outland\auchindoun\auchenai_crypts\boss_exarch_maladaar.cpp"
>
</File>
<File
RelativePath="..\scripts\outland\aunchindoun\auchenai_crypts\boss_shirrak_the_dead_watcher.cpp"
RelativePath="..\scripts\outland\auchindoun\auchenai_crypts\boss_shirrak_the_dead_watcher.cpp"
>
</File>
</Filter>
@@ -2181,11 +2181,11 @@
Name="Mana Tombs"
>
<File
RelativePath="..\scripts\outland\aunchindoun\mana_tombs\boss_nexusprince_shaffar.cpp"
RelativePath="..\scripts\outland\auchindoun\mana_tombs\boss_nexusprince_shaffar.cpp"
>
</File>
<File
RelativePath="..\scripts\outland\aunchindoun\mana_tombs\boss_pandemonius.cpp"
RelativePath="..\scripts\outland\auchindoun\mana_tombs\boss_pandemonius.cpp"
>
</File>
</Filter>
@@ -2193,19 +2193,19 @@
Name="Sethekk Halls"
>
<File
RelativePath="..\scripts\outland\aunchindoun\sethekk_halls\boss_darkweaver_syth.cpp"
RelativePath="..\scripts\outland\auchindoun\sethekk_halls\boss_darkweaver_syth.cpp"
>
</File>
<File
RelativePath="..\scripts\outland\aunchindoun\sethekk_halls\boss_tailonking_ikiss.cpp"
RelativePath="..\scripts\outland\auchindoun\sethekk_halls\boss_tailonking_ikiss.cpp"
>
</File>
<File
RelativePath="..\scripts\outland\aunchindoun\sethekk_halls\def_sethekk_halls.h"
RelativePath="..\scripts\outland\auchindoun\sethekk_halls\def_sethekk_halls.h"
>
</File>
<File
RelativePath="..\scripts\outland\aunchindoun\sethekk_halls\instance_sethekk_halls.cpp"
RelativePath="..\scripts\outland\auchindoun\sethekk_halls\instance_sethekk_halls.cpp"
>
</File>
</Filter>
@@ -2213,27 +2213,27 @@
Name="Shadow Labyrinth"
>
<File
RelativePath="..\scripts\outland\aunchindoun\shadow_labyrinth\boss_ambassador_hellmaw.cpp"
RelativePath="..\scripts\outland\auchindoun\shadow_labyrinth\boss_ambassador_hellmaw.cpp"
>
</File>
<File
RelativePath="..\scripts\outland\aunchindoun\shadow_labyrinth\boss_blackheart_the_inciter.cpp"
RelativePath="..\scripts\outland\auchindoun\shadow_labyrinth\boss_blackheart_the_inciter.cpp"
>
</File>
<File
RelativePath="..\scripts\outland\aunchindoun\shadow_labyrinth\boss_grandmaster_vorpil.cpp"
RelativePath="..\scripts\outland\auchindoun\shadow_labyrinth\boss_grandmaster_vorpil.cpp"
>
</File>
<File
RelativePath="..\scripts\outland\aunchindoun\shadow_labyrinth\boss_murmur.cpp"
RelativePath="..\scripts\outland\auchindoun\shadow_labyrinth\boss_murmur.cpp"
>
</File>
<File
RelativePath="..\scripts\outland\aunchindoun\shadow_labyrinth\def_shadow_labyrinth.h"
RelativePath="..\scripts\outland\auchindoun\shadow_labyrinth\def_shadow_labyrinth.h"
>
</File>
<File
RelativePath="..\scripts\outland\aunchindoun\shadow_labyrinth\instance_shadow_labyrinth.cpp"
RelativePath="..\scripts\outland\auchindoun\shadow_labyrinth\instance_shadow_labyrinth.cpp"
>
</File>
</Filter>

View File

@@ -130,6 +130,32 @@ void npc_escortAI::EnterEvadeMode()
Reset();
}
bool npc_escortAI::IsPlayerOrGroupInRange()
{
if (Player* pPlayer = Unit::GetPlayer(PlayerGUID))
{
if (Group* pGroup = pPlayer->GetGroup())
{
for(GroupReference* pRef = pGroup->GetFirstMember(); pRef != NULL; pRef = pRef->next())
{
Player* pMember = pRef->getSource();
if (pMember && m_creature->IsWithinDistInMap(pMember, GetMaxPlayerDistance()))
{
return true;
break;
}
}
}
else
{
if (m_creature->IsWithinDistInMap(pPlayer, GetMaxPlayerDistance()))
return true;
}
}
return false;
}
void npc_escortAI::UpdateAI(const uint32 uiDiff)
{
//Waypoint Updating
@@ -194,31 +220,7 @@ void npc_escortAI::UpdateAI(const uint32 uiDiff)
{
if (m_uiPlayerCheckTimer < uiDiff)
{
bool bIsMaxRangeExceeded = true;
if (Player* pPlayer = Unit::GetPlayer(PlayerGUID))
{
if (Group* pGroup = pPlayer->GetGroup())
{
for(GroupReference* pRef = pGroup->GetFirstMember(); pRef != NULL; pRef = pRef->next())
{
Player* pMember = pRef->getSource();
if (pMember && m_creature->IsWithinDistInMap(pMember, GetMaxPlayerDistance()))
{
bIsMaxRangeExceeded = false;
break;
}
}
}
else
{
if (m_creature->IsWithinDistInMap(pPlayer, GetMaxPlayerDistance()))
bIsMaxRangeExceeded = false;
}
}
if (DespawnAtFar && bIsMaxRangeExceeded)
if (DespawnAtFar && !IsPlayerOrGroupInRange())
{
debug_log("TSCR: EscortAI failed because player/group was to far away or not found");

View File

@@ -56,6 +56,8 @@ struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI
// EscortAI functions
void AddWaypoint(uint32 id, float x, float y, float z, uint32 WaitTimeMs = 0);
bool IsPlayerOrGroupInRange();
void FillPointMovementListForCreature();
void Start(bool bIsActiveAttacker = true, bool bRun = false, uint64 uiPlayerGUID = 0, const Quest* pQuest = NULL, bool bInstantRespawn = false, bool bCanLoopPath = false);

View File

@@ -17,17 +17,125 @@
/* ScriptData
SDName: Hinterlands
SD%Complete: 100
SDComment: Quest support: 2742
SDComment: Quest support: 863, 2742
SDCategory: The Hinterlands
EndScriptData */
/* ContentData
npc_00x09hl
npc_rinji
EndContentData */
#include "precompiled.h"
#include "escort_ai.h"
/*######
## npc_00x09hl
######*/
enum
{
SAY_OOX_START = -1000416,
SAY_OOX_AGGRO = -1000417,
SAY_OOX_DANGER = -1000418,
SAY_OOX_COMPLETE = -1000419,
QUEST_RESQUE_OOX_09 = 836,
NPC_MARAUDING_OWL = 7808,
NPC_VILE_AMBUSHER = 7809,
FACTION_ESCORTEE_A = 774,
FACTION_ESCORTEE_H = 775
};
struct MANGOS_DLL_DECL npc_00x09hlAI : public npc_escortAI
{
npc_00x09hlAI(Creature* pCreature) : npc_escortAI(pCreature) { }
void Reset() { }
void WaypointReached(uint32 uiPointId)
{
switch(uiPointId)
{
case 26:
DoScriptText(SAY_OOX_DANGER, m_creature);
break;
case 43:
DoScriptText(SAY_OOX_DANGER, m_creature);
break;
case 64:
DoScriptText(SAY_OOX_COMPLETE, m_creature);
if (Player* pPlayer = Unit::GetPlayer(PlayerGUID))
pPlayer->GroupEventHappens(QUEST_RESQUE_OOX_09, m_creature);
break;
}
}
void WaypointStart(uint32 uiPointId)
{
switch(uiPointId)
{
case 27:
for(int i = 0; i < 3; ++i)
{
float fX, fY, fZ;
m_creature->GetRandomPoint(147.927444, -3851.513428, 130.893, 7.0f, fX, fY, fZ);
m_creature->SummonCreature(NPC_MARAUDING_OWL, fX, fY, fZ, 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 25000);
}
break;
case 44:
for(int i = 0; i < 3; ++i)
{
float fX, fY, fZ;
m_creature->GetRandomPoint(-141.151581, -4291.213867, 120.130, 7.0f, fX, fY, fZ);
m_creature->SummonCreature(NPC_VILE_AMBUSHER, fX, fY, fZ, 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 25000);
}
break;
}
}
void Aggro(Unit* pWho)
{
if (pWho->GetEntry() == NPC_MARAUDING_OWL || pWho->GetEntry() == NPC_VILE_AMBUSHER)
return;
DoScriptText(SAY_OOX_AGGRO, m_creature);
}
void JustSummoned(Creature* pSummoned)
{
pSummoned->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ());
}
};
bool QuestAccept_npc_00x09hl(Player* pPlayer, Creature* pCreature, const Quest* pQuest)
{
if (pQuest->GetQuestId() == QUEST_RESQUE_OOX_09)
{
pCreature->SetStandState(UNIT_STAND_STATE_STAND);
if (pPlayer->GetTeam() == ALLIANCE)
pCreature->setFaction(FACTION_ESCORTEE_A);
else if (pPlayer->GetTeam() == HORDE)
pCreature->setFaction(FACTION_ESCORTEE_H);
DoScriptText(SAY_OOX_START, pCreature, pPlayer);
if (npc_00x09hlAI* pEscortAI = CAST_AI(npc_00x09hlAI, pCreature->AI()))
pEscortAI->Start(false, false, pPlayer->GetGUID(), pQuest);
}
return true;
}
CreatureAI* GetAI_npc_00x09hl(Creature* pCreature)
{
return new npc_00x09hlAI(pCreature);
}
/*######
## npc_rinji
######*/
@@ -164,39 +272,45 @@ struct TRINITY_DLL_DECL npc_rinjiAI : public npc_escortAI
}
}
void UpdateAI(const uint32 uiDiff)
void UpdateEscortAI(const uint32 uiDiff)
{
npc_escortAI::UpdateAI(uiDiff);
if (IsBeingEscorted && m_uiPostEventCount && !m_creature->getVictim())
//Check if we have a current target
if (!UpdateVictim())
{
if (m_uiPostEventTimer < uiDiff)
if (IsBeingEscorted && m_uiPostEventCount)
{
m_uiPostEventTimer = 3000;
if (Unit* pPlayer = Unit::GetUnit(*m_creature, PlayerGUID))
if (m_uiPostEventTimer < uiDiff)
{
switch(m_uiPostEventCount)
m_uiPostEventTimer = 3000;
if (Unit* pPlayer = Unit::GetUnit(*m_creature, PlayerGUID))
{
case 1:
DoScriptText(SAY_RIN_PROGRESS_1, m_creature, pPlayer);
++m_uiPostEventCount;
break;
case 2:
DoScriptText(SAY_RIN_PROGRESS_2, m_creature, pPlayer);
m_uiPostEventCount = 0;
break;
switch(m_uiPostEventCount)
{
case 1:
DoScriptText(SAY_RIN_PROGRESS_1, m_creature, pPlayer);
++m_uiPostEventCount;
break;
case 2:
DoScriptText(SAY_RIN_PROGRESS_2, m_creature, pPlayer);
m_uiPostEventCount = 0;
break;
}
}
else
{
m_creature->ForcedDespawn();
return;
}
}
else
{
m_creature->ForcedDespawn();
return;
}
m_uiPostEventTimer -= uiDiff;
}
else
m_uiPostEventTimer -= uiDiff;
return;
}
DoMeleeAttackIfReady();
}
};
@@ -222,6 +336,12 @@ void AddSC_hinterlands()
{
Script* newscript;
newscript = new Script;
newscript->Name = "npc_00x09hl";
newscript->GetAI = &GetAI_npc_00x09hl;
newscript->pQuestAccept = &QuestAccept_npc_00x09hl;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_rinji";
newscript->GetAI = &GetAI_npc_rinji;

View File

@@ -84,8 +84,7 @@ struct TRINITY_DLL_DECL instance_arcatraz : public ScriptedInstance
bool IsEncounterInProgress() const
{
for(uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS)
return true;
if (m_auiEncounter[i] == IN_PROGRESS) return true;
return false;
}

View File

@@ -307,14 +307,14 @@ extern void AddSC_wintergrasp();
extern void AddSC_zuldrak();
//outland
extern void AddSC_boss_exarch_maladaar(); //Aunchindoun Auchenai Crypts
extern void AddSC_boss_exarch_maladaar(); //Auchindoun Auchenai Crypts
extern void AddSC_boss_shirrak_the_dead_watcher();
extern void AddSC_boss_nexusprince_shaffar(); //Aunchindoun Mana Tombs
extern void AddSC_boss_nexusprince_shaffar(); //Auchindoun Mana Tombs
extern void AddSC_boss_pandemonius();
extern void AddSC_boss_darkweaver_syth(); //Aunchindoun Sekketh Halls
extern void AddSC_boss_darkweaver_syth(); //Auchindoun Sekketh Halls
extern void AddSC_boss_talon_king_ikiss();
extern void AddSC_instance_sethekk_halls();
extern void AddSC_instance_shadow_labyrinth(); //Aunchindoun Shadow Labyrinth
extern void AddSC_instance_shadow_labyrinth(); //Auchindoun Shadow Labyrinth
extern void AddSC_boss_ambassador_hellmaw();
extern void AddSC_boss_blackheart_the_inciter();
extern void AddSC_boss_grandmaster_vorpil();
@@ -693,14 +693,14 @@ void AddScripts()
AddSC_zuldrak();
//outland
AddSC_boss_exarch_maladaar(); //Aunchindoun Auchenai Crypts
AddSC_boss_exarch_maladaar(); //Auchindoun Auchenai Crypts
AddSC_boss_shirrak_the_dead_watcher();
AddSC_boss_nexusprince_shaffar(); //Aunchindoun Mana Tombs
AddSC_boss_nexusprince_shaffar(); //Auchindoun Mana Tombs
AddSC_boss_pandemonius();
AddSC_boss_darkweaver_syth(); //Aunchindoun Sekketh Halls
AddSC_boss_darkweaver_syth(); //Auchindoun Sekketh Halls
AddSC_boss_talon_king_ikiss();
AddSC_instance_sethekk_halls();
AddSC_instance_shadow_labyrinth(); //Aunchindoun Shadow Labyrinth
AddSC_instance_shadow_labyrinth(); //Auchindoun Shadow Labyrinth
AddSC_boss_ambassador_hellmaw();
AddSC_boss_blackheart_the_inciter();
AddSC_boss_grandmaster_vorpil();