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

upgrade Solt System [Edited]

Hrsha

Member
Joined
May 30, 2010
Messages
450
Reaction score
21
Location
Egypt
ystem [Edited]

hello guys

i have edited solt system to make it add hp to any armor
but the problem that it adds randomly from 1% to 23%
i want make it adds 30% only no more no less how ?
and what if i wana add hp and mana with 30% mana and 30% hp .
 
Last edited:
emmm try this :p i didnt test it :|
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
		if isInArray({2447, 7959, 7735, 7405, 8927, 7453, 7958, 8929, 8925}, itemEx.itemid) then
			doItemSetAttribute(itemEx.uid, "description", " health +30% ".. getCreatureName(cid) .. ".")
			doItemSetAttribute(itemEx.uid, "maxhitpointspercent", 130)
			doRemoveItem(item.uid)
		else
			doPlayerSendCancel(cid, "Sorry, not possible.")
	end
	
	return true
end
 
17:05 You see a demon armor (Arm:16).
It weighs 80.00 oz.
health +30% Pyromanic.

but there is no hp adds it just add description
no changes in my hp

even if i put movement of demon armor no changes too
 
this line does not work

doItemSetAttribute(itemEx.uid, "maxhitpointspercent", 130)

i tried this too "maxhealthpercent" does not work

any idea ?
 
if you will put it in items.xml

add a line in the armor:
PHP:
        <attribute key="maxHitpointsPercent" value="110" />
and remembder to add it to moveevents
 
if ur script works(no idea how xD) then try this one:
Code:
--[[
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 = 255
	if item.uid == 0 or item.itemid == 0 then return false end
	toPosition.stackpos = 255
    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 = 30
 
		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
 
Back
Top