• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Scripting Question] Custom Function Code help

  • 10
    Posts
    8
    Years
    • Seen Feb 28, 2018
    I don't mean to impose, but would anyone be able to help with a function code for a move I have?

    Squall
    Flying-type move
    Effect: Damages target and randomly causes rain or hail.
     
    This should work. 10% for hail and 10% for rain (dance). Don't forget to change the function code itself.
    Code:
    class PokeBattle_Move_B01 < PokeBattle_Move
      def pbEffectAfterHit(attacker,opponent,turneffects)
        int = rand(10)
        if int == 0
          @battle.weather=PBWeather::HAIL
          @battle.weatherduration=5
          @battle.weatherduration=8 if attacker.hasWorkingItem(:ICYROCK)
          @battle.pbCommonAnimation("Hail",nil,nil)
          @battle.pbDisplay(_INTL("It started to hail!"))
        elsif int == 1
          @battle.weather=PBWeather::RAINDANCE
          @battle.weatherduration=5
          @battle.weatherduration=8 if attacker.hasWorkingItem(:DAMPROCK)
          @battle.pbCommonAnimation("Rain",nil,nil)
          @battle.pbDisplay(_INTL("It started to rain!"))
        end
      end
    end
     
    Back
    Top