Merge pull request #740 from noudess/master

Fix HT and LOH to retry after failure to cast
This commit is contained in:
Michael Cook (mackal) 2018-07-21 17:19:57 -04:00 committed by GitHub
commit 983b8f7237
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1540,16 +1540,19 @@ void NPC::DoClassAttacks(Mob *target) {
if(ka_time){
int knightreuse = 1000; //lets give it a small cooldown actually.
switch(GetClass()){
case SHADOWKNIGHT: case SHADOWKNIGHTGM:{
CastSpell(SPELL_NPC_HARM_TOUCH, target->GetID());
knightreuse = HarmTouchReuseTime * 1000;
if (CastSpell(SPELL_NPC_HARM_TOUCH, target->GetID())) {
knightreuse = HarmTouchReuseTime * 1000;
}
break;
}
case PALADIN: case PALADINGM:{
if(GetHPRatio() < 20) {
CastSpell(SPELL_LAY_ON_HANDS, GetID());
knightreuse = LayOnHandsReuseTime * 1000;
if (CastSpell(SPELL_LAY_ON_HANDS, GetID())) {
knightreuse = LayOnHandsReuseTime * 1000;
}
} else {
knightreuse = 2000; //Check again in two seconds.
}