[LF] Transform system tfs 0.4 / 8.6

Discussion in 'Support' started by Untitleed, Oct 30, 2018.

  1. Untitleed

    Untitleed Member

    Joined:
    Aug 1, 2017
    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Hiho, does someone know good transform system for /\
     
  2. Untitleed

    Untitleed Member

    Joined:
    Aug 1, 2017
    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
  3. Untitleed

    Untitleed Member

    Joined:
    Aug 1, 2017
    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    someone ?
     
  4. Untitleed

    Untitleed Member

    Joined:
    Aug 1, 2017
    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
  5. GhostWD

    GhostWD I'm in love with the var_dump()

    Joined:
    Jan 25, 2009
    Messages:
    179
    Likes Received:
    24
    Best Answers:
    6
    what do you mean by good? what do you need in transform script?
     
  6. Untitleed

    Untitleed Member

    Joined:
    Aug 1, 2017
    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Yo, thanks for response. I need transform/revert system with adding hp/mana per transform (Transform system [table included])
    this system looks nice but i have problem with saving hp/mana after logout it can be stacked, so i wrote here maybe someone have good system or can help me
     
  7. GhostWD

    GhostWD I'm in love with the var_dump()

    Joined:
    Jan 25, 2009
    Messages:
    179
    Likes Received:
    24
    Best Answers:
    6
    try it and let me know is it working well

    in talkactions.xml
    Code (Text):
    1.  
    2. <talkaction words="transform" script="transform.lua" />
    3. <talkaction words="revert" script="revert.lua" />
    4.  
    and in data/talkactions/script

    transform.lua
    PHP:
    1.  
    2. local voce = {
    3.     -- [preTransformVoce] = [postTransformVoce,Outfit,Level,HP,KI,MagicEffect]
    4.     [1] = {2,21,50,1000,1200,4},
    5.     [2] = {3,22,60,2000,2200,8},
    6.     [3] = {4,23,80,3000,3200,21},
    7.     [4] = {5,24,100,5000,5200,6}
    8. }
    9.  
    10. function onSay(cid, words, param, channel)
    11.     local playerVoce = voce[getPlayerVocation(cid)]
    12.     if playerVoce and getPlayerLevel(cid) >= playerVoce[3] then
    13.         doPlayerSetVocation(cid, playerVoce[1])
    14.  
    15.         local condition = createConditionObject(CONDITION_ATTRIBUTES)
    16.         setConditionParam(condition, CONDITION_PARAM_TICKS, -1)
    17.         setConditionParam(condition, CONDITION_PARAM_STAT_MAXHEALTH, playerVoce[4])
    18.         setConditionParam(condition, CONDITION_PARAM_STAT_MAXMANA, playerVoce[5])
    19.         setConditionParam(condition, CONDITION_PARAM_SUBID, 45)
    20.         doAddCondition(cid, condition)
    21.         doSendMagicEffect(getThingPosition(cid), playerVoce[6])
    22.         doCreatureChangeOutfit(cid, {lookType=playerVoce[2]})
    23.         return true
    24.     elseif playerVoce then
    25.         doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You can't transform. You need [" .. playerVoce[3] .. "] LvL")
    26.         return true
    27.     else
    28.         doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You can't transform.")
    29.     end
    30.  
    revert.lua
    PHP:
    1.  
    2. local voce = {
    3.     -- [preRevertVoce] = [postRevertVoce,Outfit,Level,HP,KI,MagicEffect]
    4.  
    5.     [2] = {1,20,0,0,0,8},
    6.     [3] = {2,21,0,1000,1200,21},
    7.     [4] = {3,23,0,2000,2200,6},
    8.     [5] = {4,24,0,3000,3200,6}
    9. }
    10.  
    11. function onSay(cid, words, param, channel)
    12.     local playerVoce = voce[getPlayerVocation(cid)]
    13.     if playerVoce and getPlayerLevel(cid) >= playerVoce[3] then
    14.         doPlayerSetVocation(cid, playerVoce[1])
    15.  
    16.         local condition = createConditionObject(CONDITION_ATTRIBUTES)
    17.         setConditionParam(condition, CONDITION_PARAM_TICKS, -1)
    18.         setConditionParam(condition, CONDITION_PARAM_STAT_MAXHEALTH, playerVoce[4])
    19.         setConditionParam(condition, CONDITION_PARAM_STAT_MAXMANA, playerVoce[5])
    20.         setConditionParam(condition, CONDITION_PARAM_SUBID, 45)
    21.         doAddCondition(cid, condition)
    22.         doSendMagicEffect(getThingPosition(cid), playerVoce[6])
    23.         doCreatureChangeOutfit(cid, {lookType=playerVoce[2]})
    24.         return true
    25.     elseif playerVoce then
    26.         doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You can't revert.")
    27.         return true
    28.     else
    29.         doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You can't revert.")
    30.     end
    31.  
     
    Last edited: Nov 9, 2018
  8. Untitleed

    Untitleed Member

    Joined:
    Aug 1, 2017
    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Ye, it works but after relog it didn't back to first outfit
     
  9. GhostWD

    GhostWD I'm in love with the var_dump()

    Joined:
    Jan 25, 2009
    Messages:
    179
    Likes Received:
    24
    Best Answers:
    6
    Outfit and vocation so you must transform again
     

Share This Page

Loading...