YEP Auto Passive States and YEP Life Steal percentage

KentaYoui

Not again a Newbie
Member
Joined
Oct 28, 2016
Messages
5
Reaction score
2
First Language
German
Primarily Uses
Bonsoir!


I'm stuck again due to my lacking JS skills...


I'm using YEP's Auto passive State and YEP's Life Steal Plugins.


So I'm trying to add "Life Drain" (state) to the game.


It should work like this:
Weapon21 should enable the ability to apply Life Drain on each hit the actor does (with an x% proc chance).


This include the normal "Attack" and also with all Skilltypes some abilities do multiple hits and "Life Drain" should check on each hit for the Life Drain proc.


I do have my Weapon21 with the note <Passive State: 26> (26 is Life Drain)


So if I start the battle test, my actor does have the state applied, like it should.


The next step is modify State 26 that it absorb <b.maxHP x%> with an x% chance.
I thought about to use it as Skill, which would be very easy with YEP's Life Steal, but I need it as an passive)


I'm trying to combine both YEP Plugins into the notetag but I can't really get it.


Also I did saw somewhere the possibility to bind a Skill to an passive state, but can't remember it correctly.



Do Someone has an Idea?

I also checked Moggle_x plugins and other stuff.


The only solution would (maybe) work is this one from Tsukihime, but it's for ACE


http://www.rpgmakercentral.com/topic/8210-how-to-add-hp-absorb-to-a-weapon/?p=65425
 

Fugama

Means well, but messes up sometimes.
Veteran
Joined
Jun 7, 2014
Messages
158
Reaction score
90
First Language
Fake English
Primarily Uses
RMMV
mmkay, I got it all handled. Put this in the state notebox and you should be good to go, the lifesteal plugin won't be needed. I have everything notated for you so you know what to change

Code:
  <Custom Confirm Effect>
  //change this number between 0 and 1. for example, 0.5 for a 50% success rate or 0.05 for a 5% success rate
var successRate = 1.0;
  // Check to see if the life steal procs.
  if (Math.random() < successRate) {
	  //change this for different hp rates
	  var lifeRate = 0.08;
	  //calculate lifesteal
	  var totalSteal = (target.mhp * lifeRate);
	  //deal damage
	  target.gainHp(-totalSteal);
	  //gain life
	  user.gainHp(totalSteal);
	  //display damage
	  target.startDamagePopup();
	  //display HP gain
	  user.startDamagePopup();
// Check if the target is dead.
if (target.isDead()) {
  // Make the target collapse.
  target.performCollapse();
}
// Clear the target's results.
target.clearResult();
//clear user results
user.clearResult();

  }
  </Custom Confirm Effect>
 
Last edited by a moderator:

KentaYoui

Not again a Newbie
Member
Joined
Oct 28, 2016
Messages
5
Reaction score
2
First Language
German
Primarily Uses
mmkay, I got it all handled. Put this in the state notebox and you should be good to go, the lifesteal plugin won't be needed. I have everything notated for you so you know what to change



<Custom Confirm Effect>
//change this number between 0 and 1. for example, 0.5 for a 50% success rate or 0.05 for a 5% success rate
var successRate = 1.0;
// Check to see if the life steal procs.
if (Math.random() < successRate) {
//change this for different hp rates
var lifeRate = 0.08;
//calculate lifesteal
var totalSteal = (target.mhp * lifeRate);
//deal damage
target.gainHp(-totalSteal);
//gain life
user.gainHp(totalSteal);
//display damage
target.startDamagePopup();
//display HP gain
user.startDamagePopup();
// Check if the target is dead.
if (target.isDead()) {
// Make the target collapse.
target.performCollapse();
}
// Clear the target's results.
target.clearResult();
//clear user results
user.clearResult();

}
</Custom Confirm Effect>
Holy cow, It works!

Thank you for the code, It should fix all my passive states issues!


Words can not describe how thankful I am.♥
 

Fugama

Means well, but messes up sometimes.
Veteran
Joined
Jun 7, 2014
Messages
158
Reaction score
90
First Language
Fake English
Primarily Uses
RMMV
Oh uh....one quick fix! change where it calculates the lifesteal to this


//calculate lifesteal
var totalSteal = Math.floor(target.mhp * lifeRate);


otherwise you'll get odd decimals and such
 

KentaYoui

Not again a Newbie
Member
Joined
Oct 28, 2016
Messages
5
Reaction score
2
First Language
German
Primarily Uses
Oh uh....one quick fix! change where it calculates the lifesteal to this



//calculate lifesteal
var totalSteal = Math.floor(target.mhp * lifeRate);


otherwise you'll get odd decimals and such
Done, this is how my notetag looks now:

<Custom Confirm Effect>


var successRate = 0.2;


if (Math.random() < successRate) {


var totalSteal = Math.floor(target.mhp*0.1);


target.gainHp(-totalSteal);


user.gainHp(totalSteal);


target.startDamagePopup();


user.startDamagePopup();


if (target.isDead()) {


target.performCollapse();


}


target.clearResult();


user.clearResult();


}


</Custom Confirm Effect>
20% chance to steal 10% mhp, Awesome!

I also converted it to an MP drain state and an "HeavyDamage" State (do 70% b.mhp damage with an 2% chance)
 

Fugama

Means well, but messes up sometimes.
Veteran
Joined
Jun 7, 2014
Messages
158
Reaction score
90
First Language
Fake English
Primarily Uses
RMMV
Done, this is how my notetag looks now:


20% chance to steal 10% mhp, Awesome!

I also converted it to an MP drain state and an "HeavyDamage" State (do 70% b.mhp damage with an 2% chance)
Perfect! Glad it all worked out ^_^
 

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