[Server Scripting] Help with block moves

Discussion in 'Server and Client Scripting' started by Bahamut, Aug 4, 2014.

  1. Bahamut

    Bahamut New Member

    Joined:
    Aug 10, 2010
    Messages:
    25
    Likes Received:
    0
    Can anyone help me block some moves?

    Example: limit Baton Pass on determined tier, limited use for every pokemon. 1, 2 and etc in a specific tirer.

    XY OU: 1 baton pass by team.
     
  2. SongSing

    SongSing KILLL

    Joined:
    Jan 2, 2013
    Messages:
    641
    Likes Received:
    191
    PO Trainer Name:
    SongSing
    uh, i think you could use
    Code (text):
    1. beforeChangeTier(source, team, oldtier, newtier)
    to check to see if the the newtier is the tier you're limiting moves on, and do a loop using
    Code (text):
    1. sys.teamPokeMove(player_id, team, pokeslot, moveslot)
    to count how many times it has a certain move

    you should also check the user's tiers when they get on the server, and you can change their tiers to battle factory or something using
    Code (text):
    1. sys.changeTier(player_id, team, tier)
    here are the links all of these are at:
    https://github.com/po-devs/pokemon-online/wiki/Server-Script-Events
    https://github.com/po-devs/pokemon-online/wiki/Server-Script-Functions
     
  3. Bahamut

    Bahamut New Member

    Joined:
    Aug 10, 2010
    Messages:
    25
    Likes Received:
    0
    Thanks. But, i'm learning about scripts right now. Can you do this with Baton Pass, i need a example or i will not learn it. The tier is XY OU though.
     
  4. SongSing

    SongSing KILLL

    Joined:
    Jan 2, 2013
    Messages:
    641
    Likes Received:
    191
    PO Trainer Name:
    SongSing
    did you at least try to do it? i told you how :p
    if you're not familiar enough with javascript to do it then you might want to learn some more before attempting server scripts
     
  5. Bahamut

    Bahamut New Member

    Joined:
    Aug 10, 2010
    Messages:
    25
    Likes Received:
    0
    Nop, because i don't want to drop my script. My scripters is gone.

    The move is Baton Pass, the tier is XY OU and the time is 1, each team 1 baton pass.
     
  6. Fuzzysqurl

    Fuzzysqurl baa baa mareep I do what I want Server Owner Developer I do what I want Server Owner Developer

    Joined:
    Sep 12, 2012
    Messages:
    2,096
    Likes Received:
    967
    Code (javascript):
    1.  
    2. tier_checker.add_new_check(INCLUDING, ["XY OU"], function batonPassLimitXY(src, team, tier) {
    3. var batonPassLimit = 1;
    4. for (var i = 0, j = 0; i < 6; ++i) {
    5. if (sys.hasTeamPokeMove(src, team, i, sys.moveNum("Baton Pass")) && (++j > batonPassLimit)) {
    6. return ["Baton Pass is limited to one Pokémon per team in " + tier + "."];
    7. }
    8. }
    9. });
    10.  
    Add to tierchecks.js then update Tier Checks. Also spacing on this forum is terrible.

    EDIT: Also rip, i thought that said September in the date... just realized this thread is a month old and might have been solved already... oh well. For other moves, just change "Baton Pass" to whatever other move you want.