aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiztazz <felianther15@gmail.com>2017-12-21 20:57:29 +0100
committerfunjoker <funjoker109@gmail.com>2021-04-15 05:53:27 +0200
commitd01914ffccdfc4bdcbdbc2b589985618cc1b10d9 (patch)
tree0590ddb2dba076623103132c64547a965531a356
parentfb4c6c2ba68d0e66f16d4e7db2a95ec1c67f30d9 (diff)
Scripts/Stratholme: Few changes to how Ysida behaves during the Baron run (#20749)
(cherry picked from commit 2a25d9d9a7a7d4aa8b06f9cd0bb26b123adf7789)
-rw-r--r--sql/updates/world/master/2021_03_18_03_world_2017_12_21_01_world.sql18
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp62
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp34
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/stratholme.h8
4 files changed, 105 insertions, 17 deletions
diff --git a/sql/updates/world/master/2021_03_18_03_world_2017_12_21_01_world.sql b/sql/updates/world/master/2021_03_18_03_world_2017_12_21_01_world.sql
new file mode 100644
index 00000000000..d648463da68
--- /dev/null
+++ b/sql/updates/world/master/2021_03_18_03_world_2017_12_21_01_world.sql
@@ -0,0 +1,18 @@
+SET @CGUID:= 16806; -- 1 guid
+SET @GGUID:= 1577; -- 2 guids
+
+DELETE FROM `creature` WHERE `guid` = @CGUID;
+INSERT INTO `creature` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnDifficulties`, `PhaseId`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `ScriptName`, `VerifiedBuild`) VALUES
+(@CGUID, 16031, 329, 0, 0, '1', 0, 0, 0, 4044.78, -3333.68, 117.26, 4.153883, 7200, 0, 0, 4120, 0, 0, 0, 0, 0, '', 0);
+
+DELETE FROM `gameobject` WHERE `guid` IN (@GGUID + 0, @GGUID + 1);
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnDifficulties`, `PhaseId`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `ScriptName`, `VerifiedBuild`) VALUES
+(@GGUID + 0, 181071, 329, 2017, 2017, '1', 0, 4044.34, -3334.217, 115.0604, 2.740162, -0, -0, 0.9799242, 0.1993704, 300, 255, 1, '', 0),
+(@GGUID + 1, 181072, 329, 2017, 2017, '1', 0, 4039.52, -3331.85, 115.061, 1.169369, -0, -0, 0.5519361, 0.8338864, 300, 255, 1, '', 0);
+
+DELETE FROM `spell_script_names` WHERE `ScriptName` = "spell_ysida_saved_credit";
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(31912, "spell_ysida_saved_credit");
+
+UPDATE `creature_template` SET `npcflag` = `npcflag` & ~2, `AIName` = "" WHERE `entry` = 16031;
+DELETE FROM `smart_scripts` WHERE `entryorguid` = 16031;
diff --git a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp
index a73987affe1..6afe57ff2db 100644
--- a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp
+++ b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp
@@ -40,6 +40,11 @@ enum InstanceEvents
EVENT_SLAUGHTER_SQUARE = 2
};
+enum StratholmeMisc
+{
+ SAY_YSIDA_SAVED = 0
+};
+
Position const timmyTheCruelSpawnPosition = { 3625.358f, -3188.108f, 130.3985f, 4.834562f };
EllipseBoundary const beforeScarletGate(Position(3671.158f, -3181.79f), 60.0f, 40.0f);
@@ -80,8 +85,10 @@ class instance_stratholme : public InstanceMapScript
ObjectGuid portGauntletGUID;
ObjectGuid portSlaugtherGUID;
ObjectGuid portElderGUID;
+ ObjectGuid ysidaCageGUID;
ObjectGuid baronGUID;
+ ObjectGuid ysidaGUID;
ObjectGuid ysidaTriggerGUID;
GuidSet crystalsGUID;
GuidSet abomnationGUID;
@@ -160,6 +167,9 @@ class instance_stratholme : public InstanceMapScript
case NPC_ABOM_VENOM:
abomnationGUID.insert(creature->GetGUID());
break;
+ case NPC_YSIDA:
+ ysidaGUID = creature->GetGUID();
+ break;
}
}
@@ -227,6 +237,9 @@ class instance_stratholme : public InstanceMapScript
case GO_PORT_ELDERS:
portElderGUID = go->GetGUID();
break;
+ case GO_YSIDA_CAGE:
+ ysidaCageGUID = go->GetGUID();
+ break;
}
}
@@ -246,14 +259,41 @@ class instance_stratholme : public InstanceMapScript
break;
case FAIL:
DoRemoveAurasDueToSpellOnPlayers(SPELL_BARON_ULTIMATUM);
+ if (Creature* ysida = instance->GetCreature(ysidaGUID))
+ ysida->CastSpell(ysida, SPELL_PERM_FEIGN_DEATH, true);
EncounterState[0] = data;
break;
case DONE:
EncounterState[0] = data;
- if (Creature* ysidaTrigger = instance->GetCreature(ysidaTriggerGUID))
+
+ if (Creature* ysida = instance->GetCreature(ysidaGUID))
{
- Position ysidaPos = ysidaTrigger->GetPosition();
- ysidaTrigger->SummonCreature(NPC_YSIDA, ysidaPos, TEMPSUMMON_TIMED_DESPAWN, 1800000);
+ if (GameObject* cage = instance->GetGameObject(ysidaCageGUID))
+ cage->UseDoorOrButton();
+
+ float x, y, z;
+ //! This spell handles the Dead man's plea quest completion
+ ysida->CastSpell(nullptr, SPELL_YSIDA_SAVED, true);
+ ysida->SetWalk(true);
+ ysida->AI()->Talk(SAY_YSIDA_SAVED);
+ ysida->AddNpcFlag(UNIT_NPC_FLAG_QUESTGIVER);
+ ysida->GetClosePoint(x, y, z, ysida->GetObjectScale() / 3, 4.0f);
+ ysida->GetMotionMaster()->MovePoint(1, x, y, z);
+
+ Map::PlayerList const& players = instance->GetPlayers();
+
+ for (auto const& i : players)
+ {
+ if (Player* player = i.GetSource())
+ {
+ if (player->IsGameMaster())
+ continue;
+
+ //! im not quite sure what this one is supposed to do
+ //! this is server-side spell
+ player->CastSpell(ysida, SPELL_YSIDA_CREDIT_EFFECT, true);
+ }
+ }
}
events.CancelEvent(EVENT_BARON_RUN);
break;
@@ -336,19 +376,9 @@ class instance_stratholme : public InstanceMapScript
{
HandleGameObject(portGauntletGUID, true);
if (GetData(TYPE_BARON_RUN) == IN_PROGRESS)
- {
DoRemoveAurasDueToSpellOnPlayers(SPELL_BARON_ULTIMATUM);
- Map::PlayerList const& players = instance->GetPlayers();
- if (!players.isEmpty())
- for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
- if (Player* player = itr->GetSource())
- if (player->GetQuestStatus(QUEST_DEAD_MAN_PLEA) == QUEST_STATUS_INCOMPLETE)
- {
- player->AreaExploredOrEventHappens(QUEST_DEAD_MAN_PLEA);
- player->KilledMonsterCredit(NPC_YSIDA);
- }
- SetData(TYPE_BARON_RUN, DONE);
- }
+
+ SetData(TYPE_BARON_RUN, DONE);
}
EncounterState[5] = data;
break;
@@ -442,6 +472,8 @@ class instance_stratholme : public InstanceMapScript
return baronGUID;
case DATA_YSIDA_TRIGGER:
return ysidaTriggerGUID;
+ case NPC_YSIDA:
+ return ysidaGUID;
}
return ObjectGuid::Empty;
}
diff --git a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp
index ab619c8abba..079252bef55 100644
--- a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp
+++ b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp
@@ -297,9 +297,43 @@ public:
};
+class spell_ysida_saved_credit : public SpellScript
+{
+ PrepareSpellScript(spell_ysida_saved_credit);
+
+ bool Validate(SpellInfo const* /*spell*/) override
+ {
+ return ValidateSpellInfo({ SPELL_YSIDA_SAVED });
+ }
+
+ void FilterTargets(std::list<WorldObject*>& targets)
+ {
+ targets.remove_if([](WorldObject* obj)
+ {
+ return obj->GetTypeId() != TYPEID_PLAYER;
+ });
+ }
+
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ if (Player* player = GetHitUnit()->ToPlayer())
+ {
+ player->AreaExploredOrEventHappens(QUEST_DEAD_MAN_PLEA);
+ player->KilledMonsterCredit(NPC_YSIDA);
+ }
+ }
+
+ void Register() override
+ {
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_ysida_saved_credit::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY);
+ OnEffectHitTarget += SpellEffectFn(spell_ysida_saved_credit::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+};
+
void AddSC_stratholme()
{
new go_gauntlet_gate();
new npc_restless_soul();
new npc_spectral_ghostly_citizen();
+ RegisterSpellScript(spell_ysida_saved_credit);
}
diff --git a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.h b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.h
index 97464d6ef02..5beff555d20 100644
--- a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.h
+++ b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.h
@@ -78,7 +78,8 @@ enum STRGameobjectIds
GO_ZIGGURAT5 = 175796, // baron
GO_PORT_GAUNTLET = 175374, // port from gauntlet to slaugther
GO_PORT_SLAUGTHER = 175373, // port at slaugther
- GO_PORT_ELDERS = 175377 // port at elders square
+ GO_PORT_ELDERS = 175377, // port at elders square
+ GO_YSIDA_CAGE = 181071
};
enum STRQuestIds
@@ -88,7 +89,10 @@ enum STRQuestIds
enum STRSpellIds
{
- SPELL_BARON_ULTIMATUM = 27861
+ SPELL_BARON_ULTIMATUM = 27861,
+ SPELL_PERM_FEIGN_DEATH = 29266,
+ SPELL_YSIDA_SAVED = 31912,
+ SPELL_YSIDA_CREDIT_EFFECT = 31913
};
enum STRMisc