
SetUserFlag(#PARAM1,4,GetUserFlag(#PARAM1,4)+1)
SpamCheck=#PARAM2

If GetUserFlag(#PARAM1,4)<>SpamCheck
	Goto End
Endif



If GetUserFlag(#PARAM1,4)>5000
	SetUserFlag(#PARAM1,4,0)
	SpamCheck=0
Endif
	


;SendCombatMessage(GetUserID("Shrike"),GetUserFlag(#PARAM1,4))

Damage=GetUserStrength(#PARAM1)
Damage=Random(0,Damage)

Distance=Random(1,40)
Speed=Floor(Floor(Random(0,180)*Random(1,1000))/GetUserWisdom(#PARAM1))

XYPOS=1

If Distance<31
XPOS=Random(-1,1)
YPOS=Random(-1,1)
Elseif Distance<36
XPOS=Random(-2,2)
YPOS=Random(-2,2)
Elseif Distance<39
XPOS=Random(-3,3)
YPOS=Random(-3,3)
Else
XPOS=Random(-4,4)
YPOS=Random(-4,4)
Endif

If GetUserInvItem(#PARAM1,GetUserEquippedArmor(#PARAM1))=558
If GetUserSprite(#PARAM1)=84
If IsOnline(#PARAM1)=1
	If XPOS=0
		IF YPOS=0
			XYPOS=0
		Endif
	Endif
	If XYPOS<>0
	CreateEffect(52,500,0,#DIR_UP,GetUserMap(#PARAM1),GetUserX(#PARAM1)+XPOS,GetUserY(#PARAM1)+YPOS,0,0,0)
	Endif

	UserID=GetUserAtXY(GetUserMap(#PARAM1),GetUserX(#PARAM1)+XPOS,GetUserY(#PARAM1)+YPOS)
	MonsterID=GetMonsterAtXY(GetUserMap(#PARAM1),GetUserX(#PARAM1)+XPOS,GetUserY(#PARAM1)+YPOS)

	If MonsterID>=0
		CreateEffect(0,500,0,#DIR_UP,GetUserMap(#PARAM1),GetUserX(#PARAM1)+XPOS,GetUserY(#PARAM1)+YPOS,0,0,0)
		CreateEffect(52,500,0,#DIR_UP,GetUserMap(#PARAM1),GetUserX(#PARAM1)+XPOS,GetUserY(#PARAM1)+YPOS,0,0,0)
		UserDamageMonster(MonsterID,Damage,#PARAM1)
	Endif

	If UserID > 0
		If UserID <> #PARAM1
			If CanAttack(GetUserMap(#PARAM1),#PARAM1,UserID)=1
				CreateEffect(0,500,0,#DIR_UP,GetUserMap(#PARAM1),GetUserX(#PARAM1)+XPOS,GetUserY(#PARAM1)+YPOS,0,0,0)
				CreateEffect(52,500,0,#DIR_UP,GetUserMap(#PARAM1),GetUserX(#PARAM1)+XPOS,GetUserY(#PARAM1)+YPOS,0,0,0)
				UserDamageUser(#PARAM1,Damage,UserID)
			Else
				Sprite = GetClassSprite(GetUserClass(UserID))
				if GetUserGuild(UserID)>0
					Guild = GetGuildSprite(GetUserGuild(UserID))
				Else
					Guild = 0
				Endif
				If GetUserSprite(UserID) = Sprite
					CreateEffect(5,250,0,#DIR_UP,GetUserMap(#PARAM1),GetUserX(#PARAM1)+XPOS,GetUserY(#PARAM1)+YPOS,0,0,0)
					CreateEffect(52,500,0,#DIR_UP,GetUserMap(#PARAM1),GetUserX(#PARAM1)+XPOS,GetUserY(#PARAM1)+YPOS,0,0,0)
					SetUserSprite(UserID, 84)
					Timer(726,5000,UserID,0,0)
				Elseif GetUserSprite(UserID) = Guild
					CreateEffect(5,250,0,#DIR_UP,GetUserMap(#PARAM1),GetUserX(#PARAM1)+XPOS,GetUserY(#PARAM1)+YPOS,0,0,0)
					CreateEffect(52,500,0,#DIR_UP,GetUserMap(#PARAM1),GetUserX(#PARAM1)+XPOS,GetUserY(#PARAM1)+YPOS,0,0,0)
					SetUserSprite(UserID, 84)
					Timer(726,Random(5000,10000),UserID,0,0)
				Endif
			Endif
		Endif
	;Else
	;	If GetTileType(GetUserMap(#PARAM1),GetUserX(#PARAM1)+XPOS,GetUserY(#PARAM1)+YPOS)<>#TILE_WALL
	;	If GetTileType(GetUserMap(#PARAM1),GetUserX(#PARAM1)+XPOS,GetUserY(#PARAM1)+YPOS)<>#TILE_GOD
	;	If GetTileType(GetUserMap(#PARAM1),GetUserX(#PARAM1)+XPOS,GetUserY(#PARAM1)+YPOS)<>#TILE_DOOR
	;	If GetTileType(GetUserMap(#PARAM1),GetUserX(#PARAM1)+XPOS,GetUserY(#PARAM1)+YPOS)<>#TILE_WARP
	;	If GetTileType(GetUserMap(#PARAM1),GetUserX(#PARAM1)+XPOS,GetUserY(#PARAM1)+YPOS)<>#TILE_NPC
	;	If GetTileType(GetUserMap(#PARAM1),GetUserX(#PARAM1)+XPOS,GetUserY(#PARAM1)+YPOS)<>#TILE_GUILDHALL
	;	CreateEffect(13,500,0,#DIR_UP,GetUserMap(#PARAM1),GetUserX(#PARAM1)+XPOS,GetUserY(#PARAM1)+YPOS,0,0,0)
	;	CreateEffect(52,500,0,#DIR_UP,GetUserMap(#PARAM1),GetUserX(#PARAM1)+XPOS,GetUserY(#PARAM1)+YPOS,0,0,0)
	;	SpawnMonster(GetUserMap(#PARAM1),280,GetUserX(#PARAM1)+XPOS,GetUserY(#PARAM1)+YPOS)
	;	Endif
	;	Endif
	;	Endif
	;	Endif
	;	Endif
	;	Endif
	Endif


Endif
Endif
Timer(725,Speed,#PARAM1,SpamCheck+1,0)
Endif

Label End

Continue = 1