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

Special Attack!

Dixter

Amateur Web Developer
Joined
Mar 31, 2009
Messages
660
Reaction score
11
Yea i need some help with this, theres a beginner axe and sword i have on my ot, and every few hits it hits a special attack. For this i will be posting the axe script on here. It hits like exori except it is red, and a word "Desemo" appears out of you. Well when some1 started after they reached lvl 20 something and a certain skill it kept hitting "Desemo" but just the phrase, the the effect didnt appear and the monster didnt take the damage it should have. here is the script:

Code:
local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat1, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 0)
setCombatFormula(combat1, COMBAT_FORMULA_SKILL , 1.9, 0, 1.9, 0)






local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat2, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)

setCombatFormula(combat2, COMBAT_FORMULA_SKILL , 0.7, 0, 0.7, 0)


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

}

local area = createCombatArea(arr)
setCombatArea(combat1, area)



function onUseWeapon(cid, var)
	pos = getPlayerPosition(cid)
	swordskill = getPlayerSkill(cid,2)
	rand = math.random(1,100)
	if swordskill < 35 then
		if rand >= 55 then
			doSendAnimatedText(pos,"BloodHit",math.random(1,255))
			return doCombat(cid, combat1, var)
		else
			doCombat(cid, combat2, var)
		end
	elseif swordskill >= 35 and swordskill < 55 then
		if rand >= 60 then
			doSendAnimatedText(pos,"BloodHit",math.random(1,255))
		else
			doCombat(cid, combat2, var)
		end
	elseif swordskill >= 60 and swordskill < 75 then
		if rand >= 50 then
			doSendAnimatedText(pos,"BloodHit",math.random(1,255))
			return doCombat(cid, combat1, var)
		else
			doCombat(cid, combat2, var)
		end
	elseif swordskill >= 70 then
		if rand >= 55 then
			doSendAnimatedText(pos,"BloodHit",math.random(1,255))
			return doCombat(cid, combat1, var)
		else
			doCombat(cid, combat2, var)
		end
	elseif swordskill >= 80 then
		if rand >= 52 then
			doSendAnimatedText(pos,"BloodHit",math.random(1,255))
			return doCombat(cid, combat1, var)
		else
			doCombat(cid, combat2, var)
		end	
	end
end

Please help, because I have better weapons with this same script except higher damage for high lvls, as a donater item, and im worried something might go wrong with them. Thanks in advance ;)
 
im half asleep so im not sure on this answer, but i notice you got conflicting elseif s

Code:
elseif swordskill >= 35 and swordskill < 55 then

elseif swordskill >= 60 and swordskill < 75 then

elseif swordskill >= 70 then

elseif swordskill >= 80 then

with that setup from skill 55 to 59 that cant get the speical

from 70 to 74 theres a double special and 80+ theres a double
 
so what are you suggesting i change? the 70 and 80? because in the other script for better weapons the ratio is similiar, and it still works.
 
Well look, your PARAMEFFECT is posted as 0 that means that nothing is going to happen lol try this

Code:
local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat1, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 9)
setCombatFormula(combat1, COMBAT_FORMULA_SKILL , 1.9, 0, 1.9, 0)






local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat2, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)

setCombatFormula(combat2, COMBAT_FORMULA_SKILL , 0.7, 0, 0.7, 0)


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

}

local area = createCombatArea(arr)
setCombatArea(combat1, area)



function onUseWeapon(cid, var)
	pos = getPlayerPosition(cid)
	swordskill = getPlayerSkill(cid,2)
	rand = math.random(1,100)
	if swordskill < 35 then
		if rand >= 55 then
			doSendAnimatedText(pos,"BloodHit",math.random(1,255))
			return doCombat(cid, combat1, var)
		else
			doCombat(cid, combat2, var)
		end
	elseif swordskill >= 35 and swordskill < 55 then
		if rand >= 60 then
			doSendAnimatedText(pos,"BloodHit",math.random(1,255))
		else
			doCombat(cid, combat2, var)
		end
	elseif swordskill >= 60 and swordskill < 75 then
		if rand >= 50 then
			doSendAnimatedText(pos,"BloodHit",math.random(1,255))
			return doCombat(cid, combat1, var)
		else
			doCombat(cid, combat2, var)
		end
	elseif swordskill >= 70 then
		if rand >= 55 then
			doSendAnimatedText(pos,"BloodHit",math.random(1,255))
			return doCombat(cid, combat1, var)
		else
			doCombat(cid, combat2, var)
		end
	elseif swordskill >= 80 then
		if rand >= 52 then
			doSendAnimatedText(pos,"BloodHit",math.random(1,255))
			return doCombat(cid, combat1, var)
		else
			doCombat(cid, combat2, var)
		end	
	end
end
 
0 is a type of effect. it doesnt mean nothing will happen, its happening with my other scripts too. which ahve different effects.
 
Back
Top