Jump to content

[Death Knight] Death Grip


Mylifesuxito

Recommended Posts

Core: 9979

Db: PSDB rev 310

Patches: No one

hi there first i already search, and didnt see anything about this maybe not search very well so forgive me.

the thing is that when you cast death grip the animation works fine, but the target should come to you and it doesnt.

dont know how to explain me very well so if any one can explain it better plz do it.

Link to comment
Share on other sites

File ---> src/game/SpellEffects.cpp
@@ -2696,6 +2696,34 @@ void Spell::EffectDummy(uint32 i)
                m_caster->CastCustomSpell(m_caster, 45470, &bp, NULL, NULL, true);
                return;
            }
+
+            switch(m_spellInfo->Id)
+            {
+                // Death Grip
+                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.0f;
+                    float orientation = unitTarget->GetOrientation();
+
+                    m_caster->CastSpell(unitTarget, 51399, true, NULL);                
+                    
+                    if(unitTarget->GetTypeId() != TYPEID_PLAYER)
+                    {
+                        unitTarget->GetMap()->CreatureRelocation((Creature*)unitTarget,x,y,z,orientation);
+                        ((Creature*)unitTarget)->SendMonsterMove(x, y, z, orientation, MONSTER_MOVE_UNK12, 1);
+                    }
+                    else
+                        unitTarget->NearTeleportTo(x,y,z,orientation,false);
+
+                    return;
+                }
+            }
            break;
    }

I found this and more others on link down, enjoy!

http://github.com/kero99/mangos/

Link to comment
Share on other sites

thats the code that is working on 3.3.3a i added manually and works fine

            // Death Grip
           else if (m_spellInfo->Id == 49576)
           {
               if (!unitTarget)
                   return;

               m_caster->CastSpell(unitTarget, 49560, true);
               return;
           }
           else if (m_spellInfo->Id == 49560)
           {
               if (!unitTarget)
                   return;

               uint32 spellId = m_spellInfo->CalculateSimpleValue(EFFECT_INDEX_0);
               unitTarget->CastSpell(m_caster->GetPositionX(), m_caster->GetPositionY(), m_caster->GetPositionZ(), spellId, true);
               return;
           }

Link to comment
Share on other sites

  • 1 month later...

Yeah, the code works good, but on retail, the animation is different, you can see the target flying, with this you are teleported in front of caster. It's only visual, but a correct implementation could be great, but I don't know yet how to do that =/

Link to comment
Share on other sites

I found this in an another Thread:

           // Death Grip
           if( m_spellInfo->SpellFamilyFlags & 0x02000000LL )
           {
               if(!unitTarget || !m_caster)
                   return;

               // unitTarget is Creature
               if(unitTarget->GetTypeId()!=TYPEID_PLAYER)
               {
           float x = m_caster->GetPositionX();
           float y = m_caster->GetPositionY(); 
           float z = m_caster->GetPositionZ()+1;
           float orientation = unitTarget->GetOrientation();
           unitTarget->SendMonsterMove(x,y,z,orientation,MOVEMENTFLAG_JUMPING,1);
               }
               else
               {   // unitTarget is Player
                   float vsin = sin(unitTarget->GetAngle(m_caster));
                   float vcos = cos(unitTarget->GetAngle(m_caster));

                   WorldPacket data(SMSG_MOVE_KNOCK_BACK, (8+4+4+4+4+4));
                   data.append(unitTarget->GetPackGUID());
                   data << uint32(0);                                      // Sequence
                   data << float(vcos);                                    // x direction
                   data << float(vsin);                                    // y direction
                                                                       // Horizontal speed
                   data << float(damage ? damage : unitTarget->GetDistance2d(m_caster));
                   data << float(-10.0);                                   // Z Movement speed

                   ((Player*)unitTarget)->GetSession()->SendPacket(&data);
               }
           }

This one include the "flyanimation". But it needs to be updated.

Link to comment
Share on other sites

mangos 10188

win xp

2>..\\..\\src\\game\\SpellEffects.cpp(2716) : error C2065: 'MOVEMENTFLAG_JUMPING' : undeclared identifier

2>..\\..\\src\\game\\SpellEffects.cpp(2724) : error C2248: 'ByteBuffer::append' : cannot access private member declared in class 'ByteBuffer'

2> c:\\Documents and Settings\\PC\\My Documents\\mangos\\mangos\\src\\shared\\ByteBuffer.h(498) : see declaration of 'ByteBuffer::append'

2> c:\\Documents and Settings\\PC\\My Documents\\mangos\\mangos\\src\\shared\\ByteBuffer.h(55) : see declaration of 'ByteBuffer'

i used

// Death Grip
           if( m_spellInfo->SpellFamilyFlags & 0x02000000LL )
           {
               if(!unitTarget || !m_caster)
                   return;

               // unitTarget is Creature
               if(unitTarget->GetTypeId()!=TYPEID_PLAYER)
               {
           float x = m_caster->GetPositionX();
           float y = m_caster->GetPositionY(); 
           float z = m_caster->GetPositionZ()+1;
           float orientation = unitTarget->GetOrientation();
           unitTarget->SendMonsterMove(x,y,z,orientation,MOVEMENTFLAG_JUMPING,1);
               }
               else
               {   // unitTarget is Player
                   float vsin = sin(unitTarget->GetAngle(m_caster));
                   float vcos = cos(unitTarget->GetAngle(m_caster));

                   WorldPacket data(SMSG_MOVE_KNOCK_BACK, (8+4+4+4+4+4));
                   data.append(unitTarget->GetPackGUID());
                   data << uint32(0);                                      // Sequence
                   data << float(vcos);                                    // x direction
                   data << float(vsin);                                    // y direction
                                                                       // Horizontal speed
                   data << float(damage ? damage : unitTarget->GetDistance2d(m_caster));
                   data << float(-10.0);                                   // Z Movement speed

                   ((Player*)unitTarget)->GetSession()->SendPacket(&data);
               }
           }

Link to comment
Share on other sites

MOVEMENTFLAG_JUMPING is not used anymore, now its SPLINEFLAG_TRAJECTORY < but this flag causes client side crashes, so just use SPLINEFLAG_FALLING (it has the same animation - more or less)

heres my patch

@@ -2489,10 +2489,27 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx)
                }

                m_caster->CastCustomSpell(m_caster, 45470, &bp, NULL, NULL, true);
                return;
            }
+            //Death Grip - Lacking propper Jump/Leap (EffectJump -  implementation) 
+            else if (m_spellInfo->Id == 49576)
+            {
+                if (!unitTarget)
+                    return;
+
+                m_caster->CastSpell(unitTarget, 49560, true);
+                return;
+            }
+            else if (m_spellInfo->Id == 49560)
+            {
+                if (!unitTarget)
+                    return;
+
+                unitTarget->CastSpell(m_caster->GetPositionX(), m_caster->GetPositionY(), m_caster->GetPositionZ(), m_spellInfo->CalculateSimpleValue(EFFECT_INDEX_0), true);
+                return;
+            }
            break;
        }
    }

    // pet auras
@@ -2731,13 +2748,12 @@ void Spell::EffectTriggerMissileSpell(SpellEffectIndex effect_idx)
    m_caster->CastSpell(m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ, spellInfo, true, m_CastItem, 0, m_originalCasterGUID);
}

void Spell::EffectJump(SpellEffectIndex eff_idx)
{
-    if(m_caster->isInFlight())
+    if(!unitTarget || m_caster->isInFlight())
        return;
-
    // Init dest coordinates
    float x,y,z,o;
    if(m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION)
    {
        x = m_targets.m_destX;
@@ -2775,11 +2791,13 @@ void Spell::EffectJump(SpellEffectIndex eff_idx)
    {
        sLog.outError( "Spell::EffectJump - unsupported target mode for spell ID %u", m_spellInfo->Id );
        return;
    }

-    m_caster->NearTeleportTo(x, y, z, o, true);
+    float time = 1.0f;
+    // m_caster->NearTeleportTo(x, y, z, o, true);
+    m_caster->SendMonsterMove(x, y, z, SPLINETYPE_NORMAL, SPLINEFLAG_FALLING, time);
}

void Spell::EffectTeleportUnits(SpellEffectIndex eff_idx)
{
    if(!unitTarget || unitTarget->isInFlight())

@@ -2771,10 +2771,12 @@ void Spell::EffectJump(SpellEffectIndex eff_idx)
                pTarget = m_caster->getVictim();
            else if(m_caster->GetTypeId() == TYPEID_PLAYER)
                pTarget = ObjectAccessor::GetUnit(*m_caster, ((Player*)m_caster)->GetSelection());

            o = pTarget ? pTarget->GetOrientation() : m_caster->GetOrientation();
+
+         m_caster->NearTeleportTo(x, y, z, o, true); // forgot to add this from my original patch... sorry my mistake 
     }
        else
            o = m_caster->GetOrientation();
    }
    else if(unitTarget)

It's based on rev 10064, (the first patch is for Death Grip itself, the second if cuz i forgot to add something to the first patch and im too lazy to merge them) and it's the short version of my EffectJump implementation for mangos, it was working fine except of the flag i mentioned before (SPLINEFLAG_TRAJECTORY) which caused client side crashes, and since im hard headed i refused to finish the patch due to that flag (yes i just wanted to use that flag lol) and because the server where i play on doesn't accept too complex patches, hence the trimmed version (which works perfectly - at least none reported any bug with it).

§Give credit if you share it further :)

Link to comment
Share on other sites

  • 4 weeks later...
  • 2 weeks later...

patch is working in revision 10348 but you need to substitute isInFlight() for IsTaxiFlying() so the code should be:

@@ -2489,10 +2489,27 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx)

}

m_caster->CastCustomSpell(m_caster, 45470, &bp, NULL, NULL, true);

return;

}

+ //Death Grip - Lacking propper Jump/Leap (EffectJump - implementation) :)

+ else if (m_spellInfo->Id == 49576)

+ {

+ if (!unitTarget)

+ return;

+

+ m_caster->CastSpell(unitTarget, 49560, true);

+ return;

+ }

+ else if (m_spellInfo->Id == 49560)

+ {

+ if (!unitTarget)

+ return;

+

+ unitTarget->CastSpell(m_caster->GetPositionX(), m_caster->GetPositionY(), m_caster->GetPositionZ(), m_spellInfo->CalculateSimpleValue(EFFECT_INDEX_0), true);

+ return;

+ }

break;

}

}

// pet auras

@@ -2731,13 +2748,12 @@ void Spell::EffectTriggerMissileSpell(SpellEffectIndex effect_idx)

m_caster->CastSpell(m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ, spellInfo, true, m_CastItem, 0, m_originalCasterGUID);

}

void Spell::EffectJump(SpellEffectIndex eff_idx)

{

- if(m_caster->IsTaxiFlying())

+ if(!unitTarget || m_caster->IsTaxiFlying())

return;

-

// Init dest coordinates

float x,y,z,o;

if(m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION)

{

x = m_targets.m_destX;

@@ -2775,11 +2791,13 @@ void Spell::EffectJump(SpellEffectIndex eff_idx)

{

sLog.outError( "Spell::EffectJump - unsupported target mode for spell ID %u", m_spellInfo->Id );

return;

}

- m_caster->NearTeleportTo(x, y, z, o, true);

+ float time = 1.0f;

+ // m_caster->NearTeleportTo(x, y, z, o, true);

+ m_caster->SendMonsterMove(x, y, z, SPLINETYPE_NORMAL, SPLINEFLAG_FALLING, time);

}

void Spell::EffectTeleportUnits(SpellEffectIndex eff_idx)

{

if(!unitTarget || unitTarget->IsTaxiFlying())

@@ -2771,10 +2771,12 @@ void Spell::EffectJump(SpellEffectIndex eff_idx)

pTarget = m_caster->getVictim();

else if(m_caster->GetTypeId() == TYPEID_PLAYER)

pTarget = ObjectAccessor::GetUnit(*m_caster, ((Player*)m_caster)->GetSelection());

o = pTarget ? pTarget->GetOrientation() : m_caster->GetOrientation();

+

+ m_caster->NearTeleportTo(x, y, z, o, true); // forgot to add this from my original patch... sorry my mistake :)

}

else

o = m_caster->GetOrientation();

}

else if(unitTarget)

Link to comment
Share on other sites

patch is working in revision 10348 but you need to substitute isInFlight() for IsTaxiFlying() so the code should be:

Patch is from who??

one thing if this is working want to ask two things

1) the way this patch is made is hacky way? if no lets go to the 2cnd question

2) why isnt been added to the source?

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