Aller au contenu

Photo

Increase Spell DC Script


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

#1
Illustair

Illustair
  • Members
  • 62 messages
Hi. I'd just like to ask if anyone got their hands on the code for increasing DC of your spells casted? Spell Focus feats come into mind, but I couldn't find their scripts. Thanks

#2
kevL

kevL
  • Members
  • 4 078 messages
SpellFocus* looks like its hardcoded. Most spells that use a SaveDC get the DC right in the spellscript. which means, from this perspective, you'd have to rewrite all those spellscripts ............

CSL might have something about it, but i wouldna get my knickers twisted ..

#3
Illustair

Illustair
  • Members
  • 62 messages
Is that so? I'd scratch that then. Thanks

#4
painofdungeoneternal

painofdungeoneternal
  • Members
  • 1 799 messages
Yes it does it.

To adjust the DC
// adjust the 
SetLocalInt( oCaster, "HKPERM_Save_DCadj", 2 );
// or
SetLocalInt( oCaster, "HKPERM_Save_DCadj", -2 );

// adjust the next spell cast only ( removed upon casting any spell )
SetLocalInt( oCaster, "HKTEMP_Save_DCadj", 2 );
// or
SetLocalInt( oCaster, "HKTEMP_Save_DCadj", -2 );

There are vars like this to increase damage, AOE size, add metamagics

This is how i use it internally for adjusting spells on the outer planes, see "_CSLCore_Environment.nss" for the context of this code.

	if ( iTargetState & CSL_ENVIRO_NEGATIVE )
	{
		// Fire and light descriptors are impeded
		if ( iDescriptor & ( SCMETA_DESCRIPTOR_LIGHT | SCMETA_DESCRIPTOR_FIRE ) )
		{
			if ( !CSLEnviroImpededMagicCheck( oCaster, "Casting Light spell in shadow", 20, iSpellLevel, iclass ) )
			{
				return FALSE;
			}
		}
		else if ( iDescriptor & SCMETA_DESCRIPTOR_POSITIVE  || iSpellSubSchool & SPELL_SUBSCHOOL_HEALING && !( iDamageModType & DAMAGE_TYPE_NEGATIVE ) )
		{
			if ( !CSLEnviroImpededMagicCheck( oCaster, "Casting Positive spell in negative", 20, iSpellLevel, iclass ) )
			{
				return FALSE;
			}
		}
			
			
		if ( iDescriptor & SCMETA_DESCRIPTOR_LIGHT )
		{
			SetLocalInt( oCaster, "HKTEMP_Spell_DurationCatAdj", -1 );
			SetLocalInt( oCaster, "HKTEMP_sizemodpercent", 50 );
		}
		
		if ( iDescriptor & SCMETA_DESCRIPTOR_POSITIVE  )
		{
			SetLocalInt( oCaster, "HKTEMP_damagemodpercent", 75 );
			SetLocalInt( oCaster, "HKTEMP_sizemodpercent", 75 );
		}
		
		if ( iSpellSubSchool & SPELL_SUBSCHOOL_HEALING && !( iDamageModType & DAMAGE_TYPE_NEGATIVE ) )
		{
			SetLocalInt( oCaster, "HKTEMP_damagemodpercent", 75 );
			SetLocalInt( oCaster, "HKTEMP_sizemodpercent", 75 );
		}
		
		if ( iDescriptor & SCMETA_DESCRIPTOR_NEGATIVE || iDamageModType & DAMAGE_TYPE_NEGATIVE )
		{
			SetLocalInt( oCaster, "HKTEMP_damagemodpercent", 150 );
			SetLocalInt( oCaster, "HKTEMP_sizemodpercent", 125 );
		}
		
		// shadow descriptor spells do more damage, and they are always maximized
		if ( iSpellSubSchool & SPELL_SUBSCHOOL_SHADOW )
		{
			SetLocalInt( oCaster, "HKTEMP_damagemodpercent", 150 );
			SetLocalInt( oCaster, "HKTEMP_sizemodpercent", 125 );
			SetLocalInt( oCaster, "HKTEMP_Spell_MetaMagic", GetLocalInt( oCaster, "HKTEMP_Spell_MetaMagic") | METAMAGIC_MAXIMIZE );
		}
	}


#5
Illustair

Illustair
  • Members
  • 62 messages
Great stuff. That's exactly what I was looking for, and more.