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

Eat food - Instantly heals

  • Thread starter Deleted member 49793
  • Start date
D

Deleted member 49793

Guest
Hey i know this was released but cant find it... Could someone link me OR post a new script for it :)

Basicly just when player eats fish, instantly restores 50 mana and 50 health

AND

when eat cod instnatly restores 5% max hp and 5% max mana (No cooldown plz)
 
i have a hired scripter, and i do most scripts myself except ones i dont know how to do.
Edit: Try to not off topic infernus, thanks
 
Try ..
Lua:
local t = {
	[2667] = {'Munch.', hp=50, mp=50},
	[cod??] = {'Munch.', hppc=5, mppc=5},
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local v = t[item.itemid]

	doCreatureSay(cid, v[1], TALKTYPE_ORANGE_1)
	doRemoveItem(item.uid, 1)
	if v.hp then
		doCreatureAddHealth(cid, v.hp)
	elseif v.hppc then
		doCreatureAddHealth(cid, getCreatureMaxHealth(cid) * v.hppc / 100)
	end

	if v.mp then
		doCreatureAddMana(cid, v.mp)
	elseif v.mppc then
		doCreatureAddMana(cid, getCreatureMaxMana(cid) * v.mppc / 100)
	end
	return true
end
You'll have to change the script these items are binded to, in actions.xml.

For example,
Code:
	<action fromid="2666" toid="2691" event="script" value="other/food.lua"/>
to:
Code:
	<action itemid="2666" event="script" value="other/food.lua"/>
[B]	<action itemid="[COLOR="red"]2667[/COLOR]" event="script" value="other/[COLOR="red"]name_of_this_script.lua[/COLOR]"/>[/B]
	<action fromid="2668" toid="2691" event="script" value="other/food.lua"/>
 
Last edited:
Question about the actions.xml
If i leave the fact that the item is using value=|food.lua
wont it also count the item as food? I dont want it to fill you i want it to be like a potion where you can use as much as you want :D
 
Najwe its gunna be for an advanced fishing system, High level fishers can fish up Cod and northern trout which will give you for a certain time bonus's such as more hp or mana etc.
 
Ya i needed that one, Are you also able to make a way that it does the same effect as bullseye potion, berserk potion, and mastermind potion?

Edit: So like when you eat another type of fish (i know how to do the actions.xml part) then it will give same effect as bullseye potion (cannot stack)
 
Area effect? I wouldn't like to glow red (doSendMagicEffect(fromPosition, CONST_ME_MAGIC_RED)) whenever I eat fish...but it's his decision.
 
Just to player, So player eats a Northern pike for example, and it raises there magic level 2
They eat a green perch it increases there sword axe and club by 5
They eat a salmon it increases there distance by 5 :)



Problem with script cyko, I put the script in
Then in actions.xml i made it like so
<action fromid="2668" event="script" value="other/food.lua"/>
<action fromid="2669" event="script" value="other/food.lua"/>
<action fromid="2670" event="script" value="other/shrimp.lua"/>

Put the script you gave me in, But now when you try and eat a shrimp it does nothing, you click, nothing happens, just sits there
 
Last edited by a moderator:
value shouldn't be "other/nameOfFood.lua", but the actual script name.
Any errors? Have you added the line with shrimp's ID into the script?
 
Code:
<action fromid="2668" event="script" value="other/food.lua"/>
<action fromid="2669" event="script" value="other/food.lua"/>
<action fromid="2670" event="script" value="other/shrimp.lua"/>

FromID? :huh:
 
Ahhhh i see problem, Fail on my behalf ty

Edit: Changed to itemid same problem. Nothing happens
 
Last edited by a moderator:
Back
Top