Moves, Items and Movesets Ban for custom tiers

Discussion in 'Server and Client Scripting' started by Tano, May 25, 2010.

  1. Tano

    Tano Member

    Joined:
    May 18, 2010
    Messages:
    58
    Likes Received:
    0
    i need a way to make a custom tier named "Dppt-Ita", which contains certain pokemons but with restrictions on their moves and/or movesets.

    example: i want garchomp to be "OU DPPt-Ita", but only without Outrage and without Yache Berry.


    (I do not know if there is already a way to do it, but if there is, please tell me)
     
  2. Lutra

    Lutra All Gen Battler/Scripter

    Joined:
    Apr 25, 2010
    Messages:
    509
    Likes Received:
    188
    PO Trainer Name:
    Lutra
    It can only be done by script atm(blocking entry to battle with a pokemon with those moves/items). coyotte is going to expand the tier system in the future though.
     
  3. Tano

    Tano Member

    Joined:
    May 18, 2010
    Messages:
    58
    Likes Received:
    0
    but if i make a script to block outrage on garchomp, then it works also in uber tier, and i don't want that to happen.

    there is a way to ban a certain move only for a certain tier?
     
  4. Lutra

    Lutra All Gen Battler/Scripter

    Joined:
    Apr 25, 2010
    Messages:
    509
    Likes Received:
    188
    PO Trainer Name:
    Lutra
    sys.tier(player number) checks the tier of the player who has that number. So you'd have to substitute player number for source if you wanted to check for the player who is challenging and target if you want to check the player who is the target of the challenge.
     
  5. Tano

    Tano Member

    Joined:
    May 18, 2010
    Messages:
    58
    Likes Received:
    0
    can you please make an example with outrage on garchomp for tier "ddpt-ita"?
     
  6. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    Code (text):
    1. ({
    2.  
    3. ...
    4.  
    5. beforeChallengeIssued(src, dest) {
    6. if (sys.tier(src) == "dppt-ita" && sys.tier(dest) == "dppt-ita") {
    7.  
    8. for (var i = 0; i < 6; i++) {
    9.    if (sys.pokemon(sys.teamPoke(src, i)) == "Garchomp" && sys.hasPokeMove(src, i, sys.moveNum("Outrage"))) {
    10.        sys.sendMessage(src, "You can't battle in tier dppt-ita with a garchomp that has outrage");
    11.        sys.stopEvent();
    12.        return;
    13.    }
    14.    if (sys.pokemon(sys.teamPoke(dest, i)) == "Garchomp" &&  sys.hasPokeMove(dest, i, sys.moveNum("Outrage"))) {
    15.        sys.sendMessage(src, "Your opponent has a  garchomp that has outrage");
    16.        sys.stopEvent();
    17.        return;
    18.    }
    19. }
    20.  
    21.  
    22. ....
    23.  
    24. }
    25.  
    26. }
    27.  
    28. ...
    29.  
    30. )}
    Sorry for the indent, I typed it directly (and didn't test it) but that's the gist of it.

    Any more debate on the scripts and the topic will be moved to Scripts, also with how the script is done it has to match the tier (here in lowercase) exactly. If the tier is "DPPT-ITA", replace "dppt-ita" by "DPPT-ITA". You also have to add something similar in beforeBattleMatchup, for findBattle.
     
  7. Tano

    Tano Member

    Joined:
    May 18, 2010
    Messages:
    58
    Likes Received:
    0
    Edit: solved using "hasTeamPokeMove"

    thanks coyotte.
     
    Last edited: May 26, 2010
  8. Steve

    Steve Active Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    491
    Likes Received:
    45
    I'm not sure if hasPokeMove was only added recently or not, but make sure you have the latest server version.
     
  9. Tano

    Tano Member

    Joined:
    May 18, 2010
    Messages:
    58
    Likes Received:
    0
    the correct function was hasTeamPokeMove

    it works now :)

    (how do i check a particular hidden power? like hidden power [grass]?)
     
    Last edited: May 26, 2010
  10. Kioku

    Kioku Member

    Joined:
    Apr 22, 2010
    Messages:
    200
    Likes Received:
    0
    Hidden Power Grass banned on certain Pokemon? Wait, what?

    I'm not entirely sure IVs can be checked via script ( yet? ), but I could be wrong.
     
  11. Tano

    Tano Member

    Joined:
    May 18, 2010
    Messages:
    58
    Likes Received:
    0
    then my suggestion is to add this feature xD
     
  12. Lutra

    Lutra All Gen Battler/Scripter

    Joined:
    Apr 25, 2010
    Messages:
    509
    Likes Received:
    188
    PO Trainer Name:
    Lutra
    Well I'm sure it could just be made so you can check the type of Hidden Power instead of storing all IV spreads in memory. Since it has to be recognised in the team builder and in battle anyway. IVs & Evs would be great though.
     
  13. Tano

    Tano Member

    Joined:
    May 18, 2010
    Messages:
    58
    Likes Received:
    0
    well, i personally need just the hidden power type.
     
  14. coyotte508

    coyotte508 Well-Known Member Administrator Server Owner Administrator Server Owner

    Joined:
    Apr 21, 2010
    Messages:
    6,363
    Likes Received:
    168
    I'll add EVs and IVs. That'll also be helpful for eventual RPG scripts. Hidden Power is imo very specific and not needed as a built in function!
     
  15. Jules

    Jules i make you MANGRY

    Joined:
    Apr 23, 2010
    Messages:
    243
    Likes Received:
    1
    Isuggestedthatbackintheoldboards.png
    ;(