Scripter TFS 1.x Scripting Services

Discussion in 'Jobs' started by Nekiro, Nov 20, 2017.

  1. Nekiro

    Nekiro worst coder Support Team

    Joined:
    Sep 7, 2015
    Messages:
    1,659
    Likes Received:
    509
    Best Answers:
    64
    Code (Text):
    1. -- Bounce spell script made by Nekiro#5727
    2. -- little messy, but im a noob :((
    3.  
    4. local bounces = 5 -- number of bounces if targets are in distance
    5. local maxRadius = 5 -- if 5 then radius is 5x5
    6. local onlyPlayers = false
    7. local delay = 2 -- seconds
    8.  
    9. local combat = Combat()
    10. combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
    11. combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
    12.  
    13. function onGetFormulaValues(player, skill, attack, factor)
    14.     local min = (player:getLevel() / 2) + 30 -- completely random
    15.     local max = (player:getLevel() / 5) + 100
    16.     return -min, -max
    17. end
    18.  
    19. combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
    20.  
    21. local currentBounce, caster, lastBounceTarget = 1
    22. local function checkBounces(currentTargetUid)
    23.     if not caster then
    24.         return true
    25.     end
    26.  
    27.     local currTarget = Creature(currentTargetUid)
    28.     if not currTarget then
    29.         return true
    30.     end
    31.     local creatures = Game.getSpectators(currTarget:getPosition(), false, onlyPlayers, maxRadius, maxRadius, maxRadius, maxRadius)
    32.     if #creatures == 0 then
    33.         return true
    34.     end
    35.  
    36.     local randomTarget
    37.     repeat
    38.         randomTarget = creatures[math.random(#creatures)]
    39.     until randomTarget and randomTarget:isMonster() and randomTarget ~= currTarget and randomTarget ~= lastBounceTarget
    40.     currTarget:getPosition():sendDistanceEffect(randomTarget:getPosition(), CONST_ANI_FIRE)
    41.     combat:execute(caster, Variant(randomTarget.uid))
    42.     lastBounceTarget = randomTarget
    43.     currentBounce = currentBounce + 1
    44.  
    45.     if currentBounce >= bounces then
    46.         return true
    47.     end
    48.  
    49.     if lastBounceTarget then
    50.         addEvent(checkBounces, delay * 1000, lastBounceTarget.uid)
    51.     end
    52.     return true
    53. end
    54.  
    55. function onCastSpell(creature, variant)
    56.     addEvent(checkBounces, delay * 1000, variant:getNumber())
    57.     caster = creature
    58.     creature:getPosition():sendDistanceEffect(Creature(variant:getNumber()):getPosition(), CONST_ANI_FIRE)
    59.     return combat:execute(creature, variant)
    60. end

    Code (Text):
    1. -- Pull spell script made by Nekiro#5727
    2. -- unfortunately it has to be done with Game.getSpectators(), there is no "getTargetList() for players :("
    3.  
    4. local radius = 5 -- 5x5
    5. local onlyPlayers = false
    6. function onCastSpell(creature, variant)
    7.     local targets = Game.getSpectators(creature:getPosition(), false, onlyPlayers, radius, radius, radius, radius)
    8.     if #targets == 0 then
    9.         return true
    10.     end
    11.  
    12.     for _, target in pairs(targets) do
    13.         if target ~= creature then
    14.             target:teleportTo(target:getClosestFreePosition(creature:getPosition()))
    15.         end
    16.     end
    17.     return true
    18. end
    19.  

    These two scripts seem interesting to me, so there you are. If anyone have any advice on how to improve this code, feel free to tell me!

    You can find every of them on forums. Also third is not possible, until you make config with all commands with corresponding access or you can parse shits from talkactions.xml, but thats stupid.
     
    bayview and Sajgon like this.
  2. Sp0tl3ss

    Sp0tl3ss Nestalia.org

    Joined:
    Jul 19, 2014
    Messages:
    253
    Likes Received:
    10
    Best Answers:
    0
    okey sorry to whaste youre time and thanks for answering :)
     
  3. Nekiro

    Nekiro worst coder Support Team

    Joined:
    Sep 7, 2015
    Messages:
    1,659
    Likes Received:
    509
    Best Answers:
    64
    Still avaliable :)
     
  4. Sajgon

    Sajgon Active Member

    Joined:
    Mar 10, 2017
    Messages:
    123
    Likes Received:
    104
    Best Answers:
    1
    From this post and few modifications I got the following below. Thanks for the contribution mate ;)

    Pull
    [​IMG]

    Bounce
    [​IMG]

    Sorry about the poor quality, dno.
     
    Sir Knighter, Ice Mirow and Nekiro like this.
  5. Nekiro

    Nekiro worst coder Support Team

    Joined:
    Sep 7, 2015
    Messages:
    1,659
    Likes Received:
    509
    Best Answers:
    64
    Nice gifs :)

    Avaliable again. Contact me via discord, if you need anything.

    I have updated contact info, please read first post.
     
    Last edited: Jan 12, 2018
  6. Gaddhuve

    Gaddhuve Member

    Joined:
    May 6, 2011
    Messages:
    71
    Likes Received:
    16
    Best Answers:
    1
    Really pleasant and helpful guy. Solved my problem Ive been having for months within minutes. Recommended.
     
  7. Nekiro

    Nekiro worst coder Support Team

    Joined:
    Sep 7, 2015
    Messages:
    1,659
    Likes Received:
    509
    Best Answers:
    64
    Thanks! Also I'm avaliable again.
     
  8. Aeronx

    Aeronx Active Member

    Joined:
    Dec 17, 2015
    Messages:
    647
    Likes Received:
    76
    Best Answers:
    9
    Hello! Thanks for you services!

    What about the bounce spell but for solo/party players that heals instead of damage.

    Exura sio mas "playername ---> heals first player and bounces to other party players if they exist.

    Thanks!
     
  9. Nekiro

    Nekiro worst coder Support Team

    Joined:
    Sep 7, 2015
    Messages:
    1,659
    Likes Received:
    509
    Best Answers:
    64
    Why? If you want to request script go to support board.
     
  10. Aeronx

    Aeronx Active Member

    Joined:
    Dec 17, 2015
    Messages:
    647
    Likes Received:
    76
    Best Answers:
    9
    I didnt mean to be rude, but i thought you were taking request and you were actually free at the moment. >.<
     
  11. Nekiro

    Nekiro worst coder Support Team

    Joined:
    Sep 7, 2015
    Messages:
    1,659
    Likes Received:
    509
    Best Answers:
    64
    Sure, I take free requests, when I say it, also I'm helping a lot in support threads so you can just make your request there, maybe me or someone else will do it for you.

    If you need any script/system contact me! I'm free at the moment to do any job :)

    Bumping the thread as I'm avaliable for requests/scripting again.
     
    Last edited by a moderator: May 31, 2018
  12. Aeronx

    Aeronx Active Member

    Joined:
    Dec 17, 2015
    Messages:
    647
    Likes Received:
    76
    Best Answers:
    9
    On the bounce spell, if there is only 1 or 2 creatures, and spell is cast, the server crashes since there's nothing to bounce to and lastBounce cant be hit again like tar1 tar2 tar1 tar2... you cant make it bounce between two targets.
     
  13. Nekiro

    Nekiro worst coder Support Team

    Joined:
    Sep 7, 2015
    Messages:
    1,659
    Likes Received:
    509
    Best Answers:
    64
    Problem would be with „repeat” as you said if you cast between two people then one is hit second cant be, because it was already hit once, so it will loop infinitely probably. This script will crash the server while spell is still bouncing, but caster will logout or will get somehow removed.
     
    Last edited: Feb 2, 2018
  14. Aeronx

    Aeronx Active Member

    Joined:
    Dec 17, 2015
    Messages:
    647
    Likes Received:
    76
    Best Answers:
    9
    Any work around?

    I have edited this line:
    Code (Text):
    1. until randomTarget and (randomTarget:isMonster() or randomTarget:isPlayer()) and randomTarget ~= currTarget
    so it bounces on player but doesnt work. Stop working after 2 bounces, tried many stuff, not working so far.
     
  15. Nekiro

    Nekiro worst coder Support Team

    Joined:
    Sep 7, 2015
    Messages:
    1,659
    Likes Received:
    509
    Best Answers:
    64
    Bumping this thread as I'm avaliable again. Contact me if you need any script/system.
     
    Last edited: Feb 13, 2018
  16. DiegoRulez

    DiegoRulez Member

    Joined:
    Apr 16, 2012
    Messages:
    80
    Likes Received:
    8
    Best Answers:
    0
    I just hired an adjustment service in my source with Nekiro. The price was very low, did a great service and was also very quick.
    For me it was very expensive just because I am Brazilian and a very low currency, but it has nothing to do with the professional in question.
    I recommend.
     
  17. Ashtar

    Ashtar Active Member

    Joined:
    May 1, 2009
    Messages:
    242
    Likes Received:
    46
    Best Answers:
    0
    Had the pleasure of working with Nekiro for a while by now, he always provides a great and fast service. Highly recommended.
     
  18. Nekiro

    Nekiro worst coder Support Team

    Joined:
    Sep 7, 2015
    Messages:
    1,659
    Likes Received:
    509
    Best Answers:
    64
    Thanks guys! I'm avaliable for requests again, contact me if you need anything.

    I'm currently free for requests, contact me. (info in main post)

    Hello, I’m back with doing requests. Need anything? Contact me via disord.
     
    Last edited by a moderator: May 31, 2018
    Okke likes this.
  19. armyman

    armyman Member

    Joined:
    Feb 15, 2014
    Messages:
    299
    Likes Received:
    5
    Best Answers:
    0
    I recommend
     
  20. Nekiro

    Nekiro worst coder Support Team

    Joined:
    Sep 7, 2015
    Messages:
    1,659
    Likes Received:
    509
    Best Answers:
    64
    Thanks. Thread is still actual, I'm taking requests.
     

Share This Page

Loading...