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

@@ -13,6 +13,74 @@ CREATE TABLE script_waypoint (
PRIMARY KEY (entry, pointid)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Script Creature waypoints';
DELETE FROM script_waypoint WHERE entry=7806;
INSERT INTO script_waypoint VALUES
(7806, 0, 495.404358, -3478.350830, 114.837, 0, ''),
(7806, 1, 492.704742, -3486.112549, 108.627, 0, ''),
(7806, 2, 487.249756, -3485.764404, 107.890, 0, ''),
(7806, 3, 476.851959, -3489.875977, 99.985, 0, ''),
(7806, 4, 467.212402, -3493.355469, 99.819, 0, ''),
(7806, 5, 460.017029, -3496.984375, 104.481, 0, ''),
(7806, 6, 439.619446, -3500.730225, 110.534, 0, ''),
(7806, 7, 428.326385, -3495.874756, 118.662, 0, ''),
(7806, 8, 424.664032, -3489.381592, 121.999, 0, ''),
(7806, 9, 424.137299, -3470.952637, 124.333, 0, ''),
(7806, 10, 421.791107, -3449.242676, 119.126, 0, ''),
(7806, 11, 404.247070, -3429.376953, 117.644, 0, ''),
(7806, 12, 335.465271, -3430.717773, 116.456, 0, ''),
(7806, 13, 317.160126, -3426.708984, 116.226, 0, ''),
(7806, 14, 331.180115, -3464.002197, 117.143, 0, ''),
(7806, 15, 336.393616, -3501.877441, 118.201, 0, ''),
(7806, 16, 337.251312, -3544.764648, 117.284, 0, ''),
(7806, 17, 337.748932, -3565.415527, 116.797, 0, ''),
(7806, 18, 336.010925, -3597.363037, 118.225, 0, ''),
(7806, 19, 324.619141, -3622.884033, 119.811, 0, ''),
(7806, 20, 308.027466, -3648.600098, 123.047, 0, ''),
(7806, 21, 276.325409, -3685.738525, 128.356, 0, ''),
(7806, 22, 239.981064, -3717.330811, 131.874, 0, ''),
(7806, 23, 224.950974, -3730.169678, 132.125, 0, ''),
(7806, 24, 198.707870, -3768.292725, 129.420, 0, ''),
(7806, 25, 183.758316, -3791.068848, 128.045, 0, ''),
(7806, 26, 178.110657, -3801.575439, 128.370, 3000, 'SAY_OOX_DANGER'),
(7806, 27, 162.215225, -3827.014160, 129.424, 0, ''),
(7806, 28, 141.664734, -3864.519287, 131.419, 0, ''),
(7806, 29, 135.301697, -3880.089111, 132.120, 0, ''),
(7806, 30, 122.461151, -3910.071533, 135.605, 0, ''),
(7806, 31, 103.376175, -3937.725098, 137.342, 0, ''),
(7806, 32, 81.414474, -3958.614258, 138.469, 0, ''),
(7806, 33, 55.378139, -3982.004639, 136.520, 0, ''),
(7806, 34, 13.983131, -4013.952881, 126.903, 0, ''),
(7806, 35, -21.658007, -4048.713623, 118.068, 0, ''),
(7806, 36, -52.443058, -4081.209717, 117.477, 0, ''),
(7806, 37, -102.710854, -4116.760742, 118.666, 0, ''),
(7806, 38, -92.996193, -4135.847168, 119.310, 0, ''),
(7806, 39, -86.391273, -4153.331055, 122.502, 0, ''),
(7806, 40, -85.746086, -4163.600586, 121.892, 0, ''),
(7806, 41, -90.544006, -4183.577637, 117.587, 0, ''),
(7806, 42, -110.223564, -4205.861328, 121.878, 0, ''),
(7806, 43, -115.257607, -4211.962402, 121.878, 3000, 'SAY_OOX_DANGER'),
(7806, 44, -128.594650, -4233.343750, 117.766, 0, ''),
(7806, 45, -135.358917, -4258.120117, 117.562, 0, ''),
(7806, 46, -156.832428, -4258.961914, 120.059, 0, ''),
(7806, 47, -167.119873, -4274.102539, 117.062, 0, ''),
(7806, 48, -176.291016, -4287.594727, 118.721, 0, ''),
(7806, 49, -196.992981, -4315.815430, 117.588, 0, ''),
(7806, 50, -209.329300, -4331.671387, 115.142, 0, ''),
(7806, 51, -232.292236, -4356.015625, 108.543, 0, ''),
(7806, 52, -232.159683, -4370.904297, 102.815, 0, ''),
(7806, 53, -210.271133, -4389.896973, 84.167, 0, ''),
(7806, 54, -187.940186, -4407.532715, 70.987, 0, ''),
(7806, 55, -181.353577, -4418.771973, 64.778, 0, ''),
(7806, 56, -170.529861, -4440.438965, 58.943, 0, ''),
(7806, 57, -141.428543, -4465.323242, 45.963, 0, ''),
(7806, 58, -120.993629, -4487.088379, 32.075, 0, ''),
(7806, 59, -104.134621, -4501.837402, 25.051, 0, ''),
(7806, 60, -84.154663, -4529.436523, 11.952, 0, ''),
(7806, 61, -88.698898, -4544.626465, 9.055, 0, ''),
(7806, 62, -100.603447, -4575.034180, 11.388, 0, ''),
(7806, 63, -106.908669, -4600.407715, 11.046, 0, ''),
(7806, 64, -106.831703, -4620.503418, 11.057, 3000, 'SAY_OOX_COMPLETE');
DELETE FROM script_waypoint WHERE entry=4962;
INSERT INTO script_waypoint VALUES
(4962, 0, -3804.438965, -828.048035, 10.093068, 0, ''),

View File

@@ -555,6 +555,7 @@ UPDATE `creature_template` SET `ScriptName`='npc_tracy_proudwell' WHERE `entry`=
/* HILLSBRAD FOOTHILLS */
/* HINTERLANDS */
UPDATE `creature_template` SET `ScriptName`='npc_00x09hl' WHERE `entry`=7806;
UPDATE `creature_template` SET `ScriptName`='npc_rinji' WHERE `entry`=7780;
/* ICECROWN */

View File

@@ -0,0 +1,69 @@
UPDATE creature_template SET ScriptName='npc_00x09hl' WHERE entry=7806;
DELETE FROM script_waypoint WHERE entry=7806;
INSERT INTO script_waypoint VALUES
(7806, 0, 495.404358, -3478.350830, 114.837, 0, ''),
(7806, 1, 492.704742, -3486.112549, 108.627, 0, ''),
(7806, 2, 487.249756, -3485.764404, 107.890, 0, ''),
(7806, 3, 476.851959, -3489.875977, 99.985, 0, ''),
(7806, 4, 467.212402, -3493.355469, 99.819, 0, ''),
(7806, 5, 460.017029, -3496.984375, 104.481, 0, ''),
(7806, 6, 439.619446, -3500.730225, 110.534, 0, ''),
(7806, 7, 428.326385, -3495.874756, 118.662, 0, ''),
(7806, 8, 424.664032, -3489.381592, 121.999, 0, ''),
(7806, 9, 424.137299, -3470.952637, 124.333, 0, ''),
(7806, 10, 421.791107, -3449.242676, 119.126, 0, ''),
(7806, 11, 404.247070, -3429.376953, 117.644, 0, ''),
(7806, 12, 335.465271, -3430.717773, 116.456, 0, ''),
(7806, 13, 317.160126, -3426.708984, 116.226, 0, ''),
(7806, 14, 331.180115, -3464.002197, 117.143, 0, ''),
(7806, 15, 336.393616, -3501.877441, 118.201, 0, ''),
(7806, 16, 337.251312, -3544.764648, 117.284, 0, ''),
(7806, 17, 337.748932, -3565.415527, 116.797, 0, ''),
(7806, 18, 336.010925, -3597.363037, 118.225, 0, ''),
(7806, 19, 324.619141, -3622.884033, 119.811, 0, ''),
(7806, 20, 308.027466, -3648.600098, 123.047, 0, ''),
(7806, 21, 276.325409, -3685.738525, 128.356, 0, ''),
(7806, 22, 239.981064, -3717.330811, 131.874, 0, ''),
(7806, 23, 224.950974, -3730.169678, 132.125, 0, ''),
(7806, 24, 198.707870, -3768.292725, 129.420, 0, ''),
(7806, 25, 183.758316, -3791.068848, 128.045, 0, ''),
(7806, 26, 178.110657, -3801.575439, 128.370, 3000, 'SAY_OOX_DANGER'),
(7806, 27, 162.215225, -3827.014160, 129.424, 0, ''),
(7806, 28, 141.664734, -3864.519287, 131.419, 0, ''),
(7806, 29, 135.301697, -3880.089111, 132.120, 0, ''),
(7806, 30, 122.461151, -3910.071533, 135.605, 0, ''),
(7806, 31, 103.376175, -3937.725098, 137.342, 0, ''),
(7806, 32, 81.414474, -3958.614258, 138.469, 0, ''),
(7806, 33, 55.378139, -3982.004639, 136.520, 0, ''),
(7806, 34, 13.983131, -4013.952881, 126.903, 0, ''),
(7806, 35, -21.658007, -4048.713623, 118.068, 0, ''),
(7806, 36, -52.443058, -4081.209717, 117.477, 0, ''),
(7806, 37, -102.710854, -4116.760742, 118.666, 0, ''),
(7806, 38, -92.996193, -4135.847168, 119.310, 0, ''),
(7806, 39, -86.391273, -4153.331055, 122.502, 0, ''),
(7806, 40, -85.746086, -4163.600586, 121.892, 0, ''),
(7806, 41, -90.544006, -4183.577637, 117.587, 0, ''),
(7806, 42, -110.223564, -4205.861328, 121.878, 0, ''),
(7806, 43, -115.257607, -4211.962402, 121.878, 3000, 'SAY_OOX_DANGER'),
(7806, 44, -128.594650, -4233.343750, 117.766, 0, ''),
(7806, 45, -135.358917, -4258.120117, 117.562, 0, ''),
(7806, 46, -156.832428, -4258.961914, 120.059, 0, ''),
(7806, 47, -167.119873, -4274.102539, 117.062, 0, ''),
(7806, 48, -176.291016, -4287.594727, 118.721, 0, ''),
(7806, 49, -196.992981, -4315.815430, 117.588, 0, ''),
(7806, 50, -209.329300, -4331.671387, 115.142, 0, ''),
(7806, 51, -232.292236, -4356.015625, 108.543, 0, ''),
(7806, 52, -232.159683, -4370.904297, 102.815, 0, ''),
(7806, 53, -210.271133, -4389.896973, 84.167, 0, ''),
(7806, 54, -187.940186, -4407.532715, 70.987, 0, ''),
(7806, 55, -181.353577, -4418.771973, 64.778, 0, ''),
(7806, 56, -170.529861, -4440.438965, 58.943, 0, ''),
(7806, 57, -141.428543, -4465.323242, 45.963, 0, ''),
(7806, 58, -120.993629, -4487.088379, 32.075, 0, ''),
(7806, 59, -104.134621, -4501.837402, 25.051, 0, ''),
(7806, 60, -84.154663, -4529.436523, 11.952, 0, ''),
(7806, 61, -88.698898, -4544.626465, 9.055, 0, ''),
(7806, 62, -100.603447, -4575.034180, 11.388, 0, ''),
(7806, 63, -106.908669, -4600.407715, 11.046, 0, ''),
(7806, 64, -106.831703, -4620.503418, 11.057, 3000, 'SAY_OOX_COMPLETE');

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();