Jump to content

[11379] [patch] Script Effect for spell 24751


Guest dpedroia15

Recommended Posts

* What bug does the patch fix? What features does the patch add?

Implements Script Effect for spell 24751 (Trick or Treat)

* For which repository revision was the patch created?

11241

* Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread.

No.

* Who has been writing this patch? Please include either forum user names or email addresses.

Me!

@@ -6229,14 +6173,6 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
                case 24590:                                 // Brittle Armor - need remove one 24575 Brittle Armor aura
                    unitTarget->RemoveAuraHolderFromStack(24575);
                    return;
+               case 24714:                                 // Trick
+                {
+                    if (roll_chance_i(14))              // Trick (can be different critter models). 14% since below can have 1 of 6
+                        unitTarget->CastSpell(unitTarget, 24753, true);
+                    else                                // Random Costume, 6 different (plus add. for gender)
+                        unitTarget->CastSpell(unitTarget, 24720, true);
+                    return;
+               }
                case 24717:                                 // Pirate Costume
                {
                    if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
@@ -6316,9 +6252,19 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
                    // Tricked or Treated
                    unitTarget->CastSpell(unitTarget, 24755, true);

+                    uint32 trickOrTreat = (roll_chance_i(50)) ? 24714: 24715;
-                    if (roll_chance_i(50))
-                    {
-                        // Treat
-                        unitTarget->CastSpell(unitTarget, 24715, true);
-                    }
-                    else
-                    {
-                        if (roll_chance_i(14))              // Trick (can be different critter models). 14% since below can have 1 of 6
-                            unitTarget->CastSpell(unitTarget, 24753, true);
-                        else                                // Random Costume, 6 different (plus add. for gender)
-                            unitTarget->CastSpell(unitTarget, 24720, true);
-                    }

+                    unitTarget->CastSpell(unitTarget,trickOrTreat,true);
                    return;
                }
                case 26275:                                 // PX-238 Winter Wondervolt TRAP

Link to comment
Share on other sites

Yes, it doesn't matter either way. I was just following the convention that most other dummy/scripted effects follow :)

EDIT: NoFantasy made a commit regarding this spell, thread can be moved if needed

EDIT2: Posted a newer version of the commit with a slight change of NoFantasy's commit.

Link to comment
Share on other sites

  • 1 month later...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use