Merge branch 'master' into Playerbot

This commit is contained in:
Yunfan Li
2023-08-27 00:42:24 +08:00
25 changed files with 339 additions and 219 deletions
+9
View File
@@ -143,6 +143,15 @@ function comp_compile() {
find "$AC_BINPATH_FULL" -mindepth 1 -maxdepth 1 -type f -exec sudo chown root:root -- {} + find "$AC_BINPATH_FULL" -mindepth 1 -maxdepth 1 -type f -exec sudo chown root:root -- {} +
find "$AC_BINPATH_FULL" -mindepth 1 -maxdepth 1 -type f -exec sudo chmod u+s -- {} + find "$AC_BINPATH_FULL" -mindepth 1 -maxdepth 1 -type f -exec sudo chmod u+s -- {} +
if [[ -n "$DOCKER" ]]; then
[[ -f "$confDir/worldserver.conf.dist" ]] && \
cp -nv "$confDir/worldserver.conf.dist" "$confDir/worldserver.conf"
[[ -f "$confDir/authserver.conf.dist" ]] && \
cp -nv "$confDir/authserver.conf.dist" "$confDir/authserver.conf"
[[ -f "$confDir/dbimport.conf.dist" ]] && \
cp -nv "$confDir/dbimport.conf.dist" "$confDir/dbimport.conf"
fi
echo "Done" echo "Done"
;; ;;
esac esac
@@ -0,0 +1,4 @@
-- DB update 2023_08_24_02 -> 2023_08_25_00
-- Insertion Aura Has Brewfest Mug
DELETE FROM `spell_custom_attr` WHERE (`spell_id` = 42533);
INSERT INTO `spell_custom_attr` (`spell_id`, `attributes`) VALUES (42533, 16777216);
@@ -0,0 +1,4 @@
-- DB update 2023_08_25_00 -> 2023_08_25_01
--
UPDATE `creature_template` SET `flags_extra` = `flags_extra`|256 WHERE `entry`=17257;
@@ -0,0 +1,67 @@
-- DB update 2023_08_25_01 -> 2023_08_25_02
--
DELETE FROM `creature` WHERE `guid` IN (31929, 31932, 31933, 32020, 38237, 38239, 38240, 38244, 38246, 38247, 38440, 43732, 43911, 43912, 45021, 45023, 45028, 45029, 45032, 45035, 45042, 45209, 31930, 38236, 38243, 38245, 38441, 38442, 38444, 43736, 43910, 45024, 45025, 45030, 45041, 45043, 45044, 45045, 45046, 45100, 45101, 45206, 45207, 45038);
INSERT INTO `creature` (`guid`, `id1`, `id2`, `id3`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `wander_distance`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `ScriptName`, `VerifiedBuild`) VALUES
(31929, 1530, 0, 0, 0, 0, 0, 1, 1, 0, 2874.8179, 837.19354, 111.29426, 6.202622413635253906, 300, 5, 0, 198, 0, 1, 0, 0, 0, '', 50664), -- rotting ancestor
(31932, 1530, 0, 0, 0, 0, 0, 1, 1, 0, 2837.2488, 708.48346, 138.98007, 1.519538044929504394, 300, 5, 0, 198, 0, 1, 0, 0, 0, '', 50664),
(31933, 1530, 0, 0, 0, 0, 0, 1, 1, 0, 2889.9797, 709.3701, 119.96609, 5.184770107269287109, 300, 5, 0, 198, 0, 1, 0, 0, 0, '', 50664),
(32020, 1530, 0, 0, 0, 0, 0, 1, 1, 0, 2970.3154, 775.2611, 92.68646, 2.024832963943481445, 300, 5, 0, 198, 0, 1, 0, 0, 0, '', 50664),
(38237, 1530, 0, 0, 0, 0, 0, 1, 1, 0, 2886.4163, 691.8133, 122.73617, 2.53875589370727539, 300, 5, 0, 198, 0, 1, 0, 0, 0, '', 50664),
(38239, 1530, 0, 0, 0, 0, 0, 1, 1, 0, 2919.4468, 681.56134, 109.76132, 4.996694087982177734, 300, 5, 0, 198, 0, 1, 0, 0, 0, '', 50664),
(38240, 1530, 0, 0, 0, 0, 0, 1, 1, 0, 2850.913, 678.58514, 135.78427, 4.290693283081054687, 300, 5, 0, 198, 0, 1, 0, 0, 0, '', 50664),
(38244, 1530, 0, 0, 0, 0, 0, 1, 1, 0, 2919.2058, 631.01013, 101.22102, 1.763216733932495117, 300, 5, 0, 198, 0, 1, 0, 0, 0, '', 50664),
(38246, 1530, 0, 0, 0, 0, 0, 1, 1, 0, 2991.666, 716.667, 93.86101, 1.307610034942626953, 300, 5, 0, 198, 0, 1, 0, 0, 0, '', 50664),
(38247, 1530, 0, 0, 0, 0, 0, 1, 1, 0, 2899.5144, 625.1128, 103.50867, 3.468617916107177734, 300, 5, 0, 198, 0, 1, 0, 0, 0, '', 50664),
(38440, 1530, 0, 0, 0, 0, 0, 1, 1, 0, 3024.2627, 655.02637, 75.43317, 0.244346097111701965, 300, 5, 0, 198, 0, 1, 0, 0, 0, '', 50664),
(43732, 1530, 0, 0, 0, 0, 0, 1, 1, 0, 3051.9668, 649.5228, 96.2976, 4.592616081237792968, 300, 5, 0, 198, 0, 1, 0, 0, 0, '', 50664),
(43911, 1530, 0, 0, 0, 0, 0, 1, 1, 0, 3024.061, 693.17206, 66.15043, 1.364533424377441406, 300, 5, 0, 198, 0, 1, 0, 0, 0, '', 50664),
(43912, 1530, 0, 0, 0, 0, 0, 1, 1, 0, 3032.7615, 687.49396, 66.55808, 6.220858097076416015, 300, 5, 0, 198, 0, 1, 0, 0, 0, '', 50664),
(45021, 1530, 0, 0, 0, 0, 0, 1, 1, 0, 2990.6885, 717.7841, 94.103195, 1.734143614768981933, 300, 5, 0, 198, 0, 1, 0, 0, 0, '', 50664),
(45023, 1530, 0, 0, 0, 0, 0, 1, 1, 0, 3056.7256, 659.6809, 58.15043, 5.710028648376464843, 300, 5, 0, 198, 0, 1, 0, 0, 0, '', 50664),
(45028, 1530, 0, 0, 0, 0, 0, 1, 1, 0, 3030.5938, 657.6649, 58.225254, 0.25246506929397583, 300, 5, 0, 198, 0, 1, 0, 0, 0, '', 50664),
(45029, 1530, 0, 0, 0, 0, 0, 1, 1, 0, 3034.5256, 654.689, 75.43396, 0.698131680488586425, 300, 5, 0, 198, 0, 1, 0, 0, 0, '', 50664),
(45032, 1530, 0, 0, 0, 0, 0, 1, 1, 0, 3045.4407, 654.6139, 75.43524, 0.890117883682250976, 300, 5, 0, 198, 0, 1, 0, 0, 0, '', 50664),
(45035, 1530, 0, 0, 0, 0, 0, 1, 1, 0, 3044.265, 683.08966, 66.75043, 1.585389614105224609, 300, 5, 0, 198, 0, 1, 0, 0, 0, '', 50664),
(45042, 1530, 0, 0, 0, 0, 0, 1, 1, 0, 2958.9824, 745.5566, 100.98822, 5.651014328002929687, 300, 5, 0, 198, 0, 1, 0, 0, 0, '', 50664),
(45209, 1530, 0, 0, 0, 0, 0, 1, 1, 0, 3042.0586, 665.8919, 58.191853, 0.213877066969871521, 300, 0, 0, 198, 0, 2, 0, 0, 0, '', 50664),
(31930, 1534, 0, 0, 0, 0, 0, 1, 1, 0, 2905.0107, 729.7082, 114.53017, 1.04075479507446289, 300, 5, 0, 176, 0, 1, 0, 0, 0, '', 50664), -- wailing ancestor
(38236, 1534, 0, 0, 0, 0, 0, 1, 1, 0, 2956.2239, 708.47186, 105.88536, 4.775476455688476562, 300, 5, 0, 176, 0, 1, 0, 0, 0, '', 50664),
(38243, 1534, 0, 0, 0, 0, 0, 1, 1, 0, 2956.4705, 655.5519, 105.17837, 0.844802618026733398, 300, 5, 0, 176, 0, 1, 0, 0, 0, '', 50664),
(38245, 1534, 0, 0, 0, 0, 0, 1, 1, 0, 2985.0789, 680.95526, 96.413246, 5.070845603942871093, 300, 5, 0, 176, 0, 1, 0, 0, 0, '', 50664),
(38441, 1534, 0, 0, 0, 0, 0, 1, 1, 0, 2945.2393, 595.05, 93.65392, 6.072173118591308593, 300, 5, 0, 176, 0, 1, 0, 0, 0, '', 50664),
(38442, 1534, 0, 0, 0, 0, 0, 1, 1, 0, 2961.1853, 589.23804, 95.84728, 4.353847503662109375, 300, 5, 0, 176, 0, 1, 0, 0, 0, '', 50664),
(38444, 1534, 0, 0, 0, 0, 0, 1, 1, 0, 2938.0012, 538.42456, 94.00319, 6.054352760314941406, 300, 5, 0, 176, 0, 1, 0, 0, 0, '', 50664),
(43736, 1534, 0, 0, 0, 0, 0, 1, 1, 0, 2946.2646, 562.1707, 91.264786, 3.437937259674072265, 300, 5, 0, 176, 0, 1, 0, 0, 0, '', 50664),
(43910, 1534, 0, 0, 0, 0, 0, 1, 1, 0, 2983.8918, 603.40735, 98.23238, 1.835677504539489746, 300, 5, 0, 176, 0, 1, 0, 0, 0, '', 50664),
(45024, 1534, 0, 0, 0, 0, 0, 1, 1, 0, 2890.2188, 562.94965, 105.55513, 3.020595550537109375, 300, 5, 0, 176, 0, 1, 0, 0, 0, '', 50664),
(45025, 1534, 0, 0, 0, 0, 0, 1, 1, 0, 2982.3613, 687.7517, 96.146645, 1.9658128023147583, 300, 5, 0, 176, 0, 1, 0, 0, 0, '', 50664),
(45030, 1534, 0, 0, 0, 0, 0, 1, 1, 0, 3026.1106, 642.41547, 90.37821, 0.235765904188156127, 300, 5, 0, 176, 0, 1, 0, 0, 0, '', 50664),
(45041, 1534, 0, 0, 0, 0, 0, 1, 1, 0, 3008.333, 668.75, 90.43538, 3.895724296569824218, 300, 5, 0, 176, 0, 1, 0, 0, 0, '', 50664),
(45043, 1534, 0, 0, 0, 0, 0, 1, 1, 0, 3026.2622, 685.9423, 66.15042, 1.544373631477355957, 300, 5, 0, 176, 0, 1, 0, 0, 0, '', 50664),
(45044, 1534, 0, 0, 0, 0, 0, 1, 1, 0, 3043.1206, 671.6966, 81.17922, 4.442644596099853515, 300, 5, 0, 176, 0, 1, 0, 0, 0, '', 50664),
(45045, 1534, 0, 0, 0, 0, 0, 1, 1, 0, 3060.693, 654.92255, 75.55043, 2.325806140899658203, 300, 5, 0, 176, 0, 1, 0, 0, 0, '', 50664),
(45046, 1534, 0, 0, 0, 0, 0, 1, 1, 0, 3026.5713, 670.8926, 90.55045, 3.192463636398315429, 300, 5, 0, 176, 0, 1, 0, 0, 0, '', 50664),
(45100, 1534, 0, 0, 0, 0, 0, 1, 1, 0, 3052.6719, 688.94464, 66.55042, 4.559454917907714843, 300, 5, 0, 176, 0, 1, 0, 0, 0, '', 50664),
(45101, 1534, 0, 0, 0, 0, 0, 1, 1, 0, 3057.3962, 688.2738, 66.15044, 3.155925750732421875, 300, 5, 0, 176, 0, 1, 0, 0, 0, '', 50664),
(45206, 1534, 0, 0, 0, 0, 0, 1, 1, 0, 3041.2988, 659.1668, 57.750427, 4.709290504455566406, 300, 5, 0, 176, 0, 1, 0, 0, 0, '', 50664),
(45207, 1534, 0, 0, 0, 0, 0, 1, 1, 0, 3065.5005, 685.4639, 66.55043, 1.572624921798706054, 300, 5, 0, 176, 0, 1, 0, 0, 0, '', 50664),
(45038, 1658, 0, 0, 0, 0, 0, 1, 1, 0, 3043.631, 646.9064, 59.14341, 1.553343057632446289, 300, 0, 0, 273, 0, 0, 0, 0, 0, '', 50664); -- dargol
SET @NPC := 45209 * 10; -- wp data for GUID 45209 rotting ancestor
DELETE FROM `waypoint_data` WHERE `id` = @NPC;
INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES
(@NPC, 1, 3032.486, 653.2628, 58.150436, NULL, 0, 0, 0, 100, 0),
(@NPC, 2, 3055.131, 653.4985, 58.150433, NULL, 0, 0, 0, 100, 0),
(@NPC, 3, 3054.8225, 665.8006, 58.291363, NULL, 0, 0, 0, 100, 0),
(@NPC, 4, 3044.513, 666.08704, 58.15043, NULL, 0, 0, 0, 100, 0),
(@NPC, 5, 3044.265, 683.08966, 66.75043, NULL, 0, 0, 0, 100, 0),
(@NPC, 6, 3059.075, 682.25323, 66.55043, NULL, 0, 0, 0, 100, 0),
(@NPC, 7, 3058.806, 657.62976, 75.55043, NULL, 0, 0, 0, 100, 0),
(@NPC, 8, 3027.6272, 657.5499, 75.389946, NULL, 0, 0, 0, 100, 0),
(@NPC, 9, 3027.9175, 682.0833, 66.55043, NULL, 0, 0, 0, 100, 0),
(@NPC, 10, 3042.5554, 665.9998, 58.15043, NULL, 0, 0, 0, 100, 0),
(@NPC, 11, 3032.1685, 666.00415, 58.15043, NULL, 0, 0, 0, 100, 0);
DELETE FROM `creature_addon` WHERE `guid` = 45209;
INSERT INTO `creature_addon` (`guid`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `visibilityDistanceType`, `auras`) VALUES
(45209, @NPC, 0, 0, 1, 0, 0, '');
+1 -7
View File
@@ -176,13 +176,7 @@ namespace VMAP
// direction with length of 1 // direction with length of 1
G3D::Ray ray = G3D::Ray::fromOriginAndDirection(pos1, (pos2 - pos1) / maxDist); G3D::Ray ray = G3D::Ray::fromOriginAndDirection(pos1, (pos2 - pos1) / maxDist);
if (GetIntersectionTime(ray, maxDist, true, ignoreFlags)) return !GetIntersectionTime(ray, maxDist, true, ignoreFlags);
{
return false;
}
return true;
} }
//========================================================= //=========================================================
/** /**
@@ -6880,7 +6880,13 @@ bool Player::Satisfy(DungeonProgressionRequirements const* ar, uint32 target_map
} }
else if (missingPlayerItems.size()) else if (missingPlayerItems.size())
{ {
GetSession()->SendAreaTriggerMessage(GetSession()->GetAcoreString(LANG_LEVEL_MINREQUIRED_AND_ITEM), LevelMin, sObjectMgr->GetItemTemplate(missingPlayerItems[0]->id)->Name1.c_str()); LocaleConstant loc_idx = GetSession()->GetSessionDbLocaleIndex();
std::string name = sObjectMgr->GetItemTemplate(missingPlayerItems[0]->id)->Name1;
if (ItemLocale const* il = sObjectMgr->GetItemLocale(missingPlayerItems[0]->id))
{
ObjectMgr::GetLocaleString(il->Name, loc_idx, name);
}
GetSession()->SendAreaTriggerMessage(GetSession()->GetAcoreString(LANG_LEVEL_MINREQUIRED_AND_ITEM), ar->levelMin, name.c_str());
} }
else if (LevelMin) else if (LevelMin)
{ {
+15 -6
View File
@@ -1412,16 +1412,16 @@ void Spell::SelectImplicitCasterDestTargets(SpellEffIndex effIndex, SpellImplici
uint32 mapid = m_caster->GetMapId(); uint32 mapid = m_caster->GetMapId();
uint32 phasemask = m_caster->GetPhaseMask(); uint32 phasemask = m_caster->GetPhaseMask();
float collisionHeight = m_caster->GetCollisionHeight(); float collisionHeight = m_caster->GetCollisionHeight();
float destx = 0.0f, desty = 0.0f, destz = 0.0f, ground = 0.0f, startx = 0.0f, starty = 0.0f, startz = 0.0f, starto = 0.0f; float destz = 0.0f, startx = 0.0f, starty = 0.0f, startz = 0.0f, starto = 0.0f;
Position pos; Position pos;
Position lastpos; Position lastpos;
m_caster->GetPosition(startx, starty, startz, starto); m_caster->GetPosition(startx, starty, startz, starto);
pos.Relocate(startx, starty, startz, starto); pos.Relocate(startx, starty, startz, starto);
destx = pos.GetPositionX() + distance * cos(pos.GetOrientation()); float destx = pos.GetPositionX() + distance * cos(pos.GetOrientation());
desty = pos.GetPositionY() + distance * sin(pos.GetOrientation()); float desty = pos.GetPositionY() + distance * sin(pos.GetOrientation());
ground = map->GetHeight(phasemask, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ()); float ground = map->GetHeight(phasemask, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ());
bool isCasterInWater = m_caster->IsInWater(); bool isCasterInWater = m_caster->IsInWater();
if (!m_caster->HasUnitMovementFlag(MOVEMENTFLAG_FALLING) || (pos.GetPositionZ() - ground < distance)) if (!m_caster->HasUnitMovementFlag(MOVEMENTFLAG_FALLING) || (pos.GetPositionZ() - ground < distance))
@@ -1586,6 +1586,15 @@ void Spell::SelectImplicitCasterDestTargets(SpellEffIndex effIndex, SpellImplici
destz = prevZ; destz = prevZ;
//LOG_ERROR("spells", "(collision) destZ rewrited in prevZ"); //LOG_ERROR("spells", "(collision) destZ rewrited in prevZ");
// Don't make the player move backward from the xy adjustments by collisions.
if ((DELTA_X > 0 && startx > destx) || (DELTA_X < 0 && startx < destx) ||
(DELTA_Y > 0 && starty > desty) || (DELTA_Y < 0 && starty < desty))
{
destx = startx;
desty = starty;
destz = startz;
}
break; break;
} }
// we have correct destz now // we have correct destz now
@@ -1597,9 +1606,9 @@ void Spell::SelectImplicitCasterDestTargets(SpellEffIndex effIndex, SpellImplici
else else
{ {
float z = pos.GetPositionZ(); float z = pos.GetPositionZ();
bool col = VMAP::VMapFactory::createOrGetVMapMgr()->GetObjectHitPos(mapid, pos.GetPositionX(), pos.GetPositionY(), z + 0.5f, destx, desty, z + 0.5f, destx, desty, z, -0.5f); bool col = VMAP::VMapFactory::createOrGetVMapMgr()->GetObjectHitPos(mapid, pos.GetPositionX(), pos.GetPositionY(), z, destx, desty, z, destx, desty, z, -0.5f);
// check dynamic collision // check dynamic collision
bool dcol = m_caster->GetMap()->GetObjectHitPos(phasemask, pos.GetPositionX(), pos.GetPositionY(), z + 0.5f, destx, desty, z + 0.5f, destx, desty, z, -0.5f); bool dcol = m_caster->GetMap()->GetObjectHitPos(phasemask, pos.GetPositionX(), pos.GetPositionY(), z, destx, desty, z, destx, desty, z, -0.5f);
// collision occured // collision occured
if (col || dcol) if (col || dcol)
@@ -57,6 +57,12 @@ void SpellMgr::LoadSpellInfoCorrections()
spellInfo->AttributesEx3 |= SPELL_ATTR3_ALWAYS_HIT; spellInfo->AttributesEx3 |= SPELL_ATTR3_ALWAYS_HIT;
}); });
// Has Brewfest Mug
ApplySpellFix({ 42533 }, [](SpellInfo* spellInfo)
{
spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(347); // 15 min
});
// Elixir of Minor Fortitude // Elixir of Minor Fortitude
ApplySpellFix({ 2378 }, [](SpellInfo* spellInfo) ApplySpellFix({ 2378 }, [](SpellInfo* spellInfo)
{ {
@@ -592,6 +598,14 @@ void SpellMgr::LoadSpellInfoCorrections()
spellInfo->Effects[EFFECT_1].ApplyAuraName = SPELL_AURA_DUMMY; // just a marker spellInfo->Effects[EFFECT_1].ApplyAuraName = SPELL_AURA_DUMMY; // just a marker
}); });
ApplySpellFix({
6940, // Hand of Sacrifice
64205 // Divine Sacrifice
}, [](SpellInfo* spellInfo)
{
spellInfo->AttributesEx7 |= SPELL_ATTR7_DONT_CAUSE_SPELL_PUSHBACK;
});
// Seal of Command trigger // Seal of Command trigger
ApplySpellFix({ 20424 }, [](SpellInfo* spellInfo) ApplySpellFix({ 20424 }, [](SpellInfo* spellInfo)
{ {
@@ -4566,6 +4580,12 @@ void SpellMgr::LoadSpellInfoCorrections()
spellInfo->AuraInterruptFlags |= AURA_INTERRUPT_FLAG_TAKE_DAMAGE; spellInfo->AuraInterruptFlags |= AURA_INTERRUPT_FLAG_TAKE_DAMAGE;
}); });
// Torment of the Worgen
ApplySpellFix({ 30567 }, [](SpellInfo* spellInfo)
{
spellInfo->ProcChance = 3;
});
for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i) for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i)
{ {
SpellInfo* spellInfo = mSpellInfoMap[i]; SpellInfo* spellInfo = mSpellInfoMap[i];
@@ -47,6 +47,7 @@ ObjectData const creatureData[] =
{ NPC_NEFARIAN_TROOPS, DATA_NEFARIAN_TROOPS }, { NPC_NEFARIAN_TROOPS, DATA_NEFARIAN_TROOPS },
{ NPC_VICTOR_NEFARIUS, DATA_LORD_VICTOR_NEFARIUS }, { NPC_VICTOR_NEFARIUS, DATA_LORD_VICTOR_NEFARIUS },
{ NPC_CHROMAGGUS, DATA_CHROMAGGUS }, { NPC_CHROMAGGUS, DATA_CHROMAGGUS },
{ 0, 0 }
}; };
ObjectData const objectData[] = ObjectData const objectData[] =
@@ -97,6 +97,11 @@ enum Creatures
CREATURE_CRONE = 18168, CREATURE_CRONE = 18168,
}; };
enum OZActions
{
ACTION_RELEASE = 1,
};
void SummonCroneIfReady(InstanceScript* instance, Creature* creature) void SummonCroneIfReady(InstanceScript* instance, Creature* creature)
{ {
instance->SetData(DATA_OPERA_OZ_DEATHCOUNT, SPECIAL); // Increment DeathCount instance->SetData(DATA_OPERA_OZ_DEATHCOUNT, SPECIAL); // Increment DeathCount
@@ -137,13 +142,26 @@ void DespawnAll(InstanceScript* instance)
} }
} }
void DoActions(InstanceScript* instance)
{
uint32 datas[4] = {DATA_DOROTHEE, DATA_ROAR, DATA_STRAWMAN, DATA_TINHEAD};
for (uint32 data : datas)
{
if (Creature* actionCreature = instance->GetCreature(data))
{
actionCreature->AI()->DoAction(ACTION_RELEASE);
}
}
}
struct boss_dorothee : public ScriptedAI struct boss_dorothee : public ScriptedAI
{ {
boss_dorothee(Creature* creature) : ScriptedAI(creature) boss_dorothee(Creature* creature) : ScriptedAI(creature)
{ {
SetCombatMovement(false); SetCombatMovement(false);
//this is kinda a big no-no. but it will prevent her from moving to chase targets. she should just cast her spells. in this case, since there is not really something to LOS her with or get out of range this would work. but a more elegant solution would be better //this is kinda a big no-no. but it will prevent her from moving to chase targets. she should just cast her spells. in this case, since there is not really something to LOS her with or get out of range this would work. but a more elegant solution would be better
Initialize();
instance = creature->GetInstanceScript(); instance = creature->GetInstanceScript();
_scheduler.SetValidator([this] _scheduler.SetValidator([this]
@@ -152,47 +170,26 @@ struct boss_dorothee : public ScriptedAI
}); });
} }
void ScheduleActivation()
{
_scheduler.Schedule(16670ms, [this](TaskContext)
{
if (Creature* roar = instance->GetCreature(DATA_ROAR))
{
roar->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
roar->SetImmuneToPC(false);
roar->SetInCombatWithZone();
}
}).Schedule(26300ms, [this](TaskContext)
{
if (Creature* strawman = instance->GetCreature(DATA_STRAWMAN))
{
strawman->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
strawman->SetImmuneToPC(false);
strawman->SetInCombatWithZone();
}
}).Schedule(34470ms, [this](TaskContext)
{
if (Creature* tinhead = instance->GetCreature(DATA_TINHEAD))
{
tinhead->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
tinhead->SetImmuneToPC(false);
tinhead->SetInCombatWithZone();
}
});
}
void Initialize()
{
titoDied = false;
_startIntro = false;
}
InstanceScript* instance; InstanceScript* instance;
bool titoDied; bool titoDied;
void DoAction(int32 action) override
{
if (action == ACTION_RELEASE)
{
_scheduler.Schedule(11700ms, [this](TaskContext)
{
me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
me->SetImmuneToPC(false);
me->SetInCombatWithZone();
});
}
}
void Reset() override void Reset() override
{ {
Initialize(); titoDied = false;
_startIntro = false;
} }
void JustEngagedWith(Unit* /*who*/) override void JustEngagedWith(Unit* /*who*/) override
@@ -270,13 +267,7 @@ struct boss_dorothee : public ScriptedAI
if (!_startIntro) if (!_startIntro)
{ {
ScheduleActivation(); DoActions(instance);
_scheduler.Schedule(12s, [this](TaskContext)
{
me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
me->SetImmuneToPC(false);
me->SetInCombatWithZone();
});
_startIntro = true; _startIntro = true;
} }
DoMeleeAttackIfReady(); DoMeleeAttackIfReady();
@@ -347,6 +338,19 @@ struct boss_roar : public ScriptedAI
InstanceScript* instance; InstanceScript* instance;
void DoAction(int32 action) override
{
if (action == ACTION_RELEASE)
{
_scheduler.Schedule(16670ms, [this](TaskContext)
{
me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
me->SetImmuneToPC(false);
me->SetInCombatWithZone();
});
}
}
void Reset() override { } void Reset() override { }
void MoveInLineOfSight(Unit* who) override void MoveInLineOfSight(Unit* who) override
@@ -441,6 +445,19 @@ struct boss_strawman : public ScriptedAI
InstanceScript* instance; InstanceScript* instance;
void DoAction(int32 action) override
{
if (action == ACTION_RELEASE)
{
_scheduler.Schedule(26300ms, [this](TaskContext)
{
me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
me->SetImmuneToPC(false);
me->SetInCombatWithZone();
});
}
}
void Reset() override { } void Reset() override { }
void AttackStart(Unit* who) override void AttackStart(Unit* who) override
@@ -516,11 +533,11 @@ struct boss_strawman : public ScriptedAI
void UpdateAI(uint32 diff) override void UpdateAI(uint32 diff) override
{ {
_scheduler.Update(diff);
if (!UpdateVictim()) if (!UpdateVictim())
return; return;
_scheduler.Update(diff);
DoMeleeAttackIfReady(); DoMeleeAttackIfReady();
} }
private: private:
@@ -541,6 +558,19 @@ struct boss_tinhead : public ScriptedAI
InstanceScript* instance; InstanceScript* instance;
void DoAction(int32 action) override
{
if (action == ACTION_RELEASE)
{
_scheduler.Schedule(34470ms, [this](TaskContext)
{
me->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
me->SetImmuneToPC(false);
me->SetInCombatWithZone();
});
}
}
void Reset() override void Reset() override
{ {
_rustCount = 0; _rustCount = 0;
@@ -43,6 +43,7 @@ ObjectData const creatureData[] =
{ NPC_TINHEAD, DATA_TINHEAD }, { NPC_TINHEAD, DATA_TINHEAD },
{ NPC_ROMULO, DATA_ROMULO }, { NPC_ROMULO, DATA_ROMULO },
{ NPC_JULIANNE, DATA_JULIANNE }, { NPC_JULIANNE, DATA_JULIANNE },
{ 0, 0 }
}; };
class instance_karazhan : public InstanceMapScript class instance_karazhan : public InstanceMapScript
@@ -38,7 +38,8 @@ ObjectData const creatureData[] =
{ NPC_HIGH_PRIEST_THEKAL, DATA_THEKAL }, { NPC_HIGH_PRIEST_THEKAL, DATA_THEKAL },
{ NPC_ZEALOT_LORKHAN, DATA_LORKHAN }, { NPC_ZEALOT_LORKHAN, DATA_LORKHAN },
{ NPC_ZEALOT_ZATH, DATA_ZATH }, { NPC_ZEALOT_ZATH, DATA_ZATH },
{ NPC_PRIESTESS_MARLI, DATA_MARLI } { NPC_PRIESTESS_MARLI, DATA_MARLI },
{ 0, 0 }
}; };
class instance_zulgurub : public InstanceMapScript class instance_zulgurub : public InstanceMapScript
@@ -31,9 +31,10 @@ const Position PortalLocation[4] =
{ -1930.9106f, 7183.5970f, 23.007639f, 3.59537f } { -1930.9106f, 7183.5970f, 23.007639f, 3.59537f }
}; };
ObjectData const creatureData[1] = ObjectData const creatureData[] =
{ {
{ NPC_MEDIVH, DATA_MEDIVH } { NPC_MEDIVH, DATA_MEDIVH },
{ 0, 0 }
}; };
class instance_the_black_morass : public InstanceMapScript class instance_the_black_morass : public InstanceMapScript
@@ -21,7 +21,8 @@
ObjectData const creatureData[] = ObjectData const creatureData[] =
{ {
{ NPC_ONYXIA, DATA_ONYXIA } { NPC_ONYXIA, DATA_ONYXIA },
{ 0, 0 }
}; };
class instance_onyxias_lair : public InstanceMapScript class instance_onyxias_lair : public InstanceMapScript
@@ -36,6 +36,7 @@ ObjectData const creatureData[] =
{ NPC_YEGGETH, DATA_YEGGETH }, { NPC_YEGGETH, DATA_YEGGETH },
{ NPC_PAKKON, DATA_PAKKON }, { NPC_PAKKON, DATA_PAKKON },
{ NPC_ZERRAN, DATA_ZERRAN }, { NPC_ZERRAN, DATA_ZERRAN },
{ 0, 0 }
}; };
enum RajaxxWaveEvent enum RajaxxWaveEvent
@@ -35,7 +35,8 @@ ObjectData const creatureData[] =
{ NPC_MASTERS_EYE, DATA_MASTERS_EYE }, { NPC_MASTERS_EYE, DATA_MASTERS_EYE },
{ NPC_VEKLOR, DATA_VEKLOR }, { NPC_VEKLOR, DATA_VEKLOR },
{ NPC_VEKNILASH, DATA_VEKNILASH }, { NPC_VEKNILASH, DATA_VEKNILASH },
{ NPC_VISCIDUS, DATA_VISCIDUS } { NPC_VISCIDUS, DATA_VISCIDUS },
{ 0, 0 }
}; };
DoorData const doorData[] = DoorData const doorData[] =
+30 -44
View File
@@ -37,7 +37,7 @@ EndContentData */
## npc_shenthul ## npc_shenthul
######*/ ######*/
enum Shenthul enum Shenthul : uint32
{ {
QUEST_SHATTERED_SALUTE = 2460 QUEST_SHATTERED_SALUTE = 2460
}; };
@@ -134,10 +134,8 @@ public:
## npc_thrall_warchief ## npc_thrall_warchief
######*/ ######*/
enum ThrallWarchief enum ThrallWarchief : uint32
{ {
QUEST_6566 = 6566,
SPELL_CHAIN_LIGHTNING = 16033, SPELL_CHAIN_LIGHTNING = 16033,
SPELL_SHOCK = 16034, SPELL_SHOCK = 16034,
@@ -153,19 +151,17 @@ enum ThrallWarchief
AREA_ORGRIMMAR = 1637, AREA_ORGRIMMAR = 1637,
AREA_RAZOR_HILL = 362, AREA_RAZOR_HILL = 362,
AREA_CAMP_TAURAJO = 378, AREA_CAMP_TAURAJO = 378,
AREA_CROSSROADS = 380 AREA_CROSSROADS = 380,
// What the Wind Carries (ID: 6566)
QUEST_WHAT_THE_WIND_CARRIES = 6566,
GOSSIP_MENU_THRALL = 3664,
GOSSIP_RESPONSE_THRALL_FIRST = 5733,
GOSSIP_OPTION_DEFAULT = 0
}; };
const Position heraldOfThrallPos = { -462.404f, -2637.68f, 96.0656f, 5.8606f }; const Position heraldOfThrallPos = { -462.404f, -2637.68f, 96.0656f, 5.8606f };
#define GOSSIP_HTW "Please share your wisdom with me, Warchief."
#define GOSSIP_STW1 "What discoveries?"
#define GOSSIP_STW2 "Usurper?"
#define GOSSIP_STW3 "With all due respect, Warchief - why not allow them to be destroyed? Does this not strengthen our position?"
#define GOSSIP_STW4 "I... I did not think of it that way, Warchief."
#define GOSSIP_STW5 "I live only to serve, Warchief! My life is empty and meaningless without your guidance."
#define GOSSIP_STW6 "Of course, Warchief!"
/// @todo verify abilities/timers /// @todo verify abilities/timers
class npc_thrall_warchief : public CreatureScript class npc_thrall_warchief : public CreatureScript
{ {
@@ -175,47 +171,37 @@ public:
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
{ {
ClearGossipMenuFor(player); ClearGossipMenuFor(player);
switch (action)
uint32 DiscussionOrder = action - GOSSIP_ACTION_INFO_DEF;
if (DiscussionOrder>= 1 && DiscussionOrder <= 6)
{ {
case GOSSIP_ACTION_INFO_DEF+1: uint32 NextAction = GOSSIP_ACTION_INFO_DEF + DiscussionOrder + 1;
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_STW1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); uint32 GossipResponse = GOSSIP_RESPONSE_THRALL_FIRST + DiscussionOrder - 1;
SendGossipMenuFor(player, 5733, creature->GetGUID());
break; AddGossipItemFor(player, GOSSIP_MENU_THRALL + DiscussionOrder, GOSSIP_OPTION_DEFAULT, GOSSIP_SENDER_MAIN, NextAction);
case GOSSIP_ACTION_INFO_DEF+2: SendGossipMenuFor(player, GossipResponse, creature->GetGUID());
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_STW2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
SendGossipMenuFor(player, 5734, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+3:
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_STW3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
SendGossipMenuFor(player, 5735, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+4:
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_STW4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
SendGossipMenuFor(player, 5736, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+5:
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_STW5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
SendGossipMenuFor(player, 5737, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+6:
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_STW6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
SendGossipMenuFor(player, 5738, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+7:
CloseGossipMenuFor(player);
player->AreaExploredOrEventHappens(QUEST_6566);
break;
} }
else if (DiscussionOrder == 7)
{
CloseGossipMenuFor(player);
player->AreaExploredOrEventHappens(QUEST_WHAT_THE_WIND_CARRIES);
}
return true; return true;
} }
bool OnGossipHello(Player* player, Creature* creature) override bool OnGossipHello(Player* player, Creature* creature) override
{ {
if (creature->IsQuestGiver()) if (creature->IsQuestGiver())
{
player->PrepareQuestMenu(creature->GetGUID()); player->PrepareQuestMenu(creature->GetGUID());
}
if (player->GetQuestStatus(QUEST_6566) == QUEST_STATUS_INCOMPLETE) if (player->GetQuestStatus(QUEST_WHAT_THE_WIND_CARRIES) == QUEST_STATUS_INCOMPLETE)
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_HTW, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); {
AddGossipItemFor(player, GOSSIP_MENU_THRALL, GOSSIP_OPTION_DEFAULT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
}
SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID()); SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID());
return true; return true;
@@ -32,7 +32,8 @@ DoorData const doorData[] =
ObjectData const creatureData[] = ObjectData const creatureData[] =
{ {
{ NPC_KRIKTHIR_THE_GATEWATCHER, DATA_KRIKTHIR_THE_GATEWATCHER_EVENT }, { NPC_KRIKTHIR_THE_GATEWATCHER, DATA_KRIKTHIR_THE_GATEWATCHER_EVENT },
{ NPC_HADRONOX, DATA_HADRONOX_EVENT } { NPC_HADRONOX, DATA_HADRONOX_EVENT },
{ 0, 0 }
}; };
BossBoundaryData const boundaries = BossBoundaryData const boundaries =
@@ -118,7 +118,8 @@ DoorData const doorData[] =
ObjectData const creatureData[] = ObjectData const creatureData[] =
{ {
{ NPC_SINDRAGOSA, DATA_SINDRAGOSA } { NPC_SINDRAGOSA, DATA_SINDRAGOSA },
{ 0, 0 }
}; };
// this doesnt have to only store questgivers, also can be used for related quest spawns // this doesnt have to only store questgivers, also can be used for related quest spawns
@@ -27,7 +27,8 @@ DoorData const doorData[] =
ObjectData const gameObjectData[] = ObjectData const gameObjectData[] =
{ {
{ GO_THE_TALON_KINGS_COFFER, DATA_GO_TALON_KING_COFFER } { GO_THE_TALON_KINGS_COFFER, DATA_GO_TALON_KING_COFFER },
{ 0, 0 }
}; };
class instance_sethekk_halls : public InstanceMapScript class instance_sethekk_halls : public InstanceMapScript
@@ -23,7 +23,7 @@ enum Yells
{ {
SAY_AGGRO = 0, SAY_AGGRO = 0,
SAY_SUMMON = 1, SAY_SUMMON = 1,
SAY_SUMMON_BUBLE = 2, SAY_SUMMON_BUBBLE = 2,
SAY_SLAY = 3, SAY_SLAY = 3,
SAY_DEATH = 4, SAY_DEATH = 4,
EMOTE_WATERY_GRAVE = 5, EMOTE_WATERY_GRAVE = 5,
@@ -47,120 +47,95 @@ enum Spells
SPELL_SUMMON_WATER_GLOBULE_4 = 37861 SPELL_SUMMON_WATER_GLOBULE_4 = 37861
}; };
enum Misc const uint32 wateryGraveIds[4] = {SPELL_WATERY_GRAVE_1, SPELL_WATERY_GRAVE_2, SPELL_WATERY_GRAVE_3, SPELL_WATERY_GRAVE_4};
const uint32 waterGlobuleIds[4] = {SPELL_SUMMON_WATER_GLOBULE_1, SPELL_SUMMON_WATER_GLOBULE_2, SPELL_SUMMON_WATER_GLOBULE_3, SPELL_SUMMON_WATER_GLOBULE_4};
struct boss_morogrim_tidewalker : public BossAI
{ {
// Creatures boss_morogrim_tidewalker(Creature* creature) : BossAI(creature, DATA_MOROGRIM_TIDEWALKER)
NPC_WATER_GLOBULE = 21913,
NPC_TIDEWALKER_LURKER = 21920,
EVENT_SPELL_TIDAL_WAVE = 1,
EVENT_SPELL_WATERY_GRAVE = 2,
EVENT_SPELL_EARTHQUAKE = 3,
EVENT_SUMMON_MURLOCS = 4,
EVENT_KILL_TALK = 5
};
const uint32 wateryGraveId[4] = {SPELL_WATERY_GRAVE_1, SPELL_WATERY_GRAVE_2, SPELL_WATERY_GRAVE_3, SPELL_WATERY_GRAVE_4};
const uint32 waterGlobuleId[4] = {SPELL_SUMMON_WATER_GLOBULE_1, SPELL_SUMMON_WATER_GLOBULE_2, SPELL_SUMMON_WATER_GLOBULE_3, SPELL_SUMMON_WATER_GLOBULE_4};
class boss_morogrim_tidewalker : public CreatureScript
{
public:
boss_morogrim_tidewalker() : CreatureScript("boss_morogrim_tidewalker") { }
CreatureAI* GetAI(Creature* creature) const override
{ {
return GetSerpentShrineAI<boss_morogrim_tidewalkerAI>(creature); scheduler.SetValidator([this]
{
return !me->HasUnitState(UNIT_STATE_CASTING);
});
} }
struct boss_morogrim_tidewalkerAI : public BossAI void Reset() override
{ {
boss_morogrim_tidewalkerAI(Creature* creature) : BossAI(creature, DATA_MOROGRIM_TIDEWALKER) BossAI::Reset();
_recentlySpoken = false;
}
void KilledUnit(Unit*) override
{
if (!_recentlySpoken)
{ {
Talk(SAY_SLAY);
_recentlySpoken = true;
} }
void Reset() override scheduler.Schedule(6s, [this](TaskContext)
{ {
BossAI::Reset(); _recentlySpoken = false;
} });
}
void KilledUnit(Unit*) override void JustSummoned(Creature* summon) override
{
summons.Summon(summon);
summon->SetInCombatWithZone();
}
void JustDied(Unit* killer) override
{
Talk(SAY_DEATH);
BossAI::JustDied(killer);
}
void JustEngagedWith(Unit* who) override
{
BossAI::JustEngagedWith(who);
Talk(SAY_AGGRO);
scheduler.Schedule(10s, [this](TaskContext context)
{ {
if (events.GetNextEventTime(EVENT_KILL_TALK) == 0) DoCastVictim(SPELL_TIDAL_WAVE);
context.Repeat(20s);
}).Schedule(20s, [this](TaskContext context)
{
Talk(SAY_SUMMON_BUBBLE);
if (me->HealthAbovePct(25))
{ {
Talk(SAY_SLAY); Talk(EMOTE_WATERY_GRAVE);
events.ScheduleEvent(EVENT_KILL_TALK, 6000); me->CastCustomSpell(SPELL_WATERY_GRAVE, SPELLVALUE_MAX_TARGETS, 4, me, false);
} }
} else
void JustSummoned(Creature* summon) override
{
summons.Summon(summon);
summon->SetInCombatWithZone();
}
void JustDied(Unit* killer) override
{
Talk(SAY_DEATH);
BossAI::JustDied(killer);
}
void JustEngagedWith(Unit* who) override
{
BossAI::JustEngagedWith(who);
Talk(SAY_AGGRO);
events.ScheduleEvent(EVENT_SPELL_TIDAL_WAVE, 10000);
events.ScheduleEvent(EVENT_SPELL_WATERY_GRAVE, 28000);
events.ScheduleEvent(EVENT_SPELL_EARTHQUAKE, 40000);
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch (events.ExecuteEvent())
{ {
case EVENT_SPELL_TIDAL_WAVE: Talk(EMOTE_WATERY_GLOBULES);
me->CastSpell(me->GetVictim(), SPELL_TIDAL_WAVE, false); for (uint8 waterGlobuleId : waterGlobuleIds)
events.ScheduleEvent(EVENT_SPELL_TIDAL_WAVE, 20000); {
break; DoCastSelf(waterGlobuleId, true);
case EVENT_SPELL_WATERY_GRAVE: }
Talk(SAY_SUMMON_BUBLE);
if (me->HealthAbovePct(25))
{
Talk(EMOTE_WATERY_GRAVE);
me->CastCustomSpell(SPELL_WATERY_GRAVE, SPELLVALUE_MAX_TARGETS, 4, me, false);
}
else
{
Talk(EMOTE_WATERY_GLOBULES);
for (uint8 i = 0; i < 4; ++i)
me->CastSpell(me, waterGlobuleId[i], true);
}
events.ScheduleEvent(EVENT_SPELL_WATERY_GRAVE, 25000);
break;
case EVENT_SPELL_EARTHQUAKE:
Talk(EMOTE_EARTHQUAKE);
me->CastSpell(me, SPELL_EARTHQUAKE, false);
events.ScheduleEvent(EVENT_SPELL_EARTHQUAKE, urand(45000, 60000));
events.ScheduleEvent(EVENT_SUMMON_MURLOCS, 8000);
break;
case EVENT_SUMMON_MURLOCS:
Talk(SAY_SUMMON);
for (uint32 i = SPELL_SUMMON_MURLOC1; i < SPELL_SUMMON_MURLOC1 + 11; ++i)
me->CastSpell(me, i, true);
break;
} }
context.Repeat(25s);
}).Schedule(40s, [this](TaskContext context)
{
Talk(EMOTE_EARTHQUAKE);
DoMeleeAttackIfReady(); DoCastSelf(SPELL_EARTHQUAKE);
} scheduler.Schedule(8s, [this](TaskContext)
}; {
Talk(SAY_SUMMON);
for (uint32 murlocSpellId = SPELL_SUMMON_MURLOC1; murlocSpellId < SPELL_SUMMON_MURLOC1 + 11; ++murlocSpellId)
{
DoCastSelf(murlocSpellId, true);
}
});
context.Repeat(45s, 60s);
});
}
private:
bool _recentlySpoken;
}; };
class spell_morogrim_tidewalker_watery_grave : public SpellScriptLoader class spell_morogrim_tidewalker_watery_grave : public SpellScriptLoader
@@ -174,7 +149,7 @@ public:
bool Load() override bool Load() override
{ {
targetNumber = 0; _targetNumber = 0;
return true; return true;
} }
@@ -182,8 +157,8 @@ public:
{ {
PreventHitDefaultEffect(effIndex); PreventHitDefaultEffect(effIndex);
if (Unit* target = GetHitUnit()) if (Unit* target = GetHitUnit())
if (targetNumber < 4) if (_targetNumber < 4)
GetCaster()->CastSpell(target, wateryGraveId[targetNumber++], true); GetCaster()->CastSpell(target, wateryGraveIds[_targetNumber++], true);
} }
void Register() override void Register() override
@@ -192,7 +167,7 @@ public:
} }
private: private:
uint8 targetNumber; uint8 _targetNumber;
}; };
SpellScript* GetSpellScript() const override SpellScript* GetSpellScript() const override
@@ -225,6 +200,7 @@ public:
return; return;
// Xinef: acquire new target // Xinef: acquire new target
// TODO: sniffs to see how this actually happens
if (Unit* target = GetHitUnit()) if (Unit* target = GetHitUnit())
GetCaster()->AddThreat(target, 1000000.0f); GetCaster()->AddThreat(target, 1000000.0f);
} }
@@ -244,7 +220,7 @@ public:
void AddSC_boss_morogrim_tidewalker() void AddSC_boss_morogrim_tidewalker()
{ {
new boss_morogrim_tidewalker(); RegisterSerpentShrineAI(boss_morogrim_tidewalker);
new spell_morogrim_tidewalker_watery_grave(); new spell_morogrim_tidewalker_watery_grave();
new spell_morogrim_tidewalker_water_globule_new_target(); new spell_morogrim_tidewalker_water_globule_new_target();
} }
@@ -89,4 +89,6 @@ inline AI* GetSerpentShrineAI(T* obj)
return GetInstanceAI<AI>(obj, SerpentShrineScriptName); return GetInstanceAI<AI>(obj, SerpentShrineScriptName);
} }
#define RegisterSerpentShrineAI(ai_name) RegisterCreatureAIWithFactory(ai_name, GetSerpentShrineAI)
#endif #endif
@@ -30,7 +30,8 @@
ObjectData const creatureData[] = ObjectData const creatureData[] =
{ {
{ NPC_QUAGMIRRAN, DATA_QUAGMIRRAN } { NPC_QUAGMIRRAN, DATA_QUAGMIRRAN },
{ 0, 0 }
}; };
class instance_the_slave_pens : public InstanceMapScript class instance_the_slave_pens : public InstanceMapScript
@@ -23,7 +23,8 @@
ObjectData const creatureData[] = ObjectData const creatureData[] =
{ {
{ NPC_HUNGARFEN, DATA_HUNGARFEN }, { NPC_HUNGARFEN, DATA_HUNGARFEN },
{ NPC_GHAZAN, DATA_GHAZAN } { NPC_GHAZAN, DATA_GHAZAN },
{ 0, 0 }
}; };
class instance_the_underbog : public InstanceMapScript class instance_the_underbog : public InstanceMapScript
@@ -30,7 +30,8 @@ ObjectData const creatureData[] =
{ {
{ NPC_DALLIAH, DATA_DALLIAH }, { NPC_DALLIAH, DATA_DALLIAH },
{ NPC_SOCCOTHRATES, DATA_SOCCOTHRATES }, { NPC_SOCCOTHRATES, DATA_SOCCOTHRATES },
{ NPC_MELLICHAR, DATA_WARDEN_MELLICHAR } { NPC_MELLICHAR, DATA_WARDEN_MELLICHAR },
{ 0, 0 }
}; };
class instance_arcatraz : public InstanceMapScript class instance_arcatraz : public InstanceMapScript