Lua Create Condition in Onthink [tfs 0.6.3?]

Discussion in 'Support' started by Zell, May 10, 2018.

  1. Zell

    Zell Member

    Joined:
    Oct 23, 2010
    Messages:
    71
    Likes Received:
    21
    Best Answers:
    0
    hiho my dears :)

    Im trying to give a condition to player who have X vocation, but i think conditions is just for spells..

    Can anyone help me to do this? something like..

    Code (Text):
    1.  
    2.        function onThink(cid)
    3.  
    4. local condition2 = createConditionObject(CONDITION_ATTRIBUTES)
    5. setConditionParam(condition2, CONDITION_PARAM_STAT_MAXHITPOINTSPERCENT, 125)
    6. ------------
    7. if Voc == X then
    8. doAreaCombatCondition(cid, getThingPos(cid), condition2)
    9.  
    I just want give the attributes for infinite time, any idea?

    By the way I try to use "CastSpell(cid, x)
    But in my serv dont have this function..


    Thanks!
     
  2. MaR0

    MaR0 Member

    Joined:
    Apr 16, 2018
    Messages:
    55
    Likes Received:
    4
    Best Answers:
    2
    what TFS you are using.
     
  3. Zell

    Zell Member

    Joined:
    Oct 23, 2010
    Messages:
    71
    Likes Received:
    21
    Best Answers:
    0
    Im using an avesta 7.6.. maybe 0.6.3
     
  4. Zell

    Zell Member

    Joined:
    Oct 23, 2010
    Messages:
    71
    Likes Received:
    21
    Best Answers:
    0
    refresh?
     
  5. Zell

    Zell Member

    Joined:
    Oct 23, 2010
    Messages:
    71
    Likes Received:
    21
    Best Answers:
    0
    Solved for myself.

    thx anyway!
     
  6. bayview

    bayview Codex NG

    Joined:
    Jan 25, 2018
    Messages:
    375
    Likes Received:
    153
    Best Answers:
    17
    Share the solution or next time don't ask for help.. if that sounds mean then good coz keeping the solution to yourself is even meaner.
     
    MaR0 likes this.
  7. Zell

    Zell Member

    Joined:
    Oct 23, 2010
    Messages:
    71
    Likes Received:
    21
    Best Answers:
    0
    Yeah, you're right, I dont pasted the code because I just add a bad argument of function and I guess is a simple way to get this..

    Buut here is:

    Code (Text):
    1.  
    2.  
    3.  
    4. [*] function onThink(cid)
    5. [*]
    6.  
    7. [*]local condition2 = createConditionObject(CONDITION_ATTRIBUTES)
    8. [*]setConditionParam(condition2, CONDITION_PARAM_STAT_MAXHITPOINTSPERCENT, 125)
    9. [*]------------
    10. [*]if Voc == X then
    11. [*]doAreaCombatCondition(cid, getThingPos(cid), condition2) <--- WRONG
    12. [*]    doAddCondition(cid, condition2) <--- correct
    13.  
    :)
     
  8. Printer

    Printer if Printer then print("LUA") end Premium User

    Joined:
    Dec 27, 2009
    Messages:
    5,653
    Likes Received:
    1,940
    Best Answers:
    13
    You can just set the ticks to 0. This is a bit overkill.
     
    Zell likes this.

Share This Page

Loading...