I want to do a special attack with characters, so when their health is at a certain point, they can use a special attak, or maybe even any other ways of special attacks. Can anyone help me on how I can do a special attack?
2k3 or xp?
shoouldent effect it that much but if its xp then theres a skill called desperation thats scripted basically they do more damage when they have a low hp
ill find it for you:
Spell Effect No1
Name: Desparation
Special Inputs: None
Description: The lower the battlers hp the more damage that will be inflicted on the target
Create an element called desparation or whatever remember the Id
Script Editor class Game_Battler 3 skill_effect find
if skill.power != 0 and skill.atk_f > 0
remove_states_shock
effective = true
end
remember this spot in skill effect for this is the spot where you add the rest of the skill effects seems that people aren't getting this part so emphasis is necessary
right after the end statement add
if skill.element_set.include?(ELEMENT ID)
@damage_hp = 10 * user.maxhp / user.hp + self.damage
#change the formula if you want but the maxhp/hp is the most
#important part
end
Make sure you have this somewhere (preferably after this code) in skill effect (CHANGED AGAIN!!!)
if @damage_hp != 0 and @damage_hp != nil
self.damage = @damage_hp
last_hp = self.hp
self.hp -= @damage_hp
@hp_damaging = true
else
last_hp = self.hp
self.hp -= self.damage
end
at the start of skill_effect add this
@hp_damaging = false
@damage_hp = 0
find this block of code
if skill.power == 0
# Set damage to an empty string
self.damage = ""
# If state is unchanged
unless @state_changed
# Set damage to "Miss"
self.damage = "Miss"
end
end
replace that with this
if skill.power == 0 and not @hp_damaging
# Set damage to an empty string
self.damage = ""
# If state is unchanged
unless @state_changed
# Set damage to "Miss"
self.damage = "Miss"
end
end
delete these lines they should be right after the code you just added
last_hp = self.hp
self.hp -= self.damage
And you're done
the above scripts were made by trickster
note if you have rpgmaker 2003 then you cant use it but theres away to do it on 2003 as well
To do that sort of thing in RM2k(3), create a common event. In that new common event, set a variable to record the HP of the hero who will be learning the skill.
It should look like
Variable Ch:[0001: Hero HP] Set, HeroNameHere, HP
Set the common event to parallel process.
Make another common event with fork conditions that check to see if that variable is below whatever HP limit you want the new skill(s) to activate at.
It should look like
FORK Optn: Varbl[0001:Hero HP] (# goes here)less
<> Change Skill: HeroNameHere - SkillNameHere -> Memory
:ELSE Case
<> Change Skill: HeroNameHere - SkillNameHere -> Forget
End Case
This should also be a parallel process.