View Single Post
  #5  
Old 09-23-2020, 10:23 PM
Xanathol
Sarnak
 
Join Date: Oct 2009
Posts: 52
Default

Quote:
Originally Posted by ChaosSlayerZ View Post
there use to be a rule in DB that was called - "npc buff/heal friends" - check if that one is on. On other hand they should always at least heal themselves.
I may need to check my own npcs
Thanks but already checked that.

After a lot of debugging, I was able to get heals to work but no telling what all I broke in the process. Here's the changes I made.

In AICastSpell, under the switch for the AISpells[i].type, I commented out the line that prevents buffing PC pets:

Code:
				switch (AIspells[i].type) {
					case SpellType_Heal: {
						LogAI( "AI NPC [{}]: Tar [{}] DontHealMeBefore [{}] [{}]", this->GetName( ), tar->GetName( ), tar->DontHealMeBefore(), Timer::GetCurrentTime() );
						if (
							(spells[AIspells[i].spellid].targettype == ST_Target || tar == this)
							&& tar->DontHealMeBefore() < Timer::GetCurrentTime()
							// && !(tar->IsPet() && tar->GetOwner()->IsClient())	//no buffing PC's pets
							) {
In npc.cpp, under AICheckCloseBeneficialSpells, there is a check for indifferent faction which stops healing.

Code:
	/**
	 * Indifferent
	 */
	//	if (caster->GetPrimaryFaction() == 0) {
	//		return false;
	//	}
In the same function, there is a check to prevent you being healed, which seems unneccessary:

Code:
		if (mob->IsClient()) {
			// continue;
		}
And then there is a faction check which makes no sense to me - never heal an NPC that has faction with you?!

Code:
		if (mob->GetReverseFactionCon(caster) >= FACTION_KINDLY) {
			// continue;
		}

After all those changes, I can now summon my cleric pet and it will heal me or even another pet, which is what I was after.

Hopefully that helps you or any others out as well.
Reply With Quote