diff --git a/optional/sql/world/zz_optional_vanilla_phasing.sql b/optional/sql/world/zz_optional_vanilla_phasing.sql index 4f124a7..d05f15d 100644 --- a/optional/sql/world/zz_optional_vanilla_phasing.sql +++ b/optional/sql/world/zz_optional_vanilla_phasing.sql @@ -197,7 +197,7 @@ UPDATE `gameobject` SET `ScriptName` = 'gobject_ipp_wotlk' WHERE `guid` IN ( /* Hide Rogg and his anvil + forge at the entrance of Orgrimmar until WotLK */ UPDATE `creature_template` SET `ScriptName` = 'npc_ipp_wotlk' WHERE `entry` = 37072; -UPDATE `gameobject` SET `ScriptName` = 'gobject_ipp_wotlk' WHERE `guid` IN (347, 387); +UPDATE `gameobject` SET `ScriptName` = 'gobject_ipp_wotlk' WHERE `guid` IN (347, 387); -- this needs a fix still, Rogg is currently aggressive while hidden. /* Landro for TCG promotion in Booty Bay */ UPDATE `creature_template` SET `ScriptName` = 'npc_ipp_aq' WHERE `entry` = 17249; @@ -205,6 +205,3 @@ UPDATE `creature_template` SET `ScriptName` = 'npc_ipp_aq' WHERE `entry` = 17249 /* Hide barber in Kalimdor/Eastern Kingdom/Outland until WotLK - disabled by default, because most players will expect barbers to be there */ /* UPDATE `creature` SET `ScriptName` = 'npc_ipp_wotlk' WHERE `map` IN (0, 1, 530) AND `id1` IN (29139, 29141, 29142, 29143, 29145); UPDATE `gameobject` SET `ScriptName` = 'gobject_ipp_wotlk' WHERE `map` IN (0, 1, 530) AND `id` IN (190683, 190684, 190697, 190698, 190699, 190704, 190710, 190711, 190712, 191028, 191029, 191030); */ - -/* Hide training dummy in Kalimdor/Eastern Kingdom/Outland until WotLK - disabled by default, because most players will expect dummies to be there */ -/* UPDATE `creature` SET `ScriptName` = 'npc_training_dummy_ipp_wotlk' WHERE `map` IN (0, 1, 530) AND `id1` IN (31144, 31146, 32666, 32667); */ diff --git a/optional/sql/world/zz_optional_vanilla_pvp_system.sql b/optional/sql/world/zz_optional_vanilla_pvp_system.sql index 0609330..720968f 100644 --- a/optional/sql/world/zz_optional_vanilla_pvp_system.sql +++ b/optional/sql/world/zz_optional_vanilla_pvp_system.sql @@ -930,3 +930,15 @@ DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 23 AND `SourceGroup` -- Update Vanilla ExtendedCost UPDATE `npc_vendor` SET `ExtendedCost` = 0 WHERE `entry` IN (12777, 12792, 12799, 12805, 26394, 26396, 112781, 112783, 112785, 112793, 112794, 112795, 112796); + +-- officer room doors +DELETE FROM `gameobject` WHERE `guid` IN (626262, 631660, 631661); +INSERT INTO `gameobject` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, +`rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `ScriptName`, `VerifiedBuild`, `Comment`) VALUES +-- +(626262, 176576, 0, 1519, 1519, 1, 1, -8765.82, 403.164, 104.162, -0.898844, 0, 0, -0.434445, 0.900698, 900, 100, 1, 'gobject_ipp_pvp_closed', 0, NULL), +(631660, 176562, 1, 0, 0, 1, 1, 1634.87, -4247.86, 55.8397, 4.19752, 0, 0, -0.863835, 0.503774, 180, 0, 1, 'gobject_ipp_pvp_closed', NULL, NULL), +(631661, 176562, 1, 0, 0, 1, 1, 1634.87, -4247.86, 55.8397, 4.19752, 0, 0, -0.863835, 0.503774, 180, 0, 0, 'gobject_ipp_pvp_open', NULL, NULL); +-- I can't figure out why gate 31660 is not visible in Orgrimmar. something is blocking guid 31660 specifically. until someone figures it out, I created a new door. (631661) + +UPDATE `gameobject` SET `state` = 0, `ScriptName` = 'gobject_ipp_pvp_open' WHERE `guid` = 26262; diff --git a/src/IndividualProgressionAwarenessScripts.cpp b/src/IndividualProgressionAwarenessScripts.cpp index 4a07f26..3798047 100644 --- a/src/IndividualProgressionAwarenessScripts.cpp +++ b/src/IndividualProgressionAwarenessScripts.cpp @@ -236,6 +236,78 @@ public: } }; +class gobject_ipp_pvp_closed : public GameObjectScript +{ +public: + gobject_ipp_pvp_closed() : GameObjectScript("gobject_ipp_pvp_closed") { } + + struct gobject_ipp_pvp_closedAI: GameObjectAI + { + explicit gobject_ipp_pvp_closedAI(GameObject* object) : GameObjectAI(object) { }; + + bool CanBeSeen(Player const* player) override + { + Player* target = ObjectAccessor::FindConnectedPlayer(player->GetGUID()); + uint32 PVP_RANK5_QUEST = 66105; + + if (player->IsGameMaster() || !sIndividualProgression->enabled || sIndividualProgression->isExcludedFromProgression(target)) + { + return false; + } + + if (target->GetQuestStatus(PVP_RANK5_QUEST) == QUEST_STATUS_REWARDED) + { + return false; + } + else + { + return true; + } + } + }; + + GameObjectAI* GetAI(GameObject* object) const override + { + return new gobject_ipp_pvp_closedAI(object); + } +}; + +class gobject_ipp_pvp_open : public GameObjectScript +{ +public: + gobject_ipp_pvp_open() : GameObjectScript("gobject_ipp_pvp_open") { } + + struct gobject_ipp_pvp_openAI: GameObjectAI + { + explicit gobject_ipp_pvp_openAI(GameObject* object) : GameObjectAI(object) { }; + + bool CanBeSeen(Player const* player) override + { + Player* target = ObjectAccessor::FindConnectedPlayer(player->GetGUID()); + uint32 PVP_RANK5_QUEST = 66105; + + if (player->IsGameMaster() || !sIndividualProgression->enabled || sIndividualProgression->isExcludedFromProgression(target)) + { + return true; + } + + if (target->GetQuestStatus(PVP_RANK5_QUEST) == QUEST_STATUS_REWARDED) + { + return true; + } + else + { + return false; + } + } + }; + + GameObjectAI* GetAI(GameObject* object) const override + { + return new gobject_ipp_pvp_openAI(object); + } +}; + class npc_ipp_preaq : public CreatureScript { public: @@ -675,74 +747,6 @@ public: } }; -class npc_training_dummy_ipp_wotlk : public CreatureScript -{ -public: - npc_training_dummy_ipp_wotlk() : CreatureScript("npc_training_dummy_ipp_wotlk") { } - - struct npc_training_dummy_ipp_wotlkAI : ScriptedAI - { - /*explicit*/ npc_training_dummy_ipp_wotlkAI(Creature* creature) : ScriptedAI(creature) - { - me->SetCombatMovement(false); - me->ApplySpellImmune(0, 0, 98, true); // ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true) - } - - uint32 resetTimer; - - void Reset() override - { - me->CastSpell(me, 61204, true); // CastSpell(me, SPELL_STUN_PERMANENT, true) - resetTimer = 5000; - } - - void EnterEvadeMode(EvadeReason why) override - { - if (!_EnterEvadeMode(why)) - return; - - Reset(); - } - - void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override - { - resetTimer = 5000; - damage = 0; - } - - void UpdateAI(uint32 diff) override - { - if (!UpdateVictim()) - return; - - if (resetTimer <= diff) - { - EnterEvadeMode(EVADE_REASON_NO_HOSTILES); - resetTimer = 5000; - } - else - resetTimer -= diff; - } - - void MoveInLineOfSight(Unit* /*who*/) override { } - - bool CanBeSeen(Player const* player) override - { - if (player->IsGameMaster() || !sIndividualProgression->enabled) - { - return true; - } - Player* target = ObjectAccessor::FindConnectedPlayer(player->GetGUID()); - return sIndividualProgression->hasPassedProgression(target, PROGRESSION_TBC_TIER_5); - } - }; - - CreatureAI* GetAI(Creature* creature) const override - { - return new npc_training_dummy_ipp_wotlkAI(creature); - } -}; - // Add all scripts in one void AddSC_mod_individual_progression_awareness() { @@ -754,6 +758,8 @@ void AddSC_mod_individual_progression_awareness() new gobject_ipp_pre_tbc(); // Stormwind pvp room new gobject_ipp_tbc(); new gobject_ipp_wotlk(); + new gobject_ipp_pvp_closed(); // pvp officer doors + new gobject_ipp_pvp_open(); // pvp officer doors new npc_ipp_preaq(); // Cenarion Hold NPCs new npc_ipp_we(); // War Effort NPCs in cities new npc_ipp_aq(); @@ -770,5 +776,4 @@ void AddSC_mod_individual_progression_awareness() new npc_ipp_wotlk_totc(); new npc_ipp_wotlk_icc(); new npc_ipp_ds2(); - // new npc_training_dummy_ipp_wotlk(); }