;'Stab' Skill script

UserID=#USERID
TargetID=0

Damage=GetUserStrength(UserID)
Weapon=GetUserEquippedWeapon(UserID)
Damage=Damage+GetItemFlag1(GetUserInvItem(UserID,Weapon))

PosX=0
PosY=0
If GetUserDirection(UserID) = #DIR_UP
	PosY=-1
ElseIf GetUserDirection(UserID) = #DIR_DOWN
	PosY=1
ElseIf GetUserDirection(UserID) = #DIR_LEFT 
	PosX=-1
ElseIf GetUserDirection(UserID) = #DIR_RIGHT
	PosX=1
EndIf

TargetID=GetUserAt(#MAPID,#XPOS+PosX,#YPOS+PosY)

If TargetID > 0
	If GetMapType(#MAPID) <> #MAPTYPE_FRIENDLY 
		If GetMapType(#MAPID) = #MAPTYPE_NEUTRAL 
			If GetUserGuild(TargetID) = 0
				GoTo END
			EndIf
			If GetUserGuild(UserID) = 0
				GoTo END
			EndIf
		EndIf
		If GetUserGuild(UserID) = GetUserGuild(TargetID)
			GoTo END
		EndIf
		If UserID = TargetID
			GoTo END
		EndIf
		If GetUserAccess(TargetID) > 5
			If GetUserAccess(UserID) < 6
				GoTo END
			EndIf
		EndIf
	EndIf
EndIf

Label END

Continue = 1