• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Script help

AnarchGov

Member
Joined
Oct 3, 2011
Messages
263
Reaction score
6
LUA:
 	local combat = createCombatObject()
	setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_BLOCKHIT)
	setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
	setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
	setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_MANASHIELD)
	setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
	setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1, -60, -1, -60, 5, 5, 4, 7)
	function onGetFormulaValues(cid, level, skill)
local min = -(level * 3.0) * 1.0
local max = -(level * 6.0) * 1.0
return min, max
end

setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")


function onCastSpell(cid, var)

	local e = 146
	local et = 10
	local target = getCreatureTarget(cid)
	local pPos = getCreaturePosition(target)
	local b = getPlayerLookDirection(cid)
	local pPas = getCreaturePosition(cid)
	local SQM = 1
	local positions = {
		north = {x = pPos.x, y = pPos.y-SQM, z = pPos.z},
		west = {x = pPos.x-SQM, y = pPos.y, z = pPos.z},
		south = {x = pPos.x, y = pPos.y+SQM, z = pPos.z},
		east = {x = pPos.x+SQM, y = pPos.y, z = pPos.z},
		
		northwest = {x = pPos.x-SQM, y = pPos.y-SQM, z = pPos.z},
		northeast = {x = pPos.x+SQM, y = pPos.y-SQM, z = pPos.z},
		southwest = {x = pPos.x-SQM, y = pPos.y+SQM, z = pPos.z},
		southeast = {x = pPos.x+SQM, y = pPos.y+SQM, z = pPos.z}
	}
	
	if(exhaustion.check(cid, e) == false) then
		if(isPlayer(cid)) then
			if(getCreatureSpeed(target) ~= 0) then
				if(isItemEquipped(cid, WEAPON_SHIELD)) then
				
					-- Rakt
					if(isInRange(pPas, positions.north, positions.north)) then
						if(isWalkable(cid, positions.south)) then
							doTeleportThing(target, positions.south)
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
						else
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
							return false
						end
					elseif(isInRange(pPas, positions.south, positions.south)) then
						if(isWalkable(cid, positions.north)) then
							doTeleportThing(target, positions.north)
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
						else
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
							return false
						end
					elseif(isInRange(pPas, positions.west, positions.west)) then
						if(isWalkable(cid, positions.east)) then
							doTeleportThing(target, positions.east)
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
						else
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
							return false
						end
					elseif(isInRange(pPas, positions.east, positions.east)) then
						if(isWalkable(cid, positions.west)) then
							doTeleportThing(target, positions.west)
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
						else
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
							return false
						end
						
						-- Snett
					elseif(isInRange(pPas, positions.northwest, positions.northwest)) then
						if(isWalkable(cid, positions.southeast)) then
							doTeleportThing(target, positions.southeast)
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
						else
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
							return false
						end
					elseif(isInRange(pPas, positions.northeast, positions.northeast)) then
						if(isWalkable(cid, positions.southwest)) then
							doTeleportThing(target, positions.southwest)
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
						else
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
							return false
						end
					elseif(isInRange(pPas, positions.southwest, positions.southwest)) then
						if(isWalkable(cid, positions.northeast)) then
							doTeleportThing(target, positions.northeast)
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
						else
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
							return false
						end
					elseif(isInRange(pPas, positions.southeast, positions.southeast)) then
						if(isWalkable(cid, positions.northwest)) then
							doTeleportThing(target, positions.northwest)
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
						else
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
							return false
						end
						
					end
				else
					doPlayerSendCancel(cid, "You need a shield equipped to use this spell!")
					return false
				end
			else
				doCombat(cid, combat, var)
				doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
				exhaustion.set(cid, e, et)
				return false
			end
		end
	else
		doPlayerSendCancel(cid, "You are exhausted.")
		doSendMagicEffect(pPas, 2)
		return false
	end
	return true
end

This is a script for a spell that when you use it on a target it knocks the target back 1 square. Now it works perfect for knocking it back ONE square. However, i want it to knock the target back 4 squares. I tried to change "local SQM = 1" to 4, 3, 2 ,10, no other numbers will work. the only number it will recognize is 1. Anyone have any ideas? Thanks.

REP++
 
Try this
LUA:
 local combat = createCombatObject()
	setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_BLOCKHIT)
	setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
	setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
	setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_MANASHIELD)
	setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
	setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1, -60, -1, -60, 5, 5, 4, 7)
	function onGetFormulaValues(cid, level, skill)
local min = -(level * 3.0) * 1.0
local max = -(level * 6.0) * 1.0
return min, max
end
 
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
 
 
function onCastSpell(cid, var)
 
	local e = 146
	local et = 10
	local target = getCreatureTarget(cid)
	local pPos = getCreaturePosition(target)
	local b = getPlayerLookDirection(cid)
	local pPas = getCreaturePosition(cid)
	local SQM = 1
	local pushSQM = 4
	local positions = {
		north = {x = pPos.x, y = pPos.y-SQM, z = pPos.z},
		west = {x = pPos.x-SQM, y = pPos.y, z = pPos.z},
		south = {x = pPos.x, y = pPos.y+SQM, z = pPos.z},
		east = {x = pPos.x+SQM, y = pPos.y, z = pPos.z},
 
		northwest = {x = pPos.x-SQM, y = pPos.y-SQM, z = pPos.z},
		northeast = {x = pPos.x+SQM, y = pPos.y-SQM, z = pPos.z},
		southwest = {x = pPos.x-SQM, y = pPos.y+SQM, z = pPos.z},
		southeast = {x = pPos.x+SQM, y = pPos.y+SQM, z = pPos.z}
	}

	local pushpositions = {
		north = {x = pPos.x, y = pPos.y-pushSQM, z = pPos.z},
		west = {x = pPos.x-pushSQM, y = pPos.y, z = pPos.z},
		south = {x = pPos.x, y = pPos.y+pushSQM, z = pPos.z},
		east = {x = pPos.x+pushSQM, y = pPos.y, z = pPos.z},
 
		northwest = {x = pPos.x-pushSQM, y = pPos.y-pushSQM, z = pPos.z},
		northeast = {x = pPos.x+pushSQM, y = pPos.y-pushSQM, z = pPos.z},
		southwest = {x = pPos.x-pushSQM, y = pPos.y+pushSQM, z = pPos.z},
		southeast = {x = pPos.x+pushSQM, y = pPos.y+pushSQM, z = pPos.z}
	}
 
	if(exhaustion.check(cid, e) == false) then
		if(isPlayer(cid)) then
			if(getCreatureSpeed(target) ~= 0) then
				if(isItemEquipped(cid, WEAPON_SHIELD)) then
 
					-- Rakt
					if(isInRange(pPas, positions.north, positions.north)) then
						if(isWalkable(cid, pushpositions.south)) then
							doTeleportThing(target, pushpositions.south)
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
						else
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
							return false
						end
					elseif(isInRange(pPas, positions.south, positions.south)) then
						if(isWalkable(cid, pushpositions.north)) then
							doTeleportThing(target, pushpositions.north)
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
						else
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
							return false
						end
					elseif(isInRange(pPas, positions.west, positions.west)) then
						if(isWalkable(cid, pushpositions.east)) then
							doTeleportThing(target, pushpositions.east)
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
						else
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
							return false
						end
					elseif(isInRange(pPas, positions.east, positions.east)) then
						if(isWalkable(cid, pushpositions.west)) then
							doTeleportThing(target, pushpositions.west)
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
						else
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
							return false
						end
 
						-- Snett
					elseif(isInRange(pPas, positions.northwest, positions.northwest)) then
						if(isWalkable(cid, pushpositions.southeast)) then
							doTeleportThing(target, pushpositions.southeast)
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
						else
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
							return false
						end
					elseif(isInRange(pPas, positions.northeast, positions.northeast)) then
						if(isWalkable(cid, pushpositions.southwest)) then
							doTeleportThing(target, pushpositions.southwest)
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
						else
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
							return false
						end
					elseif(isInRange(pPas, positions.southwest, positions.southwest)) then
						if(isWalkable(cid, pushpositions.northeast)) then
							doTeleportThing(target, pushpositions.northeast)
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
						else
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
							return false
						end
					elseif(isInRange(pPas, positions.southeast, positions.southeast)) then
						if(isWalkable(cid, pushpositions.northwest)) then
							doTeleportThing(target, pushpositions.northwest)
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
						else
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
							return false
						end
 
					end
				else
					doPlayerSendCancel(cid, "You need a shield equipped to use this spell!")
					return false
				end
			else
				doCombat(cid, combat, var)
				doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
				exhaustion.set(cid, e, et)
				return false
			end
		end
	else
		doPlayerSendCancel(cid, "You are exhausted.")
		doSendMagicEffect(pPas, 2)
		return false
	end
	return true
end
 
Awesome yeah that worked thanks! Now idk if you could help with this but i have it set up to push the target 3 squares. However say there is a tree or a player on that third square...it wont push the creature at all. Do you know how to make it so if there is something in the path it will just stop the push short instead of making it so it wont push the creature at all? ill rep++ you btw. Thanks! <3
 
LUA:
 local combat = createCombatObject()
	setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_BLOCKHIT)
	setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
	setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
	setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_MANASHIELD)
	setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
	setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1, -60, -1, -60, 5, 5, 4, 7)
	function onGetFormulaValues(cid, level, skill)
local min = -(level * 3.0) * 1.0
local max = -(level * 6.0) * 1.0
return min, max
end
 
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
 
 
function onCastSpell(cid, var)
 
	local e = 146
	local et = 10
	local target = getCreatureTarget(cid)
	local pPos = getCreaturePosition(target)
	local b = getPlayerLookDirection(cid)
	local pPas = getCreaturePosition(cid)
	local pushSQM = 3
	local xpushSQM = 2
	local SQM = 1
	local positions = {
		north = {x = pPos.x, y = pPos.y-SQM, z = pPos.z},
		west = {x = pPos.x-SQM, y = pPos.y, z = pPos.z},
		south = {x = pPos.x, y = pPos.y+SQM, z = pPos.z},
		east = {x = pPos.x+SQM, y = pPos.y, z = pPos.z},
 
		northwest = {x = pPos.x-SQM, y = pPos.y-SQM, z = pPos.z},
		northeast = {x = pPos.x+SQM, y = pPos.y-SQM, z = pPos.z},
		southwest = {x = pPos.x-SQM, y = pPos.y+SQM, z = pPos.z},
		southeast = {x = pPos.x+SQM, y = pPos.y+SQM, z = pPos.z}
	}
 
	local pushpositions = {
		north = {x = pPos.x, y = pPos.y-pushSQM, z = pPos.z},
		west = {x = pPos.x-pushSQM, y = pPos.y, z = pPos.z},
		south = {x = pPos.x, y = pPos.y+pushSQM, z = pPos.z},
		east = {x = pPos.x+pushSQM, y = pPos.y, z = pPos.z},
 
		northwest = {x = pPos.x-pushSQM, y = pPos.y-pushSQM, z = pPos.z},
		northeast = {x = pPos.x+pushSQM, y = pPos.y-pushSQM, z = pPos.z},
		southwest = {x = pPos.x-pushSQM, y = pPos.y+pushSQM, z = pPos.z},
		southeast = {x = pPos.x+pushSQM, y = pPos.y+pushSQM, z = pPos.z}
	}

	local xpushpositions = {
		north = {x = pPos.x, y = pPos.y-xpushSQM, z = pPos.z},
		west = {x = pPos.x-xpushSQM, y = pPos.y, z = pPos.z},
		south = {x = pPos.x, y = pPos.y+xpushSQM, z = pPos.z},
		east = {x = pPos.x+xpushSQM, y = pPos.y, z = pPos.z},
 
		northwest = {x = pPos.x-xpushSQM, y = pPos.y-xpushSQM, z = pPos.z},
		northeast = {x = pPos.x+xpushSQM, y = pPos.y-xpushSQM, z = pPos.z},
		southwest = {x = pPos.x-xpushSQM, y = pPos.y+xpushSQM, z = pPos.z},
		southeast = {x = pPos.x+xpushSQM, y = pPos.y+xpushSQM, z = pPos.z}
	}
 
	if(exhaustion.check(cid, e) == false) then
		if(isPlayer(cid)) then
				if(isItemEquipped(cid, WEAPON_SHIELD)) then
 
					-- Rakt
					if(isInRange(pPas, positions.north, positions.north)) then
						if(isWalkable(cid, pushpositions.south)) then
							doTeleportThing(target, pushpositions.south)
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
						elseif(not isWalkable(cid, pushpositions.south) and isWalkable(cid, xpushpositions.south)) then
							doTeleportThing(target, xpushpositions.south)
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
						elseif(not isWalkable(cid, pushpositions.south) and not isWalkable(cid, xpushpositions.south) and isWalkable(cid, positions.south)) then
							doTeleportThing(target, positions.south)
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
						else
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
							return false
						end
					elseif(isInRange(pPas, positions.south, positions.south)) then
						if(isWalkable(cid, pushpositions.north)) then
							doTeleportThing(target, pushpositions.north)
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
						elseif(not isWalkable(cid, pushpositions.north) and isWalkable(cid, xpushpositions.north)) then
							doTeleportThing(target, xpushpositions.north)
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
						elseif(not isWalkable(cid, pushpositions.north) and not isWalkable(cid, xpushpositions.north) and isWalkable(cid, positions.north)) then
							doTeleportThing(target, positions.north)
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
						else
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
							return false
						end
					elseif(isInRange(pPas, positions.west, positions.west)) then
						if(isWalkable(cid, pushpositions.east)) then
							doTeleportThing(target, pushpositions.east)
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
						elseif(not isWalkable(cid, pushpositions.east) and isWalkable(cid, xpushpositions.east)) then
							doTeleportThing(target, xpushpositions.east)
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
						elseif(not isWalkable(cid, pushpositions.east) and not isWalkable(cid, xpushpositions.east) and isWalkable(cid, positions.east)) then
							doTeleportThing(target, positions.east)
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
						else
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
							return false
						end
					elseif(isInRange(pPas, positions.east, positions.east)) then
						if(isWalkable(cid, pushpositions.west)) then
							doTeleportThing(target, pushpositions.west)
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
						elseif(not isWalkable(cid, pushpositions.west) and isWalkable(cid, xpushpositions.west)) then
							doTeleportThing(target, xpushpositions.west)
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
						elseif(not isWalkable(cid, pushpositions.west) and not isWalkable(cid, xpushpositions.west) and isWalkable(cid, positions.west)) then
							doTeleportThing(target, positions.west)
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
						else
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
							return false
						end
 
						-- Snett
					elseif(isInRange(pPas, positions.northwest, positions.northwest)) then
						if(isWalkable(cid, pushpositions.southeast)) then
							doTeleportThing(target, pushpositions.southeast)
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
						elseif(not isWalkable(cid, pushpositions.southeast) and isWalkable(cid, xpushpositions.southeast)) then
							doTeleportThing(target, xpushpositions.southeast)
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
						elseif(not isWalkable(cid, pushpositions.southeast) and not isWalkable(cid, xpushpositions.southeast) and isWalkable(cid, positions.southeast)) then
							doTeleportThing(target, positions.southeast)
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
						else
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
							return false
						end
					elseif(isInRange(pPas, positions.northeast, positions.northeast)) then
						if(isWalkable(cid, pushpositions.southwest)) then
							doTeleportThing(target, pushpositions.southwest)
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
						elseif(not isWalkable(cid, pushpositions.southwest) and isWalkable(cid, xpushpositions.southwest)) then
							doTeleportThing(target, xpushpositions.southwest)
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
						elseif(not isWalkable(cid, pushpositions.southwest) and not isWalkable(cid, xpushpositions.southwest) and isWalkable(cid, positions.southwest)) then
							doTeleportThing(target, positions.southwest)
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
						else
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
							return false
						end
					elseif(isInRange(pPas, positions.southwest, positions.southwest)) then
						if(isWalkable(cid, pushpositions.northeast)) then
							doTeleportThing(target, pushpositions.northeast)
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
						elseif(not isWalkable(cid, pushpositions.northeast) and isWalkable(cid, xpushpositions.northeast)) then
							doTeleportThing(target, xpushpositions.northeast)
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
						elseif(not isWalkable(cid, pushpositions.northeast) and not isWalkable(cid, xpushpositions.northeast) and isWalkable(cid, positions.northeast)) then
							doTeleportThing(target, positions.northeast)
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
						else
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
							return false
						end
					elseif(isInRange(pPas, positions.southeast, positions.southeast)) then
						if(isWalkable(cid, pushpositions.northwest)) then
							doTeleportThing(target, pushpositions.northwest)
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
						elseif(not isWalkable(cid, pushpositions.northwest) and isWalkable(cid, xpushpositions.northwest)) then
							doTeleportThing(target, xpushpositions.northwest)
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
						elseif(not isWalkable(cid, pushpositions.northwest) and not isWalkable(cid, xpushpositions.northwest) and isWalkable(cid, positions.northwest)) then
							doTeleportThing(target, positions.northwest)
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
						else
							doCombat(cid, combat, var)
							doSendAnimatedText(pPos, "Boom", TEXTCOLOR_RED)
							exhaustion.set(cid, e, et)
							return false
						end
 
					end
				else
					doPlayerSendCancel(cid, "You need a shield equipped to use this spell!")
					return false
				end
		end
	else
		doPlayerSendCancel(cid, "You are exhausted.")
		doSendMagicEffect(pPas, 2)
		return false
	end
	return true
end
 
Back
Top