Eval Collection: Focused Will

ability_priest_focusedwill

Focused Will is a priest passive ability from World of Warcraft. Every time the priest receives damage he gains a stack of Focused Will (up to 2 stacks) which reduces future incoming damage by 15% per stack.

Requirements:

♦ YEP_BuffsStatesCore.js

♦ YEP_AutoPassiveStates.js

  1. First you need to create your “Focused Will” state. In my case that’s state 126.
  2. Then go to the state’s notebox and paste the following:

<Custom Turn Start Effect>

if (user._latestFwStack) {

// How many turns does one stack last?

var duration = 2;

// Remove one stack if duration has passed

if ($gameTroop.turnCount() - user._latestFwStack === duration) {

user._fwStacks -= 1;

user._fwStacks = Math.max(0, user._fwStacks);

user._latestFwStack = $gameTroop.turnCount();

// Don't forget to replace the state ID 126.

user.setStateCounter(126, user._fwStacks);

};

};

</Custom Turn Start Effect>

<Custom React Effect>

// The maximum amount of stacks

var maxStack = 2;

// Damage reduction PER STACK (percentage!)

var dmgReduction = 0.15;

// Go on if the dmg value is bigger than 0

if (value > 0) {

// Make sure stacks exist

target._fwStacks = target._fwStacks || 0;

// Increase stacks by 1

target._fwStacks += 1;

target._latestFwStack = $gameTroop.turnCount();

// Keep stacks within boundaries

target._fwStacks = Math.min(target._fwStacks, maxStack);

// Refresh the state counter. Don't forget to replace the state ID 126.

target.setStateCounter(126, target._fwStacks);

// Reduce damage based on stacks

if (target._fwStacks > 0) {

value = Math.floor(value * (1.0 - (dmgReduction * target._fwStacks)));

};

};

</Custom React Effect>

3. Use the <Passive State: x> notetag to give your state to the actor.

Make sure to read my // Comments. They will tell you what’s going on where and what to change. Don’t forget to change the state ID I used here (126) to the one you use!

Advertisements

Write a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s