Auntie Mangos Posted January 1, 1970 Report Posted January 1, 1970 Ok, so I've made a few tests with Death Grip and Feral Charge. Results : it works! For death grip I had to use another patch (that casts the actual jump spell) : see here. I just applied the dummy effect of spell 49576 : diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index ead3147..c60b0c0 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -2578,6 +2578,23 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx) // consume diseases unitTarget->RemoveAurasWithDispelType(DISPEL_DISEASE, m_caster->GetGUID()); } + //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->CalculateSimple + return; + } break; } } The visual effect is perfect, but maybe too slow, and not enough high in the air. I'm not allowed to post a video to show it...but to give an example, if you're at 30 yars from the target, it takes more than 1 sec to the target to come to you. If you're at 5 yards, it takes a lot less. Afaik, this transit time should be the same regardless of the distance between you and your target. About the height in the air, I don't know what controls this : is it speed_z ? what is speed_z, actually?
darkstalker Posted October 12, 2010 Report Posted October 12, 2010 * What bug does the patch fix? What features does the patch add? Implements packet structure for sending monster move with SPLINEFLAG_TRAJECTORY and its usage on Spell:EffectJump. This is used for effect of spells like http://www.wowhead.com/spell=49376 and http://www.wowhead.com/spell=49575. * For which repository revision was the patch created? 10567 * Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread. i think there was one, but can't find it. * Who has been writing this patch? Please include either forum user names or email addresses. darkstalker diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 823966a..76869a5 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -2877,7 +2877,14 @@ void Spell::EffectJump(SpellEffectIndex eff_idx) return; } - m_caster->NearTeleportTo(x, y, z, o, true); + uint32 speed_z = m_spellInfo->EffectMiscValue[eff_idx]; + if (!speed_z) + speed_z = 10; + uint32 time = m_spellInfo->EffectMiscValueB[eff_idx]; + if (!time) + time = speed_z * 10; + + m_caster->MonsterJump(x, y, z, o, time, speed_z); } void Spell::EffectTeleportUnits(SpellEffectIndex eff_idx) diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 3448163..ba3f8d8 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -401,6 +401,11 @@ void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, SplineTy data << uint32(flags); // splineflags data << uint32(moveTime); // Time in between points + if (flags & SPLINEFLAG_TRAJECTORY) + { + data << float(va_arg(vargs, double)); // Z jump speed + data << uint32(0); // walk time after jump + } data << uint32(1); // 1 single waypoint data << NewPosX << NewPosY << NewPosZ; // the single waypoint Point B @@ -10435,6 +10440,28 @@ void Unit::MonsterMoveWithSpeed(float x, float y, float z, uint32 transitTime) } } +void Unit::MonsterJump(float x, float y, float z, float o, uint32 transitTime, uint32 verticalSpeed) +{ + SendMonsterMove(x, y, z, SPLINETYPE_NORMAL, SplineFlags(SPLINEFLAG_TRAJECTORY | SPLINEFLAG_WALKMODE), transitTime, NULL, double(verticalSpeed)); + + if (GetTypeId() != TYPEID_PLAYER) + { + Creature* c = (Creature*)this; + // Creature relocation acts like instant movement generator, so current generator expects interrupt/reset calls to react properly + if (!c->GetMotionMaster()->empty()) + if (MovementGenerator *movgen = c->GetMotionMaster()->top()) + movgen->Interrupt(*c); + + GetMap()->CreatureRelocation((Creature*)this, x, y, z, o); + + // finished relocation, movegen can different from top before creature relocation, + // but apply Reset expected to be safe in any case + if (!c->GetMotionMaster()->empty()) + if (MovementGenerator *movgen = c->GetMotionMaster()->top()) + movgen->Reset(*c); + } +} + struct SetPvPHelper { explicit SetPvPHelper(bool _state) : state(_state) {} diff --git a/src/game/Unit.h b/src/game/Unit.h index 5efc783..332b6d4 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1450,6 +1450,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject void MonsterMove(float x, float y, float z, uint32 transitTime); void MonsterMoveWithSpeed(float x, float y, float z, uint32 transitTime = 0); + void MonsterJump(float x, float y, float z, float o, uint32 transitTime, uint32 verticalSpeed); // recommend use MonsterMove/MonsterMoveWithSpeed for most case that correctly work with movegens // if used additional args in ... part then floats must explicitly casted to double
Schmoozerd Posted October 13, 2010 Report Posted October 13, 2010 thanks, looks interesting One thing I don't understand: Shouldn't a mob(player too perhaps?) be on Idle-movement _while_ he is jumping - so is this handled anywhere else already, or are all of these jump-spells so fast (short time) that there wouldn't be any visual impact?
Forusim Posted October 13, 2010 Report Posted October 13, 2010 It looks too simple to be true Devs pls review.
zergtmn Posted October 13, 2010 Report Posted October 13, 2010 Any comments about hard-coded '10' constants?
Forgotten Posted October 13, 2010 Report Posted October 13, 2010 + if (GetTypeId() != TYPEID_PLAYER) player shouldn't be relocated? why? yes, i saw the same thing in Unit::MonsterMove\\Unit::MonsterMoveWithSpeed but it looks like a hack plus creature\\player shouldn't be relocated instantly
zergtmn Posted October 13, 2010 Report Posted October 13, 2010 http://www.wowhead.com/spell=57604 works on players too.
Toinan67 Posted October 13, 2010 Report Posted October 13, 2010 I'm compiling right now, tests results in a few minutes. I made a gist for rev. 10604 (latest) : click here. Anyway, another great patch from you, darkstalker. I think this effect should be added to the "knockback" effect : shaman's thunderstorm is an example.
darkstalker Posted October 13, 2010 Report Posted October 13, 2010 thanks, looks interesting One thing I don't understand: Shouldn't a mob(player too perhaps?) be on Idle-movement _while_ he is jumping - so is this handled anywhere else already, or are all of these jump-spells so fast (short time) that there wouldn't be any visual impact? Yea, but don't know how to do that. I just copied nearby function (MonsterMove) that seems to be working fine atm for similar purpose. Maybe should make something in movement generators but still i don't understand that part of the code. Any comments about hard-coded '10' constants? Just giving default values when dbc data is missing. If you got something better for that then contribute it (visually comparing with retail). I don't have any reference, just made it "look ok" I think this effect should be added to the "knockback" effect : shaman's thunderstorm is an example. knockback effects are actually a SMSG_MOVE_KNOCK_BACK, has nothing to do with this.
Lynx3d Posted October 13, 2010 Report Posted October 13, 2010 thanks, looks interesting I think this effect should be added to the "knockback" effect : shaman's thunderstorm is an example. knockback effects are actually a SMSG_MOVE_KNOCK_BACK, has nothing to do with this. Not really true, when using thunderstorm on mobs server does send trajectory movement, only difference is another flag that flips the orientation so "leap" becomes "knock back" effect. For players it's handled by the client of the affected player, server only sends command what momentum player got, and off you go... I experimented a while ago with a movement generator for knockback spells, but it's pretty rudimentary still (assumes flat terrain): http://github.com/Lynx3d/mangos/tree/knockback
faramir118 Posted October 13, 2010 Report Posted October 13, 2010 Go with the custom MovementGenerator. Random calls to StopMoving and SendMonsterMove mess with the improved SendMonsterMoveByPath function in mmaps.
a1ien Posted October 18, 2010 Report Posted October 18, 2010 + uint32 speed_z = m_spellInfo->EffectMiscValue[eff_idx];+ if (!speed_z) + speed_z = 10; + uint32 time = m_spellInfo->EffectMiscValueB[eff_idx]; + if (!time) + time = speed_z * 10; This information was incorrect. If you take Sniff and compare value from offy, you get different data This data from sniff offy spell - http://www.wowhead.com/spell=49575 First test: distance - 10.931 Current Position: 5739,467 175,6612 181,5781Time: 0x000000AF (175) speedZ: float 130,6122 Dest position: 5735,85 185,9771 181,593 Second test: distance - 19.637 Current Position: 5737,253 188,6062 181,593Time: 0x0000013B (315) speedZ: float 40,31242 Dest position: 5726,408 204,9769 181,593 Third test: distance - 8.15411512 Current Position: 5727,32 163,5015 179,2827Time: 0x00000083 (131) speedZ: float 233,0866 Dest position: 5724,258 156,6079 176,1856
Wojta Posted October 18, 2010 Report Posted October 18, 2010 Confirmed here, I have something about Feral charge - cat: http://pastebin.com/vs6R8Enh - when I was at minimal range(8y i think), distance in packet is 13y and something because of object size, so count with it. Just before cat lands, server sends another SMSG_MONSTER_MOVE to turn it to target (But i think that it is enough to send first one with SplineType: FacingTarget) Monster GUID: 0x0100000003591F3DMonster unk byte: 0 Current Position: -9313.498 342.0572 68.65701 Ticks Count: 0x04E3B6EB SplineType: FacingTarget Facing GUID: 0xF13000020D06E922 Spline Flags: WALKMODE Spline Time: 0x00000000 Splines Count: 1 Dest position: -9313.498 342.0572 68.65701 (distance: 0 Offtopic: Notice that player's highguid is 0x0100 (from Burning Blade EU), and on Skullcrusher(EU) it is 0x0200. PS: why did you named it speed?
darkstalker Posted October 18, 2010 Report Posted October 18, 2010 Thanks for the info, i don't have retail access so everything i did is guessed. edit: there is the collected data, first block for feral charge and second for death grip seems to be a lineal relation between travel time and distance, but couldn't find one for speedZ doesn't look like stuff matching DBC data, maybe values are result of calculating parabolic movement
VladimirMangos Posted November 2, 2010 Report Posted November 2, 2010 So base at new data patch expected to be update?
darkstalker Posted November 2, 2010 Report Posted November 2, 2010 i could but don't know how to.. something is missing there, like a formula to correlate DBC data to expected values, now i just see magic numbers
Wojta Posted November 16, 2010 Report Posted November 16, 2010 I think that "magic number" is just angle in radians*100, question is, how to calculate it.
qsa Posted November 16, 2010 Report Posted November 16, 2010 I think that "magic number" is just angle in radians*100, question is, how to calculate it. out_angle = asin(grav*dist)/(veloc^2))/2 Wasn't following the entire discussion, but there aren't too many angles you can talk about while talking about trajectory. Sorry in advance if that isn't what you meant.
qsa Posted November 16, 2010 Report Posted November 16, 2010 What number is gravity in wow? Either there is none, and all things fall at constant speed of about 54y/s or you reach cruise speed very fast. Actually calculating it, gives something around 8~ but it varies too much when delta changes. PS: there's missing "(" in my above post just after arcsin.
Wojta Posted November 16, 2010 Report Posted November 16, 2010 So, let try it with 8, according to http://img713.imageshack.us/img713/9318/shot152.png Feral charge(-6 because of bounding radius, 15 because MiscValue/10): asin((8.0f*(13.942730f-6.0f))/(15.0f*15.0f))/2.0f = 0.144138 which is close if we multiply it by 1000 asin((8.0f*(19.163143f-6.0f))/(15.0ff*15.0f))/2.0f = 0.245302 which is really far from 76.28 asin((8.0f*(24.531327f-6.0f))/(14.95f*15.0f))/2.0f = 0.362614 asin((8.0f*(26.161899f-6.0f))/(15.0f*15.0f))/2.0f = 0.403106 which is close Death Grip: asin((8.0f*(19.637053f))/(15.0f*15.0f))/2.0f = 0.389722 which is also close I dont count cases with z difference, theres something else about them...
michalpolko Posted November 17, 2010 Report Posted November 17, 2010 Can this be used for KnockBack effect?
faramir118 Posted November 18, 2010 Report Posted November 18, 2010 SpeedZ has to be vertical velocity - you can use arbitrarily large numbers, like 1000f, and the mob flies upwards very quickly.
Recommended Posts