mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 17:54:48 +01:00
Scripts/Gilneas: the chapter 2 intro completion spell will no longer despawn the npcs of other players
* corrected a phase aura entry
This commit is contained in:
5
sql/updates/world/custom/custom_2019_06_05_02_world.sql
Normal file
5
sql/updates/world/custom/custom_2019_06_05_02_world.sql
Normal file
@@ -0,0 +1,5 @@
|
||||
UPDATE `spell_area` SET `quest_start`= 14320 WHERE `spell`= 14375 AND `area`= 4714;
|
||||
|
||||
DELETE FROM `spell_script_names` WHERE `ScriptName`= 'spell_gilneas_worgen_intro_completion';
|
||||
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
|
||||
(68638, 'spell_gilneas_worgen_intro_completion');
|
||||
@@ -743,6 +743,45 @@ class spell_gilneas_forcecast_cataclysm_1 : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
class SummonerTargetSelector
|
||||
{
|
||||
public:
|
||||
SummonerTargetSelector(Unit* caster) : _caster(caster) { }
|
||||
|
||||
bool operator() (WorldObject* target)
|
||||
{
|
||||
if (target->GetTypeId() != TYPEID_UNIT)
|
||||
return true;
|
||||
|
||||
if (TempSummon* summon = target->ToUnit()->ToTempSummon())
|
||||
if (summon->GetSummoner() == _caster)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
Unit* _caster;
|
||||
};
|
||||
|
||||
class spell_gilneas_worgen_intro_completion : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_gilneas_worgen_intro_completion);
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
if (targets.empty())
|
||||
return;
|
||||
|
||||
targets.remove_if(SummonerTargetSelector(GetCaster()));
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_gilneas_worgen_intro_completion::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENTRY);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_gilneas_c2()
|
||||
{
|
||||
new go_gilneas_invasion_camera();
|
||||
@@ -757,4 +796,5 @@ void AddSC_gilneas_c2()
|
||||
new spell_gilneas_fiery_boulder();
|
||||
new spell_gilneas_call_attack_mastiff();
|
||||
new spell_gilneas_forcecast_cataclysm_1();
|
||||
RegisterSpellScript(spell_gilneas_worgen_intro_completion);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user