;Jason Attack
SetUserFlag(0,31,1)
JasonWarp=0

Label BeginAttack

SpawnX=Random(0,20)
SpawnY=Random(0,20)

If JasonWarp=0
If GetUserMap(GetUserID("Jason"))=GetUserMap(GetUserID(GetUserMessage(#USERID)))
SpawnX=GetUserX(GetUserID("Jason"))
SpawnY=GetUserY(GetUserID("Jason"))
Else
JasonWarp=1
Goto End
SetUserSprite(GetUserID("Jason"),0)
SetUserDisplayName(GetUserID("Jason"),"")
WarpUser(GetUserID("Jason"),#MAPID,SpawnX,SpawnY)
Endif
Endif

;SendMessageToMap(GetUserMap(GetUserID(GetUserMessage(#USERID))),"* Jason goes into a killer rage!", #MSG_CRITICAL)
;CreateEffect(35,2000,0,#DIR_UP,GetUserMap(GetUserID("Jason")),SpawnX,SpawnY,0,0,0)
;CreateEffect(34,1750,0,#DIR_UP,GetUserMap(GetUserID("Jason")),SpawnX,SpawnY,0,0,0)
;CreateEffect(33,1500,0,#DIR_UP,GetUserMap(GetUserID("Jason")),SpawnX,SpawnY,0,0,0)
;CreateEffect(32,1250,0,#DIR_UP,GetUserMap(GetUserID("Jason")),SpawnX,SpawnY,0,0,0)


If JasonWarp<>0
If GetTileType(GetUserMap(GetUserID(GetUserMessage(#USERID))),SpawnX,SpawnY)<>#TILE_DOOR
If GetTileType(GetUserMap(GetUserID(GetUserMessage(#USERID))),SpawnX,SpawnY)<>#TILE_WALL
If GetTileType(GetUserMap(GetUserID(GetUserMessage(#USERID))),SpawnX,SpawnY)<>#TILE_NPC
If GetTileType(GetUserMap(GetUserID(GetUserMessage(#USERID))),SpawnX,SpawnY)<>#TILE_GODONLY
If GetTileType(GetUserMap(GetUserID(GetUserMessage(#USERID))),SpawnX,SpawnY)<>#TILE_NOMONSTER
If GetTileType(GetUserMap(GetUserID(GetUserMessage(#USERID))),SpawnX,SpawnY)<>#TILE_GUILDHALL
If GetTileType(GetUserMap(GetUserID(GetUserMessage(#USERID))),SpawnX,SpawnY)<>#TILE_WARP
Goto StartAttack
Endif
Endif
Endif
Endif
Endif
Endif
Endif

Else
Goto StartAttack
Endif

Goto BeginAttack

Label StartAttack	

If Floor(GetUserID(GetUserMessage(#USERID)))>0
	SetUserSprite(GetUserID("Jason"),0)
	SetUserDisplayName(GetUserID("Jason"),"")
	SpawnMonster(GetUserMap(GetUserID(GetUserMessage(#USERID))),249,SpawnX,SpawnY)
	WarpUser(GetUserID("Jason"),GetUserMap(GetUserID(GetUserMessage(#USERID))),GetUserX(GetUserID(GetUserMessage(#USERID))),GetUserY(GetUserID(GetUserMessage(#USERID))))
	SetMonsterTarget (GetUserMap(GetUserID(GetUserMessage(#USERID))),8,GetUserID(GetUserMessage(#USERID)))
	SetMonsterTarget (GetUserMap(GetUserID(GetUserMessage(#USERID))),9,GetUserID(GetUserMessage(#USERID)))
	SetMonsterTarget (GetUserMap(GetUserID(GetUserMessage(#USERID))),10,GetUserID(GetUserMessage(#USERID)))
	SetMonsterTarget (GetUserMap(GetUserID(GetUserMessage(#USERID))),11,GetUserID(GetUserMessage(#USERID)))
	SetMonsterTarget (GetUserMap(GetUserID(GetUserMessage(#USERID))),12,GetUserID(GetUserMessage(#USERID)))
	SetMonsterTarget (GetUserMap(GetUserID(GetUserMessage(#USERID))),13,GetUserID(GetUserMessage(#USERID)))
	SetMonsterTarget (GetUserMap(GetUserID(GetUserMessage(#USERID))),14,GetUserID(GetUserMessage(#USERID)))
	SetMonsterTarget (GetUserMap(GetUserID(GetUserMessage(#USERID))),15,GetUserID(GetUserMessage(#USERID)))
	Timer(603,1000,GetUserID(GetUserMessage(#USERID)),#MAPID,0)
Endif


Label End

Continue = 1