Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::Windows Servers

Support::Windows Servers Support forum for Windows EQEMu users.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 07-16-2014, 11:03 PM
Zaela_S
Hill Giant
 
Join Date: Jun 2012
Posts: 216
Default

Vector math, yay.

I'm not sure if the server codebase has a complete vector implementation, and vector math always confuses me, but I believe you'd want something like this pseudocode:

Code:
Vector a(pusher->GetX(), pusher->GetY(), 0);
Vector b(target->GetX(), target->GetY(), 0);

Vector c = a - b;
c.normalize();
c *= MakeRandomFloat(0, 0.1f); //can leave out if the amount of push should equal 1 unit

b -= c;
Where b ends up being the X+Y position of the target pushed back by the randomized number of units away relative to the pusher's X+Y position. For NPCs you'd just update their position to that and then send out position update packets. Not sure how to apply to Clients; same kind of thing might be okay.

I leave it to you to look up the vector operations if needed cuz I hate em. Maybe we already have functions for that stuff though, too lazy to look right now.
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 06:42 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3