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

Edit this script :D

agomez

Member
Joined
Jan 28, 2009
Messages
211
Reaction score
5
can anyone help me?
i get this script, but i want it only work with 1 item (item id=2523) and not in all the weapon type :p

PHP:
--[[
Slot system 100% by mock \o
]]
---Config
local conf = {
maxSlotCount=1,
ignoredIds={}
}
--End

function choose(...) --- Function by mock.
	local arg = {...}
	return arg[math.random(1,#arg)]
end

local function isArmor(uid) -- Function by Mock the bear.
    if (getItemInfo(uid.itemid).armor ~= 0) and (getItemWeaponType(uid.uid) == 0) then
		return true
	end
	return false
end

function onUse(cid, item, fromPosition, itemEx, toPosition) -- Script by mock the bear (MTB)
	if item.uid == 0 or item.itemid == 0 then return false end
	toPosition.stackpos = 256
	if item.uid == 0 or item.itemid == 0 then return false end
	toPosition.stackpos = 256
    if isInArray(conf.ignoredIds, itemEx.itemid)
	    or (not getItemWeaponType(itemEx.uid) or getItemWeaponType(itemEx.uid) > 5)
        or (getItemWeaponType(itemEx.uid) == 0 and not isArmor(itemEx))
        or itemEx.itemid == 0 or itemEx.type > 1 or isItemStackable(itemEx.uid) then
        doPlayerSendTextMessage(cid, 24,"You cant open a slot on this item.")
        return TRUE
    end
    if isCreature(itemEx.uid) then
        return FALSE
    end
	local nam = getItemName(itemEx.uid)
	function getSlotCount(nam)
		local c = 0
		for _ in nam:gmatch('%[(.-)%]') do
			c = c+1
		end
		return c
	end
	if getSlotCount(nam) < conf.maxSlotCount then
		local l = choose('hp')
		local p = 5
 
		doSendMagicEffect(toPosition,30)
		nam = nam..' ['..l..'.+'..p..'%]'
		doSendAnimatedText(toPosition,l..' '..p..'%',120)
		doItemSetAttribute(itemEx.uid,'name',nam)
		doRemoveItem(item.uid,1)
	else
		doPlayerSendTextMessage(cid, 24,"You cant open a slot on this item.")
	end
	return true
end
thanks :D
 
You need edit actions.xml and add

2523;xxxx;xxxx;xxxx;xxxx; items to use..
for example:

PHP:
	<action itemid="2523;2524;2525;2526" event="script" value="slotsys.lua"/>

etc...
 
You need edit actions.xml and add

2523;xxxx;xxxx;xxxx;xxxx; items to use..
for example:

PHP:
	<action itemid="2523;2524;2525;2526" event="script" value="slotsys.lua"/>

etc...

Yes, i know how to put with what item the scroll will work :p, if you read the script, when you use an item for example the item id 2523, on other item it will gives you 5% more hp in any other item, but i want to edit it to only give you 5% hp in one specific item
 
Just edit your items.xml, add this on the especific item:

<attribute key="maxHealthPointsPercent" value="105"/>

and a movement to equip and deequip:

<movevent event="Equip" itemid="xxxx" slot="xxxx" function="onEquipItem"/>
<movevent event="DeEquip" itemid="xxxx" slot="xxxx" function="onDeEquipItem"/>


It will give to you 5% more health when you equip this item.
 
Back
Top