;"Inferno" skill

;The cost of blood the skill takes
BloodCost = 10

;The amount of HP the skill will deal
HealthDealt = 15

;The effect graphic to use
Graphic = 0

;Counts how many people where hit
Counter = 0

If GetUserWisdom(#USERID) > 39
   BloodCost = 40
   HealthDealt = 60
ElseIf GetUserWisdom(#USERID) > 29
   BloodCost = 30
   HealthDealt = 45
ElseIf GetUserWisdom(#USERID) > 19
   BloodCost = 24
   HealthDealt = 30
ElseIf GetUserWisdom(#USERID) > 9
   BloodCost = 16
   HealthDealt = 20
EndIf

If GetUserMana(#USERID) < BloodCost
   SendMessageToUser(#USERID, "You do not have enough blood to use the Inferno skill!", #MSG_CRITICAL)
   GoTo END
EndIf

X1 = #XPOS - 1
X2 = #XPOS
X3 = #XPOS + 1
X4 = #XPOS + 1
X5 = #XPOS + 1
X6 = #XPOS
X7 = #XPOS - 1
X8 = #XPOS - 1
X9 = #XPOS
X10 = #XPOS + 2
X11 = #XPOS
X12 = #XPOS - 2
Y1 = #YPOS - 1
Y2 = #YPOS - 1
Y3 = #YPOS - 1
Y4 = #YPOS
Y5 = #YPOS + 1
Y6 = #YPOS + 1
Y7 = #YPOS + 1
Y8 = #YPOS 
Y9 = #YPOS - 2
Y10 = #YPOS
Y11 = #YPOS + 2
Y12 = #YPOS

;Burn all players in the surrounding area

;-----------------------------------------------------------------------
UserID = GetUserAtXY(#MAPID, X1, Y1)
MonsterID = GetMonsterAtXY(#MAPID, X1, Y1)
If MonsterID <> -1
   DamageMonster(#MAPID,MonsterID,HealthDealt)
   CreateEffect(Graphic,350,0,#DIR_UP,#MAPID,X1,Y1,0,UserID,0)
   Counter = Counter + 1
ElseIf UserID > 0
   CreateEffect(Graphic,350,0,#DIR_UP,#MAPID,X1,Y1,0,UserID,0)
   Counter = Counter + 1
EndIf
If UserID > 0
	If GetUserAccess(UserID) > 0
		Pass = 1
	EndIf
	If GetMapType(#MAPID) = #MAPTYPE_FRIENDLY
		Pass = 1
	ElseIf GetMapType(#MAPID) = #MAPTYPE_NEUTRAL
		If GetUserGuild(#USERID) = 0
			Pass = 1
		ElseIf GetUserGuild(UserID) = 0
			Pass = 1
		EndIf
		If GetUserGuild(UserID ) = GetUserGuild(#USERID) 
			Pass = 1
		EndIf
	EndIf
 	
	If Pass = 0
	Damage = HealthDealt 
   
   MagicDefense = GetUserWisdom(UserID)
   MagicDefense = MagicDefense / 5
   MagicDefense = Floor(MagicDefense)
   
   Damage = Damage - MagicDefense
   If Damage < 5
      Damage = 5
   EndIf
   DamageUser(UserID,Damage)
100   
   SendMessageToUser(UserID, "Fire consumes your flesh.", #MSG_CRITICAL)
	EndIf
EndIf
;-----------------------------------------------------------------------
UserID = GetUserAtXY(#MAPID, X2, Y2)
MonsterID = GetMonsterAtXY(#MAPID, X2, Y2)
If MonsterID <> -1
   DamageMonster(#MAPID,MonsterID,HealthDealt)
   CreateEffect(Graphic,350,0,#DIR_UP,#MAPID,X2,Y2,0,UserID,0)
   Counter = Counter + 1
ElseIf UserID > 0
   CreateEffect(Graphic,350,0,#DIR_UP,#MAPID,X2,Y2,0,UserID,0)
   Counter = Counter + 1
EndIf
If UserID > 0
   	If GetUserAccess(UserID) > 0
		Pass = 1
	EndIf
	If GetMapType(#MAPID) = #MAPTYPE_FRIENDLY
		Pass = 1
	ElseIf GetMapType(#MAPID) = #MAPTYPE_NEUTRAL
		If GetUserGuild(#USERID) = 0
			Pass = 1
		ElseIf GetUserGuild(UserID) = 0
			Pass = 1
		EndIf
		If GetUserGuild(UserID ) = GetUserGuild(#USERID) 
			Pass = 1
		EndIf
	EndIf

 	If Pass = 0
   Damage = HealthDealt 
   
   MagicDefense = GetUserWisdom(UserID)
   MagicDefense = MagicDefense / 5
   MagicDefense = Floor(MagicDefense)
   
   Damage = Damage - MagicDefense
   If Damage < 5
      Damage = 5
   EndIf
   DamageUser(UserID,Damage)
   
   SendMessageToUser(UserID, "Fire consumes your flesh.", #MSG_CRITICAL)
	EndIf
EndIf
;-----------------------------------------------------------------------
UserID = GetUserAtXY(#MAPID, X3, Y3)
MonsterID = GetMonsterAtXY(#MAPID, X3, Y3)
If MonsterID <> -1
   DamageMonster(#MAPID,MonsterID,HealthDealt)
   CreateEffect(Graphic,350,0,#DIR_UP,#MAPID,X3,Y3,0,UserID,0)
   Counter = Counter + 1
ElseIf UserID > 0
   CreateEffect(Graphic,350,0,#DIR_UP,#MAPID,X3,Y3,0,UserID,0)
   Counter = Counter + 1
EndIf
If UserID > 0
   	If GetUserAccess(UserID) > 0
		Pass = 1
	EndIf
	If GetMapType(#MAPID) = #MAPTYPE_FRIENDLY
		Pass = 1
	ElseIf GetMapType(#MAPID) = #MAPTYPE_NEUTRAL
		If GetUserGuild(#USERID) = 0
			Pass = 1
		ElseIf GetUserGuild(UserID) = 0
			Pass = 1
		EndIf
		If GetUserGuild(UserID ) = GetUserGuild(#USERID) 
			Pass = 1
		EndIf
	EndIf
 
 	If Pass = 0
   Damage = HealthDealt 
   
   MagicDefense = GetUserWisdom(UserID)
   MagicDefense = MagicDefense / 5
   MagicDefense = Floor(MagicDefense)
   
   Damage = Damage - MagicDefense
   If Damage < 5
      Damage = 5
   EndIf
   DamageUser(UserID,Damage)
   
   SendMessageToUser(UserID, "Fire consumes your flesh.", #MSG_CRITICAL)
	EndIf
EndIf
;-----------------------------------------------------------------------
UserID = GetUserAtXY(#MAPID, X4, Y4)
MonsterID = GetMonsterAtXY(#MAPID, X4, Y4)
If MonsterID <> -1
   DamageMonster(#MAPID,MonsterID,HealthDealt)
   CreateEffect(Graphic,350,0,#DIR_UP,#MAPID,X4,Y4,0,UserID,0)
   Counter = Counter + 1
ElseIf UserID > 0
200   CreateEffect(Graphic,350,0,#DIR_UP,#MAPID,X4,Y4,0,UserID,0)
   Counter = Counter + 1
EndIf
If UserID > 0
   	If GetUserAccess(UserID) > 0
		Pass = 1
	EndIf
	If GetMapType(#MAPID) = #MAPTYPE_FRIENDLY
		Pass = 1
	ElseIf GetMapType(#MAPID) = #MAPTYPE_NEUTRAL
		If GetUserGuild(#USERID) = 0
			Pass = 1
		ElseIf GetUserGuild(UserID) = 0
			Pass = 1
		EndIf
		If GetUserGuild(UserID ) = GetUserGuild(#USERID) 
			Pass = 1
		EndIf
	EndIf
 
 	If Pass = 0
   Damage = HealthDealt 
   
   MagicDefense = GetUserWisdom(UserID)
   MagicDefense = MagicDefense / 5
   MagicDefense = Floor(MagicDefense)
   
   Damage = Damage - MagicDefense
   If Damage < 5
      Damage = 5
   EndIf
   DamageUser(UserID,Damage)
   
   SendMessageToUser(UserID, "Fire consumes your flesh.", #MSG_CRITICAL)
	EndIf
EndIf
;-----------------------------------------------------------------------
UserID = GetUserAtXY(#MAPID, X5, Y5)
MonsterID = GetMonsterAtXY(#MAPID, X5, Y5)
If MonsterID <> -1
   DamageMonster(#MAPID,MonsterID,HealthDealt)
   CreateEffect(Graphic,350,0,#DIR_UP,#MAPID,X5,Y5,0,UserID,0)
   Counter = Counter + 1
ElseIf UserID > 0
   CreateEffect(Graphic,350,0,#DIR_UP,#MAPID,X5,Y5,0,UserID,0)
   Counter = Counter + 1
EndIf
If UserID > 0
   	If GetUserAccess(UserID) > 0
		Pass = 1
	EndIf
	If GetMapType(#MAPID) = #MAPTYPE_FRIENDLY
		Pass = 1
	ElseIf GetMapType(#MAPID) = #MAPTYPE_NEUTRAL
		If GetUserGuild(#USERID) = 0
			Pass = 1
		ElseIf GetUserGuild(UserID) = 0
			Pass = 1
		EndIf
		If GetUserGuild(UserID ) = GetUserGuild(#USERID) 
			Pass = 1
		EndIf
	EndIf
 
 	If Pass = 0
   Damage = HealthDealt 
   
   MagicDefense = GetUserWisdom(UserID)
   MagicDefense = MagicDefense / 5
   MagicDefense = Floor(MagicDefense)
   
   Damage = Damage - MagicDefense
   If Damage < 5
      Damage = 5
   EndIf
   DamageUser(UserID,Damage)
   
   SendMessageToUser(UserID, "Fire consumes your flesh.", #MSG_CRITICAL)
	EndIf
EndIf
;-----------------------------------------------------------------------
UserID = GetUserAtXY(#MAPID, X6, Y6)
MonsterID = GetMonsterAtXY(#MAPID, X6, Y6)
If MonsterID <> -1
   DamageMonster(#MAPID,MonsterID,HealthDealt)
   CreateEffect(Graphic,350,0,#DIR_UP,#MAPID,X6,Y6,0,UserID,0)
   Counter = Counter + 1
ElseIf UserID > 0
   CreateEffect(Graphic,350,0,#DIR_UP,#MAPID,X6,Y6,0,UserID,0)
   Counter = Counter + 1
EndIf
If UserID > 0
   	If GetUserAccess(UserID) > 0
		Pass = 1
	EndIf
	If GetMapType(#MAPID) = #MAPTYPE_FRIENDLY
		Pass = 1
	ElseIf GetMapType(#MAPID) = #MAPTYPE_NEUTRAL
		If GetUserGuild(#USERID) = 0
300			Pass = 1
		ElseIf GetUserGuild(UserID) = 0
			Pass = 1
		EndIf
		If GetUserGuild(UserID ) = GetUserGuild(#USERID) 
			Pass = 1
		EndIf
	EndIf
 
 	If Pass = 0
   Damage = HealthDealt 
   
   MagicDefense = GetUserWisdom(UserID)
   MagicDefense = MagicDefense / 5
   MagicDefense = Floor(MagicDefense)
   
   Damage = Damage - MagicDefense
   If Damage < 5
      Damage = 5
   EndIf
   DamageUser(UserID,Damage)
   
   SendMessageToUser(UserID, "Fire consumes your flesh.", #MSG_CRITICAL)
	EndIf
EndIf
;-----------------------------------------------------------------------
UserID = GetUserAtXY(#MAPID, X7, Y7)
MonsterID = GetMonsterAtXY(#MAPID, X7, Y7)
If MonsterID <> -1
   DamageMonster(#MAPID,MonsterID,HealthDealt)
   CreateEffect(Graphic,350,0,#DIR_UP,#MAPID,X7,Y7,0,UserID,0)
   Counter = Counter + 1
ElseIf UserID > 0
   Counter = Counter + 1
   CreateEffect(Graphic,350,0,#DIR_UP,#MAPID,X7,Y7,0,UserID,0)
EndIf
If UserID > 0
   	If GetUserAccess(UserID) > 0
		Pass = 1
	EndIf
	If GetMapType(#MAPID) = #MAPTYPE_FRIENDLY
		Pass = 1
	ElseIf GetMapType(#MAPID) = #MAPTYPE_NEUTRAL
		If GetUserGuild(#USERID) = 0
			Pass = 1
		ElseIf GetUserGuild(UserID) = 0
			Pass = 1
		EndIf
		If GetUserGuild(UserID ) = GetUserGuild(#USERID) 
			Pass = 1
		EndIf
	EndIf
 
 	If Pass = 0
   Damage = HealthDealt 
   
   MagicDefense = GetUserWisdom(UserID)
   MagicDefense = MagicDefense / 5
   MagicDefense = Floor(MagicDefense)
   
   Damage = Damage - MagicDefense
   If Damage < 5
      Damage = 5
   EndIf
   DamageUser(UserID,Damage)
   
   SendMessageToUser(UserID, "Fire consumes your flesh.", #MSG_CRITICAL)
	EndIf
EndIf
;-----------------------------------------------------------------------
UserID = GetUserAtXY(#MAPID, X8, Y8)
MonsterID = GetMonsterAtXY(#MAPID, X8, Y8)
If MonsterID <> -1
   DamageMonster(#MAPID,MonsterID,HealthDealt)
   CreateEffect(Graphic,350,0,#DIR_UP,#MAPID,X8,Y8,0,UserID,0)
   Counter = Counter + 1
ElseIf UserID > 0
   CreateEffect(Graphic,350,0,#DIR_UP,#MAPID,X8,Y8,0,UserID,0)
   Counter = Counter + 1
EndIf
If UserID > 0
   	If GetUserAccess(UserID) > 0
		Pass = 1
	EndIf
	If GetMapType(#MAPID) = #MAPTYPE_FRIENDLY
		Pass = 1
	ElseIf GetMapType(#MAPID) = #MAPTYPE_NEUTRAL
		If GetUserGuild(#USERID) = 0
			Pass = 1
		ElseIf GetUserGuild(UserID) = 0
			Pass = 1
		EndIf
		If GetUserGuild(UserID ) = GetUserGuild(#USERID) 
			Pass = 1
		EndIf
	EndIf
 
 	If Pass = 0
   Damage = HealthDealt 
   
   MagicDefense = GetUserWisdom(UserID)
   MagicDefense = MagicDefense / 5
   MagicDefense = Floor(MagicDefense)
   
   Damage = Damage - MagicDefense
   If Damage < 5
      Damage = 5
   EndIf
   DamageUser(UserID,Damage)
   
   SendMessageToUser(UserID, "Fire consumes your flesh.", #MSG_CRITICAL)
	EndIf
EndIf
;-----------------------------------------------------------------------
UserID = GetUserAtXY(#MAPID, X9, Y9)
MonsterID = GetMonsterAtXY(#MAPID, X9, Y9)
If MonsterID <> -1
   DamageMonster(#MAPID,MonsterID,HealthDealt)
   CreateEffect(Graphic,350,0,#DIR_UP,#MAPID,X9,Y9,0,UserID,0)
   Counter = Counter + 1
ElseIf UserID > 0
   CreateEffect(Graphic,350,0,#DIR_UP,#MAPID,X9,Y9,0,UserID,0)
   Counter = Counter + 1
EndIf
If UserID > 0
   	If GetUserAccess(UserID) > 0
		Pass = 1
	EndIf
	If GetMapType(#MAPID) = #MAPTYPE_FRIENDLY
		Pass = 1
	ElseIf GetMapType(#MAPID) = #MAPTYPE_NEUTRAL
		If GetUserGuild(#USERID) = 0
			Pass = 1
		ElseIf GetUserGuild(UserID) = 0
			Pass = 1
		EndIf
		If GetUserGuild(UserID ) = GetUserGuild(#USERID) 
			Pass = 1
		EndIf
	EndIf
 
 	If Pass = 0
   Damage = HealthDealt 
   
   MagicDefense = GetUserWisdom(UserID)
   MagicDefense = MagicDefense / 5
   MagicDefense = Floor(MagicDefense)
   
   Damage = Damage - MagicDefense
   If Damage < 5
      Damage = 5
   EndIf
   DamageUser(UserID,Damage)
   
   SendMessageToUser(UserID, "Fire consumes your flesh.", #MSG_CRITICAL)
	EndIf
EndIf
;-----------------------------------------------------------------------
UserID = GetUserAtXY(#MAPID, X10, Y10)
MonsterID = GetMonsterAtXY(#MAPID, X10, Y10)
If MonsterID <> -1
   DamageMonster(#MAPID,MonsterID,HealthDealt)
   CreateEffect(Graphic,350,0,#DIR_UP,#MAPID,X10,Y10,0,UserID,0)
   Counter = Counter + 1
ElseIf UserID > 0
   CreateEffect(Graphic,350,0,#DIR_UP,#MAPID,X10,Y10,0,UserID,0)
   Counter = Counter + 1
EndIf
If UserID > 0
   	If GetUserAccess(UserID) > 0
		Pass = 1
	EndIf
	If GetMapType(#MAPID) = #MAPTYPE_FRIENDLY
		Pass = 1
	ElseIf GetMapType(#MAPID) = #MAPTYPE_NEUTRAL
		If GetUserGuild(#USERID) = 0
			Pass = 1
		ElseIf GetUserGuild(UserID) = 0
			Pass = 1
		EndIf
		If GetUserGuild(UserID ) = GetUserGuild(#USERID) 
			Pass = 1
		EndIf
	EndIf
 
 	If Pass = 0
   Damage = HealthDealt 
   
   MagicDefense = GetUserWisdom(UserID)
   MagicDefense = MagicDefense / 5
   MagicDefense = Floor(MagicDefense)
   
   Damage = Damage - MagicDefense
   If Damage < 5
      Damage = 5
   EndIf
   DamageUser(UserID,Damage)
   
   SendMessageToUser(UserID, "Fire consumes your flesh.", #MSG_CRITICAL)
	EndIf
EndIf
;-----------------------------------------------------------------------
UserID = GetUserAtXY(#MAPID, X11, Y11)
MonsterID = GetMonsterAtXY(#MAPID, X11, Y11)
If MonsterID <> -1
   DamageMonster(#MAPID,MonsterID,HealthDealt)
   CreateEffect(Graphic,350,0,#DIR_UP,#MAPID,X11,Y11,0,UserID,0)
   Counter = Counter + 1
ElseIf UserID > 0
   CreateEffect(Graphic,350,0,#DIR_UP,#MAPID,X11,Y11,0,UserID,0)
   Counter = Counter + 1
EndIf
If UserID > 0
   	If GetUserAccess(UserID) > 0
		Pass = 1
	EndIf
	If GetMapType(#MAPID) = #MAPTYPE_FRIENDLY
		Pass = 1
	ElseIf GetMapType(#MAPID) = #MAPTYPE_NEUTRAL
		If GetUserGuild(#USERID) = 0
			Pass = 1
		ElseIf GetUserGuild(UserID) = 0
			Pass = 1
		EndIf
		If GetUserGuild(UserID ) = GetUserGuild(#USERID) 
			Pass = 1
		EndIf
	EndIf
 
 	If Pass = 0
   Damage = HealthDealt 
   
   MagicDefense = GetUserWisdom(UserID)
   MagicDefense = MagicDefense / 5
   MagicDefense = Floor(MagicDefense)
   
   Damage = Damage - MagicDefense
   If Damage < 5
      Damage = 5
   EndIf
   DamageUser(UserID,Damage)
   
   SendMessageToUser(UserID, "Fire consumes your flesh.", #MSG_CRITICAL)
	EndIf
EndIf
;-----------------------------------------------------------------------
UserID = GetUserAtXY(#MAPID, X12, Y12)
MonsterID = GetMonsterAtXY(#MAPID, X12, Y12)
If MonsterID <> -1
   DamageMonster(#MAPID,MonsterID,HealthDealt)
   CreateEffect(Graphic,350,0,#DIR_UP,#MAPID,X12,Y12,0,UserID,0)
   Counter = Counter + 1
ElseIf UserID > 0
   CreateEffect(Graphic,350,0,#DIR_UP,#MAPID,X12,Y12,0,UserID,0)
   Counter = Counter + 1
EndIf
If UserID > 0
   	If GetUserAccess(UserID) > 0
		Pass = 1
	EndIf
	If GetMapType(#MAPID) = #MAPTYPE_FRIENDLY
		Pass = 1
	ElseIf GetMapType(#MAPID) = #MAPTYPE_NEUTRAL
		If GetUserGuild(#USERID) = 0
			Pass = 1
		ElseIf GetUserGuild(UserID) = 0
			Pass = 1
		EndIf
		If GetUserGuild(UserID ) = GetUserGuild(#USERID) 
			Pass = 1
		EndIf
	EndIf
 
 	If Pass = 0
   Damage = HealthDealt 
   
   MagicDefense = GetUserWisdom(UserID)
   MagicDefense = MagicDefense / 5
   MagicDefense = Floor(MagicDefense)
   
   Damage = Damage - MagicDefense
   If Damage < 5
      Damage = 5
   EndIf
   DamageUser(UserID,Damage)
   
   SendMessageToUser(UserID, "Fire consumes your flesh.", #MSG_CRITICAL)
	EndIf
EndIf
;-----------------------------------------------------------------------

If Counter > 0
   Blood = GetUserMana(#USERID)
   Blood = Blood - BloodCost
   SetUserMana(#USERID,Blood)
   
   SendMessageToUser(#USERID, "You incinerate those around you.", #MSG_EMOTE)
Else
   SendMessageToUser(#USERID, "There is nobody around you to incinerate!", #MSG_EMOTE)
EndIf

Label END

Continue = 1
