CurrX=#PARAM2
CurrY=#PARAM3
DamageAmount=25


If GetUserX(#PARAM1)>CurrX
	CurrX=CurrX+1
Endif
If GetUserX(#PARAM1)<CurrX
	CurrX=CurrX-1
Endif

If GetUserY(#PARAM1)>CurrY
	CurrY=CurrY+1
Endif
If GetUserY(#PARAM1)<CurrY
	CurrY=CurrY-1
Endif

CreateEffect(4,1000,0,#DIR_UP,GetUserMap(#PARAM1),CurrX,CurrY,0,0,0)

UserID = GetUserAtXY(GetUserMap(#PARAM1),CurrX,CurrY)

If UserID > 0
	If CanAttack(GetUserMap(UserID), #PARAM4, UserID) = 1
		UserDamageUser(#PARAM4, DamageAmount, UserID)
	EndIf
	CreateEffect(0,600,0,#DIR_UP,GetUserMap(#PARAM1),CurrX,CurrY,0,0,0)
	Goto End
Endif

If GetUserX(#PARAM1)=CurrX
	If GetUserY(#PARAM1)=CurrY
		If CanAttack(GetUserMap(#PARAM1),#PARAM4,#PARAM1) = 1
			UserDamageUser(#PARAM4, DamageAmount, #PARAM1)
		EndIf
		CreateEffect(0,600,0,#DIR_UP,GetUserMap(#PARAM1),CurrX,CurrY,0,0,0)
		Goto End
	Else
		Goto Target
	Endif
Else
	Goto Target
Endif

Goto End

Label Target
Timer5(316,1000,#PARAM1,CurrX,CurrY,#PARAM4,0)

Label End


Continue = 1