Example #1
0
        public Monk()
        {
            name = "Monk";
              classname = "Pugilist";
              glstacks = 0;
              perfectbalancebuff = false;

              bootshine = new Bootshine(this);
              truestrike = new TrueStrike(this);
              snappunch = new SnapPunch(this);
              touchofdeath = new TouchOfDeath(this);
              twinsnakes = new TwinSnakes(this);
              demolish = new Demolish(this);
              dragonkick = new DragonKick(this);
              internalrelease = new InternalRelease(this);
              perfectbalance = new PerfectBalance(this);
              fracture = new Fracture(this);
              invigorate = new Invigorate(this);
              mercystroke = new MercyStroke(this);
              steelpeak = new SteelPeak(this);
              howlingfist = new HowlingFist(this);
              bloodforblood = new BloodForBlood(this);
              autoattack = new Autoattack(this);
              xpotionstrength = new XPotionStrength(this);

              feylight = new FeyLight();
              feyglow = new FeyGlow();
              tpregen = new Regen();
        }
Example #2
0
        public int damage(ref Ability ability, int pot, bool dot = false)
        {
            double damageformula = 0.0;
              double tempint = INT;
              double multi = 1;
              //potion check
              if (xpotionintelligence.buff > 0 || (dot == true && ability.dotbuff["potion"] == true)) {
            //check for max dex increase from pot - NEEDS to be refactored...

            if (percentageOfStat(xpotionintelligence.percent, tempint) > xpotionintelligence.bonus) {
              //MainWindow.log("yolo: " + percentageOfStat(xpotiondexterity.percent, tempdex) + " tempdex " + tempdex);
              tempint += xpotionintelligence.bonus;
              //MainWindow.log("capBonus Dex from potion: " + xpotiondexterity.bonus + " percent of stat: " + percentageOfStat(xpotiondexterity.percent, tempdex));
            } else {
              tempint += percentageOfStat(xpotionintelligence.percent, tempint);
              //MainWindow.log("smBonus Dex from potion: " + percentageOfStat(xpotiondexterity.percent, tempdex));
            }
              }
              //end potion check
              if (AFstacks == 0 && UIstacks == 0 && (ability.aspect == "Fire" || ability.aspect == "Ice")) { multi = 1; }
              if (AFstacks == 3 && ability.aspect == "Fire") { multi = 1.8; }
              if (AFstacks == 1 && ability.aspect == "Fire") { multi = 1.4; }
              if (UIstacks == 3 && ability.aspect == "Fire") { multi = 0.7; }
              if (AFstacks == 3 && ability.aspect == "Ice") { multi = 0.7; }

              if (ability.abilityType == "Weaponskill" || ability.abilityType == "Instant" || ability.abilityType == "Spell" || ability.abilityType == "HealSpell") {
            damageformula = (multi * (double)pot / 100) * ((MDMG * 0.353554382 + tempint * 0.176111019 + DTR * 0.00911378 + MDMG * tempint * 0.00739962 + MDMG * (DTR - 202) * 0.002393685) / 1.5);

              }

              //crit
              double critroll = MainWindow.d100(1, 1000001) / 10000; //critroll was only rolling an interger between 1-101. Now has the same precision as critchance.
              double critchance = 0;
              critchance = 0.0697 * (double)CRIT - 18.437; //Heavyshot interaction
              //MainWindow.log("CRIT CHANCE IS:" + critchance + " ROLL IS: " + critroll);
              if (dot) {
            if (ability.dotbuff["ragingstrikes"]) { damageformula *= 1.20; }

              } else {
            if (ragingstrikes.buff > 0) { damageformula *= 1.20; }
              }

              if (critroll <= critchance) {

            numberofcrits += 1;

            MainWindow.log("!!CRIT!! - ", false);
            damageformula *= 1.5;
            if (dot) {
              ability.tickcrits += 1;
            } else {
              //normal attack crit
              ability.crits += 1;
            }
              }

              // added variance to damage.
              //damageformula = ((MainWindow.d100(-500, 500) / 10000) + 1) * (int)damageformula;
              return (int)damageformula;
        }
Example #3
0
        public int damage(ref Ability ability, int pot, bool dot = false)
        {
            double damageformula = 0.0;
              double tempmnd = MND;

              if (ability.abilityType == "Weaponskill" || ability.abilityType == "Instant" || ability.abilityType == "Spell" || ability.abilityType == "HealSpell") {
            damageformula = ((double)pot / 100) * ((MDMG * 0.353554382 + tempmnd * 0.176111019 + DTR * 0.00911378 + MDMG * tempmnd * 0.00739962 + MDMG * (DTR - 202) * 0.002393685) / 1.5);

              }

              //crit
              double critroll = MainWindow.d100(1, 1000001) / 10000; //critroll was only rolling an interger between 1-101. Now has the same precision as critchance.
              double critchance = 0;
              critchance = 0.0697 * (double)CRIT - 18.437;

              if (critroll <= critchance) {
            numberofcrits += 1;

            MainWindow.log("!!CRIT!! - ", false);
            damageformula *= 1.5;
            if (dot) {
              ability.tickcrits += 1;
            } else {
              //normal attack crit
              ability.crits += 1;
            }
              }

              // added variance to damage.
              damageformula = ((MainWindow.d100(-300, 300) / 10000) + 1) * (int)damageformula;
              return (int)damageformula;
        }
Example #4
0
        public Bard()
        {
            name = "Bard";
              classname = "Archer";

              heavyshot = new HeavyShot(this);
              windbite = new Windbite(this);
              venomousbite = new VenomousBite(this);
              straightshot = new StraightShot(this);
              bloodletter = new Bloodletter(this);
              miserysend = new MiserysEnd(this);
              bluntarrow = new BluntArrow(this);
              repellingshot = new RepellingShot(this);
              flamingarrow = new FlamingArrow(this);
              internalrelease = new InternalRelease(this);
              bloodforblood = new BloodForBlood(this);
              ragingstrikes = new RagingStrikes(this);
              hawkseye = new HawksEye(this);
              barrage = new Barrage(this);
              invigorate = new Invigorate(this);
              autoattack = new AutoAttack(this);
              armyspaeon = new ArmysPaeon(this);

              xpotiondexterity = new XPotionDexterity(this);
              feylight = new FeyLight();
              feyglow = new FeyGlow();
              regen = new Regen();
        }
Example #5
0
        public int damage(ref Ability ability, int pot, bool dot = false)
        {
            double damageformula = 0.0;
              double tempstr = STR;
              //potion check
              if (xpotionstrength.buff > 0 || (dot == true && ability.dotbuff["potion"] == true)) {
            //check for max dex increase from pot - NEEDS to be refactored...

            if (percentageOfStat(xpotionstrength.percent, tempstr) > xpotionstrength.bonus) {
              //MainWindow.log("yolo: " + percentageOfStat(xpotiondexterity.percent, tempdex) + " tempdex " + tempdex);
              tempstr += xpotionstrength.bonus;
              //MainWindow.log("capBonus Dex from potion: " + xpotiondexterity.bonus + " percent of stat: " + percentageOfStat(xpotiondexterity.percent, tempdex));
            } else {
              tempstr += percentageOfStat(xpotionstrength.percent, tempstr);
              //MainWindow.log("smBonus Dex from potion: " + percentageOfStat(xpotiondexterity.percent, tempdex));
            }
              }
              //end potion check
              if (ability.abilityType == "Weaponskill" || ability.abilityType == "Instant") {
            damageformula = ((double)pot / 100) * (0.005126317 * WEP * tempstr + 0.000128872 * WEP * DTR + 0.049531324 * WEP + 0.087226457 * tempstr + 0.050720984 * DTR);

              }
              if (ability.abilityType == "AUTOA") {
            damageformula = (AAPOT) * (0.408 * WEP + 0.103262731 * tempstr + 0.003029823 * WEP * tempstr + 0.003543121 * WEP * (DTR - 202));
              }

              //crit
              double critroll = MainWindow.d100(1, 1000001) / 10000; //critroll was only rolling an interger between 1-101. Now has the same precision as critchance.
              double critchance = 0;
              critchance = 0.0697 * (double)CRIT - 18.437; //Heavyshot interaction
              //MainWindow.log("CRIT CHANCE IS:" + critchance + " ROLL IS: " + critroll);
              if (dot) {
            if (ability.dotbuff["heavythrust"]) { damageformula *= 1.15; }
            if (ability.dotbuff["bloodforblood"]) { damageformula *= 1.30; }

              } else {
            if (heavythrust.buff > 0) { damageformula *= 1.15; }
            if (bloodforblood.buff > 0) { damageformula *= 1.30; }
              }

              if (lifesurge.buff > 0) { critroll = 0; lifesurge.buff = 0; } //lifesurge
              if (powersurge.buff > 0 && ability.name == "Jump") { damageformula *= 1.5; powersurge.buff = 0; }
              if (critroll <= critchance) {
            numberofcrits += 1;

            MainWindow.log("!!CRIT!! - ", false);
            damageformula *= 1.5;
            if (dot) {
              ability.tickcrits += 1;
            } else {
              //normal attack crit
              ability.crits += 1;
            }
              }

              // added variance to damage.
              damageformula = ((MainWindow.d100(-500, 500) / 10000) + 1) * (int)damageformula;
              return (int)damageformula;
        }
Example #6
0
        public override void execute(ref Ability ability)
        {
            if (ability.name == "Regen" && shroudofsaints.buff > 0) {
            MainWindow.log(MainWindow.time.ToString("F2") + " - " + "MP is " + MP + ".");
            MP += 212;
            if (MP > MPMax) { MP = MPMax; }
            MainWindow.log(MainWindow.time.ToString("F2") + " - " + "Shroud of Saints refreshes 212 MP. MP is now " + MP + ".");
              }

              base.execute(ref ability);
        }
Example #7
0
        public WhiteMage()
        {
            name = "White Mage";
              classname = "Conjurer";

              shroudofsaints = new ShroudOfSaints();
              cureii = new CureII();
              cure = new Cure();
              whmregen = new WHMRegen();
              feylight = new FeyLight();
              feyglow = new FeyGlow();
              regen = new Regen();
              medica = new Medica();
              medicaii = new MedicaII();
              cureiii = new CureIII();
        }
Example #8
0
        public override void impact(ref Ability ability)
        {
            if (ability.name == "Invigorate") {
            TP += 500;
            MainWindow.log(MainWindow.time.ToString("F2") + " - " + ability.name + " used. 400 TP Restored. TP is " + (TP - 400) + " => " + TP);
            if (OOT) {
              OOT = false;
              nextability = MainWindow.time;
            }
              }

              //var critchance = calculateCrit(_player);
              //set potency for now, but change to damage later.
              var accroll = (MainWindow.d100(1, 10001)) / 100;

              if (ability.abilityType == "Cooldown") {
            ability.hits += 1;
              }

              if (ability.abilityType == "Weaponskill" || (ability.abilityType == "Instant")) {
            numberofattacks += 1;
            ability.swings += 1;
            if (accroll < calculateACC()) {
              //Forms
              if (ability.name == "Bootshine" || ability.name == "Dragon Kick") { form = Form.Raptor; }
              if (ability.name == "True Strike" || ability.name == "Twin Snakes") { form = Form.Couerl; }
              if (ability.name == "Snap Punch" || ability.name == "Demolish") { form = Form.OpoOpo; }
              if (ability.name == "Snap Punch" || ability.name == "Demolish") { glstacks += 1; if (glstacks > 3) { glstacks = 3; } }

              double thisdamage = damage(ref ability, ability.potency);

              numberofhits += 1;
              ability.hits += 1;

              totaldamage += (int)thisdamage;
              ability.damage += thisdamage;
              MainWindow.log(MainWindow.time.ToString("F2") + " - " + ability.name + " Deals " + thisdamage + " Damage. Next ability at: " + nextability);
            } else {
              numberofmisses += 1;
              ability.misses += 1;
              MainWindow.log("!!MISS!! - " + MainWindow.time.ToString("F2") + " - " + ability.name + " missed! Next ability at: " + ability.nextCast);
              // Does heavyshot buff get eaten by a miss?
            }
              }
              if (ability.abilityType == "AUTOA") {
            numberofattacks += 1;
            ability.swings += 1;
            if (accroll < calculateACC()) {
              var thisdamage = damage(ref ability, ability.potency);
              numberofhits += 1;
              ability.hits += 1;
              totaldamage += thisdamage;
              ability.damage += thisdamage;
              MainWindow.log(MainWindow.time.ToString("F2") + " - " + ability.name + " Deals " + thisdamage + " Damage. Next AA at: " + ability.nextCast);
            } else {
              autoattack.misses += 1;
              numberofmisses += 1;
              MainWindow.log("!!MISS!! - " + MainWindow.time.ToString("F2") + " - " + ability.name + " missed! Next AA at: " + ability.nextCast);
            }
              }

              // If ability has debuff, create its timer.
              if (ability.debuffTime > 0 && accroll < calculateACC()) {
            if (ability.debuff > 0) {
              MainWindow.log(MainWindow.time.ToString("F2") + " - " + ability.name + "  DOT clipped.");
              //reset all buffs if clipping
              ability.dotbuff["internalrelease"] = false;
              ability.dotbuff["bloodforblood"] = false;
              ability.dotbuff["potion"] = false;
            }
            //If dot exists and ability doesn't miss, enable its time.

            ability.debuff = ability.debuffTime;

            if (internalrelease.buff > 0) { ability.dotbuff["internalrelease"] = true; }
            if (bloodforblood.buff > 0) { ability.dotbuff["bloodforblood"] = true; }
            if (xpotionstrength.buff > 0) { ability.dotbuff["potion"] = true; }

            MainWindow.log(MainWindow.time.ToString("F2") + " - " + ability.name + " DoT has been applied.  Time Left: " + ability.debuff);
              }
              if (ability.buffTime > 0 && accroll < calculateACC()) {
            ability.buff = ability.buffTime;
            MainWindow.log(MainWindow.time.ToString("F2") + " - " + ability.name + " buff has been activated.  Time Left: " + ability.buff + ". Next ability at: " + nextability);
              }
              //Add buffs to dots
        }
Example #9
0
        public override void impact(ref Ability ability)
        {
            //var critchance = calculateCrit(_player);
              //set potency for now, but change to damage later.
              var accroll = (MainWindow.d100(1, 10001)) / 100;

              if (ability.abilityType == "Cooldown") {
            ability.hits += 1;
              }

              if (ability.abilityType == "Weaponskill" || (ability.abilityType == "Instant")) {
            numberofattacks += 1;
            ability.attacks += 1;
            if (accroll < calculateACC()) {

              double thisdamage = damage(ref ability, ability.potency);

              if (MainWindow.disdebuff == true) {
            thisdamage = Math.Floor(thisdamage *= 1.12);
              }

              numberofhits += 1;
              ability.hits += 1;

              totaldamage += (int)thisdamage;
              ability.damage += thisdamage;
              MainWindow.log(MainWindow.time.ToString("F2") + " - " + ability.name + " Deals " + thisdamage + " Damage. Next ability at: " + nextability);
            } else {
              numberofmisses += 1;
              ability.misses += 1;
              MainWindow.log("!!MISS!! - " + MainWindow.time.ToString("F2") + " - " + ability.name + " missed! Next ability at: " + ability.nextCast);
              // Does heavyshot buff get eaten by a miss?
            }
              }
              if (ability.abilityType == "AUTOA") {
            autoattack.hits += 1;
            numberofattacks += 1;
            if (accroll < calculateACC()) {
              var thisdamage = damage(ref ability, ability.potency);
              numberofhits += 1;
              totaldamage += thisdamage;
              autoattack.damage += thisdamage;
              MainWindow.log(MainWindow.time.ToString("F2") + " - " + ability.name + " Deals " + thisdamage + " Damage. Next AA at: " + ability.nextCast);
            } else {
              autoattack.misses += 1;
              numberofmisses += 1;
              MainWindow.log("!!MISS!! - " + MainWindow.time.ToString("F2") + " - " + ability.name + " missed! Next AA at: " + ability.nextCast);
            }
              }

              // If ability has debuff, create its timer.
              if (ability.debuffTime > 0 && accroll < calculateACC()) {
            if (ability.debuff > 0) {
              MainWindow.log(MainWindow.time.ToString("F2") + " - " + ability.name + "  DOT clipped.");
              //reset all buffs if clipping
              ability.dotbuff[""] = false;
              ability.dotbuff["potion"] = false;
            }
            //If dot exists and ability doesn't miss, enable its time.

            ability.debuff = ability.debuffTime;

            if (cooldown1.buff > 0) { ability.dotbuff[""] = true; }
            if (xpotiondexterity.buff > 0) { ability.dotbuff["potion"] = true; }

            MainWindow.log(MainWindow.time.ToString("F2") + " - " + ability.name + " DoT has been applied.  Time Left: " + ability.debuff);
              }
              if (ability.buffTime > 0 && accroll < calculateACC()) {
            ability.buff = ability.buffTime;
            MainWindow.log(MainWindow.time.ToString("F2") + " - " + ability.name + " buff has been activated.  Time Left: " + ability.buff + ". Next ability at: " + nextability);
              }
              //Add buffs to dots
        }
Example #10
0
        //public virtual void expire() { } not really needed. Maybe handle expiration in ticks? hmmm.
        public virtual void tick(ref Ability ability)
        {
            //schedule tick
              if (MainWindow.time == MainWindow.servertime && ability.hot > 0) {
            ability.hot -= 1.0;
            if (ability.hot <= 0.0) {
              MainWindow.log(MainWindow.time.ToString("F2") + " - " + ability.name + " has fallen off.");
              //clear buffs from object.

              ability.dotbuff["potion"] = false;
              ability.dotbuff["song"] = false;
            }
              }
              if ((MainWindow.servertick == 3 && MainWindow.time == MainWindow.servertime) && (ability.hot > 0 && ability.hotPotency > 0)) {

            if (ability.name == "Medica II") {
              for (var x = 1; x <= medicaiitargets; ++x) {
            numberofticks += 1;
            ability.ticks += 1;
            var tickheal = damage(ref ability, ability.hotPotency, true);
            ability.hotheals += tickheal;
            totaldamage += tickheal;
            MainWindow.log(MainWindow.time.ToString("F2") + " - " + ability.name + " is ticking now for " + tickheal + " HP on target " + x + ". - Time Left: " + ability.hot);
              }
            } else {
              numberofticks += 1;
              ability.ticks += 1;
              var tickheal = damage(ref ability, ability.hotPotency, true);
              ability.hotheals += tickheal;
              totaldamage += tickheal;
              MainWindow.log(MainWindow.time.ToString("F2") + " - " + ability.name + " is ticking now for " + tickheal + " HP - Time Left: " + ability.hot);
            }
              }
        }
Example #11
0
File: Job.cs Project: Eein/chocobro
        public virtual void execute(ref Ability ability)
        {
            if (ability.abilityType == "AUTOA" && MainWindow.time >= ability.nextCast) {
            MainWindow.time = MainWindow.floored(MainWindow.time);
            MainWindow.log(MainWindow.time.ToString("F2") + " - Executing " + ability.name);
            ability.nextCast = MainWindow.floored((MainWindow.time + ability.recastTime));
            nextauto = MainWindow.floored((MainWindow.time + ability.recastTime));
            impact(ref ability);
              }

              if (ability.abilityType == "PETSPELL" && MainWindow.time >= ability.nextCast) {
            MainWindow.time = MainWindow.floored(MainWindow.time);
            MainWindow.log(MainWindow.time.ToString("F2") + " - Pet Casting " + ability.name);
            ability.nextCast = MainWindow.floored((MainWindow.time + ability.recastTime));
            actionmade = true;
            ability.casting = true;
            ability.endcast = MainWindow.floored(MainWindow.time + calculateSGCD(ability.castTime));
              }

              if (ability.abilityType == "PETCOOLDOWN" && MainWindow.time >= ability.nextCast) {
            MainWindow.time = MainWindow.floored(MainWindow.time);
            MainWindow.log(MainWindow.time.ToString("F2") + " - Pet Executing " + ability.name);
            //if doesnt miss, then impact

            //set nextCast.
            ability.nextCast = MainWindow.floored((MainWindow.time + ability.recastTime));
            impact(ref ability);
              }

              if (ability.name == "Regen" && MainWindow.time >= ability.nextCast) {
            if (firsttp) {
              ability.nextCast = MainWindow.time + (MainWindow.d100(0, 300) / 100);
              firsttp = false;
            } else {
              MainWindow.time = MainWindow.floored(MainWindow.time);
              int tpbefore = TP;
              int mpbefore = MP;
              TP += 60;

              int tempmpgain = 0;
              if (name == "Black Mage" && stance == Stance.UI3) { tempmpgain = 2249;}
              if (name == "Black Mage" && stance == Stance.AF3) { tempmpgain = 0; }
              if (name != "Black Mage") { tempmpgain = (int)Math.Floor((double)MPMax * 0.02); }
              MP += tempmpgain;
              if (TP > 1000) { TP = 1000; tpgained += 1000 - tpbefore; } else { tpgained += 60; }
              if (MP > MPMax) { MP = MPMax; mpgained += MPMax - mpbefore; } else { mpgained += (int)Math.Floor((double)MP * 0.02); }
              MainWindow.log(MainWindow.time.ToString("F2") + " - TP/MP Regen tick. " + tpbefore + " => " + TP + " TP. " + mpbefore + " => " + MP + " MP.");
              nextregentick = MainWindow.time + 3;
              ability.nextCast = MainWindow.floored((MainWindow.time + 3));
              if (OOT) { nextability = MainWindow.time; }
              OOT = false;
              OOM = false;
            }
              }

              if (ability.abilityType == "Weaponskill" && !OOT) {

            //If time >= next cast time and time >= nextability)
            if (TP - ability.TPcost < 0 || MP - ability.MPcost < 0) { //attempted to not allow TP to be less than 0, needs to be remade
              if (TP - ability.TPcost < 0) { MainWindow.log("Was unable to execute " + ability.name + ". Not enough TP. Current TP is " + TP + "TP."); }

              //nextability = MainWindow.time;
              //force nextability to next server tick
              //if invigorate is used and OOM then it resets the time to now.
              nextability = nextregentick + 0.01;
              nextinstant = MainWindow.time;
              OOT = true;
              OOM = true;
            } else {

              if (MainWindow.time >= ability.nextCast && MainWindow.time >= nextability && actionmade == false) {
            //Get game time (remove decimal error)
            MainWindow.time = MainWindow.floored(MainWindow.time);
            if (ability.TPcost > 0) { MainWindow.log(MainWindow.time.ToString("F2") + " - Executing " + ability.name + ". Cost is " + ability.TPcost + "TP. TP is " + TP + " => " + (TP - ability.TPcost) + "."); }
            if (ability.MPcost > 0) { MainWindow.log(MainWindow.time.ToString("F2") + " - Executing " + ability.name + ". Cost is " + ability.MPcost + "MP. MP is " + MP + " => " + (MP - ability.MPcost) + "."); }

            TP -= ability.TPcost;
            tpused += ability.TPcost;
            //if doesnt miss, then impact

            //set nextCast.
            ability.nextCast = MainWindow.floored((MainWindow.time + calculateGCD()));

            //set nextability
            nextability = MainWindow.floored((MainWindow.time + calculateGCD()));
            nextinstant = MainWindow.floored((MainWindow.time + ability.animationDelay + (MainWindow.d100(MainWindow.lowerlag, MainWindow.upperlag)) / 1000));

            //time = nextTime(nextinstant, nextability);
            actionmade = true;

            //var critroll = d100.Next(1, 101);
            // var critbonus = calculateCrit();
            impact(ref ability);
              }
            }
              }
              if (ability.abilityType == "Instant" || ability.abilityType == "Cooldown" || ability.abilityType == "HealInstant") {
            //If time >= next cast time and time >= nextability)
            if (MainWindow.time >= ability.nextCast && MainWindow.time >= nextinstant) { //&& nextability > MainWindow.time + ability.animationDelay is what i added
              //Get game time (remove decimal error)
              MainWindow.time = MainWindow.floored(MainWindow.time);
              MainWindow.log(MainWindow.time.ToString("F2") + " - Executing " + ability.name);
              //if doesnt miss, then impact

              //set nextCast.
              ability.nextCast = MainWindow.floored((MainWindow.time + ability.recastTime));

              //feylight/glow
              if (ability.name == "Fey Light") { flight = true; }
              if (ability.name == "Fey Glow") { fglow = true; }

              //set nextability
              if (MainWindow.time + ability.animationDelay > nextability) {
            nextability = MainWindow.floored((MainWindow.time + ability.animationDelay));
              }

              nextinstant = MainWindow.floored((MainWindow.time + ability.animationDelay + (MainWindow.d100(MainWindow.lowerlag, MainWindow.upperlag)) / 1000));
              impact(ref ability);
            }
              }

              if (ability.abilityType == "Spell" || ability.abilityType == "HealSpell") {
            if (ability.MPcost <= MP) {
              if (MainWindow.time >= ability.nextCast && MainWindow.time >= nextability && actionmade == false) {
            MainWindow.time = MainWindow.floored(MainWindow.time);
            string swifttext = "";
            if (swift) { swifttext = "Swift"; }
            MainWindow.log(MainWindow.time.ToString("F2") + " - " + swifttext + "Casting " + ability.name + ". MP is " + MP + ".");
            double tempnextab = 0;
            double tempnextin = 0;
            double casttime = ability.castTime;
            if (stance == Stance.AF3 && ability.name == "Blizzard III") { casttime /= 2; }
            if (stance == Stance.UI3 && ability.name == "Fire III") { casttime /= 2; }
            if (swift == true) { casttime = 0.02; swift = false; }
            if (calculateSGCD(casttime) < calculateSGCD(2.5)) { tempnextab = calculateSGCD(2.5); tempnextin = calculateSGCD(casttime); } else { tempnextab = calculateSGCD(casttime); tempnextin = calculateSGCD(casttime); }

            nextability = MainWindow.floored(MainWindow.time + tempnextab);
            nextinstant = MainWindow.floored((MainWindow.time + tempnextin));
            ability.nextCast = nextability;
            actionmade = true;
            ability.casting = true;
            ability.endcast = MainWindow.floored(MainWindow.time + tempnextin);

              }
            } else { MainWindow.log("Was unable to execute " + ability.name + ". Not enough MP. Current MP is " + MP + "MP."); }
              }
        }
Example #12
0
 //public virtual void expire() { } not really needed. Maybe handle expiration in ticks? hmmm.
 public virtual void tick(ref Ability ability)
 {
     //schedule tick
       if (MainWindow.time == MainWindow.servertime && ability.debuff > 0) {
     ability.debuff -= 1.0;
     if (ability.debuff <= 0.0) {
       MainWindow.log(MainWindow.time.ToString("F2") + " - " + ability.name + " has fallen off.");
       //clear buffs from object.
       ability.dotbuff["heavythrust"] = false;
       ability.dotbuff["bloodforblood"] = false;
       ability.dotbuff["potion"] = false;
     }
       }
       if ((MainWindow.servertick == 3 && MainWindow.time == MainWindow.servertime) && (ability.debuff > 0 && ability.dotPotency > 0)) {
     numberofticks += 1;
     ability.ticks += 1;
     var tickdmg = damage(ref ability, ability.dotPotency, true);
     ability.dotdamage += tickdmg;
     totaldamage += tickdmg;
     MainWindow.log(MainWindow.time.ToString("F2") + " - " + ability.name + " is ticking now for " + tickdmg + "  Damage - Time Left: " + ability.debuff);
     //MainWindow.log("---- " + ability.name + " - Dots - RS: " + ability.dotbuff["ragingstrikes"] + " BFB: " + ability.dotbuff["bloodforblood"] + " SS: " + ability.dotbuff["straightshot"] + " HE: " + ability.dotbuff["hawkseye"] + " IR: " + ability.dotbuff["internalrelease"] + " Potion: " + ability.dotbuff["potion"]);
       }
 }
Example #13
0
 public override void execute(ref Ability ability)
 {
     //barrage interactions
       if (ability.abilityType == "AUTOA" && MainWindow.time >= ability.nextCast) {
     if (barrage.buff > 0) {
       MainWindow.time = MainWindow.floored(MainWindow.time);
       MainWindow.log(MainWindow.time.ToString("F2") + " - Executing " + ability.name);
       impact(ref ability);
       MainWindow.log(MainWindow.time.ToString("F2") + " - Executing " + ability.name);
       impact(ref ability);
     }
       }
       base.execute(ref ability);
 }
Example #14
0
 //public virtual void expire() { } not really needed. Maybe handle expiration in ticks? hmmm.
 public virtual void tick(ref Ability ability)
 {
     //schedule tick
       if (MainWindow.time == MainWindow.servertime && ability.debuff > 0) {
     ability.debuff -= 1.0;
     if (ability.debuff <= 0.0) {
       MainWindow.log(MainWindow.time.ToString("F2") + " - " + ability.name + " has fallen off.");
       //clear buffs from object.
       ability.dotbuff["raginstrikes"] = false;
       ability.dotbuff["potion"] = false;
     }
       }
       if ((MainWindow.servertick == 3 && MainWindow.time == MainWindow.servertime) && ability.debuff > 0) {
     var tickdmg = damage(ref ability, ability.dotPotency, true);
     ability.ticks += 1;
     ability.dotdamage += tickdmg;
     totaldamage += tickdmg;
     MainWindow.log(MainWindow.time.ToString("F2") + " - " + ability.name + " is ticking now for " + tickdmg + "  Damage - Time Left: " + ability.debuff);
     if (ability.name == "Thunder" || ability.name == "Thunder II" || ability.name == "Thunder III" || ability.name == "Thunder III (TCP)") {
       if (MainWindow.d100(1, 100) <= 5) {
     MainWindow.log("!!PROC!! - Thundercloud");
     ability.procs += 1;
     thundercloud = true;
       }
     }
     //MainWindow.log("---- " + ability.name + " - Dots - RS: " + ability.dotbuff["ragingstrikes"] + " BFB: " + ability.dotbuff["bloodforblood"] + " SS: " + ability.dotbuff["straightshot"] + " HE: " + ability.dotbuff["hawkseye"] + " IR: " + ability.dotbuff["internalrelease"] + " Potion: " + ability.dotbuff["potion"]);
       }
 }
Example #15
0
        public override void impact(ref Ability ability)
        {
            lastability = ability.name;
              ability.swings += 1;
              if (ability.name == "Swiftcast") {
            opener += 1;
            swift = true;
            MainWindow.log(MainWindow.time.ToString("F2") + " - " + ability.name + " used.");

              }
              if (ability.name == "Transpose" && stance == Stance.UI3) { UIstacks = 0; AFstacks = 1; stance = Stance.AF1; }

              if (ability.name == "Convert") { opener += 1; MP += (int)(0.3 * MPMax); ; }
              if (opener <= 6 && ability.name == "Thunder II") { opener += 1; }
              if (opener <= 6 && ability.name == "Flare") { opener += 1; }
              if (opener <= 6 && ability.name == "Convert") { opener += 1; }
              if (opener <= 6 && ability.name == "Fire III") { opener += 1; }
              if (opener <= 6 && ability.name == "Fire" && MP >= 938 && MP <= 1576) { opener += 1; }

              //var critchance = calculateCrit(_player);
              //set potency for now, but change to damage later.
              var accroll = (MainWindow.d100(1, 10001)) / 100;

              if (ability.abilityType == "Cooldown") {

              }

              if (ability.abilityType == "Weaponskill" || (ability.abilityType == "Instant")) {

            if (accroll < calculateACC()) {

              double thisdamage = damage(ref ability, ability.potency);

              totaldamage += (int)thisdamage;
              ability.damage += thisdamage;
              MainWindow.log(MainWindow.time.ToString("F2") + " - " + ability.name + " Deals " + thisdamage + " Damage. Next ability at: " + nextability);
            } else {
              ability.misses += 1;
              MainWindow.log("!!MISS!! - " + MainWindow.time.ToString("F2") + " - " + ability.name + " missed! Next ability at: " + ability.nextCast);
              // Does heavyshot buff get eaten by a miss?
            }
              }

              if (ability.abilityType == "Spell") {

            if (accroll < calculateACC()) {
              ability.hits += 1;

              double thisdamage = damage(ref ability, ability.potency);
              int mpbefore = MP;
              int mpcost = 0;
              mpcost = ability.MPcost;
              if (ability.name == "Thunder III (TCP)") { thunder.debuff = 0; thunderii.debuff = 0; thunderiiitcp.debuff = 0; }
              if (AFstacks == 3 && ability.aspect == "Fire") { mpcost = (ability.MPcost * 2); }
              if (AFstacks == 3 && ability.aspect == "Ice") { mpcost = (ability.MPcost / 4); }
              if (UIstacks == 3 && ability.aspect == "Fire") { mpcost = (ability.MPcost / 4); }
              if (ability.name == "Flare") { mpcost = MP; }
              mpused += mpcost;
              MP -= mpcost;
              totaldamage += (int)Math.Round(thisdamage);
              ability.damage += (int)Math.Round(thisdamage);
              if (ability.name == "Fire III") { AFstacks = 3; UIstacks = 0; stance = Stance.AF3; }
              if (ability.name == "Ice III") { UIstacks = 3; AFstacks = 0; stance = Stance.UI3; }
              if (ability.name == "Fire III (FSP)") { UIstacks = 0; stance = Stance.AF3; AFstacks = 3; firestarter = false; firestartercheck = 0; }
              MainWindow.log(MainWindow.time.ToString("F2") + " - " + ability.name + " Deals " + thisdamage + " Damage. Next ability at: " + nextability + ". MP is now " + MP + ". Times used: " + ability.swings + "Times hit: " + ability.hits + " Total Damage: " + totaldamage + ". Opener: " + opener);

              if (ability.name == "Fire") {
            if (MainWindow.d100(1, 100) <= 40) {
              MainWindow.log("!!PROC!! - Firestarter!");
              ability.procs += 1;
              firestarter = true;
            }
              }

            } else {
              ability.misses += 1;
              MainWindow.log("!!MISS!! - " + MainWindow.time.ToString("F2") + " - " + ability.name + " missed! Next ability at: " + ability.nextCast);
              // Does heavyshot buff get eaten by a miss?
            }
              }

              if (ability.abilityType == "HealSpell") {

            double thisheal = damage(ref ability, ability.potency);
            int mpbefore = MP;
            mpused += ability.MPcost;
            totalhealed += (int)thisheal;
            ability.heals += thisheal;
            MainWindow.log(MainWindow.time.ToString("F2") + " - " + ability.name + " Heals " + thisheal + " HP. MP " + mpbefore + " => " + MP + ". Next ability at: " + nextability);
              }

              // If ability has debuff, create its timer.
              if (ability.debuffTime > 0 && accroll < calculateACC()) {
            if (ability.debuff > 0) {
              MainWindow.log(MainWindow.time.ToString("F2") + " - " + ability.name + "  DOT clipped.");
              //reset all buffs if clipping
              ability.dotbuff["raginstrikes"] = false;
              ability.dotbuff["potion"] = false;
            }
            //If dot exists and ability doesn't miss, enable its time.

            ability.debuff = ability.debuffTime;

            if (ragingstrikes.buff > 0) { ability.dotbuff["ragingstrikes"] = true; }
            if (xpotionintelligence.buff > 0) { ability.dotbuff["potion"] = true; }

            MainWindow.log(MainWindow.time.ToString("F2") + " - " + ability.name + " DoT has been applied.  Time Left: " + ability.debuff);
              }
              if (ability.buffTime > 0 && accroll < calculateACC()) {
            ability.buff = ability.buffTime;
            MainWindow.log(MainWindow.time.ToString("F2") + " - " + ability.name + " buff has been activated.  Time Left: " + ability.buff + ". Next ability at: " + nextability);
              }
              //Add buffs to dots
        }
Example #16
0
 public override void execute(ref Ability ability)
 {
     base.execute(ref ability);
 }
Example #17
0
        public override void impact(ref Ability ability)
        {
            if (ability.name == "Invigorate") {
            TP += 500;
            MainWindow.log(MainWindow.time.ToString("F2") + " - " + ability.name + " used. 500 TP Restored. TP is " + (TP - 500) + " => " + TP);
            if (OOT) {
              OOT = false;
              nextability = MainWindow.time;
            }
              }
              //var critchance = calculateCrit(_player);
              //set potency for now, but change to damage later.
              var accroll = (MainWindow.d100(1, 10001)) / 100;

              if (ability.abilityType == "Cooldown") {
            ability.hits += 1;
              }

              if (ability.abilityType == "Weaponskill" || (ability.abilityType == "Instant")) {
            numberofattacks += 1;
            ability.swings += 1;
            if (accroll < calculateACC()) {

              // change states for combos here...
              if (ability.name == "Heavy Thrust") { combo = Combo.DRGNone; }

              if (ability.name == "Impulse Drive") { combo = Combo.Disembowel; }
              if (ability.name == "Disembowel") { combo = Combo.ChaosThrust; }
              if (ability.name == "Chaos Thrust") { combo = Combo.DRGNone; }

              if (ability.name == "True Thrust") { combo = Combo.VorpalThrust; }
              if (ability.name == "Vorpal Thrust") { combo = Combo.FullThrust; }
              if (ability.name == "Full Thrust") { combo = Combo.DRGNone; }

              if (ability.name == "Phlebotomize") { combo = Combo.DRGNone; }

              //

              double thisdamage = damage(ref ability, ability.potency);

              if (disembowel.debuff > 0) {
            thisdamage = Math.Floor(thisdamage *= 1.12);
              }

              numberofhits += 1;
              ability.hits += 1;

              totaldamage += (int)thisdamage;
              ability.damage += thisdamage;
              MainWindow.log(MainWindow.time.ToString("F2") + " - " + ability.name + " Deals " + thisdamage + " Damage. Next ability at: " + nextability);
            } else {
              numberofmisses += 1;
              ability.misses += 1;
              MainWindow.log("!!MISS!! - " + MainWindow.time.ToString("F2") + " - " + ability.name + " missed! Next ability at: " + ability.nextCast);

            }
              }
              if (ability.abilityType == "AUTOA") {
            autoattack.hits += 1;
            numberofattacks += 1;
            if (accroll < calculateACC()) {
              var thisdamage = damage(ref ability, ability.potency);
              numberofhits += 1;
              totaldamage += thisdamage;
              autoattack.damage += thisdamage;
              MainWindow.log(MainWindow.time.ToString("F2") + " - " + ability.name + " Deals " + thisdamage + " Damage. Next AA at: " + ability.nextCast);
            } else {
              autoattack.misses += 1;
              numberofmisses += 1;
              MainWindow.log("!!MISS!! - " + MainWindow.time.ToString("F2") + " - " + ability.name + " missed! Next AA at: " + ability.nextCast);
            }
              }

              // If ability has debuff, create its timer.
              if (ability.debuffTime > 0 && accroll < calculateACC()) {
            if (ability.debuff > 0 && ability.dotPotency > 0) {
              MainWindow.log(MainWindow.time.ToString("F2") + " - " + ability.name + "  DOT clipped.");
              //reset all buffs if clipping
              ability.dotbuff["heavythrust"] = false;
              ability.dotbuff["bloodforblood"] = false;
              ability.dotbuff["potion"] = false;
            }
            //If dot exists and ability doesn't miss, enable its time.

            ability.debuff = ability.debuffTime;
            if (heavythrust.buff > 0) { ability.dotbuff["heavythrust"] = true; }
            if (bloodforblood.buff > 0) { ability.dotbuff["bloodforblood"] = true; }
            if (xpotionstrength.buff > 0) { ability.dotbuff["potion"] = true; }

            if (ability.dotPotency > 0) {
              MainWindow.log(MainWindow.time.ToString("F2") + " - " + ability.name + " DoT has been applied.  Time Left: " + ability.debuff);
            } else {
              MainWindow.log(MainWindow.time.ToString("F2") + " - " + ability.name + " Debuff has been applied.  Time Left: " + ability.debuff);
            }
              }
              if (ability.buffTime > 0 && accroll < calculateACC()) {
            ability.buff = ability.buffTime;
            MainWindow.log(MainWindow.time.ToString("F2") + " - " + ability.name + " buff has been activated.  Time Left: " + ability.buff + ". Next ability at: " + nextability);
              }
              //Add buffs to dots
        }
Example #18
0
        public override void execute(ref Ability ability)
        {
            //barrage interactions

              if (ability.abilityType == "AUTOA" && MainWindow.time >= ability.nextCast) {
            if (barrage.buff > 0) {
              MainWindow.time = MainWindow.floored(MainWindow.time);
              MainWindow.log(MainWindow.time.ToString("F2") + " - Executing " + ability.name);
              impact(ref ability);
              MainWindow.log(MainWindow.time.ToString("F2") + " - Executing " + ability.name);
              impact(ref ability);
            }
              }

              if (ability.nextCast <= MainWindow.time) {
            if (ability.name == "Regen" && song == Song.ArmysPaeon) {
              if (MP >= 133) {
            tpgained += 30;
            MP -= 133;
            MainWindow.log(MainWindow.time.ToString("F2") + " - Extra TP. " + TP + " => " + (TP + 30) + " TP.  MP is now " + MP + ".");
            TP += 30;
              } else {
            tpgained += 30;
            MP = 0;
            MainWindow.log(MainWindow.time.ToString("F2") + " - Extra TP. " + TP + " => " + (TP + 30) + " TP.  MP is now " + 0 + ". Song is now off.");
            TP += 30;
            song = Song.None;
              }
            }
            base.execute(ref ability);
              }
        }
Example #19
0
 public Dragoon()
 {
     name = "Dragoon";
       classname = "Lancer";
       xpotionstrength = new XPotionStrength(this);
 }
Example #20
0
        public override void impact(ref Ability ability)
        {
            //var critchance = calculateCrit(_player);
              //if (bard.straightshot.buff > 0) {  critchance += 10; }
              //set potency for now, but change to damage later.
              var accroll = (MainWindow.d100(1, 10001)) / 100;

              if (ability.name == "Army's Paeon") { song = Song.ArmysPaeon; }
              if (ability.name == "Invigorate") {
            var tpbefore = TP;
            TP += 400;
            //tpgained += 400;
            if (TP > 1000) { TP = 1000; tpgained += 1000 - tpbefore; } else { tpgained += 400; }
            MainWindow.log(MainWindow.time.ToString("F2") + " - " + ability.name + " used. 400 TP Restored. TP is " + (TP - 400) + " => " + TP);
            if (OOT) {
              OOT = false;
              nextability = MainWindow.time;
            }
              }

              if (ability.abilityType == "Cooldown") {
            ability.hits += 1;
              }

              if (ability.abilityType == "Weaponskill" || (ability.abilityType == "Instant")) {
            numberofattacks += 1;
            ability.swings += 1;
            if (accroll <= calculateACC() || hawkseye.buff > 0) {

              double thisdamage = damage(ref ability, ability.potency);

              if (MainWindow.disdebuff == true) {
            thisdamage = Math.Floor(thisdamage *= 1.12);
              }

              numberofhits += 1;
              ability.hits += 1;

              totaldamage += (int)thisdamage;
              ability.damage += thisdamage;
              MainWindow.log(MainWindow.time.ToString("F2") + " - " + ability.name + " Deals " + thisdamage + " Damage. Next ability at: " + nextability);
              if (ability.name == "Straight Shot") {
            heavyshot.buff = 0;
              }
              if (ability.name == "Heavy Shot") {
            double buffroll = MainWindow.d100(1, 101);
            if (20 >= buffroll) {
              heavyshot.buff = 10;
              heavyshot.procs += 1;
              MainWindow.log("!!PROC!! - Heavier Shot. Time Left: " + ability.buff);
            }
              }
            } else {
              numberofmisses += 1;
              ability.misses += 1;
              MainWindow.log("!!MISS!! - " + MainWindow.time.ToString("F2") + " - " + ability.name + " missed! Next ability at: " + ability.nextCast);
              // Does heavyshot buff get eaten by a miss?
              if (ability.name == "Straight Shot") {
            heavyshot.buff = 0;
              }
            }
              }
              if (ability.abilityType == "AUTOA") {
            autoattack.hits += 1;
            ability.swings += 1;
            numberofattacks += 1;
            if (accroll < calculateACC()) {
              double thisdamage = damage(ref ability, ability.potency);

              if (MainWindow.disdebuff == true) {
            thisdamage = Math.Floor(thisdamage *= 1.12);
              }
              numberofhits += 1;
              totaldamage += (int)thisdamage;
              autoattack.damage += thisdamage;
              MainWindow.log(MainWindow.time.ToString("F2") + " - " + ability.name + " Deals " + thisdamage + " Damage. Next AA at: " + ability.nextCast);
            } else {
              autoattack.misses += 1;
              numberofmisses += 1;
              MainWindow.log("!!MISS!! - " + MainWindow.time.ToString("F2") + " - " + ability.name + " missed! Next AA at: " + ability.nextCast);
            }
              }
              if (ability.abilityType == "Spell") {
            ability.hits += 1;
            MainWindow.log(MainWindow.time.ToString("F2") + " - " + ability.name + " now activated.");
              }

              // If ability has debuff, create its timer.
              if (ability.debuffTime > 0 && accroll < calculateACC()) {
            if (ability.debuff > 0) {
              MainWindow.log(MainWindow.time.ToString("F2") + " - " + ability.name + "  DOT clipped.");
              //reset all buffs if clipping
              ability.dotbuff["ragingstrikes"] = false;
              ability.dotbuff["bloodforblood"] = false;
              ability.dotbuff["straightshot"] = false;
              ability.dotbuff["hawkseye"] = false;
              ability.dotbuff["internalrelease"] = false;
              ability.dotbuff["potion"] = false;
              ability.dotbuff["song"] = false;
            }
            //If dot exists and ability doesn't miss, enable its time.

            ability.debuff = ability.debuffTime;

            if (ragingstrikes.buff > 0) { ability.dotbuff["ragingstrikes"] = true; }
            if (bloodforblood.buff > 0) { ability.dotbuff["bloodforblood"] = true; }
            if (straightshot.buff > 0) { ability.dotbuff["straightshot"] = true; }
            if (hawkseye.buff > 0) { ability.dotbuff["hawkseye"] = true; }
            if (internalrelease.buff > 0) { ability.dotbuff["internalrelease"] = true; }
            if (xpotiondexterity.buff > 0) { ability.dotbuff["potion"] = true; }
            if (song == Song.ArmysPaeon) { ability.dotbuff["song"] = true; }

            MainWindow.log(MainWindow.time.ToString("F2") + " - " + ability.name + " DoT has been applied.  Time Left: " + ability.debuff);
              }
              if (ability.buffTime > 0 && accroll < calculateACC()) {
            ability.buff = ability.buffTime;
            MainWindow.log(MainWindow.time.ToString("F2") + " - " + ability.name + " buff has been activated.  Time Left: " + ability.buff + ". Next ability at: " + nextability);
              }
              //Add buffs to dots
        }
Example #21
0
File: Job.cs Project: Eein/chocobro
        public virtual void decrement(ref Ability ability)
        {
            if (MainWindow.time == MainWindow.servertime && ability.buff > 0) {

            ability.buff -= 1.0;
            if (ability.buff <= 0.0) {
              if (ability.name == "Fey Light") {
            flight = false;
              }
              if (ability.name == "Fey Glow") {
            fglow = false;
              }
              MainWindow.log(MainWindow.time.ToString("F2") + " - " + ability.name + " has fallen off.");
            }
              }
        }
Example #22
0
        public int damage(ref Ability ability, int pot, bool dot = false)
        {
            double damageformula = 0.0;
              double tempdex = DEX;
              //potion check
              if (xpotiondexterity.buff > 0 || (dot == true && ability.dotbuff["potion"] == true)) {
            //check for max dex increase from pot - NEEDS to be refactored...

            if (percentageOfStat(xpotiondexterity.percent, tempdex) > xpotiondexterity.bonus) {
              //MainWindow.log("yolo: " + percentageOfStat(xpotiondexterity.percent, tempdex) + " tempdex " + tempdex);
              tempdex += xpotiondexterity.bonus;
              //MainWindow.log("capBonus Dex from potion: " + xpotiondexterity.bonus + " percent of stat: " + percentageOfStat(xpotiondexterity.percent, tempdex));
            } else {
              tempdex += percentageOfStat(xpotiondexterity.percent, tempdex);
              //MainWindow.log("smBonus Dex from potion: " + percentageOfStat(xpotiondexterity.percent, tempdex));
            }
              }
              //end potion check

              if (hawkseye.buff > 0 || ((dot) && ability.dotbuff["hawkseye"])) { tempdex *= 1.15; }
              if (ability.abilityType == "Weaponskill" || ability.abilityType == "Instant") {
            damageformula = ((double)pot / 100) * (WEP * .2714745 + tempdex * .1006032 + (DTR - 202) * .0241327 + WEP * tempdex * .0036167 + WEP * (DTR - 202) * .0010800 - 1);

              }
              if (ability.abilityType == "AUTOA") {
            damageformula = (AADELAY / 3.00) * (WEP * .2714745 + tempdex * .1006032 + (DTR - 202) * .0241327 + WEP * tempdex * .0036167 + WEP * (DTR - 202) * .0010800 - 1);
              }

              //crit
              double critroll = MainWindow.d100(1, 1000001) / 10000; //critroll was only rolling an interger between 1-101. Now has the same precision as critchance.
              double critchance = 0;
              if (heavyshot.buff > 0 && ability.name == "Straight Shot") { critchance = 100; } else { critchance = 0.0697 * (double)CRIT - 18.437; } //Heavyshot interaction
              //MainWindow.log("CRIT CHANCE IS:" + critchance + " ROLL IS: " + critroll);
              if (dot) {
            if (ability.dotbuff["ragingstrikes"]) { damageformula *= 1.20; }
            if (ability.dotbuff["bloodforblood"]) { damageformula *= 1.10; }
            if (ability.dotbuff["straightshot"]) { critchance += 10; }
            if (ability.dotbuff["internalrelease"]) { critchance += 10; }
            if (ability.dotbuff["song"]) { damageformula *= 0.8; }

              } else {
            if (ragingstrikes.buff > 0 && ability.name != "Flaming Arrow") { damageformula *= 1.20; }
            if (bloodforblood.buff > 0 && ability.name != "Flaming Arrow") { damageformula *= 1.10; }
            if (straightshot.buff > 0) { critchance += 10; }
            if (internalrelease.buff > 0) { critchance += 10; }
              }

              if (critroll <= critchance) {
            numberofcrits += 1;

            MainWindow.log("!!CRIT!! - ", false);
            damageformula *= 1.5;
            if (dot) {
              ability.tickcrits += 1;
              //Bloodletter procs
              if (bloodletter.nextCast > MainWindow.time && ((ability.name == "Windbite" && windbite.debuff > 0) || (ability.name == "Venomous Bite" && venomousbite.debuff > 0))) {
            var dotRoll = MainWindow.d100(1, 101);
            if (dotRoll >= 50) {
              bloodletterreset = true;
            }
              }
            } else {
              //normal attack crit
              ability.crits += 1;
            }
              }

              // added variance to damage.
              damageformula = ((MainWindow.d100(-300, 300) / 10000) + 1) * (int)damageformula;
              return (int)damageformula;
        }
Example #23
0
File: Job.cs Project: Eein/chocobro
 public virtual void impact(ref Ability ability)
 {
     isstuck = false;
       //
 }
Example #24
0
        public override void impact(ref Ability ability)
        {
            if (ability.abilityType == "Cooldown") {
            ability.hits += 1;
              }

              if (ability.abilityType == "HealSpell" || ability.abilityType == "Weaponskill") {

            ability.hits += 1;

            if (ability.name == "Cure") {
              var freecureroll = MainWindow.d100(1, 100);
              if (freecureroll <= 15) {
            freecureproc = true; MainWindow.log(MainWindow.time.ToString("F2") + " - Freecure proc!");
              }

            }

            if (ability.name == "Cure II") {
              var overcureroll = MainWindow.d100(1, 100);
              if (overcureroll <= 15) { overcureproc = true; MainWindow.log(MainWindow.time.ToString("F2") + " - Overcure proc!"); }
            }

            int mpbefore = MP;
            int mpcost = 0;
            mpcost = ability.MPcost;
            if (freecureproc && ability.name == "Cure II") { mpcost = 0; freecureproc = false; }
            if (overcureproc && ability.name == "Cure III") { mpcost /= 2; overcureproc = false; }
            mpused += mpcost;
            MP -= mpcost;
            targets = 1;
            if (ability.name == "Cure III") { targets = (int)MainWindow.d100(5, 8); }
            if (ability.name == "Medica") { targets = (int)MainWindow.d100(6, 8); }
            if (ability.name == "Medica II") { targets = (int)MainWindow.d100(7, 8); medicaiitargets = targets; }
            if (ability.name != "Cure III" && ability.name != "Medica" && ability.name != "Medica II") {
              double thisdamage = damage(ref ability, ability.potency);
              totaldamage += (int)Math.Round(thisdamage);
              ability.damage += (int)Math.Round(thisdamage);
              MainWindow.log(MainWindow.time.ToString("F2") + " - " + ability.name + " Heals " + thisdamage + " HP. Next ability at: " + nextability + ". MP is now " + MP + ".");
            } else {
              for (var x = 1; x <= targets; ++x) {
            double thisdamage = damage(ref ability, ability.potency);
            totaldamage += (int)Math.Round(thisdamage);
            ability.damage += (int)Math.Round(thisdamage);
            MainWindow.log(MainWindow.time.ToString("F2") + " - " + ability.name + " Heals " + thisdamage + " HP to target " + x + ". Next ability at: " + nextability + ". MP is now " + MP + ".");
              }
            }
              }

              if (ability.hotTime > 0) {
            ability.hot = ability.hotTime;

            MainWindow.log(MainWindow.time.ToString("F2") + " - " + ability.name + " buff has been applied.  Time Left: " + ability.hot + ". Next ability at: " + nextability);
              }

              if (ability.buffTime > 0) {
            ability.buff = ability.buffTime;
            MainWindow.log(MainWindow.time.ToString("F2") + " - " + ability.name + " buff has been activated.  Time Left: " + ability.buff + ". Next ability at: " + nextability);
              }
              //Add buffs to dots
        }