Log in

View Full Version : a way to look if..



sjlou
12-13-2011, 09:43 PM
..a NPC is in a fight

Main
12-13-2011, 09:45 PM
Off my clan war fighter.

Function Fighting( T: Tpoint): Boolean;
//Finds If hp bar is present around the given point 'T', I use it to check If other is in fight.
Var
OFX, OFY: Tpoint;
HPMod: Integer;
Begin
HPMod := 100 * ( T.Y - MSCY) / MSY2;
OFX := IntToPoint( T.X - 25, T.X + 25);
OFY := IntToPoint( T.Y - ( 100 + HPMod), T.Y);
If OFX.X < 0 Then
OFX.X := 0;
If OFY.X < 0 Then
OFY.X := 0;
Result := FindColorSpiralTolerance( T.X, T.Y, 52606, OFX.X, OFY.X, OFX.Y, OFY.Y, 39) OR FindColorSpiralTolerance( T.X, T.Y, 327842, OFX.X, OFY.X, OFX.Y, OFY.Y, 25);
End;

It look for hp bar around the possible areas for a monster that equal or smaller than a normal player, (so if you have like a corp beast or jad it wouldn't work that well).

The color might still work, if not just update it with the current color of the green and red (in hp bar).

Home
12-13-2011, 09:46 PM
..a NPC is in a fight


InFight

It's in Misc/Fighting.scar

Although I suggest you to create own function for this.


~Home

Kyle Undefined
12-13-2011, 09:46 PM
srl_inFight?

EDIT: :ninja:'d