So, I'm trying to make my skill to behave like Ice Lance. I am certainly new to scripting, but I got the easy custom formulas working. However, I haven't got a single clue how to check for a state. I tried to copy stuff from other scripts which check for states, and tried to copy that. It doesn't work. So far, I have this :
CODE
when /ICE LANCE/i
value += item.damage.eval(user, self, $game_variables)
value *= 2 if self.state_id == 7
value += item.damage.eval(user, self, $game_variables)
value *= 2 if self.state_id == 7
I also hope to make a skill that only does damage to enemies for each specified state/buff and removes them. Example:
Enemy #1 : state 1, state 2 (Damaged two times, both states removed)
Enemy #2 : state 1 (damaged once, state removed)
Enemy #2 : no states (no effect)
So, how would I check for a state/buff and add/remove them?
EDIT : Solved the first issue.
CODE
value *= 2 if self.state?(7)
And a new one arose. I need to run a common event when a command is chosen in battle. The common event itself just randomizes the variable and picks a random line of text to say. A little something for the Overdrive moves. Problem is, the text is displayed after the animation and damage.
I tried to call it through Yanfly's Lunatic Objects as a before effect. No luck. While I found a post about this issue, it's pretty old, way back from 2009, and even if it works, it's way too advanced for me.