Jump to content

tmpUnitMap not declared


Guest xarly

Recommended Posts

Hi! I'm applying a patch to fix two spells of DeathKnight (Death Army and Raise dead), a part of the code is this:

Spell.cpp

case TARGET_EFFECT_SELECT:
               if (m_spellInfo->Id == 46584 || m_spellInfo->Id == 47496 || m_spellInfo->Id == 48018 || m_spellInfo->Id == 48743)
               {
                   FillCustomTargetMap(i,tmpUnitMap);
                   break;
               }
               switch(m_spellInfo->EffectImplicitTargetB[i])
               {
                   case 0:
                       SetTargetMap(i, m_spellInfo->EffectImplicitTargetA[i], tmpUnitMap);
                       break;
                   case TARGET_SCRIPT_COORDINATES:         // B case filled in CheckCast but we need fill unit list base at A case
                       SetTargetMap(i, m_spellInfo->EffectImplicitTargetA[i], tmpUnitMap);
                       break;
                   default:
                       SetTargetMap(i, m_spellInfo->EffectImplicitTargetA[i], tmpUnitMap);
                       SetTargetMap(i, m_spellInfo->EffectImplicitTargetB[i], tmpUnitMap);
                       break;
               }
               break;

But when I compile an error says

1>..\\..\\src\\game\\Spell.cpp(551) : error C2065: 'tmpUnitMap' : identifier not declared

1>..\\..\\src\\game\\Spell.cpp(557) : error C2065: 'tmpUnitMap' : identifier not declared

1>..\\..\\src\\game\\Spell.cpp(560) : error C2065: 'tmpUnitMap' : identifier not declared

1>..\\..\\src\\game\\Spell.cpp(563) : error C2065: 'tmpUnitMap' : identifier not declared

1>..\\..\\src\\game\\Spell.cpp(564) : error C2065: 'tmpUnitMap' : identifier not declared

I'm applying this patch to revision 8487...

Could you please give me a hand? I'm afraid I can't correct it by myself

Thank you!

Link to comment
Share on other sites

Personally my dev have make a script for debug this spell:

- http://fr.wowhead.com/?spell=48743

- http://fr.wowhead.com/?spell=46584

- http://fr.wowhead.com/?spell=49576

- http://fr.wowhead.com/?spell=46584

The script is not 100% good (not cooldown with spell 46584 for exemple ...)

diff --git a/mangos/src/game/SpellEffects.cpp b/mangos/src/game/SpellEffects.cpp
index af7c914..e7a01e1 100644
--- a/mangos/src/game/SpellEffects.cpp
+++ b/mangos/src/game/SpellEffects.cpp
@@ -257,10 +257,41 @@ void Spell::EffectResurrectNew(uint32 i)
void Spell::EffectInstaKill(uint32 /*i*/)
{
    if( !unitTarget || !unitTarget->isAlive() )
        return;

+    if(m_spellInfo->Id==48743)
+    {
+        Player * joueur = (Player *)m_caster;
+        
+        Pet *t1 = joueur->GetPet();
+        if(!t1 || t1->isDead() || !t1->GetOwner())
+        {
+            m_caster->CastStop();
+            return;
+        }
+
+        if(((Creature*)t1)->GetCreatureType()!= CREATURE_TYPE_UNDEAD || t1->GetOwnerGUID() != m_caster->GetGUID()) 
+        {
+            m_caster->CastStop();
+            return;
+        }
+        
+        if(t1 && !t1->isDead())
+        {
+            int32 heal =  m_caster->GetMaxHealth()  * 0.4;
+            m_caster->ModifyHealth(heal);
+            m_caster->SendHealSpellLog(m_caster,48743,heal,false);
+            t1->SetHealth(0);
+            t1->setDeathState(JUST_DIED);
+            m_targets.setUnitTarget(NULL);
+        }
+
+        return;
+    }
+    
+
    // Demonic Sacrifice
    if(m_spellInfo->Id==18788 && unitTarget->GetTypeId()==TYPEID_UNIT)
    {
        uint32 entry = unitTarget->GetEntry();
        uint32 spellID;
@@ -1868,10 +1899,11 @@ void Spell::EffectDummy(uint32 i)
                }
                return;
            }
            break;
        case SPELLFAMILY_DEATHKNIGHT:
+        {
            // Death Coil
            if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x002000))
            {
                if (m_caster->IsFriendlyTo(unitTarget))
                {
@@ -1914,11 +1946,71 @@ void Spell::EffectDummy(uint32 i)

                int32 bp = count * m_caster->GetMaxHealth() * m_spellInfo->DmgMultiplier[0] / 100;
                m_caster->CastCustomSpell(m_caster, 45470, &bp, NULL, NULL, true);
                return;
            }
+
+            switch(m_spellInfo->Id)
+            {
+                // Poigne de la mort
+                case 49560:
+                case 49576:
+                {
+                    if (!unitTarget || !m_caster)
+                        return;
+
+                    float x = m_caster->GetPositionX();
+                    float y = m_caster->GetPositionY();
+                    float z = m_caster->GetPositionZ()+1;
+                    float orientation = unitTarget->GetOrientation();
+
+                    m_caster->CastSpell(unitTarget,51399,true,NULL);
+                    unitTarget->NearTeleportTo(x,y,z,orientation,false);
+                    unitTarget->Attack(m_caster, true);
+                     
+                    break;
+                }
+                case 46584:
+                {
+                    if(!unitTarget || !m_caster)
+                        return;
+
+                    m_caster->CastSpell(unitTarget, 52150, true, NULL);
+                    break;
+                }
+            }
+
            break;
+        }
    }

    // pet auras
    if (PetAura const* petSpell = spellmgr.GetPetAura(m_spellInfo->Id, i))
    {
@@ -5454,10 +5546,44 @@ void Spell::EffectScriptEffect(uint32 effIndex)
                   // Frost Fever
                   if(mainTarget->HasAura(55095))
                       m_caster->CastSpell(unitTarget, 55095, true);

                   break;
               }
+            case 46584:
+                {
+                    Player *player = (Player*)m_caster;
+
+                if (!unitTarget || !m_caster)
+                       return;
+
+                    if(unitTarget->isDead())
+                    {
+                        if(unitTarget->getRace() == CREATURE_TYPE_HUMANOID)
+                            m_caster->CastSpell(unitTarget,46584,true,NULL); 
+                        else
+                        {
+                            if(player->HasItemCount(37201,1,false))
+                            {
+                                player->DestroyItemCount(37201,1,true);
+                                m_caster->CastSpell(unitTarget, 46584, true, NULL);
+                            }
+                            else
+                            {
+                                m_caster->CastStop();
+                                return;
+                            }
+                        }
+                    }
+                    break;
+                }
           }
           break;
       }
   }

   // normal DB scripted effect

:)

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