2013-06-26, 05:42 AM
Code:
if (hyper && wind_of_frey_cd <= 0)
{
checkBuffs();
wind_of_frey_cd = wind_of_frey_maxcd;
damage += addDamage((damR + armor_piercing_bonus) * wind_of_frey, wind_of_frey_hits, applyIgnore(ignore, armor_piercing_ignore, sharp_eyes_ignoreguard.get()), wind_of_frey_mob);
hits += wind_of_frey_hits * wind_of_frey_mob;
if (wind_of_frey_maxdam > 0)
maxdam += (damcap + wind_of_frey_maxdam - currcap) * wind_of_frey_hits * wind_of_frey_mob;
else
maxdam += damcap * wind_of_frey_hits * wind_of_frey_mob;
addDelay(adjustspeed(wind_of_frey_delay));
dot += wind_of_frey_dot * wind_of_frey_dot_maxdur * wind_of_frey_mob;
maxdam += rangecap * wind_of_frey_dot * wind_of_frey_dot_maxdur * wind_of_frey_mob / 100;
}
else if (x <= arrow_blaster_maxmob + arrow_blaster_extratarget.get())
{
checkBuffs();
arrow_blaster_dur = arrow_blaster_maxdur;
addDelay(adjustspeed(arrow_blaster_pre));
while (arrow_blaster_dur > 0)
{
armorpiercing();
damage += addDamage((damR + armor_piercing_bonus + arrow_blaster_reinforce.get() + arrow_blaster_bosskiller.get()) * arrow_blaster1,
arrow_blaster_hits, applyIgnore(ignore, armor_piercing_ignore, sharp_eyes_ignoreguard.get()), arrow_blaster_mob);
hits += arrow_blaster_hits * arrow_blaster_mob;
maxdam += damcap * arrow_blaster_hits * arrow_blaster_mob;
AFA();
advancedQuiver();
addDelay(arrow_blaster_delay);
}
arrow_blaster2_dur = arrow_blaster2_maxdur;
arrow_blaster = arrow_blaster2;
}Here's some example code. I honestly never give any of it really much thought, and push through it while I watch anime most of the time. I could wrap the hits += into the addDamage method, but I'm not 100% sure because there have been cases (i.e. Shadow Partner, DoT) where I may want to weigh a hit differently.
The addDelay method tosses the action delay and automatically rounds it to the highest 30ms, so Arrow Blaster will always be 90ms. The adjustpeed method accounts for weapon speed, so Arrow Blaster is exempt, like buffs, but the start up (supposedly) isn't. It'd be more detrimental to stop in the middle of Arrow Blaster to cast a buff or other skills, so I have it run through the full duration before choosing another action, as such, the while loop. In theory, the optimal method with this is to re-cast the turret just as your channeling expires, resetting its duration assuming it has no real startup though it probably does. This is rather idealized, and I should probably do a check for arrow_blaster2_dur <= 5 or something before resetting it, but since I have no actual start-up input for the turret, it's of no consequence yet.
Code:
public static void arrowBlaster(double t)
{
if (arrow_blaster2_dur > 0)
{
arrow_blaster_time += t;
while (arrow_blaster_time >= arrow_blaster_delay)
{
armorpiercing();
arrow_blaster_time -= arrow_blaster_delay;
damage += addDamage((damR + arrow_blaster_reinforce.get() + arrow_blaster_bosskiller.get() + armor_piercing_bonus) * arrow_blaster, arrow_blaster_hits,
applyIgnore(ignore, armor_piercing_ignore, sharp_eyes_ignoreguard.get()), arrow_blaster_mob);
hits += (arrow_blaster_hits) * arrow_blaster_mob;
maxdam += damcap * (arrow_blaster_hits) * arrow_blaster_mob;
}
}
else
arrow_blaster_time = 0;
}AFA, advancedQuiver, armorpiercing all run through random number generators to see if you activate their effects. So when you do armorpiercing(), it checks if you activate it or not; if you don't, it increases the activation rate and sets the bonus and ignore to 0. If it does work, it sets the bonus and ignore to whatever they are and puts the activation rate back to 10%.
The methodology is just a straight forward simulation of a character going through a checklist using all its innate abilities, over the course of a few thousand iterations, and many people could easily do this more efficiently than I do; no one has bothered for whatever reason, likely because it's time consuming and reward-less.

