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

Lua script that increase 150k hp and mana forever

TKO

Syphero Owner!
Joined
Mar 10, 2008
Messages
2,252
Reaction score
27
Location
Sweden
Hey any one that have a script that increase 150k hp and mana forever?
1 mana and 1 hp potion
 
Ok, this works while the character is logged in. The math is set to divide whatever number you choose by 2. If you remove that, for some reason it gets a bit glitchy with just the + on there, and it will not add the correct amount of mana or hp. So here you are.
Code:
local hp = 30 --- Set the number here and divide by 2 and thats how much hp is added. Ex 15 hp would be added here.
local mp = 30 --- Set the number here and divide by 2 and thats how much mp is added. Ex 15 mp would be added here.


function onUse(cid, item, fromPosition, itemEx, toPosition)

     if item.itemid == XXXX then
	setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+hp/2)
	setCreatureMaxMana(cid, getCreatureMaxMana(cid)+mp/2)
	doRemoveItem(item.uid,1)
end
return true
end

Tested with TFS .3.6pl1
 
Wouldn't it be easier to make it write the change to the database? (add 150k hp there)
Saves you some resource usage.

the character has to be offline, because when it logouts, it is going to rewrite the change, to the actual max hp.

Taken from ioLoginData -> savePlayer

PHP:
query << "UPDATE `players` SET `lastlogin` = " << player->lastLogin << ", `lastip` = " << player->lastIP;
query << "`health` = " << player->health << ", ";
query << "`healthmax` = " << player->healthMax << ", ";
 
Ok, this works while the character is logged in. The math is set to divide whatever number you choose by 2. If you remove that, for some reason it gets a bit glitchy with just the + on there, and it will not add the correct amount of mana or hp. So here you are.
Code:
local hp = 30 --- Set the number here and divide by 2 and thats how much hp is added. Ex 15 hp would be added here.
local mp = 30 --- Set the number here and divide by 2 and thats how much mp is added. Ex 15 mp would be added here.


function onUse(cid, item, fromPosition, itemEx, toPosition)

     if item.itemid == XXXX then
	setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+hp/2)
	setCreatureMaxMana(cid, getCreatureMaxMana(cid)+mp/2)
	doRemoveItem(item.uid,1)
end
return true
end

Tested with TFS .3.6pl1


Tested, Works, thanks for the scrip :) Rep++
 
the character has to be offline, because when it logouts, it is going to rewrite the change, to the actual max hp.

Taken from ioLoginData -> savePlayer

PHP:
query << "UPDATE `players` SET `lastlogin` = " << player->lastLogin << ", `lastip` = " << player->lastIP;
query << "`health` = " << player->health << ", ";
query << "`healthmax` = " << player->healthMax << ", ";

It does not rewrite the max hp. On .3.6pl1 you can affectivly use the script I wrote to change the max hp and mp perm~ by using the action. No need to have it write the database, no need for anything further then what I wrote.
 
I have it, idk whow to post /lua or something, here you are.
Is a action script, only one time usage, and need lv 30k.
You can edit :)
I will request some1 to add health up for it. :p
MANA BOOSTER SCRIPT:

function onUse(cid, item, fromPosition, itemEx, toPosition)
local level, storage, mana = 30000, 13377, 150000
if(getPlayerLevel(cid) < level) then
doPlayerSendCancel(cid, "You must be atleast level " .. level .. " to use this.")
elseif(getPlayerStorageValue(cid, storage) == 1) then
doPlayerSendCancel(cid, "You have already used this before.")
else
setCreatureMaxMana(cid, getCreatureMaxMana(cid) + mana)
setPlayerStorageValue(cid, storage, 1)
doCreatureSay(cid, "You have received " .. mana .. " extra mana points.", TALKTYPE_ORANGE_1)
doRemoveItem(item.uid, 1)
end
return true
end



HEALTH :
function onUse(cid, item, fromPosition, itemEx, toPosition)
local level, storage, health = 30000, 13378, 150000
if(getPlayerLevel(cid) < level) then
doPlayerSendCancel(cid, "You must be atleast level " .. level .. " to use this.")
elseif(getPlayerStorageValue(cid, storage) == 1) then
doPlayerSendCancel(cid, "You have already used this before.")
else
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + health)
setPlayerStorageValue(cid, storage, 1)
doCreatureSay(cid, "You have received " .. health .. " extra health points.", TALKTYPE_ORANGE_1)
doRemoveItem(item.uid, 1)
end
return true
end

IN ACTIONS:
<movevent type="DeEquip" itemid="2123" slot="ring" event="script" value="hpring.lua"/>
<movevent type="Equip" itemid="2123" slot="ring" event="script" value="hpring.lua"/>

Credits: JDB
 
i have a really cool script that does that
and it even gives different ammounts depending on vocations
and you can only use this potion once
if you have any problems Message me about
it worked fine on my server

Code:
local EMPTY_POTION = 7636

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

------------------Knight

if(isKnight(itemEx.uid))then 

HEALTHGAINED = 1000
if (getPlayerStorageValue(cid,13001) == -1) then
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + HEALTHGAINED)
	doSendMagicEffect(getThingPos(itemEx.uid), 6)
doCreatureSay(itemEx.uid, "You Gained 1000 life", TALKTYPE_ORANGE_1)

	if doCreatureAddHealth(itemEx.uid, HEALTHGAINED) == LUA_ERROR then

		return FALSE
		
	end

	doAddCondition(cid, exhaust)
setPlayerStorageValue(cid,13001,1)
doTransformItem(item.uid, EMPTY_POTION)
else

doCreatureSay(itemEx.uid, "You have already use this potion before.", TALKTYPE_ORANGE_1)

end
end

------------------Paladin

if(isPaladin(itemEx.uid))then 
MANAGAINED = 750
HEALTHGAINED = 500 
if (getPlayerStorageValue(cid,13001) == -1) then

setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + HEALTHGAINED )
setCreatureMaxMana(cid, getCreatureMaxMana(cid) + MANAGAINED )

	doSendMagicEffect(getThingPos(itemEx.uid), 6)
	doCreatureSay(itemEx.uid, "You Gained 500 life and 750 mana", TALKTYPE_ORANGE_1)

	GAINED = 500

	if ((doCreatureAddHealth(itemEx.uid, HEALTHGAINED ) == LUA_ERROR) or (doPlayerAddMana(itemEx.uid, MANAGAINED ) == LUA_ERROR)) then

		return FALSE
		
	end

	doAddCondition(cid, exhaust)
setPlayerStorageValue(cid,13001,1)
doTransformItem(item.uid, EMPTY_POTION)
else

doCreatureSay(itemEx.uid, "You have already use this potion before.", TALKTYPE_ORANGE_1)

end

end

------------------Mages
if(isSorcerer(itemEx.uid) or isDruid(itemEx.uid))then 
MANAGAINED = 1750
if (getPlayerStorageValue(cid,13001) == -1) then
setCreatureMaxMana(cid, getCreatureMaxMana(cid) + MANAGAINED)
	doSendMagicEffect(getThingPos(itemEx.uid), 6)
	doCreatureSay(itemEx.uid, "You Gained 1750 Mana", TALKTYPE_ORANGE_1)


	if doCreatureAddMana(itemEx.uid, MANAGAINED ) == LUA_ERROR then

		return FALSE
		
	end

	doAddCondition(cid, exhaust)
setPlayerStorageValue(cid,13001,1)
doTransformItem(item.uid, EMPTY_POTION)
else

doCreatureSay(itemEx.uid, "You have already use this potion before.", TALKTYPE_ORANGE_1)

end

end

	

	
	return TRUE
end
 
I'm not talking about your script, I know it works, I was talking about what coiler said: "why not edit directly the database?" I was pointing out that if you are online the values you change would be rewriten when the cahracter is saved
 
Back
Top