Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Perfect World
You last visited: Today at 13:39

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Calculation formula for Mob Distance in Delphi

Discussion on Calculation formula for Mob Distance in Delphi within the Perfect World forum part of the MMORPGs category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Mar 2013
Posts: 17
Received Thanks: 3
Calculation formula for Mob Distance in Delphi

I got xyz cords like 1234.3245545454 and wonder how to calculate the distance to a Mob from that.

So how do you calculate the ingame distance to mob's in delphi ?


Distance between two points Tutorial:
Afro-Head is offline  
Old 03/28/2013, 11:04   #2
 
Sᴡoosh's Avatar
 
elite*gold: 20
Join Date: May 2009
Posts: 1,290
Received Thanks: 326
Code:
{$REGION 'Distance stuff'}
function TGrindThread.Distance(P1, P2, Q1, Q2: single): single;
begin
  result := sqrt(Power(P1 - Q1, 2) + Power(P2 - Q2, 2))
end;

function TGrindThread.distanceline(l1, l2: Single): Single;
begin
  result := Abs(l1 - l2);
end;
{$ENDREGION}
Cheers
Sᴡoosh is offline  
Thanks
1 User
Old 03/29/2013, 00:27   #3
 
elite*gold: 0
Join Date: Mar 2013
Posts: 17
Received Thanks: 3
Thanks Swoosh,
i made it the same like you :-)

Quote:
Distance:=Round(Sqrt( power((CHAR_X-MOB_X),2)+ power((CHAR_Y-MOB_Y),2 ) ));
First without power, then see Error on - Numbers.
Afro-Head is offline  
Reply


Similar Threads Similar Threads
DELPHI - Who make Exploits, Hacks and Tools with DELPHI?
05/15/2013 - CO2 Programming - 13 Replies
Hi all. Iwith DELPHI, but a dont now. hello, I use Delphi to program and i like someone put here source code of make Exploits, Hacks and Tools bot here, or part of the code. ty to all
Exp Calculation
08/21/2011 - CO2 Private Server - 4 Replies
I know this is not real exp calculation and it's custom. Just wondering, if it would be a good way to do it custom. static ulong GetExerience(ulong GainExperience, byte attLevel, byte oppLevel, byte Rate, uint Damage, byte Reborns, byte TeamMembers) { ulong Experience = (attLevel <= oppLevel) ? (GainExperience * Rate) : ((GainExperience / attLevel) * Rate); Experience += (ulong)(Damage ^ (Reborns + oppLevel)) / TeamMembers; return...
Exp calculation?
01/09/2011 - CO2 Programming - 3 Replies
Hey, Does anyone has a decent exp calculation, or show me atleast how it is calculated? I really have no idea when it comes to conquer. Thanks in advance, ImmuneOne.
[DELPHI&METIN]Wie sind die Delphi Befehle für einen Bot?
03/07/2010 - General Coding - 3 Replies
Hallo liebe com, ich habe mal eine Frage: Ich möchte einen Metin Bot in Delphi schreiben aber ich weiß nicht die Befehle für eine bestimmte Taste senden etc. könnt ihr mir die pls sagen oder per pn geben MfGGGGGG



All times are GMT +1. The time now is 13:41.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.