Jump to content

[Fix] Death grip


Recommended Posts

  • 39 years later...

i have a fix for Death grip, when i used the spell, then can not move more

SpellEffects.cpp:
void Spell::EffectDummy(uint32 i)
{
   if(!unitTarget && !gameObjTarget && !itemTarget)
       return;

   // Death Grip
   //todo : insert it to right spell family
   if (m_spellInfo->Id == 49560 || m_spellInfo->Id == 49576)//wtf 2 IDs
   {
       // Init dest coordinates
       uint32 mapid = m_caster->GetMapId();
       float x = m_caster->GetPositionX();
       float y = m_caster->GetPositionY();
       float z = m_caster->GetPositionZ();
       float orientation = unitTarget->GetOrientation();
       // Teleport
       if(unitTarget->GetTypeId() == TYPEID_PLAYER)
           ((Player*)unitTarget)->TeleportTo(mapid, x, y, z, orientation, TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET );
       else
       {
           MapManager::Instance().GetMap(mapid, m_caster)->CreatureRelocation((Creature*)unitTarget, x, y, z, orientation);
           WorldPacket data;
           unitTarget->BuildTeleportAckMsg(&data, x, y, z, orientation);
           unitTarget->SendMessageToSet(&data, false);
       }
   }

i hoe anyone can help :)

Link to comment
Share on other sites

Hrm it could be that when you float z, the tele location is actually slightly below the terrain thus you can't move. Hacky solution would be to do a z + 1(or etc) as the tele coords.

Spell family is SPELLFAMILY_DEATHKNIGHT, which ithink doesn't exist in master branch yet so you'll have to create it by addding a case entry after the switch(spellfamily).

Also view =! help due to people not sure how to help or don't have time to help.

Link to comment
Share on other sites

  • 1 month later...

tested this script with

@@ -1765,8 +1785,28 @@ void Spell::EffectDummy(uint32 i)
                return;
            }
            break;
-    }
-
+        case SPELLFAMILY_DEATHKNIGHT:
+            if (m_spellInfo->Id == 49560 || m_spellInfo->Id == 49576)//wtf 2 IDs
+            {
+                // Init dest coordinates
+                uint32 mapid = m_caster->GetMapId();
+                float x = m_caster->GetPositionX();
+                float y = m_caster->GetPositionY();
+                float z = m_caster->GetPositionZ() + 5;
+                float orientation = unitTarget->GetOrientation();
+                // Teleport
+                if(unitTarget->GetTypeId() == TYPEID_PLAYER)
+                    ((Player*)unitTarget)->TeleportTo(mapid, x, y, z, orientation, TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET );
+                else
+                {
+                    MapManager::Instance().GetMap(mapid, m_caster)->CreatureRelocation((Creature*)unitTarget, x, y, z, orientation);
+                    WorldPacket data;
+                    unitTarget->BuildTeleportAckMsg(&data, x, y, z, orientation);
+                    unitTarget->SendMessageToSet(&data, false);
+                }
+            }
+            break;
+    }

as i use death grip on creature, i cant move after using this spell, but on player, there is no problem

thx

EDIT: ok here my final result on testing this patch..

1. if cast on player, there is no problem

2. if cast on creature and got nearby player, nearby player got teleport to caster and made all teleported player stuck/freeze

3. if cast on creature but no nearby player, creature got teleported but caster stucked

Link to comment
Share on other sites

Using CreatureRelocation seems to switch your movement to the creature.

If you try moving, you are actually moving the creature you Death Gripped.

Also, you'll need to add the taunt part of the spell (a seperate spell) at the end of the code. The actual spells players have are dummies for all effects.

Link to comment
Share on other sites

diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 168cf44..adb562c 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -1764,7 +1764,23 @@ void Spell::EffectDummy(uint32 i)
                }
                return;
            }
-            break;
+            //Death Grip temp fix
+            if(m_spellInfo->Id==49576)
+            {
+                if (!unitTarget||!m_caster)
+                    return;
+                uint32 mapid = m_caster->GetMapId();
+                float x = m_caster->GetPositionX();
+                float y = m_caster->GetPositionY(); 
+                float z = m_caster->GetPositionZ()+1;
+                float orientation = unitTarget->GetOrientation();
+                m_caster->CastSpell(unitTarget,49560,true,NULL);//get taunt debuff as well
+                unitTarget->SendMonsterMove(x,y,z,0,MOVEMENTFLAG_JUMPING,1);
+                if (unitTarget->GetTypeId()==TYPEID_PLAYER)
+                    unitTarget->NearTeleportTo(x,y,z,orientation,false);
+                return;
+            }
+            break;
    }

    // pet auras

I'm using this for my server and works very well as I can tell. Any advice for improving? At least at the visual part, the unitTarget does not get pulled like "leap", just walking very fast.

Link to comment
Share on other sites

  • 2 weeks later...

You move the .patch file tin the Mangos folder (the one with /src, /win /bin, etc), you select that folder, right click on it, Git Bash Here and then u enter in the console:

git apply patch_filename.patch (if the patch is in Mangos folder, if not, write the full path).

For example: git apply deathgrip.patch

Hope it helps

Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...
Guest
This topic is now closed to further replies.
×
×
  • 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