aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/3.3.5/2025_06_29_00_world.sql19
-rw-r--r--src/server/scripts/Outland/zone_blades_edge_mountains.cpp131
2 files changed, 150 insertions, 0 deletions
diff --git a/sql/updates/world/3.3.5/2025_06_29_00_world.sql b/sql/updates/world/3.3.5/2025_06_29_00_world.sql
new file mode 100644
index 00000000000..ef1e76964fc
--- /dev/null
+++ b/sql/updates/world/3.3.5/2025_06_29_00_world.sql
@@ -0,0 +1,19 @@
+DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_bem_q10720_poison_keg';
+DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_bem_coax_marmot';
+DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_bem_charm_rexxars_rodent';
+INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
+(38629, 'spell_bem_q10720_poison_keg'),
+(38544, 'spell_bem_coax_marmot'),
+(38586, 'spell_bem_charm_rexxars_rodent');
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=38629;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(13, 1, 38629, 0, 0, 31, 0, 3, 22356, 0, 0, 0, 0, '', 'Poison Keg Targets [DND]Green Spot Grog Keg Credit'),
+(13, 1, 38629, 0, 1, 31, 0, 3, 22367, 0, 0, 0, 0, '', 'Poison Keg Targets [DND]Ripe Moonshine Keg Credit'),
+(13, 1, 38629, 0, 2, 31, 0, 3, 22368, 0, 0, 0, 0, '', 'Poison Keg Targets [DND]Fermented Seed Beer Keg Credit');
+
+UPDATE `creature_template` SET `ScriptName`='npc_q10720_keg_credit' WHERE `entry` IN (22356,22367,22368);
+UPDATE `creature_template` SET `ScriptName`='npc_q10720_marmot' WHERE `entry`=22189;
+
+UPDATE `creature_template` SET `AIName`='' WHERE `entry`=20330;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=20330;
diff --git a/src/server/scripts/Outland/zone_blades_edge_mountains.cpp b/src/server/scripts/Outland/zone_blades_edge_mountains.cpp
index 84da3ebedde..b4a8fae14ab 100644
--- a/src/server/scripts/Outland/zone_blades_edge_mountains.cpp
+++ b/src/server/scripts/Outland/zone_blades_edge_mountains.cpp
@@ -30,6 +30,7 @@ EndContentData */
#include "ScriptMgr.h"
#include "CellImpl.h"
#include "CreatureAIImpl.h"
+#include "DBCStores.h"
#include "GameObjectAI.h"
#include "GridNotifiersImpl.h"
#include "MotionMaster.h"
@@ -1069,6 +1070,131 @@ class spell_bem_wicked_strong_fetish : public SpellScript
}
};
+enum TheSmallestCreature
+{
+ SPELL_CHARM_REXXARS_RODENT = 38586,
+ SPELL_COAX_MARMOT = 38544,
+ SPELL_STEALTH_MARMOT = 42347,
+ SPELL_GREEN_EYE_GROG_CREDIT = 38996,
+ SPELL_RIPE_MOONSHINE_CREDIT = 38997,
+ SPELL_FERMENTED_SEED_BEER_CREDIT = 38998,
+
+ NPC_MARMOT = 22189,
+ NPC_GREEN_SPOT_GROG_KEG_CREDIT = 22356,
+ NPC_RIPE_MOONSHINE_KEG_CREDIT = 22367,
+ NPC_FERMENTED_SEED_BEER_KEG_CREDIT = 22368
+};
+
+struct npc_q10720_keg_credit : public ScriptedAI
+{
+ npc_q10720_keg_credit(Creature * creature) : ScriptedAI(creature)
+ {
+ // Neccessary hack to allow spell 38629 to hit the keg credit (visibility is checked against the summoner, not the caster)
+ creature->m_invisibilityDetect.AddFlag(INVISIBILITY_UNK4);
+ }
+};
+
+struct npc_q10720_marmot : public ScriptedAI
+{
+ using ScriptedAI::ScriptedAI;
+
+ void IsSummonedBy(WorldObject* summoner) override
+ {
+ summoner->CastSpell(me, SPELL_CHARM_REXXARS_RODENT, true);
+ }
+};
+
+// 38544 - Coax Marmot
+class spell_bem_coax_marmot : public AuraScript
+{
+ PrepareAuraScript(spell_bem_coax_marmot);
+
+ void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ // prevent loading the aura from db
+ if (GetTarget()->GetCharmedGUID().IsEmpty())
+ Remove();
+ }
+
+ void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ if (Creature* marmot = Object::ToCreature(GetTarget()->GetCharmed()))
+ if (marmot->GetUInt32Value(UNIT_CREATED_BY_SPELL) == SPELL_COAX_MARMOT)
+ marmot->DespawnOrUnsummon();
+ }
+
+ void Register() override
+ {
+ AfterEffectApply += AuraEffectApplyFn(spell_bem_coax_marmot::HandleEffectApply, EFFECT_1, SPELL_AURA_MOD_INVISIBILITY, AURA_EFFECT_HANDLE_REAL);
+ AfterEffectRemove += AuraEffectApplyFn(spell_bem_coax_marmot::HandleEffectRemove, EFFECT_1, SPELL_AURA_MOD_INVISIBILITY, AURA_EFFECT_HANDLE_REAL);
+ }
+};
+
+// 38586 - [DND]Charm Rexxar's Rodent
+class spell_bem_charm_rexxars_rodent : public AuraScript
+{
+ PrepareAuraScript(spell_bem_charm_rexxars_rodent);
+
+ void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ if (Unit* caster = GetCaster())
+ caster->RemoveAurasDueToSpell(SPELL_COAX_MARMOT);
+
+ if (Creature* creature = GetTarget()->ToCreature())
+ creature->DespawnOrUnsummon(1ms);
+ }
+
+ void Register() override
+ {
+ AfterEffectRemove += AuraEffectRemoveFn(spell_bem_charm_rexxars_rodent::OnRemove, EFFECT_0, SPELL_AURA_MOD_POSSESS, AURA_EFFECT_HANDLE_REAL);
+ }
+};
+
+// 38629 - Poison Keg
+class spell_bem_q10720_poison_keg : public SpellScript
+{
+ PrepareSpellScript(spell_bem_q10720_poison_keg);
+
+ bool Validate(SpellInfo const* /*spellEntry*/) override
+ {
+ return ValidateSpellInfo(
+ {
+ SPELL_GREEN_EYE_GROG_CREDIT,
+ SPELL_RIPE_MOONSHINE_CREDIT,
+ SPELL_FERMENTED_SEED_BEER_CREDIT
+ });
+ }
+
+ void HandleScriptEffect(SpellEffIndex /*effIndex*/)
+ {
+ if (Player* player = GetCaster()->GetCharmerOrOwnerPlayerOrPlayerItself())
+ {
+ uint32 spellId = 0;
+ switch (GetHitUnit()->GetEntry())
+ {
+ case NPC_GREEN_SPOT_GROG_KEG_CREDIT:
+ spellId = SPELL_GREEN_EYE_GROG_CREDIT;
+ break;
+ case NPC_RIPE_MOONSHINE_KEG_CREDIT:
+ spellId = SPELL_RIPE_MOONSHINE_CREDIT;
+ break;
+ case NPC_FERMENTED_SEED_BEER_KEG_CREDIT:
+ spellId = SPELL_FERMENTED_SEED_BEER_CREDIT;
+ break;
+ default:
+ return;
+ }
+
+ player->CastSpell(nullptr, spellId, true);
+ }
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_bem_q10720_poison_keg::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+};
+
void AddSC_blades_edge_mountains()
{
new npc_nether_drake();
@@ -1080,4 +1206,9 @@ void AddSC_blades_edge_mountains()
new spell_oscillating_field();
RegisterSpellScript(spell_bem_dispelling_analysis);
RegisterSpellScript(spell_bem_wicked_strong_fetish);
+ RegisterCreatureAI(npc_q10720_keg_credit);
+ RegisterCreatureAI(npc_q10720_marmot);
+ RegisterSpellScript(spell_bem_coax_marmot);
+ RegisterSpellScript(spell_bem_charm_rexxars_rodent);
+ RegisterSpellScript(spell_bem_q10720_poison_keg);
}