// niklata's three school macro // Intelligent fully beneficial macro, with self-buffing. // Requires Decal plugin to be active. // Requires Keba's Toolset Beta. // Supports direct spell casting, thanks to Keba's plugin! // Timings are very aggressive; increase delays as necessary to fit the latency of your // connection and computer. // Starting conditions: // Focusing object held. Constants ///////////////////////////////////////////////////////////////////// // Constants in this section should be adjusted to fit you character! StamToMana = Stamina to Mana Self I Creature1Vuln = Vulnerability Self I Creature2Buff = Leadership Mastery Self II Creature2Vuln = Vulnerability Self II Creature3Buff = Leadership Mastery Self III Creature3Vuln = Vulnerability Self III Creature4Buff = Strength Self IV Creature4Vuln = Vulnerability Self IV Creature5Buff = Item Enchantment Mastery Self V Creature5Vuln = Vulnerability Self V Creature6Buff = Mana Conversion Mastery Self VI Creature6Vuln = Vulnerability Self VI Creature7Buff = asdf Creature7Vuln = Life1Vuln = Acid Vulnerability Self I Life2Buff = Revitalize Self II Life2Vuln = Acid Vulnerability Self II Life3Buff = Stamina to Mana Self III Life3Vuln = Acid Vulnerability Self III Life4Buff = Revitalize Self IV Life4Vuln = Acid Vulnerability Self IV Life5Buff = Revitalize Self V Life5Vuln = Acid Vulnerability Self V Life6Buff = Stamina to Mana Self VI Life6Vuln = Acid Vulnerability Self VI Life7Buff = asdf Life7Vuln = asdf Item2 = Hide Value II Item3 = Hide Value III Item4 = Hide Value IV Item5 = Hide Value V Item6 = Hide Value VI Item7 = asdf CreatureBuff1 = Focus Self V CreatureBuff2 = Endurance Self V CreatureBuff3 = Creature Enchantment Mastery Self V CreatureBuff4 = Life Magic Mastery Self V CreatureBuff5 = Willpower Self V LifeBuff1 = Rejuvenation Self VI LifeBuff2 = Mana Renewal Self VI // Adjust to suit your character, use buffed values from your cycle... MaxHealth = 155 MaxStam = 214 MaxMana = 262 ////////// // Calibration variables, not directly used in macro except to calibrate. LifeMaxLevel = 6 LifeMaxType = Vuln CreatureMaxLevel = 6 CreatureMaxType = Buff ItemMaxLevel = 6 LifeBuffLevel = 5 NumLifeBuffs = 2 CreatureBuffLevel = 5 NumCreatureBuffs = 5 ////////////////////////////////////////////////////////////////////////////////// // Constants in this section are still adjustable, but are not necessary to adjust // Tolerance for amount of quantity to be below max during/after regain cycle. StamSlack = 5 ManaSlack = 30 MinMana = 60 // Should equal the cost of your most expensive spell, to save comp burn // Min time per cycle, in ms MinCycleDel = 160000 MinLifeDel = 130000 MinItemDel = 130000 MinCreatureDel = 130000 MinRestTime = 15000 MinLifeBuffDel = 700000 MinCreatureBuffDel = 700000 // Max number of times to try to cast a spell from fizzles MaxTries = 5 /////////////////////////////////////////////////////////////////// // END OF USER ADJUSTABLE VARIABLES; ADJUST BELOW AT YOUR OWN RISK! // Timing variables LifeStart = 0 CreatureStart = 0 ItemStart = 0 LifeBuffStart = 0 CreatureBuffStart = 0 // Keeps track of which spell we are on. CurrentLife = 1 CurrentCreature = 1 CurrentItem = 1 CurrentLifeBuff = 1 CurrentCreatureBuff = 1 CurrentlyCasting = Life PreviouslyCasting = Life Temp = 0 // Set by auto-calibration NumLife = 0 NumCreature = 0 NumItem = 0 LifeBuffAt = 0 CreatureBuffAt = 0 End // This line is necessary to select the proper window SetActiveWindow Asheron's Call // Works magic. Invalid values mean that no spells will be cast where calibration // cannot be made. Procedure Calibrate_Macro If $LifeMaxLevel = 1 And $LifeMaxType = Vuln Compute $NumLife = 1 End If $LifeMaxLevel = 2 And $LifeMaxType = Buff Compute $NumLife = 2 End If $LifeMaxLevel = 2 And $LifeMaxType = Vuln Compute $NumLife = 3 End If $LifeMaxLevel = 3 And $LifeMaxType = Buff Compute $NumLife = 4 End If $LifeMaxLevel = 3 And $LifeMaxType = Vuln Compute $NumLife = 5 End If $LifeMaxLevel = 4 And $LifeMaxType = Buff Compute $NumLife = 6 End If $LifeMaxLevel = 4 And $LifeMaxType = Vuln Compute $NumLife = 7 End If $LifeMaxLevel = 5 And $LifeMaxType = Buff Compute $NumLife = 8 End If $LifeMaxLevel = 5 And $LifeMaxType = Vuln Compute $NumLife = 9 End If $LifeMaxLevel = 6 And $LifeMaxType = Buff Compute $NumLife = 10 End If $LifeMaxLevel = 6 And $LifeMaxType = Vuln Compute $NumLife = 11 End If $LifeMaxLevel = 7 And $LifeMaxType = Buff Compute $NumLife = 12 End If $LifeMaxLevel = 7 And $LifeMaxType = Vuln Compute $NumLife = 13 End If $CreatureMaxLevel = 1 And $LifeMaxType = Vuln Compute $NumCreature = 1 End If $CreatureMaxLevel = 2 And $LifeMaxType = Buff Compute $NumCreature = 2 End If $CreatureMaxLevel = 2 And $LifeMaxType = Vuln Compute $NumCreature = 3 End If $CreatureMaxLevel = 3 And $LifeMaxType = Buff Compute $NumCreature = 4 End If $CreatureMaxLevel = 3 And $LifeMaxType = Vuln Compute $NumCreature = 5 End If $CreatureMaxLevel = 4 And $LifeMaxType = Buff Compute $NumCreature = 6 End If $CreatureMaxLevel = 4 And $LifeMaxType = Vuln Compute $NumCreature = 7 End If $CreatureMaxLevel = 5 And $LifeMaxType = Buff Compute $NumCreature = 8 End If $CreatureMaxLevel = 5 And $LifeMaxType = Vuln Compute $NumCreature = 9 End If $CreatureMaxLevel = 6 And $LifeMaxType = Buff Compute $NumCreature = 10 End If $CreatureMaxLevel = 6 And $LifeMaxType = Vuln Compute $NumCreature = 11 End If $CreatureMaxLevel = 7 And $LifeMaxType = Buff Compute $NumCreature = 12 End If $CreatureMaxLevel = 7 And $LifeMaxType = Vuln Compute $NumCreature = 13 End If $ItemMaxLevel = 2 Compute $NumItem = 1 End If $ItemMaxLevel = 3 Compute $NumItem = 2 End If $ItemMaxLevel = 4 Compute $NumItem = 3 End If $ItemMaxLevel = 5 Compute $NumItem = 4 End If $ItemMaxLevel = 6 Compute $NumItem = 5 End If $ItemMaxLevel = 7 Compute $NumItem = 6 End If $LifeBuffLevel = 1 Compute $LifeBuffAt = 1 End If $LifeBuffLevel = 2 Compute $LifeBuffAt = 2 End If $LifeBuffLevel = 3 Compute $LifeBuffAt = 4 End If $LifeBuffLevel = 4 Compute $LifeBuffAt = 6 End If $LifeBuffLevel = 5 Compute $LifeBuffAt = 8 End If $LifeBuffLevel = 6 Compute $LifeBuffAt = 10 End If $LifeBuffLevel = 7 Compute $LifeBuffAt = 12 End If $CreatureBuffLevel = 1 Compute $CreatureBuffAt = 1 End If $CreatureBuffLevel = 2 Compute $CreatureBuffAt = 2 End If $CreatureBuffLevel = 3 Compute $CreatureBuffAt = 4 End If $CreatureBuffLevel = 4 Compute $CreatureBuffAt = 6 End If $CreatureBuffLevel = 5 Compute $CreatureBuffAt = 8 End If $CreatureBuffLevel = 6 Compute $CreatureBuffAt = 10 End If $CreatureBuffLevel = 7 Compute $CreatureBuffAt = 12 End End // Dynamically delay, taking into account the time it takes to select a spell Procedure Spell_Delay ClearPluginVar _Spellcast While _Spellcast <> Ready Delay 250 End End Procedure Casting_Mode If _CombatState = Spellcast Else Keys ` Delay 4000 End End Procedure Peace_Mode If _CombatState = Standing Else Keys ` Delay 4000 End End Procedure Lie_Down Delay 2000 If _CombatState = Spellcast Keys ` Delay 1500 End Keys B Delay 3000 End // Vestigal? Do I even need this? Procedure Bow_Dance Delay 1000 RandomTurn Delay 1000 End // Casts a S2M. Assumes character is in casting mode. Procedure S2M Compute $Temp = $MaxMana - $ManaSlack If _MyMana > $Temp //Say No need to cast S2M. Exit End Call Casting_Mode Say /cast $StamToMana Call Spell_Delay End // Gets back some stamina. Assumes character is already lying down. Procedure Regain_Stam Loop 1000 Compute $Temp = $MaxStam - $StamSlack If _MyStamina > $Temp Break End Delay 2000 End End // Gets back some mana. Assumes caster is already in casting mode. Procedure Regain_Mana Compute $Temp = $MaxStam - $StamSlack // Check to see if we already have enough mana for S2M If _MyStamina > $Temp // If so, S2M Call S2M Else // No, so regain mana to nearly full by rest-cycling. Call Lie_Down Call Regain_Stam Call S2M Call Casting_Mode // Must exit function in casting mode! End End Procedure CastLifeSpell // Select..Case would be really nice! If $CurrentLife = 1 Say /cast $Life1Vuln End If $CurrentLife = 2 Say /cast $Life2Buff End If $CurrentLife = 3 Say /cast $Life2Vuln End If $CurrentLife = 4 Say /cast $Life3Buff End If $CurrentLife = 5 Say /cast $Life3Vuln End If $CurrentLife = 6 Say /cast $Life4Buff End If $CurrentLife = 7 Say /cast $Life4Vuln End If $CurrentLife = 8 Say /cast $Life5Buff End If $CurrentLife = 9 Say /cast $Life5Vuln End If $CurrentLife = 10 Say /cast $Life6Buff End If $CurrentLife = 11 Say /cast $Life6Vuln End If $CurrentLife = 12 Say /cast $Life7Buff End If $CurrentLife = 13 Say /cast $Life7Vuln End End Procedure CastCreatureSpell If $CurrentCreature = 1 Say /cast $Creature1Vuln End If $CurrentCreature = 2 Say /cast $Creature2Buff End If $CurrentCreature = 3 Say /cast $Creature2Vuln End If $CurrentCreature = 4 Say /cast $Creature3Buff End If $CurrentCreature = 5 Say /cast $Creature3Vuln End If $CurrentCreature = 6 Say /cast $Creature4Buff End If $CurrentCreature = 7 Say /cast $Creature4Vuln End If $CurrentCreature = 8 Say /cast $Creature5Buff End If $CurrentCreature = 9 Say /cast $Creature5Vuln End If $CurrentCreature = 10 Say /cast $Creature6Buff End If $CurrentCreature = 11 Say /cast $Creature6Vuln End If $CurrentCreature = 12 Say /cast $Creature7Buff End If $CurrentCreature = 13 Say /cast $Creature7Vuln End End Procedure CastItemSpell If $CurrentItem = 1 Say /cast $Item2 End If $CurrentItem = 2 Say /cast $Item3 End If $CurrentItem = 3 Say /cast $Item4 End If $CurrentItem = 4 Say /cast $Item5 End If $CurrentItem = 5 Say /cast $Item6 End If $CurrentItem = 6 Say /cast $Item7 End End Procedure CastLifeBuffSpell If $CurrentLifeBuff = 1 Say /cast $LifeBuff1 End If $CurrentLifeBuff = 2 Say /cast $LifeBuff2 End End Procedure CastCreatureBuffSpell If $CurrentCreatureBuff = 1 Say /cast $CreatureBuff1 End If $CurrentCreatureBuff = 2 Say /cast $CreatureBuff2 End If $CurrentCreatureBuff = 3 Say /cast $CreatureBuff3 End If $CurrentCreatureBuff = 4 Say /cast $CreatureBuff4 End If $CurrentCreatureBuff = 5 Say /cast $CreatureBuff5 End End // Casts a spell. Should never be called except from Cast_Spell. Procedure Handle_Cast If $CurrentlyCasting = Life Call CastLifeSpell End If $CurrentlyCasting = Creature Call CastCreatureSpell End If $CurrentlyCasting = Item Call CastItemSpell End If $CurrentlyCasting = LifeBuff Call CastLifeBuffSpell End If $CurrentlyCasting = CreatureBuff Call CastCreatureBuffSpell End Call Spell_Delay End // Attempts to cast a spell. If not enough mana, regains it and casts. Procedure Cast_Spell Loop $MaxTries // Get mana if necessary If _MyMana < $MinMana Delay 2000 Call Regain_Mana Delay 2000 End // Actually cast the spell, handles delay Call Handle_Cast // Handle failures If _Failure = Insufficient Mana // OOM: get mana back, count as fizzle Call Regain_Mana Continue End If _Failure = Too Busy // Not yet ready to cast, count as fizzle Continue End Call Spell_Delay If _Failure = Fizzle // Fizzled Continue End If _Failure = Charge // Shouldn't happen, count as fizzle Continue End Break End End Procedure BuffLife SetConst PreviouslyCasting = $CurrentlyCasting SetConst CurrentlyCasting = LifeBuff Loop $NumLifeBuffs Compute $CurrentLifeBuff = {Loop No} Call Cast_Spell End SetConst CurrentlyCasting = $PreviouslyCasting End Procedure BuffCreature SetConst PreviouslyCasting = $CurrentlyCasting SetConst CurrentlyCasting = CreatureBuff Loop $NumCreatureBuffs Compute $CurrentCreatureBuff = {Loop No} Call Cast_Spell End SetConst CurrentlyCasting = $PreviouslyCasting End Procedure BuffLifeIfNecessary Compute $Temp = {ElapsedMSec} - $MinLifeBuffDel If $Temp > $LifeBuffStart Call BuffLife End End Procedure BuffCreatureIfNecessary Compute $Temp = {ElapsedMSec} - $MinCreatureBuffDel If $Temp > $CreatureBuffStart Call BuffCreature End End Procedure Life_Cycle Compute $LifeStart = {ElapsedMSec} SetConst CurrentlyCasting = Life Loop $NumLife If {Loop No} = $LifeBuffAt Call BuffLifeIfNecessary End Compute $CurrentLifeBuff = {Loop No} Call Cast_Spell End End Procedure Creature_Cycle Compute $CreatureStart = {ElapsedMSec} SetConst CurrentlyCasting = Creature Loop $NumCreature If {Loop No} = $CreatureBuffAt Call BuffCreatureIfNecessary End Compute $CurrentCreatureBuff = {Loop No} Call Cast_Spell End End Procedure Item_Cycle Compute $ItemStart = {ElapsedMSec} SetConst CurrentlyCasting = Item Loop $NumItem Compute $CurrentItemBuff = {Loop No} Call Cast_Spell End End Procedure Life_Delay While 1=1 Compute $Temp = {ElapsedMSec} - $MinLifeDel If $Temp > $LifeStart Break End // Rest if there's enough time to do so efficiently. Compute $Temp = {ElapsedMSec} - $LifeStart If $Temp > $MinRestTime Call Regain_Mana End End End Procedure Creature_Delay While 1=1 Compute $Temp = {ElapsedMSec} - $MinCreatureDel If $Temp > $CreatureStart Break End // Rest if there's enough time to do so efficiently. Compute $Temp = {ElapsedMSec} - $CreatureStart If $Temp > $MinRestTime Call Regain_Mana End End End Procedure Item_Delay While 1=1 Compute $Temp = {ElapsedMSec} - $MinItemDel If $Temp > $ItemStart Break End // Rest if there's enough time to do so efficiently. Compute $Temp = {ElapsedMSec} - $ItemStart If $Temp > $MinRestTime Call Regain_Mana End End End // Handles the exp-generating spell cycle. Procedure Spell_Cycle While 1=1 Call Life_Delay Call Life_Cycle Call Creature_Delay Call Creature_Cycle Call Item_Delay Call Item_Cycle Break End End Procedure Prebuff Say /cast Mana Conversion Mastery Self V Call Spell_Delay Compute $CreatureBuffStart = {ElapsedMSec} Call BuffCreature Compute $LifeBuffStart = {ElapsedMSec} Call BuffLife End ////////////////////////////////////////////////////////////////////////////// // Start of actual program ////////////////////////////////////////////////////////////////////////////// Call Calibrate_Macro Call Casting_Mode // Handle first cycle manually to get timers set up properly. Call Prebuff Call Life_Cycle Call Creature_Cycle Call Item_Cycle // Main loop, bowdance every 5 cycles. Loop 1000 Loop 5 Call Casting_Mode Call Spell_Cycle End Call Bow_Dance End