Aller au contenu

Photo

HenchTalentAdvancedBuff ... Why Do Some Spells Fail? ... OR, Why Is My NPC Illegal?


  • Veuillez vous connecter pour répondre
2 réponses à ce sujet

#1
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

Hi All,

I make use of the OC HenchTalentAdvancedBuff function to prepare some creatures ahead of an encounter. However, I have found that in some occasions the creature that is supposed to cast the buff spell fails.

NB: In DEBUG testing, I bypass this function and do a direct call to cast the spell I have in mind, with the *only* difference being I use the CHEAT parameter in the calling, suggesting my creature *fails* to meet the criteria to cast the said spell.

E.g. If I use this line from the function (edited with the CHEAT parameter), the creature casts the spell just fine:-

ActionCastSpellAtLocation(SPELL_SUMMON_CREATURE_I, GetLocation(OBJECT_SELF), METAMAGIC_NONE, TRUE, PROJECTILE_PATH_TYPE_DEFAULT, TRUE);

Here is the full code with debug to show what I mean:-

 

NB: The send message is a homebrew debug. The function here should simply cast the spell if present. It does not. Uncomment my "cheat" version of the same line of code that is supposed to cast the spell and it does!

 

Note also, the feedback has the cleric come back at 3rd level and with 16 Wisdom.

 

Does anybody know what else the "CHEAT" parameter includes in its checking, in case I am missing something?

 

Thanks in advance,

Lance.
 

if(HenchTalentAdvancedBuff(40.0))
		{			
			SendMessageToAllPCs(GetName(OBJECT_SELF) + " <<< BUFFING C >>> " + FloatToString(GetDistanceBetween(OBJECT_SELF,oNearestPC )));
			if(GetHasSpell(174))
			{
				//ActionCastSpellAtLocation(SPELL_SUMMON_CREATURE_I, GetLocation(OBJECT_SELF), METAMAGIC_NONE, TRUE, PROJECTILE_PATH_TYPE_DEFAULT, TRUE);
				SendMessageToAllPCs(GetName(OBJECT_SELF) + " <<< HAS SPELL >>> " + " IS LEVEL >>> " + IntToString(GetLevelByClass(CLASS_TYPE_CLERIC)) + " HAS WISDOM >>> " + IntToString(GetAbilityScore(OBJECT_SELF, ABILITY_WISDOM, FALSE)));
			}
                 }


#2
kevL

kevL
  • Members
  • 4 056 messages
well, in tony's HenchTalentAdvancedBuff()
OBJECT_SELF has to be hostile to the nearest PC
within fDistance
can't be fighting already

and OBJECT_SELF needs to be able to legally cast the first spell it has in the order specified ...

notes:
bCheat casts the spell at caster-level 10 ... I think even a placeable can cast a spell if this param is TRUE
nDomainLevel doesn't do anything as far as i'm aware
bInstant is instant and shouldn't affect anything else -- probly suppresses casting vFX too

#3
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

well, in tony's HenchTalentAdvancedBuff()
OBJECT_SELF has to be hostile to the nearest PC
within fDistance
can't be fighting already

and OBJECT_SELF needs to be able to legally cast the first spell it has in the order specified ...

notes:
bCheat casts the spell at caster-level 10 ... I think even a placeable can cast a spell if this param is TRUE
nDomainLevel doesn't do anything as far as i'm aware
bInstant is instant and shouldn't affect anything else -- probly suppresses casting vFX too


Hi KevL,

Well, this one has me completely stumped ... :(

The strange thing is, the same cleric even casts the spell during combat and has the Summoned Creature appear then instead! As far as I can see the cleric meets all the criteria to cast the buff, but simply fails to do so. I can even give them the 2nd level version and it works OK. And ... I can even get a lower level goblin shaman to "buff" with the same Summoned Creature. I have no idea why this one fails, but it does.

Thankfully, I don't think it's essential now I know they will cast it in combat. ;)

However, if you should learn anything more, please do tell.

Cheers,
Lance.