if (dwVnum == SKILL_DODGE)
{
// Dodge skill: Test movement only (no affects for now)
int iSPCost = 290; // SP cost
if (GetSP() < iSPCost)
{
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Not enough SP"));
return false;
}
PointChange(POINT_SP, -iSPCost);
// DEBUG: Initial state
sys_log(0, "DODGE_DEBUG: Character=%s", GetName());
sys_log(0, "DODGE_DEBUG: Current Position: X=%ld Y=%ld", GetX(), GetY());
sys_log(0, "DODGE_DEBUG: Current Rotation: %.2f degrees", GetRotation());
// Test: Simple backward movement
float fDistance = 1000.0f;
float degree = GetRotation();
float fx = 0.0f, fy = 0.0f;
// Backward direction
GetDeltaByDegree(degree + 180.0f, fDistance, &fx, &fy);
long targetX = (long)(GetX() + fx);
long targetY = (long)(GetY() + fy);
// DEBUG: Calculated values
sys_log(0, "DODGE_DEBUG: Distance=%.2f Degree=%.2f BackwardDegree=%.2f", fDistance, degree, degree + 180.0f);
sys_log(0, "DODGE_DEBUG: Delta: fx=%.2f fy=%.2f", fx, fy);
sys_log(0, "DODGE_DEBUG: Target Position: X=%ld Y=%ld", targetX, targetY);
ChatPacket(CHAT_TYPE_INFO, "[DEBUG] Dodge: From (%ld,%ld) to (%ld,%ld) - Rot:%.1f", GetX(), GetY(), targetX, targetY, GetRotation());
// Knockback-style slide movement
sys_log(0, "DODGE_DEBUG: Calling Sync(%ld, %ld)", targetX, targetY);
Sync(targetX, targetY);
sys_log(0, "DODGE_DEBUG: After Sync - Position: X=%ld Y=%ld", GetX(), GetY());
sys_log(0, "DODGE_DEBUG: Calling Goto(%ld, %ld)", targetX, targetY);
Goto(targetX, targetY);
sys_log(0, "DODGE_DEBUG: Calling CalculateMoveDuration()");
CalculateMoveDuration();
sys_log(0, "DODGE_DEBUG: Calling SyncPacket()");
SyncPacket();
sys_log(0, "DODGE_DEBUG: Movement complete - Final Position: X=%ld Y=%ld", GetX(), GetY());
ChatPacket(CHAT_TYPE_INFO, "[DEBUG] Dodge complete! Final pos: (%ld,%ld)", GetX(), GetY());
return true;
}