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

Spell.

tompan

Member
Joined
Dec 13, 2008
Messages
646
Reaction score
24
Location
Sweden
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.

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
 
"AMMO_POWERBOLT" what is this?
LUA:
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)
	if getItemWeaponType(getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid) == WEAPON_DIST then
		return
			- (getPlayerSkill(cid, 4) * 0.47),
			- (getPlayerSkill(cid, 4) * 2.8)
	end
end
 
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, 'onGetFormulaValues')
function onCastSpell(cid, var)
	if doPlayerTakeItem(cid, 2547, 1) then
		doCombat(cid, combat, var)
		return true
	end
end
no tested
 
Back
Top