I Need help with this spell.. If it doesnt remove the item ID then it should Stop the spell.. but i cant fix it i have no idea how. i tried it all so pelase help me out here. 
means even if i dont have any powerbolt's it will still shoot the spell.
means even if i dont have any powerbolt's it will still shoot the spell.
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_BLOODHIT)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_POWERBOLT)
function onGetFormulaValues(cid, skill, attack, factor)
local wafe = getPlayerSlotItem(cid, CONST_SLOT_AMMO).ammoType
if skill == AMMO_POWERBOLT then
wafe = getPlayerSkill(cid, 4)
return
- (skill * 0.47),
- (skill * 2.8)
end
end
local repeatTimes = 1
local timeBetween = 1000 -- 1000 = 1 sec
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, 'onGetFormulaValues')
function onCastSpell(cid, var)
if doPlayerTakeItem(cid,2547,1) then
else
end
for i = 1, repeatTimes do
addEvent(doCombat, timeBetween * i, cid, combat, var)
end
return doCombat(cid, combat, var)
end