Alright, well it's been a couple years since this thread has had any ability scripts posted here, so I thought I'd add one.
This is the script for disguise, with the original concept coming from James Davy on a different thread here, but the script didn't work in the aspect that Mimikyu didn't transform after it was hit.
First, you need to add the ability to the PBEffects script:
Make the 112 the lowest number you can without repeating another effect #.
Next, in PokeBattle_Move, add this script under "opponent.damagestate.substitute=false"
Code:
if opponent.effects[PBEffects::Disguise]
@battle.pbDisplay(_INTL("{1}'s disguise served it as a decoy!",opponent.name))
opponent.effects[PBEffects::Disguise]=false
@battle.pbDisplay(_INTL("{1}'s disguise was busted!",opponent.name))
damage=0
end
Now, on to PokeBattle_Battler. Here, under "@effects[PBEffects::Illusion] = nil", add:
Code:
@effects[PBEffects::Disguise] = false
# Disguise causes the ability-suppressing effect to fade
# if it was passed on through Baton Pass
if isConst?(self.ability,PBAbilities,:DISGUISE)
@effects[PBEffects::GastroAcid] = false
end
Almost done, now is the script that tells Mimikyu to transform after taking damage. Under "transformed=false", add:
Code:
# Mimikyu
if isConst?(self.species,PBSpecies,:MIMIKYU)
if self.hasWorkingAbility(:DISGUISE)
if self.form!=1 && @effects[PBEffects::Disguise]==false
self.form=1; transformed=true
end
end
end
A few lines down, in "def pbResetForm", add Mimikyu to the list of Pokemon.
Finally, below "def pbAbilitiesOnSwitchIn(onactive)" and "return if fainted?", put:
Code:
if self.hasWorkingAbility(:DISGUISE) && onactive
@effects[PBEffects::Disguise]=true
end
This is working for me, but if anybody has any problems with it, let me know!