;Dash Skill(Apollyon)
;Goto END


;Check blood, remove blood or goto END
Mana = GetUserMana(#USERID)

If Mana > 9
	SetUserMana(#USERID, Mana - 10)
Else
	SendMessageToUser(#USERID, "You do not have enough blood to use this skill!", #MSG_CRITICAL)
	Goto END
EndIf

WDamage = 0
EquipedWeapon = GetUserEquippedWeapon(#USERID)
If EquipedWeapon > -1
	WDamage = GetItemFlag1(GetUserInvItem(#USERID, EquipedWeapon))
EndIf

BDamage = Floor(GetUserStrength(#USERID) * 0.66)
TDamage = Floor(WDamage * 1.5) + BDamage

PlusX = 0
PlusY = 0

DIR = GetUserDirection(#USERID)
If DIR = #DIR_UP
	PlusY = -1
ElseIf DIR = #DIR_DOWN
	PlusY = 1
ElseIf DIR = #DIR_LEFT
	PlusX = -1
ElseIf DIR = #DIR_RIGHT
	PlusX = 1
EndIf


Step = 0
Warping = 0
While Step < 4
	Step=Step+1
	Warping = Step
	DoDamage = 1
	X = #XPOS+Floor(PlusX*Step)
	Y = #YPOS+Floor(PlusY*Step)
	TargetID = GetUserAtXY(#MAPID, X, Y)
	MonsterID = GetMonsterAtXY(#MAPID, X, Y)
	
	If TargetID = 0
		DoDamage = 0
	EndIf
	If TargetID = #USERID
		DoDamage = 0
	EndIf
	If GetUserGuild(#USERID) > 0
		If GetUserGuild(TargetID) = GetUserGuild(#USERID)
			DoDamage = 0
		EndIf
	EndIf
	If MapType(#MAPID) = #MAPTYPE_FRIENDLY
		DoDamage = 0
	EndIf
	;If IsNeutralAndBothPlayersAreNotInAGuild = 1
	If GetMapType(#MAPID) = #MAPTYPE_NEUTRAL
		If GetUserGuild(#USERID) = 0
			If GetUserGuild(TargetID) = GetUserGuild(#USERID)
				DoDamage = 0
			EndIf
		EndIf	
	EndIf
	If DoDamage = 1
		UserDamageUser(#USERID, TDamage, TargetID)
	EndIf
	If MonsterID > -1
		UserDamageMonster(MonsterID, TDamage, #USERID)
	EndIf
	If GetTileType(#MAPID, X, Y) = #TILE_DOOR 
		Warping = Step-1
		Goto WARP
	EndIf
	If GetTileType(#MAPID, X, Y) = #TILE_WARP 
		Warping = Step-1
		Goto WARP
	EndIf
	If GetTileType(#MAPID, X, Y) = #TILE_SCRIPTED
		Warping = Step-1
		Goto WARP
	EndIf
	If GetTileType(#MAPID, X, Y) = #TILE_WALL
		Warping = Step-1
		Goto WARP
	EndIf
	If GetTileType(#MAPID, X, Y) = #TILE_NPC
		Warping = Step-1
		Goto WARP
	EndIf
	If GetTileType(#MAPID, X, Y) = #TILE_GODONLY
		Warping = Step-1
		Goto WARP
	EndIf


Wend

Label WARP

WarpX = #XPOS+Floor(PlusX*Warping)
If WarpX > 20
	WarpX = 20
ElseIf WarpX < 0
	WarpX = 0
EndIf

WarpY = #YPOS+Floor(PlusY*Warping)
If WarpY > 20
	WarpY = 20
ElseIf WarpY < 0
	WarpY = 0
EndIf

WarpUser(#USERID, #MAPID, WarpX, WarpY)


Label END

Continue = 1