Jump to content

[patch] Improved Soul Leech


Guest reeshack

Recommended Posts

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

Fixes the Improved Soul Leech warlock talent.

For which repository revision was the patch created?

Rev. 8877

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

Haven't found any in the first 150 results :o.

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

Me, reeshack.

paste2.org: http://paste2.org/p/558554

It works but it still seems to be a bit more complicated solution than it should be - any new ideas and tips are welcome of course :).

Link to comment
Share on other sites

  • 3 weeks later...

this patch created a crash on my test server. Equip http://www.wowhead.com/?spell=54696 , turn Seal of Command on, use a Judgement of Light on your target many times, when trinket proc and you maky another Judgement of Light - server crash. And very strange thing - server crash happens only at Windows O_o

*** Operation System ***
Microsoft Windows Server 2003 Enterprise Edition Service Pack 2 (Version 5.2, Build 3790)

//=====================================================
Exception code: C00000FD STACK_OVERFLOW
Fault address:  004307D7 01:0002F7D7 C:\\WoW Server\\wow\\mangosd.exe

Registers:
EAX:093D2000
EBX:F3C8FBC8
ECX:093D1454
EDX:00000003
ESI:00000000
EDI:00886AD0
CS:EIP:0023:004307D7
SS:ESP:002B:093DC518  EBP:093DC520
DS:002B  ES:002B  FS:0053  GS:002B
Flags:00010206

Call stack:
Address   Frame     Function      SourceFile
004307D7  00000000  _chkstk+27
006BE625  00000000  Spell::CheckItems+B5
006B9A41  00000000  Spell::CheckCast+E71
006B319F  00000000  Spell::Prepare+28F
00459FF5  00000000  Unit::CastSpell+1B5
00459E38  00000000  Unit::CastSpell+118
0046FBBA  00000000  Unit::HandleProcTriggerSpell+20FA
0047F696  00000000  Unit::ProcDamageAndSpellFor+666
00466D2F  00000000  Unit::ProcDamageAndSpell+2F
006AD4D3  00000000  Spell::DoAllEffectOnTarget+2C3
006B4206  00000000  Spell::handle_immediate+E6
006B403D  00000000  Spell::cast+9FD
006B32A3  00000000  Spell::Prepare+393
0045A22D  00000000  Unit::CastCustomSpell+16D
0045A0B2  00000000  Unit::CastCustomSpell+82
0046ABDF  00000000  Unit::HandleDummyAuraProc+329F
0047F874  00000000  Unit::ProcDamageAndSpellFor+844
00466D73  00000000  Unit::ProcDamageAndSpell+73
006AD645  00000000  Spell::DoAllEffectOnTarget+435
006B4206  00000000  Spell::handle_immediate+E6
006B403D  00000000  Spell::cast+9FD
006B32A3  00000000  Spell::Prepare+393
00459FF5  00000000  Unit::CastSpell+1B5
00823A58  00000000  Spell::EffectDummy+4868
006B88CF  00000000  Spell::HandleEffects+CF
006ADFEB  00000000  Spell::DoSpellHitOnUnit+67B
006AD3C5  00000000  Spell::DoAllEffectOnTarget+1B5
006B4206  00000000  Spell::handle_immediate+E6
006B403D  00000000  Spell::cast+9FD
006B32A3  00000000  Spell::Prepare+393
00459FF5  00000000  Unit::CastSpell+1B5
00459E38  00000000  Unit::CastSpell+118
00832908  00000000  Spell::EffectScriptEffect+22C8
006B88CF  00000000  Spell::HandleEffects+CF
006ADFEB  00000000  Spell::DoSpellHitOnUnit+67B
006AD3C5  00000000  Spell::DoAllEffectOnTarget+1B5
006B4206  00000000  Spell::handle_immediate+E6
006B403D  00000000  Spell::cast+9FD
006B4B00  00000000  Spell::update+290
006C0D6D  00000000  SpellEvent::Execute+2D
008DF3FC  00000000  EventProcessor::Update+EC
00456BFB  00000000  Unit::Update+3B
004CDACC  00000000  Player::Update+EC
004A0339  00000000  Map::Update+D9
0060F7C8  00000000  MapManager::Update+128
005F375B  00000000  World::Update+77B
004304CE  00000000  WorldRunnable::run+8E
00886AE9  00000000  ACE_Based::Thread::ThreadTask+19
00B714D4  00000000  ?invoke@ACE_OS_Thread_Adapter@@UAEKXZ+74
78543433  00000000  _endthreadex+44
785434C7  00000000  _endthreadex+D8
7D4DFE21  00000000  FlsSetValue+136

Link to comment
Share on other sites

diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index fe70a2c..0b14edb 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -5529,6 +5529,39 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
                    basepoints0 = int32(damage*triggerAmount/100);
                    target = this;
                    triggered_spell_id = 30294;
+                    
+                    // Improved Soul Leech
+                    AuraList const& mDummyAuras = GetAurasByType(SPELL_AURA_DUMMY);
+                    for(AuraList::const_iterator iter = mDummyAuras.begin(); iter != mDummyAuras.end(); ++iter)
+                    {
+                        if ((*iter)->GetSpellProto()->SpellIconID == 3176 && (*iter)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK)
+                        {
+                            switch ((*iter)->GetEffIndex())
+                            {
+                                case 0:
+                                {
+                                    if ((*iter)->GetSpellProto()->Id == 54117)
+                                        CastSpell(this, 54300, true, NULL, triggeredByAura);
+                                    else
+                                        CastSpell(this, 59117, true, NULL, triggeredByAura);
+
+                                    int32 bp0 = int32((*iter)->GetModifier()->m_amount * GetMaxPower(POWER_MANA) / 100);
+                                    if (Pet *pet = GetPet())
+                                        CastCustomSpell(pet, 54607, &bp0, NULL, NULL, true, NULL, triggeredByAura);
+                                    break;
+                                }
+                                case 1:
+                                {
+                                    if (!roll_chance_i((*iter)->GetModifier()->m_amount))
+                                        break;
+                                    CastSpell(this, 57669, true, NULL, triggeredByAura);
+                                    break;
+                                }
+                                default:
+                                    break;
+                            }
+                        }
+                    }
                    break;
                }
                // Shadowflame (Voidheart Raiment set bonus)

think this should work...and why u pass castItem in one of ur spell casts?

Link to comment
Share on other sites

thanks, second version works without crash, but when soul leech proc - your pet gain full mana bar (for example your pet have 17/3933 mana, when it proc - pet gain so much amount of mana that makes his bar to be full 3933/3933)

updated :

diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index fe70a2c..0b14edb 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -5529,6 +5529,39 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
                    basepoints0 = int32(damage*triggerAmount/100);
                    target = this;
                    triggered_spell_id = 30294;
+                    
+                    // Improved Soul Leech
+                    AuraList const& mDummyAuras = GetAurasByType(SPELL_AURA_DUMMY);
+                    for(AuraList::const_iterator iter = mDummyAuras.begin(); iter != mDummyAuras.end(); ++iter)
+                    {
+                        if ((*iter)->GetSpellProto()->SpellIconID == 3176 && (*iter)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK)
+                        {
+                            switch ((*iter)->GetEffIndex())
+                            {
+                                case 0:
+                                {
+                                    if ((*iter)->GetSpellProto()->Id == 54117)
+                                        CastSpell(this, 54300, true, NULL, triggeredByAura);
+                                    else
+                                        CastSpell(this, 59117, true, NULL, triggeredByAura);
+
+                                    if (Pet *pet = GetPet())
+                                    {
+                      int32 bp0 = int32((*iter)->GetModifier()->m_amount * pet->GetMaxPower(POWER_MANA) / 100);
+                                        CastCustomSpell(pet, 54607, &bp0, NULL, NULL, true, NULL, triggeredByAura);
+                                    }
+                                    break;
+                                }
+                                case 1:
+                                {
+                                    if (!roll_chance_i((*iter)->GetModifier()->m_amount))
+                                        break;
+                                    CastSpell(this, 57669, true, NULL, triggeredByAura);
+                                    break;
+                                }
+                                default:
+                                    break;
+                            }
+                        }
+                    }
                    break;
                }
                // Shadowflame (Voidheart Raiment set bonus)

Link to comment
Share on other sites

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