• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

break weapon

foxkbt

Member
Joined
Sep 29, 2009
Messages
290
Reaction score
7
Location
Salvador
I wonder if it is possible to use a number of the name of an item in a function

if possible would like a function to return to this number

My idea is to make a weapon that breaks
I thought of using storage but there would only suffer damage to owner

EX:
08:26 You see the sword of pain - health [100/100] (Atk: 64 Def: 5)
It weighs 320.00 oz.

function getHealthWeapon(cid)
if getName(itemid) == - health then
local value = [ex/ex]
return value
end
end

remember this is just one example I know that this function does not exist
 
@ratser
an item can have 2 aids? if so I didnt know...
Nope. But you can replace the current action.id with the function I told you. Anyways, why would you like to have an item with 2 action.ids if you can create several script types (action, creatureevent, movement...) for the same item and use the same 'aid'?
 
just make it in source, add int variable to items storing durability, decrease it in internalUseWeapon or something

Hmm yeah. It can be done in attribute but how add variable that it will be conected with lua code (and will be for e.x. every 20 sec changing)?? :huh:

I mean this var:

Code:
...Durability: [[COLOR="red"][SIZE="4"][B]58[/B][/SIZE][/COLOR]/100]
 
Last edited:
when dealing hit random or always (wha you preffer) decrease that variable in item(or weapon?) object
and you can change it via lua using getItemAttribute and doItemSetAttribute(if is set in item class) so fixing weapons will work

and if max is percent it is not problem, if it change from weapon to weapon just add 2 variables(one for current and one for max, max can be stored also in itemtype cause you probably want the same durability for each item with the same id)
 
Back
Top