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

Close Thread "Problem fixed" thanks

Lava Titan

Developer
Joined
Jul 25, 2009
Messages
1,529
Solutions
1
Reaction score
85
Location
Portugal
Sup otland

This time i'm requesting a Health Ring Script

Item ID: 2357

Funcion: when a player put the ring on his ring slot his hp will go up 25%

When he takes it from the slot his hp will back to normal.

PHP:
TFS 0.3.4

Thank you if you help!
Will rep++ if your script works fine!
 
OMG! SPAMMER You Know Items.XML ?

Not tested:
Lua:
	<item id="2357" article="a" name="ring of wishes">
		<attribute key="weight" value="90"/>
		<attribute key="slotType" value="ring"/>
		<attribute key="maxHitPointsPercent" value="125"/>
	</item>
 
Last edited:
...

PHP:
[Warning - Items::loadFromXml] Unknown key value maxHitPointsPercent

See...
Thats why i wanted a script or something else to add at items.xml

<_<
 
i added what u sayed but it doesnt work...
i already restarted the serv 2x to test and nop it doesnt work in-game and it says that when i turn the server on
 
Maybe?

Lua:
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)*1.25) -- 25% More HP.
 
Go to my Lua Function List and "Ctrl + F" -> Search "doPlayerAddSword" and you have 80% of the script.

I think I know how to do, but I don't know how to put 3 scripts in one... I want:

If a Paladin clicks on the statue, he gets 5 Dist skills,
if sorc, 5 ml,
if knight, 5 skills (club, axe and sword) :p
 
Add this to the items.xml of the ring.

PHP:
<attribute key="maxHealthPercent" value="150"/> -- 50%
<attribute key="maxManaPercent" value="150"/> -- 50%
 
lol i'm looking for this script/attribute at like 3 moths or 4 and no1 could do it ...

i know that its possible but idk how didnt any1 know how to make it yet ...
 
data/movements/scripts/script.lua
Lua:
local condition1 = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition1, CONDITION_PARAM_STAT_MAXHITPOINTSPERCENT, 125) -- 25% more Health

local ring_id = 2357
function onEquip(cid, item, slot)
	if getPlayerSlotItem(cid, CONST_SLOT_RING) == ring_id then
		doAddCondition(cid, condition1)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your health has been raised.")
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED)
	end
	return TRUE
end

local ring_id = 2357
function onDeEquip(cid, item, slot)
	if getPlayerSlotItem(cid, CONST_SLOT_RING) ~= ring_id then
		doRemoveCondition(cid, condition1)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your health is back to normal.")
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_BLUE)
	end
	return TRUE
end
 
Script problems

this half of the script works

PHP:
local condition2 = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition2, CONDITION_PARAM_STAT_MAXHITPOINTSPERCENT, 100)

local ring_id = 2357
function onDeEquip(cid, item, slot)
        if getPlayerSlotItem(cid, CONST_SLOT_RING) ~= ring_id then
                doAddCondition(cid, condition2)
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your health is back to normal.")
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_BLUE)
        end
        return TRUE
end

but this one

PHP:
local condition1 = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition1, CONDITION_PARAM_STAT_MAXHITPOINTSPERCENT, 120)

local ring_id = 2357
function onEquip(cid, item, slot)
        if getPlayerSlotItem(cid, CONST_SLOT_RING) == ring_id then
                doAddCondition(cid, condition1)
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your health has been raised.")
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED)
        end
        return TRUE
end
doesnt...:(
 
Back
Top