From 8cbe63f110ed0515974ac607f076ec87f2c5be58 Mon Sep 17 00:00:00 2001 From: Gultask <100873791+Gultask@users.noreply.github.com> Date: Sun, 5 Mar 2023 17:32:04 -0300 Subject: [PATCH] chore(Core/Scripts): Use serverside spell instead of SummonCreature for Nether-wraith Beacon (#15285) --- .../rev_1678042235460663800.sql | 8 ++++++ src/server/scripts/World/item_scripts.cpp | 25 ------------------- 2 files changed, 8 insertions(+), 25 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1678042235460663800.sql diff --git a/data/sql/updates/pending_db_world/rev_1678042235460663800.sql b/data/sql/updates/pending_db_world/rev_1678042235460663800.sql new file mode 100644 index 000000000..c4a6d5b30 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1678042235460663800.sql @@ -0,0 +1,8 @@ +-- +UPDATE `spell_dbc` SET `Effect_1` = 28, `EffectMiscValueB_1` = 64, `EffectBasePoints_1` = 0 WHERE `ID` = 39111; + +DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId` = 17) AND (`SourceEntry` = 39105); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(17, 0, 39105, 0, 0, 47, 0, 10832, 8, 0, 0, 0, 0, '', 'Player can only use Nether-wraith Beacon (31742) while quest Becoming a Spellfire Tailor (10832) is in progress'); + +UPDATE `item_template` SET `ScriptName` = '' WHERE (`entry` = 31742); diff --git a/src/server/scripts/World/item_scripts.cpp b/src/server/scripts/World/item_scripts.cpp index fff776729..c7f59a982 100644 --- a/src/server/scripts/World/item_scripts.cpp +++ b/src/server/scripts/World/item_scripts.cpp @@ -23,7 +23,6 @@ SDCategory: Items EndScriptData */ /* ContentData -item_nether_wraith_beacon(i31742) Summons creatures for quest Becoming a Spellfire Tailor (q10832) item_flying_machine(i34060, i34061) Engineering crafted flying machines item_gor_dreks_ointment(i30175) Protecting Our Own(q10488) item_only_for_flight Items which should only useable while flying @@ -80,29 +79,6 @@ public: } }; -/*##### -# item_nether_wraith_beacon -#####*/ - -class item_nether_wraith_beacon : public ItemScript -{ -public: - item_nether_wraith_beacon() : ItemScript("item_nether_wraith_beacon") { } - - bool OnUse(Player* player, Item* /*item*/, SpellCastTargets const& /*targets*/) override - { - if (player->GetQuestStatus(10832) == QUEST_STATUS_INCOMPLETE) - { - if (Creature* nether = player->SummonCreature(22408, player->GetPositionX(), player->GetPositionY() + 20, player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 180000)) - nether->AI()->AttackStart(player); - - if (Creature* nether = player->SummonCreature(22408, player->GetPositionX(), player->GetPositionY() - 20, player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 180000)) - nether->AI()->AttackStart(player); - } - return false; - } -}; - /*##### # item_gor_dreks_ointment #####*/ @@ -272,7 +248,6 @@ public: void AddSC_item_scripts() { new item_only_for_flight(); - new item_nether_wraith_beacon(); new item_gor_dreks_ointment(); new item_incendiary_explosives(); new item_mysterious_egg();