Author Topic: Getting creature speed  (Read 652 times)

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Getting creature speed
« Reply #15 on: January 25, 2016, 07:07:12 pm »


               


I managed to fix this.


 


Monk 21 speed 1.7 after haste (from any source) 2.2. But I dont know how it should behave further. What should happen after casting expeditious retreat? I have two possibilities either 2.2 (nothing) or 2.95. Or maybe totally different number?




 


The stacking of perma-haste with expeditious retreat should be 1.5*1.5+ monk speed, which for level 21 should be 2.95; this is what is registered when you add and remove a speed effect thereafter, and thus it is the simplest fix.


 


However, we both know that BioWare did make the spell haste incompatible with expeditious retreat, (and even the epic feat has measures to prevent stacking one way).  Only mass haste (and haste-slow if you wish to count that) was neglected from the implementation.  If you interpret that retreat should not stack with any haste source, then you could reasonably argue that 2.2 should be used instead.


               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Getting creature speed
« Reply #16 on: January 25, 2016, 08:18:35 pm »


               

Well in that case I think I got it right.

 
Here is plugin prerelease for testing. This is version2, I got simple fix that works perfectly but can be a bit inefficient in multiplayer as it runs too often, so I was trying to patch it assembler which should be many times faster. But its always a bit risky and can cause crashes. If something like that happen let me know.

 

To get current speed you can use this code in OnChat event:

 



if(sMessage == "testspeed")

 {

    SetLocalString(oPC,"NWNX!PATCH!GetMovementRateFactor","...........................");

    string sSpeed = GetLocalString(oPC,"NWNX!PATCH!GetMovementRateFactor");

    DeleteLocalString(oPC,"NWNX!PATCH!GetMovementRateFactor");

    SendMessageToPC(oPC,"speed: "+sSpeed);

}




Expeditious: yes, I was using haste item not haste spell and haste from item stacks.