50% chance to die after using a skill

Virgo

Villager
Member
Joined
Feb 18, 2014
Messages
16
Reaction score
1
First Language
English
Primarily Uses
So i made a skill called rapture and every time you cast that skill you have 50% chance to die,

but the problem is i dont know how to make it work like that.

Do i need a script or something,can somone tell me please.

Thanks and sry on my bad english.
 

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,513
Reaction score
3,202
First Language
Binary
Primarily Uses
RMMZ
make the skill call a common event and put this snippet in the script call command of the common event,

(rand > 0.5) ? BattleManager.actor.hp -= 9999 : nilNot tried, should work.
 

Korokage

Veteran
Veteran
Joined
Mar 1, 2015
Messages
56
Reaction score
9
First Language
English
Primarily Uses
As an addendum to the above, you can do something similar in the formula box of the skill. If you do it in the formula box it would look like  ■ ᴆᴈᴋᴉᴦᴀ ■'s code, except that BattleManager.actor.hp would become a.hp.
 

Dark_Metamorphosis

What a horrible night to have a curse.
Veteran
Joined
Nov 23, 2012
Messages
2,192
Reaction score
382
First Language
Swedish
Primarily Uses
Yeah using custom formulas for the skills is the way to go if you are using VX or VXAce. It's amazing what you can do in the skill formula box :)
 

Virgo

Villager
Member
Joined
Feb 18, 2014
Messages
16
Reaction score
1
First Language
English
Primarily Uses
WOW.That was fast,thanks
 

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,513
Reaction score
3,202
First Language
Binary
Primarily Uses
RMMZ
Yeah using custom formulas for the skills is the way to go if you are using VX or VXAce. It's amazing what you can do in the skill formula box :)
This is true... For example...

Put this in skill formula box...

a.my_awesome_skill(a,Then add this cheeky little snippet in a script page...

# Opens Classclass Game_Battler # Defines custom skill formula def my_awesome_skill(a, # Get attack value atk_val = (a.atk + a.mat * 5) / 2 # Get defence value def_val = (b.def + b.mdf * 5) / 2 # Get total value tot_val = atk_val * (def_val / 2) * a.hp_rate # Take all attacker hp if rand > 0.5 (50% randomness) if (rand >= 0.5) a.hp -= a.hp end # Take all attackers mp if damage was 0 or negative if (tot_val <= 0) a.mp -= a.mp end # Add State 5 To attacker if its hp rate is greater than enemies if (a.hp_rate > b.hp_rate) a.add_state(5) else # Add the same state to the enemy if not b.add_state(5) end # End Custom Skill Formula and return damage value return tot_val end # End ClassendHave fun with that :p

Keep in mind though, all these modifications take place way before the total damage value is determined as the formula is only the first part of the overall process.
 
Last edited by a moderator:

Dark_Metamorphosis

What a horrible night to have a curse.
Veteran
Joined
Nov 23, 2012
Messages
2,192
Reaction score
382
First Language
Swedish
Primarily Uses
This is true... For example...

Put this in skill formula box...
Nothing I would ever be able to put in as a skill formula xd

That shows my point even more, amazing on what can be done in that text box :p

Even though I just use very basic formulas in there haha.
 

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,513
Reaction score
3,202
First Language
Binary
Primarily Uses
RMMZ
Yea, I usually just put mega simple things there too, like '100', but then again, I code in thousands of lines worth of modifications too, so... :p
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:

Forum statistics

Threads
105,854
Messages
1,017,004
Members
137,562
Latest member
tamedeathman
Top