• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.

Idea Replacing the moveset after transforming into new form?

niki442

Rookie
Member
Joined
May 7, 2025
Posts
2
Hello all,

I want to ask if it possible to replace the current moveset of a pokemon for a predetermined moveset, when he transforms into a new form?

This is what Im using to change the form:

Ruby:
Expand Collapse Copy
class Battle::Move::HealAndChangeErenForm < Battle::Move  
def pbEndOfMoveUsageEffect(user, targets, numHits, switchedBattlers)    
return if numHits == 0    return if user.fainted? || user.effects[PBEffects::Transform]    
return if !user.isSpecies?(:EREN)    
user.effects[PBEffects::AquaRing] = true # Gives healing every turn    
user.pbChangeForm(1, _INTL("{1} transformed into the Attack Titan!", user.pbThis))  
end
end
 

nomists

Trainer
Member
Joined
Sep 2, 2023
Posts
51
Hello all,

I want to ask if it possible to replace the current moveset of a pokemon for a predetermined moveset, when he transforms into a new form?

This is what Im using to change the form:

Ruby:
Expand Collapse Copy
class Battle::Move::HealAndChangeErenForm < Battle::Move
def pbEndOfMoveUsageEffect(user, targets, numHits, switchedBattlers)  
return if numHits == 0    return if user.fainted? || user.effects[PBEffects::Transform]  
return if !user.isSpecies?(:EREN)  
user.effects[PBEffects::AquaRing] = true # Gives healing every turn  
user.pbChangeForm(1, _INTL("{1} transformed into the Attack Titan!", user.pbThis))
end
end
It should be possible based on what you're doing.

While I don't have time to program this code myself, what you'd want to do is grab the moves from the current battler and save them. So, I'd suggest making a new local variable and adding something after the changeform there like:

Ruby:
Expand Collapse Copy
@tempmoves = user.moves.map { |m| Pokemon::Move.new(m.id) }
Make sure you declare this variable earlier though at the start of the class. I think this should work because I think user here is the exact battler, but it could give some issues.

Anyway, keep that temporarily stored so that you can use it to restore the pokemon's moves when it changes forms back or when you exit battle or it dies (you'd have to account for all these possibilities. Might need to add another variable to check).

Anyway, what you'd then want to set each move individually depending on the form, so something like
Code:
Expand Collapse Copy
user.moves[0] = #insert move here.
Now, you'd need to do that for all four moves. Also, you'd need to dig up how to set each move manually to your desired move (try searching around in the code for this with ctrl + shift + f)

Anyhow, that's how my approach would go, but admittedly I haven't messed with setting moves that much before and I could have minor details wrong, so be careful and don't be afraid to correct anything I've told you. But if you wanted to start poking around with Ruby on your own, this could be a start.
 

niki442

Rookie
Member
Joined
May 7, 2025
Posts
2
It should be possible based on what you're doing.

While I don't have time to program this code myself, what you'd want to do is grab the moves from the current battler and save them. So, I'd suggest making a new local variable and adding something after the changeform there like:

Ruby:
Expand Collapse Copy
@tempmoves = user.moves.map { |m| Pokemon::Move.new(m.id) }
Make sure you declare this variable earlier though at the start of the class. I think this should work because I think user here is the exact battler, but it could give some issues.

Anyway, keep that temporarily stored so that you can use it to restore the pokemon's moves when it changes forms back or when you exit battle or it dies (you'd have to account for all these possibilities. Might need to add another variable to check).

Anyway, what you'd then want to set each move individually depending on the form, so something like
Code:
Expand Collapse Copy
user.moves[0] = #insert move here.
Now, you'd need to do that for all four moves. Also, you'd need to dig up how to set each move manually to your desired move (try searching around in the code for this with ctrl + shift + f)

Anyhow, that's how my approach would go, but admittedly I haven't messed with setting moves that much before and I could have minor details wrong, so be careful and don't be afraid to correct anything I've told you. But if you wanted to start poking around with Ruby on your own, this could be a start.
Thank you for the suggestions!

Just to note that I`m willing to pay if you could free a bit of your time for the code :)
 

nomists

Trainer
Member
Joined
Sep 2, 2023
Posts
51
Thank you for the suggestions!

Just to note that I`m willing to pay if you could free a bit of your time for the code :)
I sincerely appreciate the offer here! Unfortunately, I'm just at a point of my life where time is more valuable than money. However, there are others who do contract coding on here with Essentials you could check with in the Team Recruitment section with posts tagged as 'Freelance" (Goliospod User worked on Essentials and otherwise does contract coding, for instance, and there are others around that could do it if you want to put some feelers out with a status post).
 
Back
Top