• 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 Stopping player food/equipment regeneration

devianceone

Lua Scripter
Joined
Jan 24, 2009
Messages
756
Reaction score
28
Does anyone know a way to stop food and equipment effects like soft boots from adding health to the player? It seems onStatsChange completely ignores the health gained by food/equipment. I need a way to have a similar effect that PZ has, which stops all food/equip regeneration, but still allow monsters to spawn on that tile.
 
I want the item to work everywhere else obviously, but within a specific event area I don't any ways to gain health/mana. I can stop potions, healing spells and whatever with onStatsChange, but food/equipment doesn't call that function when healing.
 
I want the item to work everywhere else obviously, but within a specific event area I don't any ways to gain health/mana. I can stop potions, healing spells and whatever with onStatsChange, but food/equipment doesn't call that function when healing.

what about the "onEquip" script?
 
There is no onEquip script, all items are using only items.xml, movements.xml ect. Preventing equipping or unequipping them with a script is not an option. This wont control where it regenerates anyways and still does not solve the problem with food.
 
food is easy :p
just check action/other/food.lua
All that does is feed a player, if I disable feeding inside the event, they can still eat outside of the event and get regeneration until it wears off. Unless there's a way to set someones hunger/food level to 0 after they enter, this probably wont work. Does doPlayerFeed accept negative numbers?

Code:
function onEquip(cid, item, slot)
Example? I don't understand what approach you're trying to tell me..


No, but you can add an event to "remove" health.

doCreatureAddHealth(cid, - hp)

Softs add 10 hp, you subtract 10.
I have way to many items to do this, and its a very messy inefficient solution.. If 100+ players are using these items, you'll have a ton of events running every second adjusting peoples health, checking positions, storages ect.
 
I have way to many items to do this, and its a very messy inefficient solution.. If 100+ players are using these items, you'll have a ton of events running every second adjusting peoples health, checking positions, storages ect.

Of course.
 
edit the sauce
I wont be the only one with the script, so I cant expect everyone to do source editing for something so small.

Anyways, I converted to a custom health system which changes outfit color from green to red depending on 'health' left, so regeneration no longer matters.

If anyone still has a solution for this, I'd still like to know. There is probably a way, but I'm just missing it.
 
Back
Top