Help changing time healing my manarune script! (tfs 1.2)

Discussion in 'Requests' started by Edroniasty, Nov 5, 2017.

  1. Edroniasty

    Edroniasty Member

    Joined:
    Oct 2, 2015
    Messages:
    92
    Likes Received:
    1
    Best Answers:
    0
    Hello! I need to change my paladin manarune & uh time healing ( rune should be 1s - 1000ms but I need keep timeBetweenExActions = 500 in my config.lua and can't change it.. This is action script - timeBetweenActions') - 2000 don't working the spell is still 500ms

    Code (Text):
    1. local exhaust = createConditionObject(CONDITION_EXHAUST)
    2. setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenActions') - 2000))
    3.  
    4. function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    5.     local level = player:getLevel()
    6.     local mlevel = player:getMagicLevel()
    7.     local hpandma_minimum = (level * 7.8) + (SKILL_MAGLEVEL * 0)
    8.     local hpandma_maximum = (level * 9) + (SKILL_MAGLEVEL * 0)
    9.     if player:getVocation():getId() == 3 or 7 then
    10.         player:addMana(math.random(hpandma_minimum, hpandma_maximum))
    11.         player:addHealth(math.random(hpandma_minimum, hpandma_maximum))
    12.         player:getPosition():sendMagicEffect(CONST_ME_GIFT_WRAPS)
    13.     else
    14.         return FALSE
    15.     end
    16. return TRUE
    17. end
    Help!
     
  2. Edroniasty

    Edroniasty Member

    Joined:
    Oct 2, 2015
    Messages:
    92
    Likes Received:
    1
    Best Answers:
    0
  3. WibbenZ

    WibbenZ Support Team Support Team

    Joined:
    Oct 16, 2008
    Messages:
    5,912
    Likes Received:
    1,021
    Best Answers:
    199
    Code (Lua):
    1. setConditionParam(exhaust, CONDITION_PARAM_TICKS, 1500))
     
  4. Edroniasty

    Edroniasty Member

    Joined:
    Oct 2, 2015
    Messages:
    92
    Likes Received:
    1
    Best Answers:
    0
    thanks, I will try later ;]

    not working - script still using exhaust from config.lua
     
    Last edited by a moderator: Nov 12, 2017
  5. strutZ

    strutZ Australian OT Member {AKA Beastn}

    Joined:
    Nov 16, 2014
    Messages:
    1,300
    Likes Received:
    460
    Best Answers:
    5
    impossible. Try reloading the server and making sure you save the change.
     
  6. Edroniasty

    Edroniasty Member

    Joined:
    Oct 2, 2015
    Messages:
    92
    Likes Received:
    1
    Best Answers:
    0
    so... I change to 5000,9000 and 90000
    Code (Text):
    1. setConditionParam(exhaust, CONDITION_PARAM_TICKS, 90000)
    still 0.5 s

    timeBetweenActions = 200
    timeBetweenExActions = 10000

    (now I can use rune between 10 seconds not 90s like in param ticks.. serv was reloaded, properly saved..

    I have other script for manarune and this script works fine with 1s exhaust
    Code (Text):
    1. function onUse(cid, item, frompos, itemEx, topos)
    2. local playerinfo = -- Please don't touch
    3. {
    4. level = getPlayerLevel(cid),
    5. mlevel = getPlayerMagLevel(cid),
    6. voc = getPlayerVocation(cid)
    7. }
    8. local config =
    9. {
    10. strenght = "template", ---Values: template (strenght dependent on level and magic level), constant (on all level adding same mana)
    11. template = {min = (((playerinfo.level * 12.5) + (playerinfo.mlevel * 1)) + 0.0) , max =(((playerinfo.level * 14) + (playerinfo.mlevel * 1)) + 0.0)}, -- liczymy - lvl * 4 /1.5 = x m lvl * 2 /1.5 = x lvl + m lvl = Minimum, lvl * 6 /1.5 = x m lvl * 4 /1.5 = x lvl + m lvl = Maximum
    12. constant = {min = 400, max = 800},--only if strenght is constant
    13. exhaustion = 1,--exhaustion in secs
    14. exhaustion_value = 56789, --exhaustion storage value
    15. minimum_level = 1,--minimum level to use manarune
    16. minimum_mlevel = 0,--minimum magic level to use manarune
    17. cannot_use_voc = {3,4,7,8,11,12} --id vocation which cannot use
    18. }
    19. local rand = 0
    20. if(isPlayer(itemEx.uid) == false) then
    21. return true
    22. end
    23. if(playerinfo.level < config.minimum_level) then
    24. return true
    25. end
    26. if(playerinfo.mlevel < config.minimum_mlevel) then
    27. return true
    28. end
    29. if(isInArray(config.cannot_use_voc, playerinfo.voc)) then
    30. return true
    31. end
    32. if(config.strenght ~= "template" and config.strenght ~= "constant") then
    33. config.strenght = "constant"
    34. end
    35. if(getPlayerStorageValue(cid, config.exhaustion_value) > os.time()) then
    36. doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You are exhausted.")
    37. return true
    38. end
    39. if(config.strenght == "template") then
    40. rand = math.random(config.template.min, config.template.max)
    41. elseif (config.strenght == "constant") then
    42. rand = math.random(config.constant.min, config.constant.max)
    43. end
    44. doPlayerAddMana(cid, rand)
    45. setPlayerStorageValue(cid, config.exhaustion_value, (os.time() + config.exhaustion))
    46. doCreatureSay(cid, "+"..math.floor(rand).." mana", TALKTYPE_ORANGE_1)
    47. return true
    48. end
    If u can change it and make it heal HP & MP I will solve my problem ;)

    bump
     
    Last edited by a moderator: Nov 11, 2017
  7. WibbenZ

    WibbenZ Support Team Support Team

    Joined:
    Oct 16, 2008
    Messages:
    5,912
    Likes Received:
    1,021
    Best Answers:
    199
    Rules for the Support board
    #2

    Restart the server if it still does not work check the path to the script and make sure you edited the correct script.
     
  8. Edroniasty

    Edroniasty Member

    Joined:
    Oct 2, 2015
    Messages:
    92
    Likes Received:
    1
    Best Answers:
    0
    setConditionParam(exhaust, CONDITION_PARAM_TICKS, 1500))
    unexpected symbol near ')'
    I deleted 1 ")" and its working but for 500 ms not 1500 - 1.5 second.. don't know what I need to do.. ;s can u change my other script and make it add hp to? - this will help me because that other script working.
     
  9. WibbenZ

    WibbenZ Support Team Support Team

    Joined:
    Oct 16, 2008
    Messages:
    5,912
    Likes Received:
    1,021
    Best Answers:
    199
    Yeah must have forgotten to remove that extra )
    The script is working, so double check your XML file to make sure you are editing the correct script, you must have another one that the rune is loaded from but you are editing a copy or something.
     
  10. Edroniasty

    Edroniasty Member

    Joined:
    Oct 2, 2015
    Messages:
    92
    Likes Received:
    1
    Best Answers:
    0
    I change name of script, rune ID and now I have 100% sure that script don't use
    Code (Text):
    1. setConditionParam(exhaust, CONDITION_PARAM_TICKS, 1500))
    but uses
    Code (Text):
    1. timeBetweenExActions = 500
    I can change exActions to 1000/5000 anyway rune will be 1s or 5s exhaust.. so maybee u can edit my other script that I posted up? (just need to add HP & MANA heal together.
     
  11. WibbenZ

    WibbenZ Support Team Support Team

    Joined:
    Oct 16, 2008
    Messages:
    5,912
    Likes Received:
    1,021
    Best Answers:
    199
    That can't be posible since that variable is never called.
    Can you upload your actions.xml and the itemid aswell as the script you are using now and ill test it myself.
    I highly doubt it unless you have some modified source code or modify the function via Lua.
     
  12. Edroniasty

    Edroniasty Member

    Joined:
    Oct 2, 2015
    Messages:
    92
    Likes Received:
    1
    Best Answers:
    0
    full action.xml
    Code (Text):
    1. <?xml version="1.0" encoding="UTF-8"?>
    2. <actions>
    3.     <!-- Quests -->
    4.     <action uniqueid="9600" script="quests/anichest.lua"/>
    5.     <action uniqueid="9601" script="quests/anichest.lua"/>
    6.     <action uniqueid="9602" script="quests/anichest.lua"/>
    7.     <action uniqueid="9603" script="quests/anichest.lua"/>
    8.     <action uniqueid="9604" script="quests/orshachest.lua"/>
    9.     <action uniqueid="9605" script="quests/orshachest.lua"/>
    10.     <action uniqueid="9606" script="quests/orshachest.lua"/>
    11.     <action uniqueid="9607" script="quests/orshachest.lua"/>
    12.     <action uniqueid="9608" script="quests/orshachest.lua"/>
    13.     <action actionid="1234" script="quests/anniLever.lua"/>
    14.     <action actionid="1235" script="quests/orshalever.lua"/>
    15.     <action itemid="1740" script="quests/quests.lua" />
    16.     <action fromid="1747" toid="1749" script="quests/quests.lua" />
    17.     <action uniqueid="30015" script="quests/annihilator.lua" />
    18.    
    19.     <!-- Demon Oak -->
    20.     <action itemid="8293" script="quests/demon oak/demonOak.lua" />
    21.     <action fromuid="9008" touid="9011" script="quests/demon oak/demonOakChest.lua" />
    22.     <action uniqueid="9007" script="quests/demon oak/demonOakGravestone.lua" />
    23.    
    24.     <!-- Tools -->
    25.     <action itemid="10515" script="tools/squeeze.lua"/>
    26.     <action itemid="10512" script="tools/squeeze.lua"/>
    27.     <action itemid="10514" script="tools/squeeze.lua"/>
    28.     <action itemid="2322" script="tools/King.lua"/>
    29.     <action itemid="3955" script="tools/voodoo.lua"/>
    30.     <action itemid="2420" script="tools/machete.lua" />
    31.     <action itemid="2550" script="tools/scythe.lua" />
    32.     <action itemid="2580" script="tools/fishing.lua" allowfaruse="1" />
    33.     <action itemid="2554" script="tools/shovel.lua" />
    34.     <action itemid="2120" script="tools/rope.lua" />
    35.     <action itemid="2553" script="tools/pick.lua" />
    36.     <action actionid="1001" script="vdk.lua"/>
    37.     <action actionid="1002" script="vdd.lua"/>
    38.     <action actionid="1003" script="vds.lua"/>
    39.     <action actionid="1004" script="vdp.lua"/>
    40.     <action actionid="2000" script="quests/a.lua"/> <!--box quests -->
    41.     <action actionid="2001" script="quests/a.lua"/> <!--corpse quests -->
    42.     <action actionid="3013" script="cart.lua"/>
    43.     <action actionid="3014" script="cart.lua"/>
    44.     <action actionid="3015" script="cart.lua"/>
    45.     <action actionid="3016" script="cart.lua"/>
    46.    
    47.     <!-- runes -->
    48.     <action itemid="2280" script="runes/manarune.lua"/>
    49.     <action itemid="2298" script="runes/p.lua"/>
    50.     <action itemid="2273" script="runes/knight uh.lua"/>
    51.     <action itemid="2276" script="runes/knight manarune.lua"/>
    52.     <action itemid="2283" script="runes/tp rune.lua"/>
    53.  
    54.     <!-- Increase/Decrease ItemId -->
    55.     <action itemid="1873" function="increaseItemId" />
    56.     <action itemid="1874" function="decreaseItemId" />
    57.     <action itemid="1875" function="increaseItemId" />
    58.     <action itemid="1876" function="decreaseItemId" />
    59.     <action itemid="2162" function="increaseItemId" />
    60.     <action itemid="2163" function="decreaseItemId" />
    61.     <action itemid="3947" function="increaseItemId" />
    62.     <action itemid="3948" function="decreaseItemId" />
    63.     <action itemid="1479" function="increaseItemId" />
    64.     <action itemid="1480" function="decreaseItemId" />
    65.     <action itemid="1945" function="increaseItemId" />
    66.     <action itemid="1946" function="decreaseItemId" />
    67.     <action itemid="2037" function="increaseItemId" />
    68.     <action itemid="2038" function="decreaseItemId" />
    69.     <action itemid="2039" function="increaseItemId" />
    70.     <action itemid="2040" function="decreaseItemId" />
    71.     <action itemid="2058" function="increaseItemId" />
    72.     <action itemid="2059" function="decreaseItemId" />
    73.     <action itemid="2060" function="increaseItemId" />
    74.     <action itemid="2061" function="decreaseItemId" />
    75.     <action itemid="2066" function="increaseItemId" />
    76.     <action itemid="2067" function="decreaseItemId" />
    77.     <action itemid="2068" function="increaseItemId" />
    78.     <action itemid="2069" function="decreaseItemId" />
    79.     <action itemid="2064" function="increaseItemId" />
    80.     <action itemid="2065" function="decreaseItemId" />
    81.     <action itemid="2578" function="increaseItemId" />
    82.     <action itemid="2096" function="increaseItemId" />
    83.     <action itemid="2097" function="decreaseItemId" />
    84.     <action itemid="1786" function="increaseItemId" />
    85.     <action itemid="1787" function="decreaseItemId" />
    86.     <action itemid="1788" function="increaseItemId" />
    87.     <action itemid="1789" function="decreaseItemId" />
    88.     <action itemid="1790" function="increaseItemId" />
    89.     <action itemid="1791" function="decreaseItemId" />
    90.     <action itemid="1792" function="increaseItemId" />
    91.     <action itemid="1793" function="decreaseItemId" />
    92.     <action itemid="1634" function="increaseItemId" />
    93.     <action itemid="1635" function="decreaseItemId" />
    94.     <action itemid="1636" function="increaseItemId" />
    95.     <action itemid="1637" function="decreaseItemId" />
    96.     <action itemid="1638" function="increaseItemId" />
    97.     <action itemid="1639" function="decreaseItemId" />
    98.     <action itemid="1640" function="increaseItemId" />
    99.     <action itemid="1641" function="decreaseItemId" />
    100.     <action itemid="5812" function="increaseItemId" />
    101.     <action itemid="5813" function="decreaseItemId" />
    102.     <action itemid="6489" function="increaseItemId" />
    103.     <action itemid="6490" function="decreaseItemId" />
    104.     <action itemid="7058" function="increaseItemId" />
    105.     <action itemid="7059" function="decreaseItemId" />
    106.     <action itemid="8684" function="increaseItemId" />
    107.     <action itemid="8685" function="decreaseItemId" />
    108.     <action itemid="8686" function="increaseItemId" />
    109.     <action itemid="8687" function="decreaseItemId" />
    110.     <action itemid="8688" function="increaseItemId" />
    111.     <action itemid="8689" function="decreaseItemId" />
    112.     <action itemid="8690" function="increaseItemId" />
    113.     <action itemid="8691" function="decreaseItemId" />
    114.     <action itemid="9575" function="increaseItemId" />
    115.     <action itemid="9576" function="decreaseItemId" />
    116.     <action itemid="9577" function="increaseItemId" />
    117.     <action itemid="9578" function="decreaseItemId" />
    118.     <action itemid="9579" function="increaseItemId" />
    119.     <action itemid="9580" function="decreaseItemId" />
    120.     <action itemid="9581" function="increaseItemId" />
    121.     <action itemid="9582" function="decreaseItemId" />
    122.     <action itemid="9747" function="increaseItemId" />
    123.     <action itemid="9748" function="decreaseItemId" />
    124.     <action itemid="9749" function="increaseItemId" />
    125.     <action itemid="9750" function="decreaseItemId" />
    126.  
    127.     <!-- Food -->
    128.     <action itemid="2362" script="other/food.lua" />
    129.     <action fromid="2666" toid="2691" script="other/food.lua" />
    130.     <action fromid="2695" toid="2696" script="other/food.lua" />
    131.     <action fromid="2787" toid="2796" script="other/food.lua" />
    132.     <action itemid="5097" script="other/food.lua" />
    133.     <action itemid="6125" script="other/food.lua" />
    134.     <action fromid="6278" toid="6279" script="other/food.lua" />
    135.     <action fromid="6393" toid="6394" script="other/food.lua" />
    136.     <action itemid="6501" script="other/food.lua" />
    137.     <action fromid="6541" toid="6545" script="other/food.lua" />
    138.     <action itemid="6569" script="other/food.lua" />
    139.     <action itemid="6574" script="other/food.lua" />
    140.     <action fromid="7158" toid="7159" script="other/food.lua" />
    141.     <action fromid="7372" toid="7377" script="other/food.lua" />
    142.     <action fromid="7909" toid="7910" script="other/food.lua" />
    143.     <action itemid="7963" script="other/food.lua" />
    144.     <action itemid="8112" script="other/food.lua" />
    145.     <action fromid="8838" toid="8845" script="other/food.lua" />
    146.     <action itemid="8847" script="other/food.lua" />
    147.     <action itemid="9005" script="other/food.lua" />
    148.     <action itemid="9114" script="other/food.lua" />
    149.     <action itemid="9996" script="other/food.lua" />
    150.     <action itemid="10454" script="other/food.lua" />
    151.     <action itemid="11246" script="other/food.lua" />
    152.     <action itemid="11370" script="other/food.lua" />
    153.     <action itemid="11429" script="other/food.lua" />
    154.     <action fromid="12415" toid="12418" script="other/food.lua" />
    155.     <action fromid="12637" toid="12639" script="other/food.lua" />
    156.  
    157.     <!-- Spellbooks -->
    158.     <action itemid="2175" script="other/spellbook.lua" />
    159.     <action itemid="6120" script="other/spellbook.lua" />
    160.     <action fromid="8900" toid="8904" script="other/spellbook.lua" />
    161.     <action itemid="8918" script="other/spellbook.lua" />
    162.  
    163.     <!-- Other -->
    164.     <action itemid="12328" script="other/full potion.lua"/>
    165.     <action itemid="5785" script="other/VIP Item.lua" />
    166.     <action actionid="5788" script="other/VIP Door.lua" />
    167.     <action actionid="5789" script="other/VIP Door2.lua" />
    168.     <action itemid="9933" script="other/double.lua"/>
    169.     <action itemid="9932" script="other/double.lua"/>
    170.     <action itemid="9969" script="other/b skull.lua"/>
    171.     <action itemid="10309" script="other/r skull.lua"/>
    172.     <action itemid="12544" script="other/stamina.lua"/>
    173.     <action itemid="12466" script="other/dbrain.lua"/>
    174.     <action itemid="5808" script="other/obrain.lua"/>
    175.     <action itemid="2153" script="other/upgrader wand.lua"/>
    176.     <action itemid="2154" script="other/upgrader crossbow.lua"/>
    177.     <action itemid="2155" script="other/upgrader club.lua"/>
    178.     <action itemid="2156" script="other/upgrader axe.lua"/>
    179.     <action itemid="2158" script="other/upgrader sword.lua"/>
    180.     <action itemid="2148" script="other/changegold.lua"/>
    181.     <action itemid="2152" script="other/changegold.lua"/>
    182.     <action itemid="2160" script="other/changegold.lua"/>
    183.     <action itemid="9955" script="other/changegold.lua"/> <!-- 1 VAMPIRE -->
    184.     <action itemid="2157" script="other/changegold.lua"/> <!-- 1 bar of gold -->
    185.     <action itemid="9971" script="other/changegold.lua"/> <!-- 1 Gold Ingot -->
    186.     <action itemid="6578" script="other/partyhat.lua" />
    187.     <action itemid="2114" script="other/piggybank.lua" />
    188.     <action fromid="6570" toid="6571" script="other/surprisebag.lua" />
    189.     <action itemid="6576" script="other/fireworksrocket.lua" />
    190.     <action itemid="2036" script="other/watch.lua" />
    191.     <action fromid="1728" toid="1731" script="other/watch.lua" />
    192.     <action itemid="6572" script="other/partytrumpet.lua" />
    193.     <action itemid="2785" script="other/blueberrybush.lua" />
    194.     <action itemid="2579" script="other/trap.lua" />
    195.     <action fromid="3901" toid="3938" script="other/constructionkits.lua" />
    196.     <action fromid="5086" toid="5088" script="other/constructionkits.lua" />
    197.     <action itemid="6114" script="other/constructionkits.lua" />
    198.     <action itemid="6115" script="other/constructionkits.lua" />
    199.     <action itemid="6372" script="other/constructionkits.lua" />
    200.     <action itemid="6373" script="other/constructionkits.lua" />
    201.     <action itemid="8692" script="other/constructionkits.lua" />
    202.     <action itemid="9974" script="other/constructionkits.lua" />
    203.     <action itemid="11124" script="other/constructionkits.lua" />
    204.     <action itemid="11126" script="other/constructionkits.lua" />
    205.     <action itemid="11133" script="other/constructionkits.lua" />
    206.     <action itemid="11205" script="other/constructionkits.lua" />
    207.     <action fromid="7904" toid="7907" script="other/bed_modification_kits.lua" />
    208.     <action fromid="2070" toid="2078" script="other/music.lua" />
    209.     <action fromid="2080" toid="2085" script="other/music.lua" />
    210.     <action itemid="2332" script="other/music.lua" />
    211.     <action itemid="2364" script="other/music.lua" />
    212.     <action fromid="2367" toid="2368" script="other/music.lua" />
    213.     <action fromid="2370" toid="2373" script="other/music.lua" />
    214.     <action fromid="2041" toid="2042" script="other/decayto.lua" />
    215.     <action fromid="2044" toid="2045" script="other/decayto.lua" />
    216.     <action fromid="2047" toid="2048" script="other/decayto.lua" />
    217.     <action fromid="2050" toid="2055" script="other/decayto.lua" />
    218.     <action itemid="430" script="other/teleport.lua" />
    219.     <action itemid="1369" script="other/teleport.lua" />
    220.     <action itemid="1386" script="other/teleport.lua" />
    221.     <action itemid="3678" script="other/teleport.lua" />
    222.     <action itemid="5543" script="other/teleport.lua" />
    223.     <action fromid="2376" toid="2404" script="other/destroy.lua" />
    224.     <action fromid="2406" toid="2419" script="other/destroy.lua" />
    225.     <action fromid="2421" toid="2453" script="other/destroy.lua" />
    226.     <action fromid="2005" toid="2009" script="other/fluids.lua" />
    227.     <action fromid="2011" toid="2015" script="other/fluids.lua" />
    228.     <action itemid="2023" script="other/fluids.lua" />
    229.     <action itemid="1775" script="other/fluids.lua" />
    230.     <action fromid="2031" toid="2034" script="other/fluids.lua" />
    231.     <action fromid="2574" toid="2577" script="other/fluids.lua" />
    232.     <action fromid="5792" toid="5797" script="other/die.lua" />
    233.     <action itemid="7588" script="other/potions.lua" />
    234.     <action itemid="7589" script="other/potions.lua" />
    235.     <action itemid="7590" script="other/potions.lua" />
    236.     <action itemid="7591" script="other/potions.lua" />
    237.     <action itemid="7618" script="other/potions.lua" />
    238.     <action itemid="7620" script="other/potions.lua" />
    239.     <action itemid="8472" script="other/potions.lua" />
    240.     <action itemid="8473" script="other/potions.lua" />
    241.     <action itemid="8474" script="other/potions.lua" />
    242.     <action itemid="8704" script="other/potions.lua" />
    243.     <action itemid="2692" script="other/createbread.lua" />
    244.     <action itemid="2694" script="other/createbread.lua" />
    245.     <action fromid="6436" toid="6447" script="other/windows.lua" />
    246.     <action fromid="6450" toid="6473" script="other/windows.lua" />
    247.     <action fromid="6788" toid="6791" script="other/windows.lua" />
    248.     <action fromid="7025" toid="7032" script="other/windows.lua" />
    249.     <action fromid="10264" toid="10267" script="other/windows.lua" />
    250.     <action fromid="10488" toid="10491" script="other/windows.lua" />
    251.     <action fromid="5303" toid="5304" script="other/windows.lua" />
    252.     <action fromid="6448" toid="6449" script="other/windows.lua" />
    253.     <action fromid="1209" toid="1214" script="other/doors.lua" />
    254.     <action fromid="1219" toid="1262" script="other/doors.lua" />
    255.     <action fromid="1539" toid="1542" script="other/doors.lua" />
    256.     <action fromid="2086" toid="2092" script="other/doors.lua" />
    257.     <action fromid="3535" toid="3552" script="other/doors.lua" />
    258.     <action fromid="4913" toid="4918" script="other/doors.lua" />
    259.     <action fromid="5082" toid="5085" script="other/doors.lua" />
    260.     <action fromid="5098" toid="5145" script="other/doors.lua" />
    261.     <action fromid="5278" toid="5295" script="other/doors.lua" />
    262.     <action fromid="5515" toid="5518" script="other/doors.lua" />
    263.     <action fromid="5732" toid="5737" script="other/doors.lua" />
    264.     <action fromid="5745" toid="5749" script="other/doors.lua" />
    265.     <action fromid="6192" toid="6209" script="other/doors.lua" />
    266.     <action fromid="6249" toid="6266" script="other/doors.lua" />
    267.     <action fromid="6795" toid="6802" script="other/doors.lua" />
    268.     <action fromid="6891" toid="6908" script="other/doors.lua" />
    269.     <action fromid="7033" toid="7050" script="other/doors.lua" />
    270.     <action fromid="7054" toid="7057" script="other/doors.lua" />
    271.     <action fromid="8541" toid="8558" script="other/doors.lua" />
    272.     <action fromid="9165" toid="9184" script="other/doors.lua" />
    273.     <action fromid="9267" toid="9284" script="other/doors.lua" />
    274.     <action itemid="10032" script="other/doors.lua" />
    275.     <action fromid="10268" toid="10285" script="other/doors.lua" />
    276.     <action fromid="10468" toid="10486" script="other/doors.lua" />
    277.     <action fromid="10775" toid="10777" script="other/doors.lua" />
    278.     <action fromid="10780" toid="10786" script="other/doors.lua" />
    279.     <action fromid="10789" toid="10792" script="other/doors.lua" />
    280.     <action fromid="12092" toid="12105" script="other/doors.lua" />
    281.     <action fromid="12188" toid="12190" script="other/doors.lua" />
    282.     <action fromid="12193" toid="12199" script="other/doors.lua" />
    283.     <action fromid="12202" toid="12205" script="other/doors.lua" />
    284.     <action itemid="3743" script="other/transforms.lua" />
    285.     <action itemid="4404" script="other/transforms.lua" />
    286.     <action fromaid="18488" toaid="18492" script="other/skilltrainer.lua" />
    287. </actions>
    288.  
    id rune 2298

    script p.lua
    Code (Text):
    1. local exhaust = createConditionObject(CONDITION_EXHAUST)
    2. setConditionParam(exhaust, CONDITION_PARAM_TICKS, 3000)
    3.  
    4. function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    5.     local level = player:getLevel()
    6.     local mlevel = player:getMagicLevel()
    7.     local hpandma_minimum = (level * 7.8) + (SKILL_MAGLEVEL * 0)
    8.     local hpandma_maximum = (level * 9) + (SKILL_MAGLEVEL * 0)
    9.     if player:getVocation():getId() == 3 or 7 then
    10.         player:addMana(math.random(hpandma_minimum, hpandma_maximum))
    11.         player:addHealth(math.random(hpandma_minimum, hpandma_maximum))
    12.         player:getPosition():sendMagicEffect(CONST_ME_GIFT_WRAPS)
    13.     else
    14.         return FALSE
    15.     end
    16. return TRUE
    17. end
    config.lua
    -- Item Usage
    timeBetweenActions = 200
    timeBetweenExActions = 500
     
  13. WibbenZ

    WibbenZ Support Team Support Team

    Joined:
    Oct 16, 2008
    Messages:
    5,912
    Likes Received:
    1,021
    Best Answers:
    199
    Do a serach for CONDITION_EXHAUST and see if there is some overwrite function for the conditions, never had this problem myself.
    Also try to restart the computer if something went really wrong with the cache or something

    Also use the new functions if you have something in your compat.lua that could be broke;
    Code (Lua):
    1. local exhaust = Condition(CONDITION_EXHAUST)
    2. exhaust:setParameter(CONDITION_PARAM_TICKS, 3000)
     
  14. Edroniasty

    Edroniasty Member

    Joined:
    Oct 2, 2015
    Messages:
    92
    Likes Received:
    1
    Best Answers:
    0
    I changed script to
    Code (Text):
    1. local exhaust = Condition(CONDITION_EXHAUST)
    2. exhaust:setParameter(CONDITION_PARAM_TICKS, 3000)
    3.  
    4. function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    5.     local level = player:getLevel()
    6.     local mlevel = player:getMagicLevel()
    7.     local hpandma_minimum = (level * 7.8) + (SKILL_MAGLEVEL * 0)
    8.     local hpandma_maximum = (level * 9) + (SKILL_MAGLEVEL * 0)
    9.     if player:getVocation():getId() == 3 or 7 then
    10.         player:addMana(math.random(hpandma_minimum, hpandma_maximum))
    11.         player:addHealth(math.random(hpandma_minimum, hpandma_maximum))
    12.         player:getPosition():sendMagicEffect(CONST_ME_GIFT_WRAPS)
    13.     else
    14.         return FALSE
    15.     end
    16. return TRUE
    17. end
    / still the same - what u mean search for CONDITION_EXHAUST? where should I search? in .cpp files?
    my compat.lua
    Untitled Post
     
  15. WibbenZ

    WibbenZ Support Team Support Team

    Joined:
    Oct 16, 2008
    Messages:
    5,912
    Likes Received:
    1,021
    Best Answers:
    199
    Use ex notepad++ and do a folder serach for CONDITION_EXHAUST
    No in your data folder.
     
  16. Edroniasty

    Edroniasty Member

    Joined:
    Oct 2, 2015
    Messages:
    92
    Likes Received:
    1
    Best Answers:
    0
    local exhaust = Condition(CONDITION_EXHAUST_HEAL)
    local exhaust = Condition(CONDITION_EXHAUST_HEAL)
    local exhaust = Condition(CONDITION_EXHAUST_HEAL)
    local exhaust = Condition(CONDITION_EXHAUST_HEAL)
    if player:getCondition(CONDITION_EXHAUST_HEAL) then
    CONDITION_EXHAUST = CONDITION_EXHAUST_WEAPON
    CONDITION_EXHAUST = CONDITION_EXHAUST_WEAPON
    local exhaust = createConditionObject(CONDITION_EXHAUST)
    local exhaust = createConditionObject(CONDITION_EXHAUST)

    9 results in 7 files/ condition_exhaust 2 results in compat.lua

    in my compat.lua I have this
    Code (Text):
    1. CONDITION_EXHAUST = CONDITION_EXHAUST_WEAPON
     
    Last edited: Nov 14, 2017 at 4:22 PM
  17. WibbenZ

    WibbenZ Support Team Support Team

    Joined:
    Oct 16, 2008
    Messages:
    5,912
    Likes Received:
    1,021
    Best Answers:
    199
    Do you have any problems with any other scripts that uses that condition?
     
  18. Edroniasty

    Edroniasty Member

    Joined:
    Oct 2, 2015
    Messages:
    92
    Likes Received:
    1
    Best Answers:
    0
    no, I don't anyway I solve it myself just editing my other manarune script which I posted up and add healing HP together with mana / anyway thanks for u help and time good man.
     
  19. Static_

    Static_ Well-Known Member

    Joined:
    Feb 14, 2015
    Messages:
    3,200
    Likes Received:
    1,388
    Best Answers:
    194
    you're not even adding it to the player, all you have is the condition variable and params set, but you're not checking for it nor setting the condition to the player
     
    WibbenZ likes this.

Share This Page

Loading...