http://forum.ragezone.com/f921/delphi-maplestory-gm-client-1159523/
Code:
if HasEntry(Path + '/origin') then
begin
case MirrorX of
True:
begin
Self.Flip := -1;
if Owner.InLadder then
AdjX := 3
else
AdjX := 0;
Origin.X := EquipData[Path + '/origin'].Vector.X - Self.ImageWidth + AdjX;
end;
False:
begin
Self.Flip := 1;
Origin.X := -EquipData[Path + '/origin'].Vector.X;
end;
end;
Origin.Y := -EquipData[Path + '/origin'].Vector.Y;
end;
if HasEntry(Path + '/map/brow') then
begin
Brow.X := -EquipData[Path + '/map/brow'].Vector.X * Self.Flip;
Brow.Y := -EquipData[Path + '/map/brow'].Vector.Y;
if Image = 'head' then
HeadBrow := Brow;
Self.Offset.X := Origin.X + HeadNeck.X - BodyNeck.X - HeadBrow.X + Brow.X - TamingNavel.X;
Self.Offset.Y := Origin.Y + HeadNeck.Y - BodyNeck.Y - HeadBrow.Y + Brow.Y - TamingNavel.Y;
end;
if HasEntry(Path + '/map/neck') then
begin
Neck.X := -EquipData[Path + '/map/neck'].Vector.X * Self.Flip;
Neck.Y := -EquipData[Path + '/map/neck'].Vector.Y;
if Image = 'body' then
BodyNeck := Neck;
if Image = 'head' then
HeadNeck := Neck;
end;
if HasEntry(Path + '/map/hand') then
begin
Hand.X := -EquipData[Path + '/map/hand'].Vector.X * Self.Flip;
Hand.Y := -EquipData[Path + '/map/hand'].Vector.Y;
if Image = 'arm' then
ArmHand := Hand;
if Image = 'body' then
BodyHand := Hand;
Self.Offset.X := Origin.X + Hand.X + ArmNavel.X - ArmHand.X - BodyNavel.X;
Self.Offset.Y := Origin.Y + Hand.Y + ArmNavel.Y - ArmHand.Y - BodyNavel.Y;
end;
if HasEntry(Path + '/map/handMove') then
begin
HandMove.X := -EquipData[Path + '/map/handMove'].Vector.X * Self.Flip;
HandMove.Y := -EquipData[Path + '/map/handMove'].Vector.Y;
if Image = 'lHand' then
lHandMove := HandMove;
Self.Offset.X := Origin.X + HandMove.X - lHandMove.X;
Self.Offset.Y := Origin.Y + HandMove.Y - lHandMove.Y;
end;
if HasEntry(Path + '/map/navel') then
begin
Navel.X := -EquipData[Path + '/map/navel'].Vector.X * Self.Flip;
Navel.Y := -EquipData[Path + '/map/navel'].Vector.Y;
if Image = 'arm' then
ArmNavel := Navel;
if Image = 'body' then
BodyNavel := Navel;
Self.Offset.X := Origin.X + Navel.X - BodyNavel.X - TamingNavel.X;
Self.Offset.Y := Origin.Y + Navel.Y - BodyNavel.Y - TamingNavel.Y;
end;
Hello, thanks for the code!
I've tried calculating with it the body and the arm, but this is what I got:
You must be registered to see links
It's close but not exactly in the right place where it should be.
Here are my calculations:
TamingNavel.X = 0; // I guess?
TamingNavel.Y = 0; // I guess?
MirrorX = 0;
// I skipped "map/hand" and "map/neck" because they don't do anything in this case, I think.
Body:
Origin.X = -16;
Origin.Y = -31;
Navel.X = -(-8) = 8;
Navel.Y = -(-21) = 21;
BodyNavel = Navel;
Offset.X = Origin.X + Navel.X - BodyNavel.X - TamingNavel.X = -16 + 8 - 8 - 0 = -16;
Offset.Y = Origin.Y + Navel.Y - BodyNavel.Y - YamingNavel.Y = -31 + 21 - 21 - 0 = -31;
Arm:
Origin.X = -5;
Origin.Y = -9;
Navel.X = -(-13) = 13;
Navel.Y = -(-1) = 1;
Offset.X = Origin.X + Navel.X - BodyNavel.X - TamingNavel.X = -5 + 13 - 8 - 0 = 0;
Offset.Y = Origin.Y + Navel.Y - BodyNavel.Y - TamingNavel.Y = -9 + 1 - 21 - 0 = -29;
Drawing(The 100 is just so I can see the sprites): // Am I drawing right?
draw(100 + -16, 100 + - 31, body); // 100 + Offset.X, 100 + Offset.Y
draw(100 + 0, 100 + -29, arm); // 100 + Offset.X, 100 + Offset.Y
------------------
Thanks!