• 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!

Spell Help

Exedion

Active Member
Joined
Jun 11, 2007
Messages
628
Reaction score
30
I try to make a new pala spell, when you cast, the spell remove 12 of the ammon in the arrow slot and make the attack, i try some things but i they donk work, please someone check and fix for me i will add rep+

PHP:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_NONE)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1.5, -150, -1.1, -150)

local arr = {
{0, 1, 1, 1, 0},
{1, 1, 1, 1, 1},
{1, 1, 2, 1, 1},
{1, 1, 1, 1, 1},
{0, 1, 1, 1, 0}
}

local area = createCombatArea(arr)
setCombatArea(combat, area)
local amount = 12
local arrow = {2543, 7364, 7365}
local bolt = {2543, 2547, 6529, 7363}  
local arrowShoot = {CONST_ANI_ARROW, CONST_ANI_SNIPERARROW, CONST_ANI_ONYXARROW}
local boltShoot = {CONST_ANI_BOLT, CONST_ANI_POWERBOLT, CONST_ANI_INFERNALBOLT, CONST_ANI_PIERCINGBOLT}

function onCastSpell(cid, var)
	if getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid == arrow[1] then
		animationShoot = arrowShoot[1]
	elseif getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid == arrow[2] then
		animationShoot = arrowShoot[2]
	elseif getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid == arrow[3] then
		animationShoot = arrowShoot[3]
	elseif getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid == bolt[1] then
		animationShoot = boltShoot[1]
	elseif getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid == bolt[2] then
		animationShoot = boltShoot[2]
	elseif getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid == bolt[3] then
		animationShoot = boltShoot[3]
	elseif getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid == bolt[4] then
		animationShoot = boltShoot[4]
end
local removeItem = getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid >= 0
	if 	doPlayerRemoveItem(cid, removeItem, amount) and getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid == arrow[1] or getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid == arrow[2] or getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid == arrow[3] or getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid == bolt[1] or getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid == bolt[2] or getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid == bolt[3] or getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid == bolt[4] then
		local pPos = getCreaturePosition(cid)
		doSendDistanceShoot(pPos, {x=pPos.x-2, y=pPos.y, z=pPos.z}, animationShoot)
		doSendDistanceShoot(pPos, {x=pPos.x-2, y=pPos.y-1, z=pPos.z}, animationShoot)
		doSendDistanceShoot(pPos, {x=pPos.x-2, y=pPos.y+1, z=pPos.z}, animationShoot)
		doSendDistanceShoot(pPos, {x=pPos.x+1, y=pPos.y-2, z=pPos.z}, animationShoot)
		doSendDistanceShoot(pPos, {x=pPos.x-1, y=pPos.y-2, z=pPos.z}, animationShoot)
		doSendDistanceShoot(pPos, {x=pPos.x, y=pPos.y-2, z=pPos.z}, animationShoot)
		doSendDistanceShoot(pPos, {x=pPos.x+2, y=pPos.y, z=pPos.z}, animationShoot)
		doSendDistanceShoot(pPos, {x=pPos.x+2, y=pPos.y+1, z=pPos.z}, animationShoot)
		doSendDistanceShoot(pPos, {x=pPos.x+2, y=pPos.y-1, z=pPos.z}, animationShoot)
		doSendDistanceShoot(pPos, {x=pPos.x-1, y=pPos.y+2, z=pPos.z}, animationShoot)
		doSendDistanceShoot(pPos, {x=pPos.x+1, y=pPos.y+2, z=pPos.z}, animationShoot)
		doSendDistanceShoot(pPos, {x=pPos.x, y=pPos.y+2, z=pPos.z}, animationShoot)
		doSendMagicEffect({x=pPos.x-2, y=pPos.y, z=pPos.z}, 9)
		doSendMagicEffect({x=pPos.x-2, y=pPos.y-1, z=pPos.z}, 9)
		doSendMagicEffect({x=pPos.x-2, y=pPos.y+1, z=pPos.z}, 9)
		doSendMagicEffect({x=pPos.x+1, y=pPos.y-2, z=pPos.z}, 9)
		doSendMagicEffect({x=pPos.x-1, y=pPos.y-2, z=pPos.z}, 9)
		doSendMagicEffect({x=pPos.x, y=pPos.y-2, z=pPos.z}, 9)
		doSendMagicEffect({x=pPos.x+2, y=pPos.y, z=pPos.z}, 9)
		doSendMagicEffect({x=pPos.x+2, y=pPos.y+1, z=pPos.z}, 9)
		doSendMagicEffect({x=pPos.x+2, y=pPos.y-1, z=pPos.z}, 9)
		doSendMagicEffect({x=pPos.x-1, y=pPos.y+2, z=pPos.z}, 9)
		doSendMagicEffect({x=pPos.x+1, y=pPos.y+2, z=pPos.z}, 9)
		doSendMagicEffect({x=pPos.x, y=pPos.y+2, z=pPos.z}, 9)
		doCombat(cid, combat, var)
		else
			doPlayerSendCancel(cid, "You need equip ".. amount .." ammunition")
			doCreatureAddMana(cid, 800)
		end
	return TRUE
end
 
Last edited:
Back
Top