help with code
Well, since you asked, heres a couple of changes that I've put in to spellcast.inc my copy of genbot.
The first change is to the CheckCann function. The way it's written, it's possible to drop the Shaman down to frenzy range (depending on his hit point pool) with Canni5. It may even be mathmatically possible to kill him outright, since Canni5 takes 1924HP but the check is for 1900 (he would have to be above 60% health with less than 1924HP in order to Canni-cide).
Code: Select all
Sub CheckCann
/if (!${Me.Moving}) {
/if (${Me.CurrentMana}<${Me.MaxMana}-1066 && ${Me.CurrentHPs}>${Me.MaxHPs}\5+1924 && ${CannAATimer}<=0) {
/alt activate 47
/varset CannAATimer 3m
/return
}
/if (${Me.PctHPs}<70 && !${Me.Buff["Quiescence"].ID}) {
/if (${DebugList.Find[spell]}) /echo CheckCann "Quiescence" "${Me.Name}"
/call AddCast "Quiescence" ${Me.Name} buff
/return
}
/if (${Me.PctMana}<95 && ${Me.PctHPs}>=40 && ${CannTimer}<=0 && !${CastStep}) {
/if (${DebugList.Find[spell]}) /echo CheckCann "${CanniSpell}" "${Me.Name}"
/call AddCast "${CanniSpell}" ${Me.Name} buff
/varset CannTimer 4s
}
}
/return
I changed the percentage checks to hard number checks for Canni5. If you're down more than 1066 mana and are 1924HP over frenzy range (frenzy is 20%, right?) it will fire off Canni5.
I also stuck a health check in here. I figured that while other classes may want to self heal with a HoT, Shamans get the most use out of their HoT when cast after a Canni, so I put it in the Canni routine. If health drops below 70%, it will cast Quiescence. The spell should probably be configurable from the INI file but since I have Q, I just stuck it in there.
I've also changed the CheckYaulp routine. I got rid of the Yaulp timer. Instead, I directly check for the buff. Also, if the bot is in combat he will cast Yaulp even if he's at full mana. I figure that the +ATK and +DEX is good for the meleeing cleric even if the Mana Regen is going to waste. Yaulp overwrites some spells that may be more useful in combat, but if you're yaulping for mana you'll overwrite them anyway.
Code: Select all
Sub CheckYaulp
/if (!${Me.Moving}) {
/if ((${Me.PctMana}<95 || ${CombatTargetID}) && !${Me.Buff["${YaulpSpell}"].ID}) {
/if (${DebugList.Find[spell]}) /echo CheckYaulp "${YaulpSpell}" "${Me.Name}"
/call AddCast "${YaulpSpell}" ${Me.Name} buff
}
}
/return