View Single Post
  #28  
Old 12-10-2016, 12:34 PM
Meddera
Sarnak
 
Join Date: Nov 2016
Posts: 28
Default

I think I just found it in the code.


if( iSpellTypes == SpellType_Heal ) {
if( botCasterClass == CLERIC || botCasterClass == DRUID || botCasterClass == SHAMAN) {
if(caster->HasGroup()) {
Group *g = caster->GetGroup();
if(g) {
for(int i = 0; i < MAX_GROUP_MEMBERS; i++) {
if(g->members[i] && !g->members[i]->qglobal) {
if(g->members[i]->IsClient() && g->members[i]->GetHPRatio() < 90) {
if(caster->AICastSpell(g->members[i], 100, SpellType_Heal))
return true;
} else if((g->members[i]->GetClass() == WARRIOR || g->members[i]->GetClass() == PALADIN || g->members[i]->GetClass() == SHADOWKNIGHT) && g->members[i]->GetHPRatio() < 95) {
if(caster->AICastSpell(g->members[i], 100, SpellType_Heal))
return true;
} else if(g->members[i]->GetClass() == ENCHANTER && g->members[i]->GetHPRatio() < 80) {
if(caster->AICastSpell(g->members[i], 100, SpellType_Heal))
return true;
} else if(g->members[i]->GetHPRatio() < 70) {
if(caster->AICastSpell(g->members[i], 100, SpellType_Heal))
return true;
}


This of course is just a guess, but I am playing with a warrior right now and the 95% is when I get healed and I see the < 95 up there. Ok I see things that could probably be changed to correct my issues. I hate to be a pain as I know you guys have heard this a million times, but I am new to this and I was unable to get the original method of getting a the piece parts to work so I used the installer. Is it possible to make changes in the cpp files above using that method? Or do I need to go back and try to get the more complicated process to work?


I also see similiar code below for the Paladin class, but there is nothing for the gethpratio. The line is there, but no number and when I made a Paladin bot he would not heal me.

} else if((g->members[i]->GetClass() == WARRIOR || g->members[i]->GetClass() == PALADIN || g->members[i]->GetClass() == SHADOWKNIGHT) && g->members[i]->GetHPRatio() < hpRatioToHeal) {
if(caster->AICastSpell(g->members[i], 100, SpellType_Heal))
Reply With Quote