• 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.
  • Dawn, Gloria, Juliana, or Summer - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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] Ability help

  • 158
    Posts
    6
    Years
    Hi! Remember when I wanted to know how to change the forms of Emomoth depending on its happiness? Well, I done that but I am still stuck with something else...
    You see, I have an ability set for Emomoth called Mixed Emotions, which raises its attack and speed stats when its happiness is maximum (255) and lowers its attack and speed stats when its happiness is minimum (0) upon entering a battle.

    Anyone have a code for that please?
     
    Ok so here's a thing: you have two pokemon objects the battler and the pokemon. The normal pokemon object defined in Pokebattle_Pokemon stores their happiness which lets them draw specific forms while the battler object draws variables from the Pokebattle_Pokemon pokmeon object but stores it in the new object. This means you're going to have to figure out how to call the pokemon objects happiness value. The easy part is once all that is done:

    if battler.happiness >= whatever#youwant && hasWorkingAbility(:INTERNALNAME)
    has x effect
    end

    if you want them to activate upon switchin you'll have to sneak the ability code around intimidate in pokebattle_battle.


    remember stages are defined weirdly. check the correct methods that define them at different points. the correct method for stat changes is:
    attacker.pbIncreaseStat(PBStats::ATTACK,2,attacker,false,self)

    where :ATTACK means which stage, and the second number how many stages
     
    Last edited:
    Ok so here's a thing: you have two pokemon objects the battler and the pokemon. The normal pokemon object defined in Pokebattle_Pokemon stores their happiness which lets them draw specific forms while the battler object draws variables from the Pokebattle_Pokemon pokmeon object but stores it in the new object. This means you're going to have to figure out how to call the pokemon objects happiness value. The easy part is once all that is done:

    if battler.happiness >= whatever#youwant && hasWorkingAbility(:INTERNALNAME)
    has x effect
    end

    if you want them to activate upon switchin you'll have to sneak the ability code around intimidate in pokebattle_battle.


    remember stages are defined weirdly. check the correct methods that define them at different points. the correct method for stat changes is:
    attacker.pbIncreaseStat(PBStats::ATTACK,2,attacker,false,self)

    where :ATTACK means which stage, and the second number how many stages

    Okay! Idk if it'll work but I will try something...!
     
    Uh... Someone help me... I got this:
    Spoiler:
     
    Back
    Top