• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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.

Is it possible to have Stance Change work?

94
Posts
11
Years
    • Seen May 4, 2018
    I really want Aegislash in my game, but I need to know if it's possible to script Stance Change and make it work. Otherwise I'll have to add it and make it change in a different way, but that sorta loses the purpose of its existance. I wouldn't even care if its sprite didn't change and if it changed to Shield Mode by using King's Shield only and any other move to Blade Mode.
     
    8
    Posts
    9
    Years
    • Seen Jun 16, 2015
    Yeah I was wondering about that as well. Pokemon Zeta and Omicron has it, but from what I've heard, it's very screwed up. I never used Aegislash on my Zeta team, so I don't know what it's like myself.
     

    Radical Raptr

    #BAMFPokemonNerd
    1,121
    Posts
    13
    Years
  • Sounds easy enough, Aegislash is always in sheild form, and will change to it when it is sent out or switched out. When using damaging movers it switches to blade form, and using kings sheild reverts it to sheild form. Using status moves other than king's sheild to not change it's stance.

    Also, the Ability activates prior to and independently of any checks for status conditions that may stop the execution of the user's attack, such as sleep or confusion.
    Stance Change cannot be Traced, copied with Role Play, suppressed with Gastro Acid, or replaced with Simple Beam, Worry Seed, Entrainment, or Skill Swap. If a Pokémon other than Aegislash obtains Stance Change with Imposter or Transform, the Pokémon will not change Formes. In addition, Stance Change is unaffected by Mummy.
     
    95
    Posts
    9
    Years
    • Seen Jun 18, 2016
    I think it would be something like this:

    Code:
    if isConst?(self.ability,PBAbilities,:STANCECHANGE) &&
           isConst?(self.species,PBSpecies,:AEGISLASH) && hp>0 && thismove.basedamage > 0
            @pokemon.form=1
            pbCheckForm
          end

    That would be in PokeBattle_Battler, right under this:

    Code:
    if status==PBStatuses::FROZEN && (thismove.flags&0x40)!=0 # flag g: Thaws user before moving
          self.status=0
          pbCheckForm
          @battle.pbDisplay(_INTL("{1} was defrosted by {2}!",pbThis,thismove.name))
        end

    Then, look for this:

    Code:
    def pbAbilitiesOnSwitchIn(onactive)
        return if hp<=0

    Put this after:

    Code:
    if isConst?(self.species,PBSpecies,:AEGISLASH) && onactive
            self.pokemon.form=0
            pbCheckForm
        end

    Finally, look for the def pbResetForm and add this after the Castform line:

    Code:
    isConst?(self.species,PBSpecies,:AEGISLASH) ||

    Then you just have to add the way to go back to the shield form (create King Shield and make it change Aegislash to form 0 whenever it is used. It should work for you.

    Edit: Also, under this:

    Code:
    # Giratina
        if isConst?(self.species,PBSpecies,:GIRATINA) && hp>0
          if [email protected]
            [email protected]
            transformed=true
          end
        end

    Put this:

    Code:
    if isConst?(self.species,PBSpecies,:AEGISLASH) && hp>0
          if [email protected]
            [email protected]
            transformed=true
          end
        end
     
    1,224
    Posts
    10
    Years
  • I think it would be something like this:

    Code:
    if isConst?(self.ability,PBAbilities,:STANCECHANGE) &&
           isConst?(self.species,PBSpecies,:AEGISLASH) && hp>0 && thismove.basedamage > 0
            @pokemon.form=1
            pbCheckForm
          end

    That would be in PokeBattle_Battler, right under this:

    Code:
    if status==PBStatuses::FROZEN && (thismove.flags&0x40)!=0 # flag g: Thaws user before moving
          self.status=0
          pbCheckForm
          @battle.pbDisplay(_INTL("{1} was defrosted by {2}!",pbThis,thismove.name))
        end

    Then, look for this:

    Code:
    def pbAbilitiesOnSwitchIn(onactive)
        return if hp<=0

    Put this after:

    Code:
    if isConst?(self.species,PBSpecies,:AEGISLASH) && onactive
            self.pokemon.form=0
            pbCheckForm
        end

    Finally, look for the def pbResetForm and add this after the Castform line:

    Code:
    isConst?(self.species,PBSpecies,:AEGISLASH) ||

    Then you just have to add the way to go back to the shield form (create King Shield and make it change Aegislash to form 0 whenever it is used. It should work for you.

    Edit: Also, under this:

    Code:
    # Giratina
        if isConst?(self.species,PBSpecies,:GIRATINA) && hp>0
          if [email protected]
            [email protected]
            transformed=true
          end
        end

    Put this:

    Code:
    if isConst?(self.species,PBSpecies,:AEGISLASH) && hp>0
          if [email protected]
            [email protected]
            transformed=true
          end
        end
    assuming you would create a new function for King's Shield, you would just have to add this right?
    Code:
    if isConst?(self.ability,PBAbilities,:STANCECHANGE) &&
          isConst?(self.species,PBSpecies,:AEGISLASH) && hp>0 && thismove.function==XXX #Where XXX is the function number 
          @pokemon.form=0
          pbCheckForm
        end
     
    95
    Posts
    9
    Years
    • Seen Jun 18, 2016
    assuming you would create a new function for King's Shield, you would just have to add this right?
    Code:
    if isConst?(self.ability,PBAbilities,:STANCECHANGE) &&
          isConst?(self.species,PBSpecies,:AEGISLASH) && hp>0 && thismove.function==XXX #Where XXX is the function number 
          @pokemon.form=0
          pbCheckForm
        end

    Yeah, just that. Also, in the King Shield function you have to add that if you get hit by a contact move while protecting, you lower the enemy attack by 2, but that's up to you :-P
     
    1,224
    Posts
    10
    Years
  • Yeah, just that. Also, in the King Shield function you have to add that if you get hit by a contact move while protecting, you lower the enemy attack by 2, but that's up to you :-P

    (For other peoples reference)
    I added this above Protect in PokeBattle_Battler
    Code:
    if $game_switches[68]==true && (thismove.flags&0x01)!=0 #King's Shield
          if isConst?(opponent.ability,PBAbilities,:CONTRARY)
            if opponent.pbCanIncreaseStatStage?(PBStats::ATTACK,false)
          opponent.pbIncreaseStat(PBStats::ATTACK,1,false,showanim)
          @battle.pbDisplay(_INTL("{1} protected itself!",target.pbThis))
          @battle.successStates[user.index].protected=true
          return false
        end 
            elsif !isConst?(opponent.ability,PBAbilities,:CONTRARY)
          if opponent.pbCanReduceStatStage?(PBStats::ATTACK,false)
          opponent.pbReduceStat(PBStats::ATTACK,1,false,showanim)
          @battle.pbDisplay(_INTL("{1} protected itself!",target.pbThis))
          @battle.successStates[user.index].protected=true
          return false
        end 
        end
      end
    and this is the move effect
    Code:
    ################################################################################
    #  King's Shield
    ################################################################################
    class PokeBattle_Move_152 < PokeBattle_Move
      def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
        ratesharers=[
           0xAA,   # Detect, Protect, King's Sheild
           0xAB,   # Quick Guard
           0xAC,   # Wide Guard
           0xE8,    # Endure
           0x151,    #spiky shield
           0x152,    #King's Shield
           0x164      #Mat Block
        ]
        if !ratesharers.include?(PBMoveData.new(attacker.lastMoveCalled).function)
          attacker.effects[PBEffects::ProtectRate]=1
        end
        #TODO: Fails if this is the last attack in the round
        if @battle.pbRandom(65536)>(65536/attacker.effects[PBEffects::ProtectRate]).floor
          attacker.effects[PBEffects::ProtectRate]=1
          @battle.pbDisplay(_INTL("But it failed!"))
          return -1
        end
        pbShowAnimation(@id,attacker,nil,hitnum,alltargets,showanimation)
        attacker.effects[PBEffects::Protect]=true
        attacker.effects[PBEffects::ProtectRate]*=2
        $game_switches[68]=true
        @battle.pbDisplay(_INTL("{1} protected itself!",attacker.pbThis))
        return 0
      end
    end
    feel free to create a new effect instead of the game switch, I was just being lazy
     
    148
    Posts
    11
    Years
  • I remember reading someone talking about how if an ability like stance change was made it wouldn't be able to change the Pokemon's graphic. Is that true? Using something like this to have deoxys change between all it's forms would be really fun to try.
     
    1,405
    Posts
    11
    Years
  • I remember reading someone talking about how if an ability like stance change was made it wouldn't be able to change the Pokemon's graphic. Is that true? Using something like this to have deoxys change between all it's forms would be really fun to try.

    As long as you have the forme graphics in the battlers folder, it should change graphics with the forms too.

    And you idea stealer even if i didn't state it anywhere, i was gonna try the Deoxys forme change thing D:<
     
    148
    Posts
    11
    Years
  • As long as you have the forme graphics in the battlers folder, it should change graphics with the forms too.

    And you idea stealer even if i didn't state it anywhere, i was gonna try the Deoxys forme change thing D:<

    Haha, by all means try it. I'm just starting to really try learning how essentials works. The stuff
    DL Kurosh and mej71 just put up still looks a little confusing to me. Will be a little bit before I try to change it to work with Deoxys. Will be fantastic seeing it work though :)
     
     
    1,405
    Posts
    11
    Years
  • Haha, by all means try it. I'm just starting to really try learning how essentials works. The stuff
    DL Kurosh and mej71 just put up still looks a little confusing to me. Will be a little bit before I try to change it to work with Deoxys. Will be fantastic seeing it work though :)
     

    I will mess with it tomorrow or few days after that. I can send you a PM/s if you want to know how it goes.
     
    148
    Posts
    11
    Years
  • I will mess with it tomorrow or few days after that. I can send you a PM/s if you want to know how it goes.

    Sounds good.

    So, if this is what the ability code looks like for one move function that changes form:

    Code:
    if isConst?(self.ability,PBAbilities,:STANCECHANGE) &&
          isConst?(self.species,PBSpecies,:AEGISLASH) && hp>0 && thismove.function==XXX #Where XXX is the function number 
          @pokemon.form=0
          pbCheckForm
        end

    Would it just be as simple as adding an elseif statement afterwords for each other move function that changes a form? And change the form itself.

    Code:
    if isConst?(self.ability,PBAbilities,:STANCECHANGE) &&
          isConst?(self.species,PBSpecies,:AEGISLASH) && hp>0 && thismove.function==XXX #Where XXX is the function number 
          @pokemon.form=0
          pbCheckForm
        end
    elseif isConst?(self.ability,PBAbilities,:STANCECHANGE) &&
          isConst?(self.species,PBSpecies,:AEGISLASH) && hp>0 && thismove.function==XXX #Second function number
          @pokemon.form=0 # Whatever other form you want to change into
          pbCheckForm
        end

    or is it more complicated then that. Never messed around with form stuff so im just shooting in the dark really.

    Or by using "||" instead of elseif?
     
    Last edited:
    1,405
    Posts
    11
    Years
  • Sounds good.

    So, if this is what the ability code looks like for one move function that changes form:

    Code:
    if isConst?(self.ability,PBAbilities,:STANCECHANGE) &&
          isConst?(self.species,PBSpecies,:AEGISLASH) && hp>0 && thismove.function==XXX #Where XXX is the function number 
          @pokemon.form=0
          pbCheckForm
        end

    Would it just be as simple as adding an elseif statement afterwords for each other move function that changes a form? And change the form itself.

    Code:
    if isConst?(self.ability,PBAbilities,:STANCECHANGE) &&
          isConst?(self.species,PBSpecies,:AEGISLASH) && hp>0 && thismove.function==XXX #Where XXX is the function number 
          @pokemon.form=0
          pbCheckForm
        end
    elseif isConst?(self.ability,PBAbilities,:STANCECHANGE) &&
          isConst?(self.species,PBSpecies,:AEGISLASH) && hp>0 && thismove.function==XXX #Second function number
          @pokemon.form=0 # Whatever other form you want to change into
          pbCheckForm
        end

    or is it more complicated then that. Never messed around with form stuff so im just shooting in the dark really.

    Or by using "||" instead of elseif?

    Tried doing my own ability like that once. For some reason it doesn't work like that.

    Code:
    if isConst?(self.ability,PBAbilities,:STANCECHANGE) &&
          isConst?(self.species,PBSpecies,:AEGISLASH) && hp>0 && thismove.function==XXX #Where XXX is the function number 
          @pokemon.form=0
          pbCheckForm
        end
    if isConst?(self.ability,PBAbilities,:STANCECHANGE) &&
          isConst?(self.species,PBSpecies,:AEGISLASH) && hp>0 && thismove.function==XXX #Second function number
          @pokemon.form=0 # Whatever other form you want to change into
          pbCheckForm
        end

    This should work. It's the same with every ability that uses more than 1 condition, you pretty much just keep using if isConst? for every condition(and what it does).
     
    8
    Posts
    9
    Years
    • Seen Jun 16, 2015
    Roaming Murkrow where in the script do I your script? Like which script and which line? I'm not really big in this coding stuff.
     
    1,224
    Posts
    10
    Years
  • Roaming Murkrow where in the script do I your script? Like which script and which line? I'm not really big in this coding stuff.

    PokeBattle_Battler

    @ JynxedOne,
    Or by using "||" instead of elseif?

    those are not equivalent, "||" is an equivalent of "or". You wouldn't be able to use it like that. If you're looking for shortcuts, there's something called a ternary operator, but I wouldn't use it for something like this.


    Edit: As to whether the graphics will update, I haven't tested it but they should. Notice the stuff DL added under pbResetForm and such, the same way castform changes form mid-battle.
     
    Last edited:
    148
    Posts
    11
    Years
  • assuming you would create a new function for King's Shield, you would just have to add this right?
    Code:
    if isConst?(self.ability,PBAbilities,:STANCECHANGE) &&
          isConst?(self.species,PBSpecies,:AEGISLASH) && hp>0 && thismove.function==XXX #Where XXX is the function number 
          @pokemon.form=0
          pbCheckForm
        end

    When I place your code in PokeBattle_Battler it keeps giving me the error

    "Script 'PokeBattle_Battler' line 1909:nomethoderror occurred. Undefined method 'ability' for PokeBattle_Battler:class

    All i've done so far is make STANCECHANGE an ability in the ability text and add King's shield function code to it.

    Sorry, fixed it.
     
    Last edited:
    1,224
    Posts
    10
    Years
  • When I place your code in PokeBattle_Battler it keeps giving me the error

    "Script 'PokeBattle_Battler' line 1909:nomethoderror occurred. Undefined method 'ability' for PokeBattle_Battler:class

    All i've done so far is make STANCECHANGE an ability in the ability text and add King's shield function code to it.

    did you put it under this?
    Code:
     if status==PBStatuses::FROZEN && (thismove.flags&0x40)!=0 # flag g: Thaws user before moving
          self.status=0
          pbCheckForm
          @battle.pbDisplay(_INTL("{1} was defrosted by {2}!",pbThis,thismove.name))
        end

    Also, I tested it and the graphics don't update for the transformation. I'll look into that.
     
    148
    Posts
    11
    Years
  • did you put it under this?
    Code:
     if status==PBStatuses::FROZEN && (thismove.flags&0x40)!=0 # flag g: Thaws user before moving
          self.status=0
          pbCheckForm
          @battle.pbDisplay(_INTL("{1} was defrosted by {2}!",pbThis,thismove.name))
        end

    Also, I tested it and the graphics don't update for the transformation. I'll look into that.

    I just tested it too, and as soon as it attacked the graphic changed to the second form one.
     
    148
    Posts
    11
    Years
  • Mine says he transformed, but the graphic doesn't update. I don't see any mistakes I made with DL's codes.

    After I put all his codes in nothing happened. So I took the code you made and put it below his in
    PokeBattle_Battler.

    Problem being he doesn't change back to shield form when using king's shield. Not sure where I messed up ether.

    Code:
    #Agislash Form Change
        if isConst?(self.ability,PBAbilities,:STANCECHANGE) &&
           isConst?(self.species,PBSpecies,:AEGISLASH) && hp>0 && thismove.basedamage > 0
            @pokemon.form=1
            pbCheckForm
          end    
        #Agislash Form Change
       if isConst?(self.ability,PBAbilities,:STANCECHANGE) &&
          isConst?(self.species,PBSpecies,:AEGISLASH) && hp>0 && thismove.function==135 #Where XXX is the function number 
          @pokemon.form=0
          pbCheckForm
        end

    This code you posted. I didn't put it in. What dies it do? Is it necessary for this to work properly?
    Code:
    if $game_switches[68]==true && (thismove.flags&0x01)!=0 #King's Shield
          if isConst?(opponent.ability,PBAbilities,:CONTRARY)
            if opponent.pbCanIncreaseStatStage?(PBStats::ATTACK,false)
          opponent.pbIncreaseStat(PBStats::ATTACK,1,false,showanim)
          @battle.pbDisplay(_INTL("{1} protected itself!",target.pbThis))
          @battle.successStates[user.index].protected=true
          return false
        end 
            elsif !isConst?(opponent.ability,PBAbilities,:CONTRARY)
          if opponent.pbCanReduceStatStage?(PBStats::ATTACK,false)
          opponent.pbReduceStat(PBStats::ATTACK,1,false,showanim)
          @battle.pbDisplay(_INTL("{1} protected itself!",target.pbThis))
          @battle.successStates[user.index].protected=true
          return false
        end 
        end
      end
     
    Last edited:
    Back
    Top