Core/Misc: Implemented Icecrown Citadel buff disable (#23394)

Closes #8576 
Closes #7940
This commit is contained in:
Keader
2019-06-12 15:22:32 -03:00
committed by GitHub
parent 69fd5d0d8f
commit 94b60ff0ef
6 changed files with 76 additions and 4 deletions

View File

@@ -0,0 +1,8 @@
UPDATE `creature_template` SET `ScriptName`='npc_entrance_faction_leader' WHERE `entry`IN (39371,39372);
DELETE FROM `spell_area` WHERE `spell`=73822 AND `area`=4812;
DELETE FROM `spell_area` WHERE `spell`=73828 AND `area`=4812;
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup` IN (11203, 11206);
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(15,11203,0,0,13,0,45,1,0,0,0,'','King of Stormwind - Show Option if DATA_ICC_BUFF is 1'),
(15,11206,0,0,13,0,45,1,0,0,0,'','Overlord of the Warsong Offensive - Show Option if DATA_ICC_BUFF is 1');

View File

@@ -21,6 +21,7 @@
#include "DatabaseEnv.h"
#include "Formulas.h"
#include "Group.h"
#include "InstanceScript.h"
#include "Log.h"
#include "ObjectMgr.h"
#include "Player.h"
@@ -33,6 +34,7 @@
#include "Util.h"
#include "WorldPacket.h"
#include "WorldSession.h"
#include "ZoneScript.h"
#define PET_XP_FACTOR 0.05f
@@ -71,6 +73,8 @@ void Pet::AddToWorld()
GetMap()->GetObjectsStore().Insert<Pet>(GetGUID(), this);
Unit::AddToWorld();
AIM_Initialize();
if (ZoneScript* zoneScript = GetZoneScript() ? GetZoneScript() : GetInstanceScript())
zoneScript->OnCreatureCreate(this);
}
// Prevent stuck pets when zoning. Pets default to "follow" when added to world

View File

@@ -1153,6 +1153,8 @@ bool Aura::CanBeSaved() const
case 44413: // Incanter's Absorption
case 40075: // Fel Flak Fire
case 55849: // Power Spark
case 73822: // Hellscream's Warsong
case 73828: // Strength of Wrynn
return false;
}

View File

@@ -282,9 +282,11 @@ enum ICCEventIds
EVENT_AWAKEN_WARD_4 = 22909,
};
enum ICCMovementPoints
enum ICCMisc
{
POINT_LAND = 1,
POINT_LAND = 1,
ICC_BUFF_MENUID_ALLY = 11204,
ICC_BUFF_MENUID_HORDE = 11207
};
class FrostwingVrykulSearcher
@@ -1790,6 +1792,19 @@ class npc_arthas_teleport_visual : public CreatureScript
}
};
struct npc_entrance_faction_leader : public ScriptedAI
{
npc_entrance_faction_leader(Creature* creature) : ScriptedAI(creature) { }
bool GossipSelect(Player* /*player*/, uint32 menuId, uint32 /*gossipListId*/) override
{
if (menuId == ICC_BUFF_MENUID_ALLY || menuId == ICC_BUFF_MENUID_HORDE)
if (InstanceScript* instance = me->GetInstanceScript())
instance->SetData(DATA_ICC_BUFF, 0);
return false;
}
};
class spell_icc_stoneform : public SpellScriptLoader
{
public:
@@ -2261,6 +2276,7 @@ void AddSC_icecrown_citadel()
new npc_frostwing_vrykul();
new npc_impaling_spear();
new npc_arthas_teleport_visual();
RegisterCreatureAI(npc_entrance_faction_leader);
new spell_icc_stoneform();
new spell_icc_sprit_alarm();
new spell_frost_giant_death_plague();

View File

@@ -59,7 +59,11 @@ enum ICSharedSpells
// Shadowmourne questline
SPELL_UNSATED_CRAVING = 71168,
SPELL_SHADOWS_FATE = 71169
SPELL_SHADOWS_FATE = 71169,
// ICC Buffs
SPELL_HELLSCREAMS_WARSONG = 73822,
SPELL_STRENGHT_OF_WRYNN = 73828
};
enum ICTeleporterSpells
@@ -122,7 +126,8 @@ enum ICDataTypes
DATA_UPPERSPIRE_TELE_ACT = 41, /// also used by conditions
DATA_BLOOD_QUEEN_LANA_THEL_COUNCIL = 42,
DATA_BLOOD_PRINCE_COUNCIL_INTRO = 43,
DATA_SINDRAGOSA_INTRO = 44
DATA_SINDRAGOSA_INTRO = 44,
DATA_ICC_BUFF = 45 // used by conditions
};
enum ICCreaturesIds

View File

@@ -21,6 +21,7 @@
#include "InstanceScript.h"
#include "Map.h"
#include "ObjectMgr.h"
#include "Pet.h"
#include "Player.h"
#include "PoolMgr.h"
#include "ScriptMgr.h"
@@ -149,6 +150,7 @@ class instance_icecrown_citadel : public InstanceMapScript
BloodQuickeningMinutes = 0;
BloodPrinceIntro = 1;
SindragosaIntro = 1;
ICCBuffActive = 1;
}
// A function to help reduce the number of lines for teleporter management.
@@ -182,10 +184,25 @@ class instance_icecrown_citadel : public InstanceMapScript
if (GetBossState(DATA_LADY_DEATHWHISPER) == DONE && GetBossState(DATA_ICECROWN_GUNSHIP_BATTLE) != DONE)
SpawnGunship();
if (ICCBuffActive)
{
uint32 spellId = TeamInInstance == ALLIANCE ? SPELL_STRENGHT_OF_WRYNN : SPELL_HELLSCREAMS_WARSONG;
player->CastSpell(player, spellId, true);
}
}
void OnCreatureCreate(Creature* creature) override
{
if (creature->IsPet() && creature->GetOwnerGUID().IsPlayer())
{
uint32 spellId = TeamInInstance == ALLIANCE ? SPELL_STRENGHT_OF_WRYNN : SPELL_HELLSCREAMS_WARSONG;
if (ICCBuffActive)
creature->CastSpell(creature, spellId, true);
else
creature->RemoveAurasDueToSpell(spellId);
}
switch (creature->GetEntry())
{
case NPC_LORD_MARROWGAR:
@@ -724,6 +741,8 @@ class instance_icecrown_citadel : public InstanceMapScript
return BloodPrinceIntro;
case DATA_SINDRAGOSA_INTRO:
return SindragosaIntro;
case DATA_ICC_BUFF:
return ICCBuffActive;
default:
break;
}
@@ -1090,6 +1109,23 @@ class instance_icecrown_citadel : public InstanceMapScript
case DATA_SINDRAGOSA_INTRO:
SindragosaIntro = data;
break;
case DATA_ICC_BUFF:
ICCBuffActive = data;
if (!ICCBuffActive)
{
uint32 spellId = TeamInInstance == ALLIANCE ? SPELL_STRENGHT_OF_WRYNN : SPELL_HELLSCREAMS_WARSONG;
Map::PlayerList const& players = instance->GetPlayers();
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
{
if (Player* player = itr->GetSource())
{
player->RemoveAurasDueToSpell(spellId);
if (Pet* pet = player->GetPet())
pet->RemoveAurasDueToSpell(spellId);
}
}
}
break;
default:
break;
}
@@ -1506,6 +1542,7 @@ class instance_icecrown_citadel : public InstanceMapScript
uint16 BloodQuickeningMinutes;
uint8 BloodPrinceIntro;
uint8 SindragosaIntro;
uint8 ICCBuffActive;
bool IsBonedEligible;
bool IsOozeDanceEligible;
bool IsNauseaEligible;