- 2
- Posts
- 5
- Years
- Seen Jan 16, 2024
I am very new to scripting for pokemon essentials so i need help
Basically Im trying to make an ability, called carnivore so that it allows biting moves to act like giga drain but im getting weird results like in this clip
Is there anyway to get it to work so that biting moves act exactly like giga drain under this ability?
This is the script im using:
Battle::AbilityEffects::DamageCalcFromUser.add(:CARNIVORE,
proc { |ability, user, target, move, mults, baseDmg, type|
if move.bitingMove?
original_target_hp = target.hp
damage_dealt = target.pbReduceHP(baseDmg, false)
target.pbFaint if target.hp <= 0
hp_restored = original_target_hp - target.hp
user.pbRecoverHP(hp_restored) if hp_restored > 0
end
}
)
Basically Im trying to make an ability, called carnivore so that it allows biting moves to act like giga drain but im getting weird results like in this clip
This is the script im using:
Battle::AbilityEffects::DamageCalcFromUser.add(:CARNIVORE,
proc { |ability, user, target, move, mults, baseDmg, type|
if move.bitingMove?
original_target_hp = target.hp
damage_dealt = target.pbReduceHP(baseDmg, false)
target.pbFaint if target.hp <= 0
hp_restored = original_target_hp - target.hp
user.pbRecoverHP(hp_restored) if hp_restored > 0
end
}
)