Jump to content

Recommended Posts

Posted

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

Implement Script-Effect for spell 26218

For which repository revision was the patch created?

10829

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

Further information:

http://www.wowhead.com/npc=15760#comments

in short: this spell should trigger one of 26206, 26207, 45036.

See also http://www.scriptdev2.com/project.php?issueid=1194 for testing.

diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 568c2aa..f680ddd 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -5714,6 +5714,16 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
                case 25143:
                case 25650:
                case 25652:
+                case 26218:                                 // Mistletoe
+                {
+                    if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
+                        return;
+
+                    uint32 spells[3] = {26206, 26207, 45036};
+
+                    m_caster->CastSpell(unitTarget, spells[urand(0, 2)], true);
+                    return;
+                }
                case 29128:
                case 29129:
                case 35376:

Posted

made in function arrays static not good sometime. Static var in function have special work in C/C++.

it not just constant array BUT constant initilized at first function call. So lot mostly time at it init call at first function call and checks that array init at all next accesses. If not make array static then compiler by self can see that array can moved in some shared memory block for all function calls.

×
×
  • 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