-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Scripts/Events): Implement headless horseman downscale (#360)
- Loading branch information
Showing
4 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/* | ||
* This file is part of the AzerothCore Project. See AUTHORS file for Copyright information | ||
* | ||
* This program is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU Affero General Public License as published by the | ||
* Free Software Foundation; either version 3 of the License, or (at your | ||
* option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for | ||
* more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along | ||
* with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include "Player.h" | ||
#include "ScriptMgr.h" | ||
|
||
#include "ProgressionSystem.h" | ||
|
||
enum Misc | ||
{ | ||
MAP_SCARLET_MONASTERY = 189, | ||
|
||
QUEST_HEADLESS_HORSEMAN = 50000, | ||
|
||
NPC_HEADLESS_HORSEMAN = 23682 | ||
}; | ||
|
||
class mod_progression_eventquest_playerscript : public PlayerScript | ||
{ | ||
public: | ||
mod_progression_eventquest_playerscript() : PlayerScript("mod_progression_eventquest_playerscript") { } | ||
|
||
void OnMapChanged(Player* player) | ||
{ | ||
if (player->GetMap()->GetId() == MAP_SCARLET_MONASTERY && sGameEventMgr->IsActiveEvent(12)) | ||
{ | ||
if (Quest const* quest = sObjectMgr->GetQuestTemplate(QUEST_HEADLESS_HORSEMAN)) | ||
{ | ||
if (player->CanTakeQuest(quest, false)) | ||
{ | ||
player->AddQuestAndCheckCompletion(quest, nullptr); | ||
} | ||
} | ||
} | ||
} | ||
}; | ||
|
||
class unit_headless_horseman_script : public UnitScript | ||
{ | ||
public: | ||
unit_headless_horseman_script() : UnitScript("unit_headless_horseman_script") { } | ||
|
||
void OnUnitDeath(Unit* me, Unit* killer) override | ||
{ | ||
if (me->GetEntry() != NPC_HEADLESS_HORSEMAN) | ||
{ | ||
return; | ||
} | ||
|
||
if (killer->GetMap() && killer->GetMap()->IsDungeon()) | ||
{ | ||
killer->GetMap()->DoForAllPlayers([&](Player* player) | ||
{ | ||
player->CompleteQuest(QUEST_HEADLESS_HORSEMAN); | ||
|
||
if (Quest const* quest = sObjectMgr->GetQuestTemplate(QUEST_HEADLESS_HORSEMAN)) | ||
{ | ||
player->RewardQuest(quest, 0, nullptr, true, true); | ||
} | ||
}); | ||
} | ||
} | ||
}; | ||
|
||
void AddSC_event_hallows_end_1_19() | ||
{ | ||
new mod_progression_eventquest_playerscript(); | ||
new unit_headless_horseman_script(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
SET @QUESTID = 50000; | ||
SET @TITLE = 'The Time is Nigh!'; | ||
DELETE FROM `quest_template` WHERE `ID` = @QUESTID; | ||
INSERT INTO `quest_template` (`ID`, `QuestType`, `QuestLevel`, `MinLevel`, `QuestSortID`, `QuestInfoID`, `SuggestedGroupNum`, `Flags`, `RewardItem1`, `RewardAmount1`, `LogTitle`, `LogDescription`, `QuestDescription`, `RequiredNpcOrGo1`, `RequiredNpcOrGoCount1`) VALUES | ||
(@QUESTID, 2, -1, 70, -22, 0, 5, 4096, 54516, 1, @TITLE, 'Venture into the Scarlet Monastery and put an end to the Headless Horseman\'s menace.', 'Slay the Headless Horseman', 23682, 1); | ||
|
||
DELETE FROM `item_loot_template` WHERE `entry` = 54516 AND `item` IN (49426, 49128, 49126); | ||
|
||
UPDATE `creature_template` SET `minlevel` = 70, `maxlevel` = 70 WHERE `entry` IN (23682, 23775,23694, 23545); |
12 changes: 12 additions & 0 deletions
12
src/Bracket_80_1/sql/world/progression_1_19_hallows_end_down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
SET @QUESTID = 50000; | ||
DELETE FROM `quest_template` WHERE `ID` = @QUESTID; | ||
|
||
DELETE FROM `item_loot_template` WHERE `entry` = 54516 AND `item` IN (49426, 49128, 49126); | ||
INSERT INTO `item_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES | ||
(54516,49126,0,2,0,1,0,1,1,'Loot-Filled Pumpkin - The Horseman\'s Horrific Helm'), | ||
(54516,49128,0,2,0,1,0,1,1,'Loot-Filled Pumpkin - The Horseman\'s Baleful Blade'), | ||
(54516,49426,0,100,0,1,0,2,2,'Loot-Filled Pumpkin - Emblem of Frost'); | ||
|
||
UPDATE `creature_template` SET `minlevel` = 80, `maxlevel` = 80 WHERE `entry` IN (23682, 23775,23694, 23545); | ||
|
||
|