• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Regeneration Mixture

jestemPolakiem

New Member
Joined
Oct 17, 2009
Messages
48
Reaction score
2
Location
Poland
translatelogo.gif
Regeneration Mixture
created by jestemPolakiem

mapab.png


Introduction
Welcome all members of this forum! I would like to give you my newly-created script.​
This post was created in the previous model, put here for a look, professionalism and format. Of course, everything is translated by Google Translate, confirming that in the upper right corner is a special icon.​

Description
The action script is simple - you get or purchase the item called regeneration mixture (with id 7443) and uses it. Automatically uses on it - can not be used on another creature. It has five to use - or if it is purchased in a shop allowed to establish more. It adds for 30 seconds, a certain amount of life and mana - you have a pattern here​
PHP:
health = getCreatureMaxHealth(cid) * 0.2 + 50, mana = getCreatureMaxMana(cid) * 0.15 + 40

Changelog
  • fixed bug when a logout form - thanks to Karpio

Install
data/actions/actions.xml - before </actions>
PHP:
<action itemid="7443" event="script" value="regmixture.lua" override="yes"/>
data/items/items.xml - before </items>
PHP:
<item id="7443" article="a" name="regeneration mixture" override="yes">
	<attribute key="description" 	value="Potion regenerate your life and a certain amount of mana in a given time."/>
	<attribute key="decayTo"	 	value="7636"/>
	<attribute key="charges"   	  value="5"/>
	<attribute key="showcharges" 	value="1"/>
	<attribute key="weight" 	 	value="300"/>
</item>
data/actions/scripts/regmixture.lua
PHP:
function onUse(cid, item, fromPos, itemEx, toPos)
	local function doRegeneration(cid, formula, count)
		if (not isPlayer(cid)) then 
			return
		end
		doCreatureAddHealth(cid, formula.health)
		doCreatureAddMana(cid, formula.mana)
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
		if (count ~= 1) then
			addEvent(doRegeneration, 1000, cid, formula, count - 1)
		end
		return true
	end
	local form = {health = getCreatureMaxHealth(cid) * 0.2 + 50, mana = getCreatureMaxMana(cid) * 0.15 + 40}
	doRegeneration(cid, form, 30)
	doChangeTypeItem(item.uid, item.type - 1)
	return true
end


Termination
I greet all​
jestemPolakiem​
 
Last edited:
Wow!

very nice!! i'll put it in my server ;] but i want replace the potion for a rune. It's almost same?
 
translatelogo.gif
Dear users, introduced an amendment which will correct the error in the engine.
 
Last edited:
Ok. Tell me where I can edit the amount to be added mana and hp? How do I edit that gave the mana and hp depending on your level and magic level?

PL
Ok. Powiedz mi gdzie mogę edytować ilość dodawanej mana i hp? Jak edytować by dawało mane i hp zależnie od poziomu magicznego i poziomu?
 
translatelogo.gif
witmar, iabove you give you the appropriate line, but if you have it below the code - just replace.
PHP:
local form = {health = getPlayerMagLevel(cid) * getPlayerLevel(cid) * 0.1 + 80, mana = getPlayerMagLevel(cid) * getPlayerLevel(cid) * 0.05 + 50}
 
Nice that you release these scripts.

But a tip: If you put the function outside of the onUse function it won't be loaded every time the script is executed. That would be better ;/
 
Back
Top