TFS 0.X Exausted SSA/Might Ring

Discussion in 'Support' started by eyez, Sep 9, 2018.

  1. eyez

    eyez Member

    Joined:
    Oct 11, 2016
    Messages:
    64
    Likes Received:
    3
    Best Answers:
    0
    I did found this script to add a exausted on SSA and Might Ring (to prevent bots rulles)
    It's working, you cant equip the item before exausted finish

    But SSA and Might Ring are not losing charges after u recive damage (after i added this script)

    Code (Text):
    1.  
    2.     <!-- onequip_exausted_pvp -->
    3.     <movevent type="Equip" itemid="2197" slot="necklace" event="script" value="onequip_exausted_pvp/ssa_exhaust.lua"/>
    4.     <movevent type="DeEquip" itemid="2197" slot="necklace" event="script" value="onequip_exausted_pvp/ssa_exhaust.lua"/>
    5.     <movevent type="Equip" itemid="2164" slot="ring" event="script" value="onequip_exausted_pvp/mightring_exhaust.lua"/>
    6.     <movevent type="DeEquip" itemid="2164" slot="ring" event="script" value="onequip_exausted_pvp/mightring_exhaust.lua"/>
    7.  
    SSA
    Code (Text):
    1.  
    2. local storage = 9500
    3. local fixStorage = 8000
    4. local time = 4
    5. function onEquip(cid, item, slot, boolean)
    6.     if getPlayerStorageValue(cid, fixStorage) == 1 then
    7.         doPlayerSetStorageValue(cid, fixStorage, -1)
    8.         return callFunction(cid, item.uid, slot, boolean)
    9.     end
    10.     if getPlayerStorageValue(cid, storage) >= os.time() then
    11.         print("exhausted")
    12.         return false
    13.     end
    14.     doPlayerSetStorageValue(cid, storage, os.time() + time)
    15.     doPlayerSetStorageValue(cid, fixStorage, 1)
    16.     print("exhaustion set for 5 seconds")
    17.     return true
    18. end
    19. function onDeEquip(cid, item, slot, boolean)
    20.     return callFunction(cid, item.uid, slot, boolean)
    21. end
    22.  
    mightring
    Code (Text):
    1.  
    2. local storage = 9501
    3. local fixStorage = 8001
    4. local time = 4
    5. function onEquip(cid, item, slot, boolean)
    6.     if getPlayerStorageValue(cid, fixStorage) == 1 then
    7.         doPlayerSetStorageValue(cid, fixStorage, -1)
    8.         return callFunction(cid, item.uid, slot, boolean)
    9.     end
    10.     if getPlayerStorageValue(cid, storage) >= os.time() then
    11.         print("exhausted")
    12.         return false
    13.     end
    14.     doPlayerSetStorageValue(cid, storage, os.time() + time)
    15.     doPlayerSetStorageValue(cid, fixStorage, 1)
    16.     print("exhaustion set for 5 seconds")
    17.     return true
    18. end
    19. function onDeEquip(cid, item, slot, boolean)
    20.     return callFunction(cid, item.uid, slot, boolean)
    21. end
    22.  
     
  2. eyez

    eyez Member

    Joined:
    Oct 11, 2016
    Messages:
    64
    Likes Received:
    3
    Best Answers:
    0
    bump
     
  3. JDB

    JDB OtLand Veteran

    Joined:
    Jun 1, 2009
    Messages:
    4,133
    Likes Received:
    110
    Best Answers:
    2
    You should use the exhaustion function:
    Code (Lua):
    1. local exhaust = 3 --seconds
    2. local eStorage = 55510
    3. function onEquip(cid, item, slot)
    4.     if exhaustion.check(cid, eStorage) then
    5.         doPlayerSendCancel(cid, "You are exhausted.")
    6.         return false
    7.     end
    8.  
    9.     exhaustion.set(cid, eStorage, exhaust)
    10.     return true
    11. end
     
    Last edited: Sep 15, 2018
    eyez likes this.
  4. eyez

    eyez Member

    Joined:
    Oct 11, 2016
    Messages:
    64
    Likes Received:
    3
    Best Answers:
    0
    With this script it's showing the exausted message, removing on damage, but it's not blocking to equip when you are exausted
     
  5. eyez

    eyez Member

    Joined:
    Oct 11, 2016
    Messages:
    64
    Likes Received:
    3
    Best Answers:
    0
    bump
     
  6. eyez

    eyez Member

    Joined:
    Oct 11, 2016
    Messages:
    64
    Likes Received:
    3
    Best Answers:
    0
    bump
     
  7. eyez

    eyez Member

    Joined:
    Oct 11, 2016
    Messages:
    64
    Likes Received:
    3
    Best Answers:
    0
  8. eyez

    eyez Member

    Joined:
    Oct 11, 2016
    Messages:
    64
    Likes Received:
    3
    Best Answers:
    0
  9. eyez

    eyez Member

    Joined:
    Oct 11, 2016
    Messages:
    64
    Likes Received:
    3
    Best Answers:
    0
  10. jestem pro

    jestem pro That is the question

    Joined:
    Apr 20, 2013
    Messages:
    529
    Likes Received:
    57
    Best Answers:
    8
    coz it rather needs to be done by sources not lua
    now you can pick up the item but if you're exhausted, cannot use.
     
    eyez likes this.
  11. eyez

    eyez Member

    Joined:
    Oct 11, 2016
    Messages:
    64
    Likes Received:
    3
    Best Answers:
    0

    how? where?
    Fir3element/3777
     
  12. eyez

    eyez Member

    Joined:
    Oct 11, 2016
    Messages:
    64
    Likes Received:
    3
    Best Answers:
    0

Share This Page

Loading...