mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 02:25:38 +01:00
Merge branch '4.3.4' of https://gitlab.com/trinitycore/TrinityCore_434 into ShatteredWorld
# Conflicts: # src/server/scripts/EasternKingdoms/Gilneas/chapter1.cpp # src/server/scripts/Kalimdor/LostCityOfTheTolvir/boss_lockmaw_and_augh.cpp # src/server/scripts/Kalimdor/LostCityOfTheTolvir/instance_lost_city_of_the_tolvir.cpp # src/server/scripts/Kalimdor/LostCityOfTheTolvir/lost_city_of_the_tolvir.h # src/server/scripts/Spells/spell_quest.cpp
This commit is contained in:
@@ -25,10 +25,16 @@ EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "AreaBoundary.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "Creature.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "EventMap.h"
|
||||
#include "GameObject.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "stratholme.h"
|
||||
#include "Log.h"
|
||||
#include "Map.h"
|
||||
#include "MotionMaster.h"
|
||||
#include "Player.h"
|
||||
#include "stratholme.h"
|
||||
|
||||
enum InstanceEvents
|
||||
{
|
||||
@@ -36,6 +42,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);
|
||||
|
||||
@@ -76,8 +87,10 @@ class instance_stratholme : public InstanceMapScript
|
||||
ObjectGuid portGauntletGUID;
|
||||
ObjectGuid portSlaugtherGUID;
|
||||
ObjectGuid portElderGUID;
|
||||
ObjectGuid ysidaCageGUID;
|
||||
|
||||
ObjectGuid baronGUID;
|
||||
ObjectGuid ysidaGUID;
|
||||
ObjectGuid ysidaTriggerGUID;
|
||||
GuidSet crystalsGUID;
|
||||
GuidSet abomnationGUID;
|
||||
@@ -156,6 +169,10 @@ class instance_stratholme : public InstanceMapScript
|
||||
case NPC_ABOM_VENOM:
|
||||
abomnationGUID.insert(creature->GetGUID());
|
||||
break;
|
||||
case NPC_YSIDA:
|
||||
ysidaGUID = creature->GetGUID();
|
||||
creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -223,6 +240,9 @@ class instance_stratholme : public InstanceMapScript
|
||||
case GO_PORT_ELDERS:
|
||||
portElderGUID = go->GetGUID();
|
||||
break;
|
||||
case GO_YSIDA_CAGE:
|
||||
ysidaCageGUID = go->GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -242,14 +262,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->SetFlag(UNIT_NPC_FLAGS, 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;
|
||||
@@ -332,19 +379,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;
|
||||
@@ -438,6 +475,8 @@ class instance_stratholme : public InstanceMapScript
|
||||
return baronGUID;
|
||||
case DATA_YSIDA_TRIGGER:
|
||||
return ysidaTriggerGUID;
|
||||
case NPC_YSIDA:
|
||||
return ysidaGUID;
|
||||
}
|
||||
return ObjectGuid::Empty;
|
||||
}
|
||||
|
||||
@@ -31,12 +31,17 @@ npc_spectral_ghostly_citizen
|
||||
EndContentData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "stratholme.h"
|
||||
#include "Group.h"
|
||||
#include "Player.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "GameObject.h"
|
||||
#include "GameObjectAI.h"
|
||||
#include "Group.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "MotionMaster.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "SpellScript.h"
|
||||
#include "stratholme.h"
|
||||
|
||||
/*######
|
||||
## go_gauntlet_gate (this is the _first_ of the gauntlet gates, two exist)
|
||||
@@ -297,9 +302,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);
|
||||
}
|
||||
|
||||
@@ -76,7 +76,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
|
||||
@@ -86,7 +87,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
|
||||
|
||||
@@ -122,7 +122,7 @@ class VoidSpawnSummon : public BasicEvent
|
||||
|
||||
bool Execute(uint64 /*time*/, uint32 /*diff*/)
|
||||
{
|
||||
_owner->CastSpell((Unit*)nullptr, SPELL_SUMMON_VOID_SENTINEL, true);
|
||||
_owner->CastSpell(nullptr, SPELL_SUMMON_VOID_SENTINEL, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -590,7 +590,7 @@ class spell_summon_blood_elves_script : SpellScriptLoader
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_SUMMON_BLOOD_ELVES; ++i)
|
||||
GetCaster()->CastSpell((Unit*)nullptr, SummonBloodElvesSpells[urand(0,3)], true);
|
||||
GetCaster()->CastSpell(nullptr, SummonBloodElvesSpells[urand(0,3)], true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -625,7 +625,7 @@ class spell_muru_darkness : SpellScriptLoader
|
||||
void HandleAfterCast()
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_SUMMON_DARK_FIEND; ++i)
|
||||
GetCaster()->CastSpell((Unit*)nullptr, SummonDarkFiendSpells[i], true);
|
||||
GetCaster()->CastSpell(nullptr, SummonDarkFiendSpells[i], true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -687,7 +687,7 @@ class spell_transform_visual_missile_periodic : public SpellScriptLoader
|
||||
|
||||
void OnPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
GetTarget()->CastSpell((Unit*)nullptr, RAND(TRANSFORM_VISUAL_MISSILE_1, TRANSFORM_VISUAL_MISSILE_2), true);
|
||||
GetTarget()->CastSpell(nullptr, RAND(TRANSFORM_VISUAL_MISSILE_1, TRANSFORM_VISUAL_MISSILE_2), true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -713,7 +713,7 @@ class spell_summon_blood_elves_periodic : public SpellScriptLoader
|
||||
|
||||
void OnPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
GetTarget()->CastSpell((Unit*)nullptr, SPELL_SUMMON_BLOOD_ELVES_SCRIPT, true);
|
||||
GetTarget()->CastSpell(nullptr, SPELL_SUMMON_BLOOD_ELVES_SCRIPT, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
|
||||
@@ -242,7 +242,7 @@ class npc_corrupted_soul_fragment : public CreatureScript
|
||||
if (instance->GetGuidData(DATA_BRONJAHM).GetCounter() != id)
|
||||
return;
|
||||
|
||||
me->CastSpell((Unit*)nullptr, SPELL_CONSUME_SOUL, true);
|
||||
me->CastSpell(nullptr, SPELL_CONSUME_SOUL, true);
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
|
||||
@@ -319,7 +319,7 @@ class instance_gundrak : public InstanceMapScript
|
||||
|
||||
if (GameObject* altar = GetGameObject(altarId))
|
||||
if (Creature* trigger = altar->FindNearestCreature(NPC_ALTAR_TRIGGER, 10.0f))
|
||||
trigger->CastSpell((Unit*)nullptr, spellId, true);
|
||||
trigger->CastSpell(nullptr, spellId, true);
|
||||
|
||||
// eventId equals statueId
|
||||
ToggleGameObject(eventId, GO_STATE_READY);
|
||||
|
||||
@@ -1845,8 +1845,8 @@ class spell_igb_rocket_pack : public SpellScriptLoader
|
||||
void HandleRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
SpellInfo const* damageInfo = sSpellMgr->AssertSpellInfo(SPELL_ROCKET_PACK_DAMAGE);
|
||||
GetTarget()->CastCustomSpell(SPELL_ROCKET_PACK_DAMAGE, SPELLVALUE_BASE_POINT0, 2 * (damageInfo->Effects[EFFECT_0].CalcValue() + aurEff->GetTickNumber() * aurEff->GetAmplitude()), NULL, TRIGGERED_FULL_MASK);
|
||||
GetTarget()->CastSpell(NULL, SPELL_ROCKET_BURST, TRIGGERED_FULL_MASK);
|
||||
GetTarget()->CastCustomSpell(SPELL_ROCKET_PACK_DAMAGE, SPELLVALUE_BASE_POINT0, 2 * (damageInfo->Effects[EFFECT_0].CalcValue() + aurEff->GetTickNumber() * aurEff->GetAmplitude()), nullptr, TRIGGERED_FULL_MASK);
|
||||
GetTarget()->CastSpell(nullptr, SPELL_ROCKET_BURST, TRIGGERED_FULL_MASK);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
|
||||
@@ -857,7 +857,7 @@ class spell_summon_gauntlet_mobs_periodic : public SpellScriptLoader
|
||||
for (uint8 i = 0; i < 2; ++i)
|
||||
{
|
||||
uint32 spellId = SummonSpellsList.front();
|
||||
GetTarget()->CastSpell((Unit*)nullptr, spellId, true);
|
||||
GetTarget()->CastSpell(nullptr, spellId, true);
|
||||
SummonSpellsList.push_back(spellId);
|
||||
SummonSpellsList.pop_front();
|
||||
}
|
||||
|
||||
@@ -2369,7 +2369,7 @@ public:
|
||||
{
|
||||
if (GetTarget()->isDead())
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->CastSpell(NULL, SPELL_WINDSOUL_CREDT);
|
||||
caster->CastSpell(nullptr, SPELL_WINDSOUL_CREDT);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
|
||||
Reference in New Issue
Block a user