Trinitycore: [Script/SQL/Fix] Fumping and The Big Bone Worm

Created on 8 Jan 2014  路  43Comments  路  Source: TrinityCore/TrinityCore

TrinityCore rev. b1431bdd47a2+ 2013-12-29 23:31:07 -0330 (master branch) (Win32, Release) (worldserver-daemon)
(The + is because of this script.)
Using World DB: TDB 335.52

I take NO credit for this! Only credit I take is testing to see if it works.

ALL Credit goes to @Discover- it is his script!

SQL...

-- Addition to spell_script_names for Fumping and The Big Bone Worm
DELETE FROM spell_script_names WHERE spell_id IN (39238,39246);
INSERT INTO spell_script_names VALUES (39238,'spell_fumping_bone_sifters'),(39246,'spell_fumping_gigantic_bone_worm ');

Script... Add to: scripts > Source Files > spell_quest.cpp

enum Fumping
{
    NPC_MATURE_BONE_SIFTER  = 22482,
    NPC_SAND_GNOME          = 22483,
    NPC_HAISHULUD           = 22038,
};

// Quests 'Fumping' and 'The Big Bone Worm'
class spell_fumping_bone_sifters : public SpellScriptLoader
{
    public:
        spell_fumping_bone_sifters() : SpellScriptLoader("spell_fumping_bone_sifters") { }

        class spell_fumping_bone_sifters_SpellScript : public SpellScript
        {
            PrepareSpellScript(spell_fumping_bone_sifters_SpellScript)

            void HandleDummy(SpellEffIndex /*effIndex*/)
            {
                if (Player* player = GetCaster()->ToPlayer())
                    urand(0, 1) == 0 ? player->SummonCreature(NPC_MATURE_BONE_SIFTER, player->GetPositionX()+rand()%10, player->GetPositionY()+rand()%10, player->GetPositionZ()+5, 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0) : player->SummonCreature(NPC_SAND_GNOME, player->GetPositionX()+rand()%10, player->GetPositionY()+rand()%10, player->GetPositionZ()+5, 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0);
            }

            void Register()
            {
                OnEffectHit += SpellEffectFn(spell_fumping_bone_sifters_SpellScript::HandleDummy, EFFECT_ALL, SPELL_EFFECT_ANY);
            }
        };

        SpellScript* GetSpellScript() const
        {
            return new spell_fumping_bone_sifters_SpellScript();
        }
};

class spell_fumping_gigantic_bone_worm : public SpellScriptLoader
{
    public:
        spell_fumping_gigantic_bone_worm() : SpellScriptLoader("spell_fumping_gigantic_bone_worm") { }

        class spell_fumping_gigantic_bone_worm_SpellScript : public SpellScript
        {
            PrepareSpellScript(spell_fumping_gigantic_bone_worm_SpellScript)

            void HandleDummy(SpellEffIndex /*effIndex*/)
            {
                if (Player* player = GetCaster()->ToPlayer())
                {
                    switch (urand(1, 3))
                    {
                        case 1:
                            player->SummonCreature(NPC_MATURE_BONE_SIFTER, player->GetPositionX()+rand()%10, player->GetPositionY()+rand()%10, player->GetPositionZ()+5, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 300000);
                            player->SummonCreature(NPC_MATURE_BONE_SIFTER, player->GetPositionX()+rand()%10, player->GetPositionY()-rand()%10, player->GetPositionZ()+5, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 300000);
                            player->SummonCreature(NPC_MATURE_BONE_SIFTER, player->GetPositionX()-rand()%10, player->GetPositionY()+rand()%10, player->GetPositionZ()+5, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 300000);
                            break;
                        case 2:
                            player->SummonCreature(NPC_SAND_GNOME, player->GetPositionX()+rand()%10, player->GetPositionY()+rand()%10, player->GetPositionZ()+5, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 300000);
                            player->SummonCreature(NPC_SAND_GNOME, player->GetPositionX()+rand()%10, player->GetPositionY()-rand()%10, player->GetPositionZ()+5, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 300000);
                            player->SummonCreature(NPC_SAND_GNOME, player->GetPositionX()-rand()%10, player->GetPositionY()+rand()%10, player->GetPositionZ()+5, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 300000);
                            break;
                        case 3:
                            player->SummonCreature(NPC_HAISHULUD, player->GetPositionX()+rand()%5, player->GetPositionY()+rand()%5, player->GetPositionZ()+5, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
                            break;
                    }
                }
            }

            void Register()
            {
                OnEffectHit += SpellEffectFn(spell_fumping_gigantic_bone_worm_SpellScript::HandleDummy, EFFECT_ALL, SPELL_EFFECT_ANY);
            }
        };

        SpellScript* GetSpellScript() const
        {
            return new spell_fumping_gigantic_bone_worm_SpellScript();
        }
};

Don't Forget to Add:

new spell_fumping_bone_sifters();
new spell_fumping_gigantic_bone_worm();

to the bottom of spell_quest.cpp like I did at first. (I'm new to c++ so it was a noob mistake lol)

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Comp-C++Script Feedback-FixOutdatedMissingWIP Sub-Quests Sub-Spells

Most helpful comment

Confirmend issue:
TrinityCore rev. ed2c2941a74e
Fumping does not spawn the worm.

All 43 comments

Don't worry. This is a learning project, and you merely learned something. It looks like that same code could be added to both master and 4.3.4 branches, too.

Actually, how about a ready to use patch file, like:

--- orig/src/server/scripts/Spells/spell_quest.cpp  2013-12-30 21:55:18.810506052 -0500
+++ Kylroi/src/server/scripts/Spells/spell_quest.cpp    2014-01-08 18:17:35.570562481 -0500
@@ -2241,6 +2241,85 @@ class spell_q12919_gymers_throw : public
         }
 };

+enum Fumping
+{
+    NPC_MATURE_BONE_SIFTER  = 22482,
+    NPC_SAND_GNOME          = 22483,
+    NPC_HAISHULUD           = 22038,
+};
+ 
+// Quests 'Fumping' and 'The Big Bone Worm'
+class spell_fumping_bone_sifters : public SpellScriptLoader
+{
+    public:
+        spell_fumping_bone_sifters() : SpellScriptLoader("spell_fumping_bone_sifters") { }
+ 
+        class spell_fumping_bone_sifters_SpellScript : public SpellScript
+        {
+            PrepareSpellScript(spell_fumping_bone_sifters_SpellScript)
+ 
+            void HandleDummy(SpellEffIndex /*effIndex*/)
+            {
+                if (Player* player = GetCaster()->ToPlayer())
+                    urand(0, 1) == 0 ? player->SummonCreature(NPC_MATURE_BONE_SIFTER, player->GetPositionX()+rand()%10, player->GetPositionY()+rand()%10, player->GetPositionZ()+5, 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0) : player->SummonCreature(NPC_SAND_GNOME, player->GetPositionX()+rand()%10, player->GetPositionY()+rand()%10, player->GetPositionZ()+5, 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0);
+            }
+ 
+            void Register()
+            {
+                OnEffectHit += SpellEffectFn(spell_fumping_bone_sifters_SpellScript::HandleDummy, EFFECT_ALL, SPELL_EFFECT_ANY);
+            }
+        };
+ 
+        SpellScript* GetSpellScript() const
+        {
+            return new spell_fumping_bone_sifters_SpellScript();
+        }
+};
+ 
+class spell_fumping_gigantic_bone_worm : public SpellScriptLoader
+{
+    public:
+        spell_fumping_gigantic_bone_worm() : SpellScriptLoader("spell_fumping_gigantic_bone_worm") { }
+ 
+        class spell_fumping_gigantic_bone_worm_SpellScript : public SpellScript
+        {
+            PrepareSpellScript(spell_fumping_gigantic_bone_worm_SpellScript)
+ 
+            void HandleDummy(SpellEffIndex /*effIndex*/)
+            {
+                if (Player* player = GetCaster()->ToPlayer())
+                {
+                    switch (urand(1, 3))
+                    {
+                        case 1:
+                            player->SummonCreature(NPC_MATURE_BONE_SIFTER, player->GetPositionX()+rand()%10, player->GetPositionY()+rand()%10, player->GetPositionZ()+5, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 300000);
+                            player->SummonCreature(NPC_MATURE_BONE_SIFTER, player->GetPositionX()+rand()%10, player->GetPositionY()-rand()%10, player->GetPositionZ()+5, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 300000);
+                            player->SummonCreature(NPC_MATURE_BONE_SIFTER, player->GetPositionX()-rand()%10, player->GetPositionY()+rand()%10, player->GetPositionZ()+5, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 300000);
+                            break;
+                        case 2:
+                            player->SummonCreature(NPC_SAND_GNOME, player->GetPositionX()+rand()%10, player->GetPositionY()+rand()%10, player->GetPositionZ()+5, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 300000);
+                            player->SummonCreature(NPC_SAND_GNOME, player->GetPositionX()+rand()%10, player->GetPositionY()-rand()%10, player->GetPositionZ()+5, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 300000);
+                            player->SummonCreature(NPC_SAND_GNOME, player->GetPositionX()-rand()%10, player->GetPositionY()+rand()%10, player->GetPositionZ()+5, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 300000);
+                            break;
+                        case 3:
+                            player->SummonCreature(NPC_HAISHULUD, player->GetPositionX()+rand()%5, player->GetPositionY()+rand()%5, player->GetPositionZ()+5, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
+                            break;
+                    }
+                }
+            }
+ 
+            void Register()
+            {
+                OnEffectHit += SpellEffectFn(spell_fumping_gigantic_bone_worm_SpellScript::HandleDummy, EFFECT_ALL, SPELL_EFFECT_ANY);
+            }
+        };
+ 
+        SpellScript* GetSpellScript() const
+        {
+            return new spell_fumping_gigantic_bone_worm_SpellScript();
+        }
+};
+
 void AddSC_quest_spell_scripts()
 {
     new spell_q55_sacred_cleansing();
@@ -2295,4 +2374,6 @@ void AddSC_quest_spell_scripts()
     new spell_q12619_emblazon_runeblade_effect();
     new spell_q12919_gymers_grab();
     new spell_q12919_gymers_throw();
+    new spell_fumping_bone_sifters();
+    new spell_fumping_gigantic_bone_worm();
 }

This, of course, is for those familiar with adding a patch, but not comfortable with editing the source directly.

Or create a PR with fix :P

I don't know why @Discover- didn't add this to the core already, it does work. lol

I think I'll leave the PR aspect for someone else (like the developer who created the code in the first place).

@Raszagal mb cuz its dirty hack?

spellid: 39238 should randomly spawn Sand Gnomes _or_ Mature Bone Sifter - with this script u will spawn both at time! Thats cuz script overwrites all effects, but needs just effect 1.
spellid: 39246 should spawn 2-3 (not just 3) _or_ Hai'shulud - with this script u can spawn 2 Hai'shulud at time with gnomes LOL. Btw u need to kill clefthoof (target(?) dead body before use item) and despawn dead body on item use (effect 2, I think).

 player->SummonCreature(NPC_MATURE_BONE_SIFTER, player->GetPositionX()+rand()%10, player->GetPositionY()+rand()%10, player->GetPositionZ()+5, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 300000);

U like flyin mobs? =)
Why 5 minutes despawn time?
From comments and tactics "how to kill Hai'shulud" - mob should despawn after 2-3 minutes (script sets despawn time to 10(!) minutes).

player->SummonCreature(NPC_SAND_GNOME, player->GetPositionX()+rand()%10, player->GetPositionY()+rand()%10, player->GetPositionZ()+5, 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0);

TEMPSUMMON_DEAD_DESPAWN? sure?

All mobs after spawn should aggro u, not just spawn and stay (tried with hunt 70lvl) + gnomes should randomly say something.

P.S. Also, I believe these need to be added to spell_item.cpp not spell_quest.cpp ;p
P.P.S. https://github.com/TrinityCore/TrinityCore/issues/6293

Just for everyone's information, this was not pushed because it was not written to be TC-ready. If I recall correctly, I wrote it for a friend a really long time ago and didn't want to bother with all details.

Feel free to fix it up, @killradio.

I don't think @killradio knows how to code, just pick apart and/or attack the operation of what other people have written. I haven't seen any code from that person, but I could be mistaken when I say they can't code.

@Kylroi @Raszagal just if you don't know it^^

Use ```cpp for cpp code instead of ``` Use ```sql for sql code instead of ``` Use ```diff for patches/diffs instead of ```

Example:

sql -- ```sql INSERT INTO spell_script_names VALUES (39238,'spell_fumping_bone_sifters'),(39246,'spell_fumping_gigantic_bone_worm ');

-- ``` INSERT INTO spell_script_names VALUES (39238,'spell_fumping_bone_sifters'),(39246,'spell_fumping_gigantic_bone_worm ');

@FireEmerald: @Kylroi should have used the 'diff' tag, not 'cpp':

- herp derp
+ herpa derpa

Can someone provide a video of the quest?

@FireEmerald Thanks for the tip. I don't recall seeing that on the help page(s) for what could be done, or I might have actually used it. I'll keep it in mind for the future, though.

I got this https://gist.github.com/Nyeriah/08af22463fffca3901c2 for the second spell, but it kind of looks bad + I can't get the condition to work so it's not ready for TC.

The spell was meant to be cast _only_ when there's a dead clefthoof nearby, but atm it can be cast anywhere. @dr-j tried to fix it through conditions but it didn't work, SpellCastResult seems to be failing at it too, so, /shrug

Please change the quest name in the title, it is supposed to be Fumping, not "Frumping" :warning: (derogatory)

Anything here is valid? If it's c++ plz create a PR.

We never managed to make the cast conditions (that should require a dead clefthoof nearby) to work, otherwise the script at https://github.com/TrinityCore/TrinityCore/issues/11418#issuecomment-55811808 is valid

New SAI fix suggested by @Killyana in #14170

That SAI fix doesn't have anything to do with this directly. It just scripts the creatures

No it's just for the npc, the spell wowhead.com/spell=39246 must be scripted on cpp.

Any News ?

Still not fixed. BTW if i remember correctly on retail drums should appear around the characters.

Yes
We can only hope a dev shows a great heart.

Just to repeat what Killyana said:
"[...], the spell http://www.wowhead.com/spell=39246/fumping needs to be scripted on cpp." (in C++)


edit: for those of you who are not using SpellWork, but could use the info:

ID - 39246 Fumping
=================================================
Description: May bring up a gigantic bone worm. It may also bring up other unpleasant creatures.
ToolTip: Fumping
Category = 0, SpellIconID = 2280, activeIconID = 0, SpellVisual = (8969,0)
Family SPELLFAMILY_GENERIC, flag [0] 0x00000000 [1] 0x00000000 [2] 0x00000000

SpellSchoolMask = 1 (SPELL_SCHOOL_MASK_NORMAL)
DamageClass = 0 (SPELL_DAMAGE_CLASS_NONE)
PreventionType = 0 (SPELL_PREVENTION_TYPE_NONE)
=================================================
Attributes: 0x10800000 (SPELL_ATTR0_CASTABLE_WHILE_DEAD, SPELL_ATTR0_CANT_USED_IN_COMBAT)
AttributesEx1: 0x20000440 (SPELL_ATTR1_CHANNELED_2, SPELL_ATTR1_NO_THREAT, SPELL_ATTR1_CHANNEL_DISPLAY_SPELL_NAME)
AttributesEx2: 0x00000001 (SPELL_ATTR2_CAN_TARGET_DEAD)
=================================================
Spell Level = 0, base 0, max 0, maxTarget 0

Category = 0
DispelType = 0 (DISPEL_NONE)
Mechanic = 0 (MECHANIC_NONE)
SpellRange: (Id 12) "Interact Range":
    MinRange = 0, MinRangeFriendly = 0
    MaxRange = 5, MaxRangeFriendly = 5

Speed 1,00
CastingTime (Id 1) = 0,00
Duration: ID (28)  5000, 0, 5000
Interrupt Flags: 0x0000000F, AuraIF 0x0000000C, ChannelIF 0x0000000C

Allowed areas:
3697 - The Bone Wastes (Map: 530)

Chance = 101, charges - 0
=================================================
Effect 0: Id 6 (SPELL_EFFECT_APPLY_AURA)
BasePoints = 1
Targets (1, 0) (TARGET_UNIT_CASTER, NO_TARGET)
Aura Id 4 (SPELL_AURA_DUMMY), value = 1, misc = 0 (0), miscB = 0, periodic = 0

Effect 1: Id 3 (SPELL_EFFECT_DUMMY)
BasePoints = 1
Targets (18, 0) (TARGET_DEST_CASTER, NO_TARGET)

Effect 2: Id 3 (SPELL_EFFECT_DUMMY)
BasePoints = 1
Targets (38, 0) (TARGET_UNIT_NEARBY_ENTRY, NO_TARGET)

=================================================
Items using this spell:
   31825: Fumper - "An ancient drum."
=================================================
Missile data
Missile motion: Spin Around Caster Slow (3)
Missile count: 3
Missile Script body:
local outerWheelSpinRate = 180  -- 1 spin / sec
local outerWheelMag = 2.5           -- 1 yard
local missileAngle = outerWheelSpinRate * time

if (missileIndex > 0) then
    local anglePerMissile = 360 / (missileCount)
    missileAngle = missileAngle + anglePerMissile * missileIndex
end

transFront = outerWheelMag * cos ( missileAngle )
transRight = outerWheelMag * sin ( missileAngle )
transUp = -distanceToFirePos

If anything here is still valid anyone can open a PR for this?

@Nyeriah The conditions bellow fixes the cast conditions issue, the only problem left is that the item still can be used after the dead clefthoof despawns, which can be fixed by the patch

DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=39246 AND `ConditionTypeOrReference`=36;
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry`=39246;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(17,0,39246,0,0,29,0,22105,10,1,0,11,0,'',"Spell 'Fumping' requires dead Decrepit Clefthoof");
diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp
index 6317fae..3dc5e23 100644
--- a/src/server/game/Conditions/ConditionMgr.cpp
+++ b/src/server/game/Conditions/ConditionMgr.cpp
@@ -284,7 +284,11 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) const
         }
         case CONDITION_NEAR_CREATURE:
         {
-            condMeets = GetClosestCreatureWithEntry(object, ConditionValue1, (float)ConditionValue2, bool(!ConditionValue3)) ? true : false;
+            Creature* crea = GetClosestCreatureWithEntry(object, ConditionValue1, (float)ConditionValue2, bool(!ConditionValue3));
+            if (!crea || (ConditionValue3 && crea->getDeathState() == DEAD))
+                condMeets = false;
+            else
+                condMeets = true;
             break;
         }
         case CONDITION_NEAR_GAMEOBJECT:

Have any Dev a great heart ? . :1st_place_medal:
Please :+1:

TrinityCore rev. 906498e9f4d8 2017-08-04 03:52:24 +0200 (3.3.5 branch) (Win64, Release, Static)

Just in case anyone are in doubt, quest 10929 (Fumping) does work now, but The Big Bone Worm (http://www.wowhead.com/quest=10930/the-big-bone-worm) still does not work because http://www.wowhead.com/spell=39246/fumping is not scripted yet (AFAIK). I don't know if this is because of targeting issues with the dead clefthoof or if it is just a question of scripting the spell.

@tkrokli did you apply the patch from https://github.com/TrinityCore/TrinityCore/issues/11418#issuecomment-234781581?

@sirikfoll https://github.com/TrinityCore/TrinityCore/issues/11418#issuecomment-234781581 is valid? if yes please commit it.

Well, Sirikfoll did create the PR Core/Conditions Exclude creatures not spawned from CONDITION_NEAR_CREATURE search #17706 a year ago, but it got closed by Shauren's commit https://github.com/TrinityCore/TrinityCore/commit/75c34bda679e7307c6e85b7e288b6e72eb14ca38 pushed 22. August 2016. Judging by those events, I thought the patch above was considered unwanted. Then again, I could easily be mistaken (and Shauren's judgement could have missed the mark too).

Sql is still needed, and update and test the .cpp provided by nyeriah, I will look into it

Nowadays, you can use the ques item when the NPC is alive too.
Alive or dead, if you use the quest item, the cast bar dissapears without finishing and the NPC dissapears.

Confirmend issue:
TrinityCore rev. ed2c2941a74e
Fumping does not spawn the worm.

Below fixes the summon the visual when you use the drum only seems to play momentarily when you first start channeling though
~~~sql

DELETE FROM smart_scripts WHERE entryorguid=2203800 AND source_type=9 AND id IN(5,6,7);
INSERT INTO smart_scripts (entryorguid, source_type, id, link, event_type, event_phase_mask, event_chance, event_flags, event_param1, event_param2, event_param3, event_param4, event_param5, action_type, action_param1, action_param2, action_param3, action_param4, action_param5, action_param6, target_type, target_param1, target_param2, target_param3, target_param4, target_x, target_y, target_z, target_o, cus_target_param1, comment) VALUES
(2203800, 9, 5, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 28, 37751, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Hai shulud - Script - Remove Aura Submerged'),
(2203800, 9, 6, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 28, 38885, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Hai shulud - Script - Remove Aura amaging Tunnel Bore Bone Passive'),
(2203800, 9, 7, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 11, 37752, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Hai shulud - Script - Cast Cast Stand');

UPDATE smart_scripts SET event_param1='5000', event_param2='5000' WHERE entryorguid=2203800 AND source_type=9 AND id=2 AND link=0;

DELETE FROM smart_scripts WHERE entryorguid=22105 AND source_type=0 AND id IN(3,4);
INSERT INTO smart_scripts (entryorguid, source_type, id, link, event_type, event_phase_mask, event_chance, event_flags, event_param1, event_param2, event_param3, event_param4, event_param5, action_type, action_param1, action_param2, action_param3, action_param4, action_param5, action_param6, target_type, target_param1, target_param2, target_param3, target_param4, target_x, target_y, target_z, target_o, cus_target_param1, comment) VALUES
(22105, 0, 3, 4, 8, 0, 100, 0, 39246, 0, 0, 0, 0, 86, 39248, 2, 7, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Decrepit Clefthoof - On Spellhit (Fumping) - Cross Cast'),
(22105, 0, 4, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 41, 3000, 300, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Decrepit Clefthoof - On Spellhit (Fumping) - Despawn ');

DELETE FROM smart_scripts WHERE entryorguid=22038 AND source_type=0 AND id=5;
INSERT INTO smart_scripts (entryorguid, source_type, id, link, event_type, event_phase_mask, event_chance, event_flags, event_param1, event_param2, event_param3, event_param4, event_param5, action_type, action_param1, action_param2, action_param3, action_param4, action_param5, action_param6, target_type, target_param1, target_param2, target_param3, target_param4, target_x, target_y, target_z, target_o, cus_target_param1, comment) VALUES
(22038, 0, 5, 0, 4, 0, 100, 0, 0, 0, 0, 0, 0, 28, 38885, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Hai shulud - On Agro - Remove Aura');

DELETE FROM conditions WHERE SourceTypeOrReferenceId=17 AND SourceGroup=0 AND SourceEntry=39246;
DELETE FROM conditions WHERE SourceTypeOrReferenceId=22 AND SourceGroup=4 AND SourceEntry=22105;

INSERT INTO conditions (SourceTypeOrReferenceId, SourceGroup, SourceEntry, SourceId, ElseGroup, ConditionTypeOrReference, ConditionTarget, ConditionValue1, ConditionValue2, ConditionValue3, NegativeCondition, ErrorType, ErrorTextId, ScriptName, Comment) VALUES
(17, 0, 39246, 0, 0, 29, 0, 22105, 5, 1, 0, 0, 0, '', 'Fumping - must be dead decrepid clefthoof within 5 yards'),
(22, 4, 22105, 0, 0, 29, 0, 22038, 200, 0, 1, 0, 0, '', 'Execute SAI if only there is no hai shulun in vicinity');

I noticed the below spell attribute (can target dead)
~~~

ID - 39248 Summon Hai'Shulud

Category = 0, SpellIconID = 1, activeIconID = 0, SpellVisual = (0,0), SpellPriority = 0
Family SPELLFAMILY_GENERIC, flag [0] 0x00000000 [1] 0x00000000 [2] 0x00000000

SpellSchoolMask = 1 (SPELL_SCHOOL_MASK_NORMAL)
DamageClass = 0 (SPELL_DAMAGE_CLASS_NONE)

PreventionType = 0 (SPELL_PREVENTION_TYPE_NONE)

Attributes: 0x00000180 (SPELL_ATTR0_HIDDEN_CLIENTSIDE, SPELL_ATTR0_HIDE_IN_COMBAT_LOG)
AttributesEx2: 0x00000001 (SPELL_ATTR2_CAN_TARGET_DEAD)

After spending plenty of time to fix worms, I decided just to leave current progress here
Tried to find the knockback spell gnomes and worms uses but with no luck

--
DELETE FROM `spell_script_names` WHERE `spell_id` = 39246 AND `ScriptName` = "spell_q10930_fumping";
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
(39246,"spell_q10930_fumping");

DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 13 AND `SourceEntry` IN (39248,39250);
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(13,1,39248,0,0,31,0,3,22105,0,0,0,0,"","Group 0: Spell 'Summon Hai'Shulud' (Effect 0) targets creature 'Decrepit Clefthoof'"),
(13,1,39250,0,0,31,0,3,22105,0,0,0,0,"","Group 0: Spell 'Despawn Clefthoof' (Effect 0) targets creature 'Decrepit Clefthoof'");

DELETE FROM `spell_scripts` WHERE `id` = 39250;
INSERT INTO `spell_scripts` (`id`,`effIndex`,`delay`,`command`,`datalong`,`datalong2`,`dataint`,`x`,`y`,`z`,`o`,`Comment`) VALUES
(39250,0,0,18,0,0,0,0,0,0,0,"Despawn Clefthoof - On Effect Hit (Dummy) - Target - Despawn");

UPDATE `creature_template` SET `speed_walk` = 1, `speed_run` = 1 WHERE `entry` = 22482;
UPDATE `creature_template` SET `speed_walk` = 1 WHERE `entry` = 22483;

UPDATE `creature_text` SET `Language` = 0, `Emote` = 15 WHERE `CreatureID` = 22483;

DELETE FROM `smart_scripts` WHERE `entryorguid` = 22483 AND `source_type` = 0;
DELETE FROM `smart_scripts` WHERE `entryorguid` = 2248300 AND `source_type` = 9;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`event_param5`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_param4`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(22483,0,0,0,37,0,100,0,0,0,0,0,0,80,2248300,2,0,0,0,0,1,0,0,0,0,0,0,0,0,"Sand Gnome - On AI Initialize - Run Script"),

(2248300,9,0,0,0,0,100,0,0,0,0,0,0,8,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Sand Gnome - On Script - Set Reactstate Passive"),
(2248300,9,1,0,0,0,100,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Sand Gnome - On Script - Say Line 0"),
(2248300,9,2,0,0,0,100,0,1500,1500,0,0,0,8,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Sand Gnome - On Script - Set Reactstate Aggressive"),
(2248300,9,3,0,0,0,100,0,0,0,0,0,0,49,0,0,0,0,0,0,23,0,0,0,0,0,0,0,0,"Sand Gnome - On Script - Start Attack Owner");

ex1dreamer fixed the bug with disappearing drums via SetDest (#26472)

For some reason second script interrupts channeling spell but I didn't tried to understand where the problem lies because I mostly tried to fix worms

enum Fumping
{
    SPELL_SUMMON_SAND_GNOME    = 39240,
    SPELL_SUMMON_BONE_SLICER   = 39241,

    SPELL_SUMMON_SAND_GNOME_1  = 39247,
    SPELL_SUMMON_BONE_SLICER_1 = 39245,
    SPELL_SUMMON_HAISHULUD     = 39248,
    SPELL_DESPAWN_CLEFTHOOF    = 39250
};

// 39238 - Fumping
class spell_q10929_fumping : public SpellScript
{
    PrepareSpellScript(spell_q10929_fumping);

    bool Validate(SpellInfo const* /*spell*/) override
    {
        return ValidateSpellInfo({ SPELL_SUMMON_SAND_GNOME, SPELL_SUMMON_BONE_SLICER });
    }

    void SetDest(SpellDestination& dest)
    {
        Position const offset = { 0.5f, 0.5f, 5.0f, 0.0f };
        dest.RelocateOffset(offset);
    }

    void HandleSummon(SpellEffIndex /*effIndex*/)
    {
        if (Unit* caster = GetCaster())
            caster->CastSpell(caster, RAND(SPELL_SUMMON_SAND_GNOME, SPELL_SUMMON_BONE_SLICER), true);
    }

    void Register() override
    {
        OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_q10929_fumping::SetDest, EFFECT_1, TARGET_DEST_CASTER);
        OnEffectHit += SpellEffectFn(spell_q10929_fumping::HandleSummon, EFFECT_1, SPELL_EFFECT_DUMMY);
    }
};

// 39246 - Fumping
class spell_q10930_fumping : public SpellScript
{
    PrepareSpellScript(spell_q10930_fumping);

    bool Validate(SpellInfo const* /*spell*/) override
    {
        return ValidateSpellInfo(
        {
            SPELL_SUMMON_SAND_GNOME_1,
            SPELL_SUMMON_BONE_SLICER_1,
            SPELL_SUMMON_HAISHULUD,
            SPELL_DESPAWN_CLEFTHOOF
        });
    }

    void SetDest(SpellDestination& dest)
    {
        Position const offset = { 0.5f, 0.5f, 5.0f, 0.0f };
        dest.RelocateOffset(offset);
    }

    void HandleSummon(SpellEffIndex /*effIndex*/)
    {
        if (Unit* caster = GetCaster())
            caster->CastSpell(caster, RAND(SPELL_SUMMON_SAND_GNOME_1, SPELL_SUMMON_BONE_SLICER_1, SPELL_SUMMON_HAISHULUD), true);
    }

    void HandleDespawn(SpellEffIndex /*effIndex*/)
    {
        if (Unit* caster = GetCaster())
            caster->CastSpell(nullptr, SPELL_DESPAWN_CLEFTHOOF, true);
    }

    void Register() override
    {
        OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_q10930_fumping::SetDest, EFFECT_1, TARGET_DEST_CASTER);
        OnEffectHit += SpellEffectFn(spell_q10930_fumping::HandleSummon, EFFECT_1, SPELL_EFFECT_DUMMY);
        OnEffectHit += SpellEffectFn(spell_q10930_fumping::HandleDespawn, EFFECT_2, SPELL_EFFECT_DUMMY);
    }
};

    RegisterSpellScript(spell_q10929_fumping);
    RegisterSpellScript(spell_q10930_fumping);

I think conditions should be different. I.e. for spell 39248:
ConditionTypeOrReference -> 29 (CONDITION_NEAR_CREATURE);
ConditionValue1 -> 22105 (Decrepit Clefthoof);
ConditionValue2 -> 5 (Distance in yards, taht is line with 39246 properties)
ConditionValue3 -> 1 (Dead)
Otherwise no need to kill the Clefthoof

I'm also thinking that hook OnEffectHit will summon worms too soon. Hook to AuraEffectRemoveFn looks more blizzlike to me.

Tried to find the knockback spell gnomes and worms uses but with no luck

The mature bone sifter seems to be usign server side 37989 Tunnel Bore Bone Passive. It in turn inflicts server side 37990 Bone Bore. This one has interesting attributes.
ID - 37990 Bone Bore
ToolTip: Stunned.
Category = 0, SpellIconID = 66, activeIconID = 0, SpellVisual = (8767,0), SpellPriority = 0
Family SPELLFAMILY_GENERIC, flag [0] 0x00000000 [1] 0x00000000 [2] 0x00000000

SpellSchoolMask = 8 (SPELL_SCHOOL_MASK_NATURE)
DamageClass = 1 (SPELL_DAMAGE_CLASS_MAGIC)
PreventionType = 1 (SPELL_PREVENTION_TYPE_SILENCE)

Attributes: 0x08000100 (SPELL_ATTR0_HIDE_IN_COMBAT_LOG, SPELL_ATTR0_CASTABLE_WHILE_SITTING)

But it doesn't stun my character...

Another pair of spells exist for the big worm
38885 Damaging Tunnel Bore Bone Passive ->38886 Bone Bore. This one works and inflicts Nature Damage visible in the combat log

I think conditions should be different. I.e. for spell 39248:
Otherwise no need to kill the Clefthoof

Need to check later

The mature bone sifter seems to be usign server side 37989 Tunnel Bore Bone Passive. It in turn inflicts server side 37990 Bone Bore. This one has interesting attributes.

In retail they removes that aura after aggro
And they don't stun player, just knockback after spawn(both gnomes and worms)

The problem with worms is they are scripted wrongly in general, there are like 10 of them only in TBC and they share similar scripts

Also one other interesting thing you will find about the submerge/emerge spells the spell which is used by virtually every worm to submerge is marked as xt-002 submerge spell by scriptname and it adds non selectable flags in script but then the spell used to stand but then this is never removed again when the aura is removed

Yeah, I noticed that
It should be turned to generic spell script
And quite possibly I wasn't able to script them properly because of how that spell is implemented

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tje3d picture tje3d  路  3Comments

daddycaddy picture daddycaddy  路  3Comments

Rushor picture Rushor  路  3Comments

Keader picture Keader  路  3Comments

Rushor picture Rushor  路  3Comments