- 79
- Posts
- 9
- Years
- Seen Jan 12, 2024
Here are some custom abilities I've coded that I've seen in a lot of fangames, and people have asked how to implement. I've tested all of them and they appear to be working correctly :]
Distract: Breaks the concentration of opposing pokemon upon entering battle, lowering their Sp. Atk stat. (Special version of Intimidate) Suggested users: Kadabra, Alakazam, Gardevoir, Gothitelle
How to implement:
Vampire Bite: The Pok?mon's biting attacks drain half the damage taken by the target. Suggested users: Zubat, Golbat, Crobat, Spinarak, Ariados, Gorebyss
How to implement:
Steel-Toe: Boosts the power of kicking moves (variant of Iron Fist) Suggested users: Hitmonlee, Blaziken, Lopunny
How to Implement:
There are many other custom abilities that are variants of other moves, for example a special version of Huge Power, but all you have to do is change a few values, so I didn't include those. If you're new to essentials and to coding, I highly recommend looking at the scripts for existing abilities, and basing your new ones off those. It teaches you about coding much more than just looking up how to do it. If you get stuck, then ask people for help :]
Distract: Breaks the concentration of opposing pokemon upon entering battle, lowering their Sp. Atk stat. (Special version of Intimidate) Suggested users: Kadabra, Alakazam, Gardevoir, Gothitelle
How to implement:
Spoiler:
In PokeBattle_Battler, paste the red code directly below the code for Intimidate:
Then, in PokeBattle_BattlerEffects, paste the red underneath the code for
This one is super long and easy to mess up, if you get a syntax error look at the code for intimidate; it's nearly identical, and make sure you add it before the very last 'end'
Code:
[COLOR="Green"]# Intimidate[/COLOR]
if self.hasWorkingAbility(:INTIMIDATE) && onactive
PBDebug.log("[Ability triggered] #{pbThis}'s Intimidate")
for i in 0...4
if pbIsOpposing?(i) && [email protected][i].fainted?
@battle.battlers[i].pbReduceAttackStatIntimidate(self)
end
end
end
[COLOR="Green"]# Distract[/COLOR]
[COLOR="Red"] if self.hasWorkingAbility(:DISTRACT) && onactive
PBDebug.log("[Ability triggered] #{pbThis}'s Distract")
for i in 0...4
if pbIsOpposing?(i) && [email protected][i].fainted?
@battle.battlers[i].pbReduceAttackStatDistract(self)
end
end
end[/COLOR]
Code:
pbReduceAttackStatIntimidate:
def pbReduceAttackStatIntimidate(opponent)
return false if fainted?
if effects[PBEffects::Substitute]>0
@battle.pbDisplay(_INTL("{1}'s substitute protected it from {2}'s {3}!",
pbThis,opponent.pbThis(true),PBAbilities.getName(opponent.ability)))
return false
end
if !opponent.hasWorkingAbility(:CONTRARY)
if pbOwnSide.effects[PBEffects::Mist]>0
@battle.pbDisplay(_INTL("{1} is protected from {2}'s {3} by Mist!",
pbThis,opponent.pbThis(true),PBAbilities.getName(opponent.ability)))
return false
end
if hasWorkingAbility(:CLEARBODY) || hasWorkingAbility(:WHITESMOKE) ||
hasWorkingAbility(:HYPERCUTTER) ||
(hasWorkingAbility(:FLOWERVEIL) && pbHasType?(:GRASS))
abilityname=PBAbilities.getName(self.ability)
oppabilityname=PBAbilities.getName(opponent.ability)
@battle.pbDisplay(_INTL("{1}'s {2} prevented {3}'s {4} from working!",
pbThis,abilityname,opponent.pbThis(true),oppabilityname))
return false
end
if pbPartner.hasWorkingAbility(:FLOWERVEIL) && pbHasType?(:GRASS)
abilityname=PBAbilities.getName(pbPartner.ability)
oppabilityname=PBAbilities.getName(opponent.ability)
@battle.pbDisplay(_INTL("{1}'s {2} prevented {3}'s {4} from working!",
pbPartner.pbThis,abilityname,opponent.pbThis(true),oppabilityname))
return false
end
end
return pbReduceStatWithCause(PBStats::ATTACK,1,opponent,PBAbilities.getName(opponent.ability))
end
[COLOR="Red"] def pbReduceAttackStatDistract(opponent)
return false if fainted?
if effects[PBEffects::Substitute]>0
@battle.pbDisplay(_INTL("{1}'s substitute protected it from {2}'s {3}!",
pbThis,opponent.pbThis(true),PBAbilities.getName(opponent.ability)))
return false
end
if !opponent.hasWorkingAbility(:CONTRARY)
if pbOwnSide.effects[PBEffects::Mist]>0
@battle.pbDisplay(_INTL("{1} is protected from {2}'s {3} by Mist!",
pbThis,opponent.pbThis(true),PBAbilities.getName(opponent.ability)))
return false
end
if hasWorkingAbility(:CLEARBODY) || hasWorkingAbility(:WHITESMOKE) ||
(hasWorkingAbility(:FLOWERVEIL) && pbHasType?(:GRASS))
abilityname=PBAbilities.getName(self.ability)
oppabilityname=PBAbilities.getName(opponent.ability)
@battle.pbDisplay(_INTL("{1}'s {2} prevented {3}'s {4} from working!",
pbThis,abilityname,opponent.pbThis(true),oppabilityname))
return false
end
if pbPartner.hasWorkingAbility(:FLOWERVEIL) && pbHasType?(:GRASS)
abilityname=PBAbilities.getName(pbPartner.ability)
oppabilityname=PBAbilities.getName(opponent.ability)
@battle.pbDisplay(_INTL("{1}'s {2} prevented {3}'s {4} from working!",
pbPartner.pbThis,abilityname,opponent.pbThis(true),oppabilityname))
return false
end
end
return pbReduceStatWithCause(PBStats::SPATK,1,opponent,PBAbilities.getName(opponent.ability))
end[/COLOR]
end
Vampire Bite: The Pok?mon's biting attacks drain half the damage taken by the target. Suggested users: Zubat, Golbat, Crobat, Spinarak, Ariados, Gorebyss
How to implement:
Spoiler:
In PokeBattle_Battler, paste the red code directly below 'if !target.damagestate.substitute' and directly above the code for Cursed Body:
Code:
if !target.damagestate.substitute
[COLOR="Green"]#Vampire Bite[/COLOR]
[COLOR="red"] if user.hasWorkingAbility(:VAMPIREBITE) && move.isBitingMove?
if target.hasWorkingAbility(:LIQUIDOOZE)
PBDebug.log("[Ability triggered] #{user.pbThis}'s Vampire Bite")
PBDebug.log("[Ability triggered] #{target.pbThis}'s Liquid Ooze")
hploss=user.pbReduceHP((target.damagestate.hplost/2).round,true)
@battle.pbDisplay(_INTL("{1} sucked up the liquid ooze!",user.pbThis))
else
if user.effects[PBEffects::HealBlock]==0
PBDebug.log("[Ability triggered] #{user.pbThis}'s Vampire Bite")
hpgain=user.pbRecoverHP((target.damagestate.hplost/2).round,true)
if hpgain>0
@battle.pbDisplay(_INTL("{1}'s Vampire Bite restored its HP!",user.pbThis))
end
end
end
end[/COLOR]
if target.hasWorkingAbility(:CURSEDBODY,true) && @battle.pbRandom(10)<3
if user.effects[PBEffects::Disable]<=0 && move.pp>0 && !user.fainted?
user.effects[PBEffects::Disable]=3
user.effects[PBEffects::DisableMove]=move.id
@battle.pbDisplay(_INTL("{1}'s {2} disabled {3}!",target.pbThis,
PBAbilities.getName(target.ability),user.pbThis(true)))
PBDebug.log("[Ability triggered] #{target.pbThis}'s Cursed Body disabled #{user.pbThis(true)}")
end
end
Steel-Toe: Boosts the power of kicking moves (variant of Iron Fist) Suggested users: Hitmonlee, Blaziken, Lopunny
How to Implement:
Spoiler:
In PokeBattle_Move, add the red code below all of the move flags, 'isBombMove' will probably be the last one:
If you added gen 7 moves, add Trop Kick, High Horse Power, and Stomping Tantrum to the list above. Then, underneath the code for Iron Fist, add this:
Code:
def isBombMove?
return (@flags&0x2000)!=0 [COLOR="green"]# flag n: Is bomb move[/COLOR]
end
[COLOR="Red"] def isKickingMove? [COLOR="Green"]# Kicking moves[/COLOR]
return ( isConst?(@id,PBMoves,:DOUBLEKICK) ||
isConst?(@id,PBMoves,:MEGAKICK) ||
isConst?(@id,PBMoves,:JUMPKICK) ||
isConst?(@id,PBMoves,:ROLLINGKICK) ||
isConst?(@id,PBMoves,:LOWKICK) ||
isConst?(@id,PBMoves,:HIGHJUMPKICK) ||
isConst?(@id,PBMoves,:TRIPLEKICK) ||
isConst?(@id,PBMoves,:BLAZEKICK) ||
isConst?(@id,PBMoves,:BULLDOZE) ||
isConst?(@id,PBMoves,:STOMP))
end [/COLOR]
Code:
if attacker.hasWorkingAbility(:IRONFIST) && isPunchingMove?
damagemult=(damagemult*1.2).round
end
[COLOR="red"] if attacker.hasWorkingAbility(:STEELTOE) && isKickingMove?
damagemult=(damagemult*1.2).round
end[/COLOR]
Last edited: