Implement Naxx40 Attunement Shortcut Entrance Logic

This commit is contained in:
郑佩茹
2022-09-13 14:57:59 -06:00
parent c9626a5f27
commit b98ab65a9d
4 changed files with 49 additions and 16 deletions

View File

@@ -62,6 +62,7 @@ REPLACE INTO `gameobject_loot_template` (`Entry`, `Item`, `Reference`, `Chance`,
-- Add Entrance transporter object. Necromantic Runestone (id: 189314, displayID: 7786) -- Add Entrance transporter object. Necromantic Runestone (id: 189314, displayID: 7786)
SET @TRANSPORTER_ENTRY:= 9000; SET @TRANSPORTER_ENTRY:= 9000;
SET @TRANSPORTER_COOLDOWN:= 5; SET @TRANSPORTER_COOLDOWN:= 5;
SET @DEATH_KNIGHT_PORTAL_EFFECT:= 28444;
SET @TRANSPORTER_X:= 3123.26; SET @TRANSPORTER_X:= 3123.26;
SET @TRANSPORTER_Y:= -3869.36; SET @TRANSPORTER_Y:= -3869.36;
SET @TRANSPORTER_Z:= 138.34; SET @TRANSPORTER_Z:= 138.34;
@@ -75,7 +76,7 @@ INSERT INTO `gameobject_template` (`entry`, `type`, `displayId`, `name`,
`VerifiedBuild`) `VerifiedBuild`)
VALUES VALUES
(@TRANSPORTER_ENTRY, 10, 7786, 'Teleport To Naxxramas', '', '', '', 1, 0, 0, 0, (@TRANSPORTER_ENTRY, 10, 7786, 'Teleport To Naxxramas', '', '', '', 1, 0, 0, 0,
0, @TRANSPORTER_COOLDOWN, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @TRANSPORTER_COOLDOWN, 0, 0, 0, 0, 0, @DEATH_KNIGHT_PORTAL_EFFECT, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, '', '', 12340); 0, 0, '', '', 12340);
DELETE FROM `gameobject` WHERE `id`=@TRANSPORTER_ENTRY AND `map`=0 AND `zoneId`=0 AND `areaID`=0; DELETE FROM `gameobject` WHERE `id`=@TRANSPORTER_ENTRY AND `map`=0 AND `zoneId`=0 AND `areaID`=0;
INSERT INTO `gameobject` INSERT INTO `gameobject`
@@ -88,6 +89,27 @@ VALUES
@TRANSPORTER_Z, @TRANSPORTER_O, 0, 0, @TRANSPORTER_Z, @TRANSPORTER_O, 0, 0,
-0.063658, -1, 1, 0, 1, '', 0); -0.063658, -1, 1, 0, 1, '', 0);
-- Add condition Attunement to teleport spell
-- Shows when not attuned Error Message 107: That spell is not available to you
DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId` = 17) AND
(`SourceGroup` = 0) AND (`SourceEntry` = @DEATH_KNIGHT_PORTAL_EFFECT) AND
(`SourceId` = 0) AND (`ElseGroup` IN (0)) AND (`ConditionTypeOrReference` =
8) AND (`ConditionTarget` = 1) AND (`ConditionValue1` IN (9121, 9122, 9123)) AND
(`ConditionValue2` = 0) AND (`ConditionValue3` = 0);
INSERT INTO `conditions`
(`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`,
`ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`,
`ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`,
`ErrorTextId`, `ScriptName`, `Comment`)
VALUES
(17, 0, @DEATH_KNIGHT_PORTAL_EFFECT, 0, 0, 8, 1, 9378, 0, 0, 0, 107, 0, '', 'Entered Naxxramas Flag');
-- Update Teleport Positions of spells used by Naxxramas Portal
SET @DEATH_KNIGHT_PORTAL_EFFECT:= 28444;
DELETE FROM `spell_target_position` WHERE `ID` IN (@DEATH_KNIGHT_PORTAL_EFFECT);
INSERT INTO `spell_target_position` (`ID`, `EffectIndex`, `MapID`, `PositionX`, `PositionY`, `PositionZ`, `Orientation`, `VerifiedBuild`)
VALUES (@DEATH_KNIGHT_PORTAL_EFFECT, 0, 533, 3005.51, -3434.64, 304.195, 6.2831, 0);
-- Add Floating Naxx Object (id: 181056) -- Add Floating Naxx Object (id: 181056)
-- Node 0 of PathID 436 in taxiPathNode -- Node 0 of PathID 436 in taxiPathNode

View File

@@ -8,7 +8,7 @@ DELETE FROM `disables` WHERE `sourceType` = 1 AND `entry` IN (
9236, 9078, 9071, 9043, 9090, 9107, 9061, 9240, 9244, 9073, 9074, 9236, 9078, 9071, 9043, 9090, 9107, 9061, 9240, 9244, 9073, 9074,
9241, 9054, 9068, 9075, 9069, 9095, 9050, 9234, 9072, 9059, 9058, 9241, 9054, 9068, 9075, 9069, 9095, 9050, 9234, 9072, 9059, 9058,
9245, 9093, 9056, 9243, 9091, 9104, 9108, 9246, 9086, 9092, 9055, 9245, 9093, 9056, 9243, 9091, 9104, 9108, 9246, 9086, 9092, 9055,
9235, 9238, 9239 ); 9235, 9238, 9239, 9378);
REPLACE INTO `creature_queststarter` (`id`, `quest`) VALUES REPLACE INTO `creature_queststarter` (`id`, `quest`) VALUES
(16115, 9033), (16115, 9033),
@@ -318,4 +318,7 @@ UPDATE `quest_template_addon` SET `PrevQuestID` = 9233 WHERE (`ID` IN (9237, 923
DELETE FROM `creature_queststarter` WHERE (`quest` IN (9237, 9239, 9240, 9238, 9235, 9236, 9234, 9244, 9246, 9245, 9241, 9242, 9243, 9232)); DELETE FROM `creature_queststarter` WHERE (`quest` IN (9237, 9239, 9240, 9238, 9235, 9236, 9234, 9244, 9246, 9245, 9241, 9242, 9243, 9232));
INSERT INTO `creature_queststarter` (`id`, `quest`) VALUES (@NPC, 9237), (@NPC, 9239), (@NPC, 9240), (@NPC, 9238), (@NPC, 9235), (@NPC, 9236), (@NPC, 9234), (@NPC, 9244), (@NPC, 9246), (@NPC, 9245), (@NPC, 9241), (@NPC, 9242), (@NPC, 9243), (@NPC, 9232); INSERT INTO `creature_queststarter` (`id`, `quest`) VALUES (@NPC, 9237), (@NPC, 9239), (@NPC, 9240), (@NPC, 9238), (@NPC, 9235), (@NPC, 9236), (@NPC, 9234), (@NPC, 9244), (@NPC, 9246), (@NPC, 9245), (@NPC, 9241), (@NPC, 9242), (@NPC, 9243), (@NPC, 9232);
DELETE FROM `creature_questender` WHERE (`quest` IN (9237, 9239, 9240, 9238, 9235, 9236, 9234, 9244, 9246, 9245, 9241, 9242, 9243, 9232)); DELETE FROM `creature_questender` WHERE (`quest` IN (9237, 9239, 9240, 9238, 9235, 9236, 9234, 9244, 9246, 9245, 9241, 9242, 9243, 9232));
INSERT INTO `creature_questender` (`id`, `quest`) VALUES (@NPC, 9237), (@NPC, 9239), (@NPC, 9240), (@NPC, 9238), (@NPC, 9235), (@NPC, 9236), (@NPC, 9234), (@NPC, 9244), (@NPC, 9246), (@NPC, 9245), (@NPC, 9241), (@NPC, 9242), (@NPC, 9243), (@NPC, 9232); INSERT INTO `creature_questender` (`id`, `quest`) VALUES (@NPC, 9237), (@NPC, 9239), (@NPC, 9240), (@NPC, 9238), (@NPC, 9235), (@NPC, 9236), (@NPC, 9234), (@NPC, 9244), (@NPC, 9246), (@NPC, 9245), (@NPC, 9241), (@NPC, 9242), (@NPC, 9243), (@NPC, 9232);
-- We are going to re-use the deprecated Naxxramas attunement flag quest but need to change some values
UPDATE `quest_template` SET `RequiredFactionId1` = 0, `RequiredFactionValue1` = 0, `RewardFactionID1` = 0, `RewardFactionValue1` = 0, `QuestSortID` = 0 WHERE `ID` = 9378;

View File

@@ -1315,7 +1315,7 @@ public:
if (isAttuned(player)) if (isAttuned(player))
{ {
player->SetRaidDifficulty(RAID_DIFFICULTY_10MAN_HEROIC); player->SetRaidDifficulty(RAID_DIFFICULTY_10MAN_HEROIC);
player->TeleportTo(533, 3005.68f, -3447.77f, 293.93f, 4.65f); player->TeleportTo(533, 3005.51f, -3434.64f, 304.195f, 6.2831f);
} }
} }
@@ -1348,15 +1348,14 @@ class NaxxPlayerScript : public PlayerScript
public: public:
NaxxPlayerScript() : PlayerScript("NaxxPlayerScript") { } NaxxPlayerScript() : PlayerScript("NaxxPlayerScript") { }
// Used in Naxx40, waiting for this AC PR to merge before can be used: https://github.com/azerothcore/azerothcore-wotlk/pull/12860
// void OnBeforeChooseGraveyard(Player* player, TeamId /*teamId*/, bool /*nearCorpse*/, uint32& graveyardOverride) override
// void OnBeforeChooseGraveyard(Player* player, TeamId /*teamId*/, bool /*nearCorpse*/, uint32& graveyardOverride) override {
// { if (player->GetMapId() == MAP_NAXX && player->GetMap()->GetSpawnMode() == RAID_DIFFICULTY_10MAN_HEROIC)
// if (player->GetMapId() == MAP_NAXX && player->GetMap()->GetSpawnMode() == RAID_DIFFICULTY_10MAN_HEROIC) {
// { graveyardOverride = NAXX40_GRAVEYARD;
// graveyardOverride = NAXX40_GRAVEYARD; }
// } }
// }
}; };
class naxx_northrend_entrance : public AreaTriggerScript class naxx_northrend_entrance : public AreaTriggerScript
@@ -1465,6 +1464,14 @@ public:
// Cast on player Naxxramas Entry Flag Trigger DND - Classic (spellID: 29296) // Cast on player Naxxramas Entry Flag Trigger DND - Classic (spellID: 29296)
player->CastSpell(player, 29296, true); player->CastSpell(player, 29296, true);
if (player->GetQuestStatus(NAXX40_ENTRANCE_FLAG) != QUEST_STATUS_REWARDED)
{
// Mark player as having entered
Quest const* quest = sObjectMgr->GetQuestTemplate(NAXX40_ENTRANCE_FLAG);
player->AddQuest(quest, nullptr);
player->CompleteQuest(NAXX40_ENTRANCE_FLAG);
player->RewardQuest(quest, 0, player, false, false);
}
} }
}; };

View File

@@ -245,9 +245,10 @@ enum NXGraveyards
enum NXAttunementQuests enum NXAttunementQuests
{ {
NAXX40_ATTUNEMENT_1 = 9121, NAXX40_ATTUNEMENT_1 = 9121,
NAXX40_ATTUNEMENT_2 = 9122, NAXX40_ATTUNEMENT_2 = 9122,
NAXX40_ATTUNEMENT_3 = 9123 NAXX40_ATTUNEMENT_3 = 9123,
NAXX40_ENTRANCE_FLAG = 9378
}; };
template <class AI, class T> template <class AI, class T>