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

MoveEvent Slot system - Multi slot (No crashes)

instead of CONDITION_PARAM_STAT_MAXHEALTHPERCENT, use CONDITION_PARAM_STAT_MAXHEALTH ?


I changed
Code:
 ---Script by mock the bear!
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_MAXHEALTH, 100+i)
	setConditionParam(conditionHP[i], CONDITION_PARAM_BUFF, true)
	setConditionParam(conditionHP[i], CONDITION_PARAM_SUBID, 50)

and it add's 100hp + 4hp to player but when i click look:

11:47 You see a plate armor [hp.+4%] (Arm:10).
It weighs 120.00 oz.

What I need to change, to make it look like this:

XX - how many hp it add's


11:47 You see a plate armor [hp.+XX] (Arm:10).
It weighs 120.00 oz.

hmm?
 
edit ??:p
Code:
		local l = choose('hp','mp','ml','cas','shield','dist')
		local p = getper()
 
		doSendMagicEffect(toPosition,30)
		nam = nam..' ['..l..'.+'..p..'%]'
		doSendAnimatedText(toPosition,l..' '..p..'%',120)
 
edit ??:p
Code:
		local l = choose('hp','mp','ml','cas','shield','dist')
		local p = getper()
 
		doSendMagicEffect(toPosition,30)
		nam = nam..' ['..l..'.+'..p..'%]'
		doSendAnimatedText(toPosition,l..' '..p..'%',120)

Yes but when i edit it to:

Code:
	if getSlotCount(nam) < conf.maxSlotCount then
		local l = choose('hp','mp','ml','cas','shield','dist')
		local p = getper()
 
		doSendMagicEffect(toPosition,30)
		nam = nam..' ['..l..'.+'..p..']'
		doSendAnimatedText(toPosition,l..' '..p..'',120)
		doItemSetAttribute(itemEx.uid,'name',nam)
		doRemoveItem(item.uid,1)
	else

(I remove ,,%")

Script doesn't works ;/
 
It would be interesting if it were an item I could go changing the properties of the slot using random...
 
Yes but when i edit it to:

Code:
	if getSlotCount(nam) < conf.maxSlotCount then
		local l = choose('hp','mp','ml','cas','shield','dist')
		local p = getper()
 
		doSendMagicEffect(toPosition,30)
		nam = nam..' ['..l..'.+'..p..']'
		doSendAnimatedText(toPosition,l..' '..p..'',120)
		doItemSetAttribute(itemEx.uid,'name',nam)
		doRemoveItem(item.uid,1)
	else

(I remove ,,%")

Script doesn't works ;/
maybe try

Code:
	if getSlotCount(nam) < conf.maxSlotCount then
        local l = choose('hp','mp','ml','cas','shield','dist')
		local p = getper()
 
		doSendMagicEffect(toPosition,30)
		nam = nam..' ['..l..'.+'..p..'%]'
		doSendAnimatedText(toPosition,l..'+'..p..'',120)
 
Last edited:
When I equip some "sloted item" I get bug that close Tibia, and when I it works. But it's not funny receive a bug.
 
How can I set max % for upgrades cuz i sometimes get 70% upgrade but it's to high for me. And one more question, can anyone edit this script and make it possible to remove slots?
 
nobody realize that?

elseif sl == 'mp' then
doAddCondition(cid,conditionMP[tonumber(n)])
doCreatureAddMana(cid,HP-getCreatureMana(cid))
ca[51] = 1
doPlayerSendTutorial(cid,19)

change to MP and fix bug of gain mana on login or deequip items.
(sry my English)
 
so i made a mistake by allowing players to have 3 slots per item, i want them to have just 1 per item, what can i do?
 
Hello i need some help! Instead make serval rows of ex. cas+5, cas+3 cant it merge all which belong togehter ex. cas+5+cas+3=cas+8!

Lua:
10:29 You see a plate armor [cas.+2%] [dist.+7%] [ml.+5%] [cas.+2%] [cas.+5%] [hp.+14%] [cas.+14%] [cas.+1%] [ml.+23%] [hp.+15%] [ml.+9%] [dist.+19%] [shield.+6%] [shield.+15%] [dist.+1%] [hp.+6%] [shield.+10%] [ml.+11%] [hp.+10%] [ml.+6%] [mp.+30%] [mp.+5%] [mp.+2%] [shield.+11%] [ml.+5%] [ml.+3%] [ml.+7%] [mp.+7%] [mp.+41%] [cas.+1%] [shield.+13%] [hp.+2%] [shield.+4%] [shield.+15%] [dist.+1%] [ml.+3%] [ml.+23%] [hp.+4%] [ml.+6%] [dist.+31%] [mp.+3%] [cas.+13%] [hp.+1%] [cas.+2%] [ml.+13%] [ml.+19%] [mp.+
 
Hey, I'm currently using this on my 0.4 Server, but I'm wondering... Do you have another script for a item that will take off the upgrades? Say example your a druid and you don't want the dist% you can destroy it using something then buy another crystal and try again for a better upgrade?
 
Hey, I'm currently using this on my 0.4 Server, but I'm wondering... Do you have another script for a item that will take off the upgrades? Say example your a druid and you don't want the dist% you can destroy it using something then buy another crystal and try again for a better upgrade?

I needed it myself too, but I suck in finding strings, therefore I wrote one which removes all slots without detection(and keeps name of random items + upgrades, if you want upgrade system which keeps names from random stats mods pm me):
Lua:
--- Slot removal system 
--- Based on Mock the bear (MTB)'s upgrade, slot systems.
--- compatible with Cyko's random stats
local function stringstarts(String,Start)
   return string.sub(String,1,string.len(Start))==Start
end

if not setItemName then
    function setItemName(uid,name)
		return doItemSetAttribute(uid,'name',name)
    end
end

local function getWeaponLevel(uid) -- Function by Mock the bear.
   uid = uid or 0
   local name = getItemName(uid.uid) or getItemInfo(uid.itemid).name or ''
   local lvl = string.match(name,'%s%+(%d+)%s*')
   return tonumber(lvl) or 0
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
local word = "" -- keep it for random items stats mod compatibility
         if item.uid == 0 or item.itemid == 0 then return false end
		 toPosition.stackpos = 255
         if isCreature(itemEx.uid) == TRUE then
            return FALSE
         end
		 
		-- keep it for random items stats mod compatibility
		if stringstarts(getItemName(itemEx.uid),"rare") then
		word = "rare "
		elseif stringstarts(getItemName(itemEx.uid),"special") then
		word = "special "
		elseif stringstarts(getItemName(itemEx.uid),"legendary") then
		word = "legendary "
		end
		

        local level = getWeaponLevel(itemEx)
		if level > 0 then
            setItemName(itemEx.uid, word..getItemNameById(itemEx.itemid)..' +'..(level))
		else
			setItemName(itemEx.uid, word..getItemNameById(itemEx.itemid))
		end
            addEvent(doPlayerSendTextMessage,500,cid, MESSAGE_LOOT,"All slots on your item are clear now.")
            doSendMagicEffect(toPosition, 12)
			doRemoveItem(item.uid,1)
	return true
end
 
Back
Top