Help Aqua Ring-esque ability

Greenadine

Rookie
Member
Posts
1
#1
I've been trying to make a custom ability that heals the attacker for a small amount of health whenever it attacks. I've tried to take the code from Aqua Ring and Poison Touch and combine those and put it in the script PokeBattle_Battler. But as I expected, it will not work that way.

The code I used for the ability is
Code:
if user.hasWorkingAbility(:ESSENCETHEFT,true) && @battle.pbRandom(10)<3
	PHDebug.Log("[Ability triggered] #{user.pbThis}'s Essence Theft")
	hpgain=(i.totalhp/16).floor
	hpgain=(hpgain*1.3).floor if i.hasWorkingItem(:BIGROOT)
	hpgain=i.pbRecoverHP(hpgain,true)
	pbDisplay(_INTL("{1}'s Essence Theft restored its HP a little!",i.pbThis)) if hpgain>0
end
I have never tried to make an ability before, or even try to make custom things through coding it in the scripts. Anyone know what I should do?
 
Top