• 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 Action using player class lib v 1.0

Mock

Mock the bear (MTB)
Joined
Jul 29, 2008
Messages
619
Reaction score
109
Location
Brazil
This function it's only an example...
This action need use this lib:
http://otland.net/f163/apcl-awsome-player-class-lib-v-1-0-like-revscripts-125079/

This code convert all health in mana points.

Done using the lib:
LUA:
local health_per_cycle = 100
function onUse(cid,item)
    local cid = Player:new(cid)
    if cid.health > health_per_cycle then
        if cid:getstorage(16544) <= os.time() then
            cid.storage = U:pack(16544,os.time()+2) --- 2 secs of exhaust
            cid.addhealth = -100 
            cid.addmana = 100
            cid:doCreatureSay('Ahhh',1)
            doSendMagicEffect(cid.position,12)
            doRemoveItem(item.uid)
        else 
             cid:doPlayerSendCancel('You are exhausted.')
        end
    else 
        cid:doPlayerSendCancel('Sorry, no health.')
    end
end

Just read the code ;D
 
Last edited:
it's like revs :P
but when you set cid.health = 100 it works like a function (instant)
no delay
 
Would be nice if you shorten function names, like:
Code:
cid:doCreatureSay(...)
=>
Code:
cid:say(...)

Code:
cid:doPlayeSendCancel(...)
=>
Code:
cid:sendCancel(...)

So it's faster to write scripts using this lib.
 
Would be nice if you shorten function names, like:
Code:
cid:doCreatureSay(...)
=>
Code:
cid:say(...)

Code:
cid:doPlayeSendCancel(...)
=>
Code:
cid:sendCancel(...)

So it's faster to write scripts using this lib.
++1
 
Would be nice if you shorten function names, like:
Code:
cid:doCreatureSay(...)
=>
Code:
cid:say(...)

Code:
cid:doPlayeSendCancel(...)
=>
Code:
cid:sendCancel(...)

So it's faster to write scripts using this lib.
But some are shorten:
cid:doCreatureSay('Ahhh',1)
^the same of
doCreatureSay(cid,...)
but you can:

cid:dosay(...)
cid:docancel(...)

[OBJ]:[METHOD][VALUE](PARAMS)

[cid]:[do][say](...)
cid:dosay(...)

Check:
Code:
Player['do'] = {
	['move'] = doMoveCreature,
	['summom'] = doSummonCreature,
	['remove'] = doRemoveCreature,
	['say'] = doCreatureSay,
	['mute'] = doMutePlayer,
	['broadcast'] = doPlayerBroadcastMessage,
	['buyitem'] = doPlayerBuyItem,
	['buyitemcontainer']= doPlayerBuyItemContainer,
	['save'] = doPlayerSave,
	['sendcancel'] = doPlayerSendCancel,
	['cancel'] = doPlayerSendCancel,
	['channelmessage'] = doPlayerSendChannelMessage,
	['defautcancel'] = doPlayerSendDefaultCancel,
	['outfitwindow'] = doPlayerSendOutfitWindow,
	['textmessage'] = doPlayerSendTextMessage,
	['message'] = doPlayerSendTextMessage,
	['tutorial'] = doPlayerSendTutorial,
	['removeaccban'] = doRemoveAccountBanishment,
	['removecondition'] = doRemoveCondition,
	['removeconditions']= doRemoveConditions,
 
}
 
Last edited:
Back
Top