• 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 Is possible?

renancs

New Member
Joined
Jul 8, 2008
Messages
252
Reaction score
3
Im looking for this, and trying script, but dont work
i looking for a spell that damage according ur vocation, like this

Code:
--Calculed by ta4e--
--For tibia 8.31--
--Made in 07/11/08--

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
function getCombatFormulas(cid, lv, maglv)

	if isDruid(cid) then
		local formula_min = -((lv*0.25 + maglv*3) * 1.2)
		local formula_max = -((lv*0.25 + maglv*3) * 1.6)
	else
		local formula_min = -((lv*0.25 + maglv*3) * 1.7)
		local formula_max = -((lv*0.25 + maglv*3) * 2.1)
	end

	if(formula_max < formula_min) then
		local tmp = formula_max
		formula_max = formula_min
		formula_min = tmp
	end
	return formula_min, formula_max
end

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "getCombatFormulas")

function onCastSpell(cid, var)
	return doCombat(cid, combat, var)
end

whats wrong in the code?
 
DMG receiving/dealing to anyone depending on vocation you can simply fix changing it in /data/xml/vocations.xml
if i helped rep me
 
DMG receiving/dealing to anyone depending on vocation you can simply fix changing it in /data/xml/vocations.xml
if i helped rep me

did u mean, that i make one script to druids SD, and one script to anothers vocations SD?
 
start with end

in 3 last lines

Lua:
end
return LUA_NO_ERROR
end
 
Huh?

Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
function getCombatFormulas(cid, lv, maglv)
	local voc_multipiler = {
		min = {
			[1] = 1.0,
			[2] = 1.0,
			[3] = 1.0,
			[4] = 1.0
		},
		max = {
			[1] = 2.0,
			[2] = 2.0,
			[3] = 2.0,
			[4] = 2.0
		}
	}

	local formula_min = -((lv*0.25 + maglv*3) * voc_multipiler.min[getPlayerVocation(cid)])
	local formula_max = -((lv*0.25 + maglv*3) * voc_multipiler.max[getPlayerVocation(cid)])

	if(formula_max < formula_min) then
		local tmp = formula_max
		formula_max = formula_min
		formula_min = tmp
	end
	return formula_min, formula_max
end

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "getCombatFormulas")

function onCastSpell(cid, var)
	return doCombat(cid, combat, var)
end
 
Huh?

Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
function getCombatFormulas(cid, lv, maglv)
	local voc_multipiler = {
		min = {
			[1] = 1.0,
			[2] = 1.0,
			[3] = 1.0,
			[4] = 1.0
		},
		max = {
			[1] = 2.0,
			[2] = 2.0,
			[3] = 2.0,
			[4] = 2.0
		}
	}

	local formula_min = -((lv*0.25 + maglv*3) * voc_multipiler.min[getPlayerVocation(cid)])
	local formula_max = -((lv*0.25 + maglv*3) * voc_multipiler.max[getPlayerVocation(cid)])

	if(formula_max < formula_min) then
		local tmp = formula_max
		formula_max = formula_min
		formula_min = tmp
	end
	return formula_min, formula_max
end

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "getCombatFormulas")

function onCastSpell(cid, var)
	return doCombat(cid, combat, var)
end

i try this, i skill doesnt work
i get this error:
Code:
[26/09/2009 09:45:46] Lua Script Error: [Spell Interface] 
[26/09/2009 09:45:46] in callback: data/spells/scripts/attack/sudden death.lua:getCombatFormulas
[26/09/2009 09:45:46] (Unknown scriptfile)

[26/09/2009 09:45:46] data/spells/scripts/attack/sudden death.lua:19: attempt to compare two nil values


forgot, was my mistake, it works fine, thnx you so much!

=D
rep++ to all, ty for the help
 
Last edited:
Back
Top