mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-23 05:36:23 +00:00
fix(Scripts/Misc): Replace some AddItem/CreateItem with spells (#9006)
Co-authored-by: offl <11556157+offl@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1637191609234345200');
|
||||
|
||||
UPDATE `spell_dbc` SET `effect_1` = 24, `ImplicitTargetA_1` = 25, `EffectItemType_1` = 32688 WHERE `id` = 40804;
|
||||
UPDATE `spell_dbc` SET `effect_1` = 24, `ImplicitTargetA_1` = 25, `EffectItemType_1` = 32689 WHERE `id` = 40805;
|
||||
UPDATE `spell_dbc` SET `effect_1` = 24, `ImplicitTargetA_1` = 25, `EffectItemType_1` = 32690 WHERE `id` = 40806;
|
||||
UPDATE `spell_dbc` SET `effect_1` = 24, `ImplicitTargetA_1` = 25, `EffectItemType_1` = 32691 WHERE `id` = 40807;
|
||||
UPDATE `spell_dbc` SET `effect_1` = 24, `ImplicitTargetA_1` = 25, `EffectItemType_1` = 32692 WHERE `id` = 40808;
|
||||
UPDATE `spell_dbc` SET `effect_1` = 24, `ImplicitTargetA_1` = 25, `EffectItemType_1` = 32693 WHERE `id` = 40809;
|
||||
UPDATE `spell_dbc` SET `effect_1` = 24, `ImplicitTargetA_1` = 25, `EffectItemType_1` = 32700 WHERE `id` = 40908;
|
||||
UPDATE `spell_dbc` SET `effect_1` = 24, `ImplicitTargetA_1` = 25, `EffectItemType_1` = 32701 WHERE `id` = 40910;
|
||||
UPDATE `spell_dbc` SET `effect_1` = 24, `ImplicitTargetA_1` = 25, `EffectItemType_1` = 32702 WHERE `id` = 40911;
|
||||
UPDATE `spell_dbc` SET `effect_1` = 24, `ImplicitTargetA_1` = 25, `EffectItemType_1` = 32703 WHERE `id` = 40912;
|
||||
UPDATE `spell_dbc` SET `effect_1` = 24, `ImplicitTargetA_1` = 25, `EffectItemType_1` = 32704 WHERE `id` = 40913;
|
||||
UPDATE `spell_dbc` SET `effect_1` = 24, `ImplicitTargetA_1` = 25, `EffectItemType_1` = 32705 WHERE `id` = 40914;
|
||||
UPDATE `spell_dbc` SET `effect_1` = 24, `ImplicitTargetA_1` = 25, `EffectItemType_1` = 32706 WHERE `id` = 40915;
|
||||
UPDATE `spell_dbc` SET `effect_1` = 24, `ImplicitTargetA_1` = 25, `EffectItemType_1` = 32707 WHERE `id` = 40916;
|
||||
UPDATE `spell_dbc` SET `effect_1` = 24, `ImplicitTargetA_1` = 25, `EffectItemType_1` = 32708 WHERE `id` = 40918;
|
||||
UPDATE `spell_dbc` SET `effect_1` = 24, `ImplicitTargetA_1` = 25, `EffectItemType_1` = 32709 WHERE `id` = 40919;
|
||||
UPDATE `spell_dbc` SET `effect_1` = 24, `ImplicitTargetA_1` = 25, `EffectItemType_1` = 32710 WHERE `id` = 40920;
|
||||
UPDATE `spell_dbc` SET `effect_1` = 24, `ImplicitTargetA_1` = 25, `EffectItemType_1` = 32711 WHERE `id` = 40921;
|
||||
UPDATE `spell_dbc` SET `effect_1` = 24, `ImplicitTargetA_1` = 25, `EffectItemType_1` = 32712 WHERE `id` = 40922;
|
||||
UPDATE `spell_dbc` SET `effect_1` = 24, `ImplicitTargetA_1` = 25, `EffectItemType_1` = 32713 WHERE `id` = 40923;
|
||||
@@ -7436,6 +7436,24 @@ void SpellMgr::LoadDbcDataCorrections()
|
||||
spellInfo->AttributesEx3 |= SPELL_ATTR3_ALWAYS_HIT;
|
||||
});
|
||||
|
||||
// Serverside - Summon Arcane Disruptor
|
||||
ApplySpellFix({ 49591 }, [](SpellEntry* spellInfo)
|
||||
{
|
||||
spellInfo->ProcChance = 101;
|
||||
spellInfo->Effect[1] = 24;
|
||||
spellInfo->EffectImplicitTargetA[1] = 25;
|
||||
spellInfo->EffectItemType[1] = 37889;
|
||||
});
|
||||
|
||||
// Serverside - Create Rocket Pack
|
||||
ApplySpellFix({ 70055 }, [](SpellEntry* spellInfo)
|
||||
{
|
||||
spellInfo->ProcChance = 101;
|
||||
spellInfo->Effect[1] = 24;
|
||||
spellInfo->EffectImplicitTargetA[1] = 25;
|
||||
spellInfo->EffectItemType[1] = 49278;
|
||||
});
|
||||
|
||||
// Ashenvale Outrunner Sneak
|
||||
// Stealth
|
||||
ApplySpellFix({ 20540, 32199 }, [](SpellEntry* spellInfo)
|
||||
|
||||
@@ -670,16 +670,24 @@ public:
|
||||
|
||||
enum CreateHeartCandy
|
||||
{
|
||||
ITEM_HEART_CANDY_1 = 21818,
|
||||
ITEM_HEART_CANDY_2 = 21817,
|
||||
ITEM_HEART_CANDY_3 = 21821,
|
||||
ITEM_HEART_CANDY_4 = 21819,
|
||||
ITEM_HEART_CANDY_5 = 21816,
|
||||
ITEM_HEART_CANDY_6 = 21823,
|
||||
ITEM_HEART_CANDY_7 = 21822,
|
||||
ITEM_HEART_CANDY_8 = 21820,
|
||||
SPELL_CREATE_HEART_CANDY_1 = 26668,
|
||||
SPELL_CREATE_HEART_CANDY_2 = 26670,
|
||||
SPELL_CREATE_HEART_CANDY_3 = 26671,
|
||||
SPELL_CREATE_HEART_CANDY_4 = 26672,
|
||||
SPELL_CREATE_HEART_CANDY_5 = 26673,
|
||||
SPELL_CREATE_HEART_CANDY_6 = 26674,
|
||||
SPELL_CREATE_HEART_CANDY_7 = 26675,
|
||||
SPELL_CREATE_HEART_CANDY_8 = 26676
|
||||
};
|
||||
|
||||
std::array<uint32, 8> constexpr CreateHeartCandySpells =
|
||||
{
|
||||
SPELL_CREATE_HEART_CANDY_1, SPELL_CREATE_HEART_CANDY_2, SPELL_CREATE_HEART_CANDY_3,
|
||||
SPELL_CREATE_HEART_CANDY_4, SPELL_CREATE_HEART_CANDY_5, SPELL_CREATE_HEART_CANDY_6,
|
||||
SPELL_CREATE_HEART_CANDY_7, SPELL_CREATE_HEART_CANDY_8
|
||||
};
|
||||
|
||||
// 26678 - Create Heart Candy
|
||||
class spell_item_create_heart_candy : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
@@ -689,17 +697,19 @@ public:
|
||||
{
|
||||
PrepareSpellScript(spell_item_create_heart_candy_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo(CreateHeartCandySpells);
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
if (!GetHitUnit() || !GetHitUnit()->ToPlayer())
|
||||
return;
|
||||
if (Player* target = GetHitUnit()->ToPlayer())
|
||||
{
|
||||
target->CastSpell(target, Acore::Containers::SelectRandomContainerElement(CreateHeartCandySpells), true);
|
||||
}
|
||||
|
||||
Player* target = GetHitUnit()->ToPlayer();
|
||||
|
||||
static const uint32 items[] = {ITEM_HEART_CANDY_1, ITEM_HEART_CANDY_2, ITEM_HEART_CANDY_3, ITEM_HEART_CANDY_4, ITEM_HEART_CANDY_5, ITEM_HEART_CANDY_6, ITEM_HEART_CANDY_7, ITEM_HEART_CANDY_8};
|
||||
|
||||
target->AddItem(items[urand(0, 7)], 1);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
|
||||
@@ -1404,6 +1404,7 @@ enum chromie
|
||||
ITEM_ARCANE_DISRUPTOR = 37888,
|
||||
QUEST_DISPELLING_ILLUSIONS = 13149,
|
||||
QUEST_A_ROYAL_ESCORT = 13151,
|
||||
SPELL_SUMMON_ARCANE_DISRUPTOR = 49591
|
||||
};
|
||||
|
||||
class npc_cos_chromie_start : public CreatureScript
|
||||
@@ -1411,44 +1412,66 @@ class npc_cos_chromie_start : public CreatureScript
|
||||
public:
|
||||
npc_cos_chromie_start() : CreatureScript("npc_cos_chromie_start") { }
|
||||
|
||||
bool OnQuestAccept(Player*, Creature* creature, const Quest* pQuest) override
|
||||
struct npc_cos_chromie_startAI : public ScriptedAI
|
||||
{
|
||||
if (pQuest->GetQuestId() == QUEST_DISPELLING_ILLUSIONS)
|
||||
if (InstanceScript* pInstance = creature->GetInstanceScript())
|
||||
pInstance->SetData(DATA_SHOW_CRATES, 1);
|
||||
npc_cos_chromie_startAI(Creature* creature) : ScriptedAI(creature) {}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 /*action*/) override
|
||||
{
|
||||
// final menu id, show crates if hidden and add item if missing
|
||||
if (player->PlayerTalkClass->GetGossipMenu().GetMenuId() == 9595)
|
||||
bool OnQuestAccept(Player*, Creature* creature, const Quest* pQuest)
|
||||
{
|
||||
if (InstanceScript* pInstance = creature->GetInstanceScript())
|
||||
if (pInstance->GetData(DATA_ARTHAS_EVENT) == COS_PROGRESS_NOT_STARTED)
|
||||
pInstance->SetData(DATA_SHOW_CRATES, 1);
|
||||
|
||||
if (!player->HasItemCount(ITEM_ARCANE_DISRUPTOR))
|
||||
player->AddItem(ITEM_ARCANE_DISRUPTOR, 1);
|
||||
}
|
||||
// Skip Event
|
||||
else if (player->PlayerTalkClass->GetGossipMenu().GetMenuId() == 11277)
|
||||
{
|
||||
if (InstanceScript* pInstance = creature->GetInstanceScript())
|
||||
if (pQuest->GetQuestId() == QUEST_DISPELLING_ILLUSIONS)
|
||||
{
|
||||
if (pInstance->GetData(DATA_ARTHAS_EVENT) == COS_PROGRESS_NOT_STARTED)
|
||||
if (InstanceScript* pInstance = creature->GetInstanceScript())
|
||||
{
|
||||
pInstance->SetData(DATA_ARTHAS_EVENT, COS_PROGRESS_FINISHED_INTRO);
|
||||
if (Creature* arthas = ObjectAccessor::GetCreature(*creature, pInstance->GetGuidData(DATA_ARTHAS)))
|
||||
arthas->AI()->Reset();
|
||||
pInstance->SetData(DATA_SHOW_CRATES, 1);
|
||||
}
|
||||
player->NearTeleportTo(LeaderIntroPos2.GetPositionX(), LeaderIntroPos2.GetPositionY(), LeaderIntroPos2.GetPositionZ(), LeaderIntroPos2.GetOrientation());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// return false to display last windows
|
||||
return false;
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 /*action*/)
|
||||
{
|
||||
// final menu id, show crates if hidden and add item if missing
|
||||
if (player->PlayerTalkClass->GetGossipMenu().GetMenuId() == 9595)
|
||||
{
|
||||
if (InstanceScript* pInstance = creature->GetInstanceScript())
|
||||
{
|
||||
if (pInstance->GetData(DATA_ARTHAS_EVENT) == COS_PROGRESS_NOT_STARTED)
|
||||
{
|
||||
pInstance->SetData(DATA_SHOW_CRATES, 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (!player->HasItemCount(ITEM_ARCANE_DISRUPTOR))
|
||||
{
|
||||
me->CastSpell(player, SPELL_SUMMON_ARCANE_DISRUPTOR);
|
||||
}
|
||||
}
|
||||
// Skip Event
|
||||
else if (player->PlayerTalkClass->GetGossipMenu().GetMenuId() == 11277)
|
||||
{
|
||||
if (InstanceScript* pInstance = creature->GetInstanceScript())
|
||||
{
|
||||
if (pInstance->GetData(DATA_ARTHAS_EVENT) == COS_PROGRESS_NOT_STARTED)
|
||||
{
|
||||
pInstance->SetData(DATA_ARTHAS_EVENT, COS_PROGRESS_FINISHED_INTRO);
|
||||
if (Creature* arthas = ObjectAccessor::GetCreature(*creature, pInstance->GetGuidData(DATA_ARTHAS)))
|
||||
{
|
||||
arthas->AI()->Reset();
|
||||
}
|
||||
}
|
||||
player->NearTeleportTo(LeaderIntroPos2.GetPositionX(), LeaderIntroPos2.GetPositionY(), LeaderIntroPos2.GetPositionZ(), LeaderIntroPos2.GetOrientation());
|
||||
}
|
||||
}
|
||||
|
||||
// return false to display last windows
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetCullingOfStratholmeAI<npc_cos_chromie_startAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -169,6 +169,7 @@ enum Spells
|
||||
SPELL_ON_ORGRIMS_HAMMER_DECK = 70121,
|
||||
|
||||
// Rocket Pack
|
||||
SPELL_CREATE_ROCKET_PACK = 70055,
|
||||
SPELL_ROCKET_PACK_DAMAGE = 69193,
|
||||
SPELL_ROCKET_BURST = 69192,
|
||||
SPELL_ROCKET_PACK_USEABLE = 70348,
|
||||
@@ -1423,7 +1424,7 @@ public:
|
||||
|
||||
void sGossipSelect(Player* player, uint32 /*sender*/, uint32 /*action*/) override
|
||||
{
|
||||
player->AddItem(ITEM_GOBLIN_ROCKET_PACK, 1);
|
||||
me->CastSpell(player, SPELL_CREATE_ROCKET_PACK);
|
||||
player->PlayerTalkClass->SendCloseGossip();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1728,83 +1728,52 @@ class spell_item_make_a_wish : public SpellScript
|
||||
}
|
||||
};
|
||||
|
||||
enum MingoFortune
|
||||
{
|
||||
SPELL_CREATE_FORTUNE_1 = 40804,
|
||||
SPELL_CREATE_FORTUNE_2 = 40805,
|
||||
SPELL_CREATE_FORTUNE_3 = 40806,
|
||||
SPELL_CREATE_FORTUNE_4 = 40807,
|
||||
SPELL_CREATE_FORTUNE_5 = 40808,
|
||||
SPELL_CREATE_FORTUNE_6 = 40809,
|
||||
SPELL_CREATE_FORTUNE_7 = 40908,
|
||||
SPELL_CREATE_FORTUNE_8 = 40910,
|
||||
SPELL_CREATE_FORTUNE_9 = 40911,
|
||||
SPELL_CREATE_FORTUNE_10 = 40912,
|
||||
SPELL_CREATE_FORTUNE_11 = 40913,
|
||||
SPELL_CREATE_FORTUNE_12 = 40914,
|
||||
SPELL_CREATE_FORTUNE_13 = 40915,
|
||||
SPELL_CREATE_FORTUNE_14 = 40916,
|
||||
SPELL_CREATE_FORTUNE_15 = 40918,
|
||||
SPELL_CREATE_FORTUNE_16 = 40919,
|
||||
SPELL_CREATE_FORTUNE_17 = 40920,
|
||||
SPELL_CREATE_FORTUNE_18 = 40921,
|
||||
SPELL_CREATE_FORTUNE_19 = 40922,
|
||||
SPELL_CREATE_FORTUNE_20 = 40923
|
||||
};
|
||||
|
||||
std::array<uint32, 20> const CreateFortuneSpells =
|
||||
{
|
||||
SPELL_CREATE_FORTUNE_1, SPELL_CREATE_FORTUNE_2, SPELL_CREATE_FORTUNE_3, SPELL_CREATE_FORTUNE_4, SPELL_CREATE_FORTUNE_5,
|
||||
SPELL_CREATE_FORTUNE_6, SPELL_CREATE_FORTUNE_7, SPELL_CREATE_FORTUNE_8, SPELL_CREATE_FORTUNE_9, SPELL_CREATE_FORTUNE_10,
|
||||
SPELL_CREATE_FORTUNE_11, SPELL_CREATE_FORTUNE_12, SPELL_CREATE_FORTUNE_13, SPELL_CREATE_FORTUNE_14, SPELL_CREATE_FORTUNE_15,
|
||||
SPELL_CREATE_FORTUNE_16, SPELL_CREATE_FORTUNE_17, SPELL_CREATE_FORTUNE_18, SPELL_CREATE_FORTUNE_19, SPELL_CREATE_FORTUNE_20
|
||||
};
|
||||
|
||||
// http://www.wowhead.com/item=32686 Mingo's Fortune Giblets
|
||||
// 40802 Mingo's Fortune Generator
|
||||
class spell_item_mingos_fortune_generator : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_item_mingos_fortune_generator);
|
||||
|
||||
void HandleDummy(SpellEffIndex effIndex)
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
// Selecting one from Bloodstained Fortune item
|
||||
uint32 newitemid;
|
||||
switch (urand(1, 20))
|
||||
{
|
||||
case 1:
|
||||
newitemid = 32688;
|
||||
break;
|
||||
case 2:
|
||||
newitemid = 32689;
|
||||
break;
|
||||
case 3:
|
||||
newitemid = 32690;
|
||||
break;
|
||||
case 4:
|
||||
newitemid = 32691;
|
||||
break;
|
||||
case 5:
|
||||
newitemid = 32692;
|
||||
break;
|
||||
case 6:
|
||||
newitemid = 32693;
|
||||
break;
|
||||
case 7:
|
||||
newitemid = 32700;
|
||||
break;
|
||||
case 8:
|
||||
newitemid = 32701;
|
||||
break;
|
||||
case 9:
|
||||
newitemid = 32702;
|
||||
break;
|
||||
case 10:
|
||||
newitemid = 32703;
|
||||
break;
|
||||
case 11:
|
||||
newitemid = 32704;
|
||||
break;
|
||||
case 12:
|
||||
newitemid = 32705;
|
||||
break;
|
||||
case 13:
|
||||
newitemid = 32706;
|
||||
break;
|
||||
case 14:
|
||||
newitemid = 32707;
|
||||
break;
|
||||
case 15:
|
||||
newitemid = 32708;
|
||||
break;
|
||||
case 16:
|
||||
newitemid = 32709;
|
||||
break;
|
||||
case 17:
|
||||
newitemid = 32710;
|
||||
break;
|
||||
case 18:
|
||||
newitemid = 32711;
|
||||
break;
|
||||
case 19:
|
||||
newitemid = 32712;
|
||||
break;
|
||||
case 20:
|
||||
newitemid = 32713;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
return ValidateSpellInfo(CreateFortuneSpells);
|
||||
}
|
||||
|
||||
CreateItem(effIndex, newitemid);
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
GetCaster()->CastSpell(GetCaster(), Acore::Containers::SelectRandomContainerElement(CreateFortuneSpells), true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
|
||||
Reference in New Issue
Block a user