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

Help SOUL REFILLER - POTION

wafuboe

Active Member
Joined
Dec 24, 2010
Messages
884
Solutions
2
Reaction score
26
function onUse(cid, item, fromPosition, itemEx, toPosition)

doPlayerAddSoul(cid, 10)
doRemoveItem(item.uid)
doSendMagicEffect(getThingPosition(cid), CONST_ME_GREEN)
doCreatureSay(cid, "Ahhhh.", TALKTYPE_MONSTER)

return true
end


mm there is a problem with the soul it doesnt goes up i want something like a potion not like you use it you have+1 soul point

i want to refill all the soul that the player can have example the player max soul is 300 and he has 3, 10 ,0 or 50 refill it to his max soul..

my script doesnt works :I

if someone can do a good one i apreciatte it ;D
 
LUA:
local MIN = 70 -- Min soul the pot should add
local MAX = 130 -- max soul the pot should add
 
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isPlayer(itemEx.uid) == FALSE then
		return FALSE
	end
 
	if hasCondition(cid, CONDITION_EXHAUST_HEAL) == TRUE then
		doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
		return TRUE
	end
 
	if doPlayerAddSoul(itemEx.uid, math.random(MIN, MAX)) == LUA_ERROR then
		return FALSE
	end
 
	doAddCondition(cid, exhaust)
	doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
	doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)	
	return TRUE
end

[Xml]<action itemid="xxxx" event="script" value="soulpot.lua" allowfaruse="1"/> [/Xml]
 
Last edited:
it add soul to the player ;S
a player gets 244 max soul then waste it all and again 244 and again and again :S
like a potion but with soulpoints, dont exceding the max soulpoints the player has
if a player has 200 soulpoints max he use it he wont get more soulpoints
ifa a player has 200 soulpoints and he has 100 at the moment he use it and 200 not more :S

random soulpoints or refill to maxsoulpoints its ok too
 
[13/01/2012 13:31:02] [Error - Action Interface]
[13/01/2012 13:31:02] data/actions/scripts/soulrefill.lua:onUse
[13/01/2012 13:31:02] Description:
[13/01/2012 13:31:02] data/actions/scripts/soulrefill.lua:9: attempt to call global 'addPlayerSoul' (a nil value)
[13/01/2012 13:31:02] stack traceback:
[13/01/2012 13:31:02] data/actions/scripts/soulrefill.lua:9: in function <data/actions/scripts/soulrefill.lua:4>

local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))

function onUse(cid, item, fromPosition, itemEx, toPosition)
if isPlayer(itemEx.uid) == FALSE then
return FALSE
end
if getPlayerSoul(cid) < 300 then
addPlayerSoul(cid, math.random(50, 100 - getPlayerSoul(cid)))
end

if hasCondition(cid, CONDITION_EXHAUST_HEAL) == TRUE then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return TRUE
end

if doPlayerAddSoul(itemEx.uid, math.random(MIN, MAX)) == LUA_ERROR then
return FALSE
end

doAddCondition(cid, exhaust)
doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_GREEN)
doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
return TRUE
end




its ok the script or i place it wrong?
srry im not good in scripts ;S
 
Back
Top