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

Script request

Maxens

Member
Joined
Apr 9, 2009
Messages
479
Reaction score
7
Location
Germany
Hey everyone! :)

Could anyone post here a script for a item which is called "HP Booster"?
I got a script for a "MP Booster" but i can't change the script to use it also as a HP Booster :P

Here is my script:

PHP:
local cfg = 
{ 
	level = 1000,
	itemid = 8474,
	newMana = 150000
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if (item.itemid == cfg.itemid) then
		if getPlayerLevel(cid) >= cfg.level then  
			setCreatureMaxMana(cid, (getCreatureMaxMana(cid)+cfg.newMana))
			doSendAnimatedText(getCreaturePosition(cid), "MANA!",TEXTCOLOR_RED)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
			doCreatureSay(cid, "You have recieved ".. cfg.newMana .." extra mana points, now your mana is ".. getCreatureMaxMana(cid) .."!", TALKTYPE_ORANGE_1)  
			doRemoveItem(item.uid)  
		else  
			doPlayerSendCancel(cid, "Your level is not high enough.")  
		end
		return TRUE
	end
end

Thanks alot!
 
LUA:
local cfg =  
{  
    level = 1000, 
    itemid = 8474, 
    newHealth = 150000 
} 
function onUse(cid, item, fromPosition, itemEx, toPosition) 
    if (item.itemid == cfg.itemid) then 
        if getPlayerLevel(cid) >= cfg.level then   
            setCreatureMaxHealth(cid, (getCreatureMaxHealth(cid)+cfg.newHealth)) 
            doSendAnimatedText(getCreaturePosition(cid), "MANA!",TEXTCOLOR_RED) 
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS) 
            doCreatureSay(cid, "You have recieved ".. cfg.newHealth .." extra mana points, now your mana is ".. getCreatureMaxMana(cid) .."!", TALKTYPE_ORANGE_1)   
            doRemoveItem(item.uid)   
        else   
            doPlayerSendCancel(cid, "Your level is not high enough.")   
        end 
        return TRUE 
    end 
end
 
like this?

LUA:
local cfg =  
{  
    level = 1000, 
    itemid = 8474, 
    newHP = 150000 
} 
function onUse(cid, item, fromPosition, itemEx, toPosition) 
    if (item.itemid == cfg.itemid) then 
        if getPlayerLevel(cid) >= cfg.level then   
            setCreatureMaxHealth(cid, (getCreatureMaxHealth(cid)+cfg.newHP)) 
            doSendAnimatedText(getCreaturePosition(cid), "HEALTH!",TEXTCOLOR_RED) 
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS) 
            doCreatureSay(cid, "You have recieved ".. cfg.newHP .." extra mana points, now your HP is ".. getCreatureMaxHealth(cid) .."!", TALKTYPE_ORANGE_1)   
            doRemoveItem(item.uid)   
        else   
            doPlayerSendCancel(cid, "Your level is not high enough.")   
        end 
        return TRUE 
    end 
end
rep+

edit:
owned was faster xD
 
Yeah! Works fine! :D

I'll rep+ you both for that fast answer :DD

Could you also give me a script which makes if i use a item (i think it will be a scroll or gem or something) and then the player gets double EXP for 1 hour...you can use it once a day! WOuld be very cool! :)
 
I found this on internett

The ring which is used is Death ring
Death_Ring.gif


First copy this 2 codes in your action.xml "usually Data>actions"
Code:
<action itemid="[COLOR="lime"]6300[/COLOR]" event="script" value="YOURSCRIPTNAME.lua"/>
Code:
<action itemid="[COLOR="lime"]6301[/COLOR]" event="script" value="YOURSECONDSCRIPTNAME.lua"/>

Green is the item id choose whatever you want

I would like you to notice first script.lua must be different than the second script.lua

Now when you finish adding the codes above add this 2 scripts each one in different.lua

Code:
local config = { 
    rate = 1.5,
} 

function onUse(cid, item, fromPosition, itemEx, toPosition)
if doPlayerRemoveMoney(cid, [COLOR="red"]20000[/COLOR]) then
itemEx=itemid == [COLOR="lime"]6300[/COLOR]
doCreatureSay(cid, "Your extra experience rate has been activated! It is now: " .. config.rate .. "x doubled your former experience rate.", TALKTYPE_ORANGE_1, true, cid) 
            doPlayerSetExperienceRate(cid, config.rate) 
            doTransformItem(item.uid,[COLOR="lime"]6301[/COLOR])
else
				doCreatureSay(cid, "You don't have enough money to Start Other exp condition !", TALKTYPE_ORANGE_1, true, cid)
end
			return true
		end

Red is the cash in gold which will be taken when u use the item
Green is the item id choose what you want

Code:
function onUse(cid, item, slot) 
    if(item.itemid == [COLOR="lime"]6301[/COLOR]) then 
        doPlayerSetExperienceRate(cid, 1.0) 
           doCreatureSay(cid, "Your extra experience rate has ended.", 

TALKTYPE_ORANGE_1,true,cid) 
            doTransformItem(item.uid,[COLOR="lime"]6300[/COLOR]) 
    end 
end
Green is the item id's

Now items.xml part
add those codes
Code:
<item id="[COLOR="lime"]6300[/COLOR]" article="a" name="[COLOR="orange"]disabled exp ring[/COLOR]">
		<attribute key="weight" value="80" />
		<attribute key="slotType" value="ring" />
		<attribute key="transformEquipTo" value="6301" />
		<attribute key="stopduration" value="1" />
		<attribute key="showduration" value="0" />
	</item>
	<item id="[COLOR="lime"]6301[/COLOR]" article="a" name="[COLOR="orange"]enabled exp ring[/COLOR]">
		<attribute key="weight" value="80" />
		<attribute key="slotType" value="ring" />
		<attribute key="decayTo" value="0" />
		<attribute key="transformDeEquipTo" value="6300" />
		<attribute key="duration" value="480" />
		<attribute key="armor" value="1" />
		<attribute key="showduration" value="0" />
	</item>

Orange is the item name you can change it for what ever you want
Green is the item id you can choose what u want

Now images
If you have money and click on it this happends
25que6f.png


When you click other time to disable it
5mwwf6.png


if you click while not having the cash u set up
308bh35.png


Well that's all
Credits goes to me ;p

id's 6300 and 6301 can be changed for what you want

I guess that's the first time i post here on Vapus, Don't flame please.

Patch v1 !!! Read

well here is Patch v1

This will make if the ring is removed from player bp's or any slot on his body it reset the exp to normal to avoid multi usage

add this in movements -->scripts -->YOURSCRIPTNAME.LUA

Code:
function onAddItem(item, tile, pos, cid)
	if isPlayer(cid) and getPlayerItemCount(cid, 6301) == 0 then
		doPlayerSetExperienceRate(cid, 1.0)
doCreatureSay(cid, "Your extra experience rate has ended.", TALKTYPE_ORANGE_1,false,cid) 
            doTransformItem(item.uid, 6300) 
	end
end
in movements.xml -->
Code:
<movevent type="AddItem" itemid="6301" event="script" value="add.lua"/>
best wishes:rolleyes:
 
Back
Top