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

doSetItemAttribute add skills

kermaxpl

Pora na Nonsens Scripter
Joined
Aug 21, 2012
Messages
121
Reaction score
7
Location
Poland
Hi, i'm looking for modification which will allow me to add item's attributes like skillSword with doItemSetAttribute or similar.
 
Have some examples:
http://otland.net/f163/mod-random-item-stats-130295/
http://otland.net/f81/perfect-items-upgrade-2-0-slot-sytem-89450/ << swap shield and bow functions otherwise it'll add attack to shield instead of defense
http://otland.net/f81/slot-system-multi-slot-no-crashes-90387/

39642449.png
 
I know I can modify atk/def/range/crit chance/attack speed but i want to change skills or max mana/hp or regen or absorb or reflect
 
Last edited:
max mana and hp are in Mock's slot system, I've tested them - seems to work
Idk about absorb/reflect if there's function to add them
 
Yes yes sorry my mistake I should to read more carefuly
It doen't work, can anyone help me?
This is description of my item
Code:
15:15 You see zyciodajne fortified Metalowa Palka (Atk:12, Def:8).
It weighs 68.00 oz.
[hp:+20%]
[Defense:+21%]
ItemID: [2417].
Position: [X: 5400] [Y: 5162] [Z: 7].
And my script
Lua:
local conditionMP,conditionHP,conditionML,conditionCLUB,conditionSHI,conditionDIST,conditionAMP = {},{},{},{},{},{},{}
for i=1,100 do ---Carrega as conditions
	--- HP
	conditionHP[i] = createConditionObject(CONDITION_ATTRIBUTES)
	setConditionParam(conditionHP[i], CONDITION_PARAM_TICKS, -1)
	setConditionParam(conditionHP[i], CONDITION_PARAM_STAT_MAXHEALTHPERCENT, 100+i)
	setConditionParam(conditionHP[i], CONDITION_PARAM_BUFF, true)
	setConditionParam(conditionHP[i], CONDITION_PARAM_SUBID, 50)
end

function onEquip(cid, item, slot)
	local HP = getCreatureHealth(cid)
	local MP = getCreatureMana(cid)
	local desc = getItemDescriptions(item.uid)
	local t = desc:gmatch('(%a+).(%w+)')
	
	for sl, n in pairs(t) do
		if sl == 'hp' then
			doAddCondition(cid,conditionHP[tonumber(n)])
			doCreatureAddHealth(cid,HP-getCreatureHealth(cid))
		end
	end
	return true
end

function onDeEquip(cid, item, slot)
		doRemoveCondition(cid, CONDITION_ATTRIBUTES) 
return true
end
I recived this error when I was trying to equip item:
Code:
[6:42:00.594] [Error - MoveEvents Interface]
[6:42:00.594] data/movements/scripts/customloot.lua:onEquip
[6:42:00.594] Description:
[6:42:00.594] data/movements/scripts/customloot.lua:15: attempt to call method 'gmatch' (a nil value)
[6:42:00.594] stack traceback:
[6:42:00.594]   data/movements/scripts/customloot.lua:15: in function <data/movements/scripts/customloot.lua:11>
 
Last edited:
Back
Top Bottom