Jump to content

[Lua]Пример кудлауна на предметы


Go-piratia

Recommended Posts

Скрипт устанавливает кулдаун на использование предмета.  Добавляем в ItemEffect.lua

Gyosa = {}
function ItemUse_SSSJ ( role , Item )
    local name = GetChaDefaultName(role)
    if Gyosa[name] == nil then
        Gyosa[name] = { UsedTime = os.time() }
    end
 
    local cooldown = Gyosa[name].UsedTime - os.time()
        if cooldown > 0 then
        SystemNotice(role,"Gyoza cooldown on effect wait "..cooldown.." second(s) to use again!")
            UseItemFailed(role)
            return
        end
 
    mxhp = GetChaAttr(role,ATTR_MXHP)
    hp_resume = mxhp * 0.3
    hp = hp + hp_resume
 
    if hp > mxhp then
        hp = mxhp
    end
    SetCharaAttr(hp, role, ATTR_HP)
    Gyosa[name].UsedTime = os.time()+10
end

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Chat

Chat

Please enter your display name

×
×
  • Create New...