Aller au contenu

Photo

Wanderings, Wonderings, and even a little progress


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

#1
Saralach

Saralach
  • Members
  • 18 messages

Well, these forums have certainly changed since I wandered off... Anyhow, to business.

 

In my spare time I have been working on the invocation pack and have finally come up with a way to get around the item property spell immunities that are mostly on golems. Don't know why I didn't think of this before, but hey, live and learn then blow up the planes.

 

The basic gist is to use feats as replacements. The only thing ResistSpell is still used for us mantles, fired twice to properly deplete spell levels. This should also remove the bug about SR on items only work once, but I haven't looked at that.

 

I still have a ways to go remaking spells as I like to do. Below is the code for anyone interested.

//Checks caster level at full level for SR and bypasses globes when needed
int SVResistSpell(object oCaster, object oTarget, float fDelay=0.0f, int nSpellLvl = 0)
{
    if (fDelay > 0.5)
    {
        fDelay = fDelay - 0.1;
    }
	if (nSpellLvl < 1)
	{
	    nSpellLvl = 2;
	}
	
	//Get caster level of oCaster
	int nCasterLvl = GetCasterLevel(oCaster);		
	//Get the target spell resistance
	int nTargetSR = GetSpellResistance(oTarget);
	
	int nResist = 0;
	int nRet = FALSE;
	//Declare variables for SR check
	int nSRMods = 0;				
	int nRoll;
	int nMySRCheck;
	effect eSR = EffectVisualEffect( VFX_DUR_SPELL_SPELL_RESISTANCE );	// uses NWN2 VFX
    effect eGlobe = EffectVisualEffect( VFX_DUR_SPELL_GLOBE_INV_LESS );	// uses NWN2 VFX
    effect eMantle = EffectVisualEffect( VFX_DUR_SPELL_SPELL_MANTLE );
	
	if(nTargetSR > 0)
		{

			//Check if oCaster has feats to overcome spell resistance
			if(GetHasFeat(FEAT_EPIC_SPELL_PENETRATION, oCaster))
			{ nSRMods = 6; }
			else
			if(GetHasFeat(FEAT_GREATER_SPELL_PENETRATION, oCaster))
			{ nSRMods = 4; }
			else		
			if(GetHasFeat(FEAT_SPELL_PENETRATION, oCaster))
			{ nSRMods = 2; }
				
			string sFeedback = "<c=cyan>" + GetName(oTarget) + " is attempting to resist your invocation: ";			
			
			nRoll = d20();
			nMySRCheck = nRoll + nCasterLvl + nSRMods;
			if((nMySRCheck <= nTargetSR || nRoll == 1) && nRoll != 20 )
			{
				nResist = 1;
				sFeedback += "Success (" + " " + IntToString(nMySRCheck) + "  vs " + IntToString(nTargetSR) +  " SR ).</c>";
	        	DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eSR, oTarget));
			}
			else
			{
				sFeedback += "Failure (" + " " + IntToString(nMySRCheck) + "  vs " + IntToString(nTargetSR) +  " SR ).</c>";				
				nResist = 0;
			}	
			//Display feedback
			SendMessageToPC(oCaster, sFeedback);			
			
    }
	
	//Globe
		
	if (GetHasSpellEffect(SPELL_GLOBE_OF_INVULNERABILITY, oTarget) && nSpellLvl <=4)
		{nResist = 2;}

	if (GetHasSpellEffect(SPELL_GREATER_SHADOW_CONJURATION_MINOR_GLOBE, oTarget) && nSpellLvl <=3)
		{nResist = 2;}
		
	if (GetHasSpellEffect(SPELL_LESSER_GLOBE_OF_INVULNERABILITY, oTarget) && nSpellLvl <=3)
		{nResist = 2;}
		
		//Spell Immunity
		
	if(GetHasFeat(8209, oTarget))
	{nResist = 2;}
	else
	if(GetHasFeat(8208, oTarget) && nSpellLvl <= 8)
	{nResist = 2;}
	else
	if(GetHasFeat(8207, oTarget) && nSpellLvl <= 7)
	{nResist = 2;}
	else
	if(GetHasFeat(8206, oTarget) && nSpellLvl <= 6)
	{nResist = 2;}
	else
	if(GetHasFeat(8205, oTarget) && nSpellLvl <= 5)
	{nResist = 2;}
	else
	if(GetHasFeat(8204, oTarget) && nSpellLvl <= 4)
	{nResist = 2;}
	else
	if(GetHasFeat(8203, oTarget) && nSpellLvl <= 3)
	{nResist = 2;}
	else
	if(GetHasFeat(8202, oTarget) && nSpellLvl <= 2)
	{nResist = 2;}
	else
	if(GetHasFeat(8201, oTarget) && nSpellLvl <= 1)
	{nResist = 2;}

	if(nResist == 2) //Globe
    {
	    nRet = TRUE;
        DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eGlobe, oTarget));
    }
	
	//Spell Mantle
	if (GetHasSpellEffect(SPELL_LEAST_SPELL_MANTLE, oTarget)
	|| GetHasSpellEffect(SPELL_LESSER_SPELL_MANTLE, oTarget)
	|| GetHasSpellEffect(SPELL_SPELL_MANTLE, oTarget)
	|| GetHasSpellEffect(SPELL_GREATER_SPELL_MANTLE, oTarget) )
	
	{ nResist = 3; }
	
	
    if(nResist == 3) //Spell Mantle
    {
		ResistSpell(oCaster, oTarget); //Fire the resist off twice so that the mantle is correctly depleted.
        ResistSpell(oCaster, oTarget);
		nRet = TRUE;
		
		if (fDelay > 0.5)
        {
            fDelay = fDelay - 0.1;
        }
        DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eMantle, oTarget));
    }
	
	return nRet;
} 



#2
rjshae

rjshae
  • Members
  • 4 485 messages

Umm... huh? I must be missing some of the context here. Could you explain what you mean by, "the item property spell immunities that are mostly on golems"? Or "The basic gist is to use feats as replacements"; replacements for what?



#3
Dann-J

Dann-J
  • Members
  • 3 161 messages

Umm... huh? I must be missing some of the context here. Could you explain what you mean by, "the item property spell immunities that are mostly on golems"? Or "The basic gist is to use feats as replacements"; replacements for what?

 

Spell resistance via an item property is bugged - it works once and then never again (unless you unequip and re-equip the item). Creature hides are essentially equipped items with properties, so spell resistance on creatures like golems or dragons isn't persistent.

 

Spell resistance works via feats (such as Drow spell resistance), however spells that are supposed to reduce spell resistance don't work against feats.

 

There have been a few attempts to circumvent the problem over the years (see here, and here, and here). This would seem to be another one.


  • rjshae aime ceci

#4
Saralach

Saralach
  • Members
  • 18 messages

There are item properties Spell Immunity by Level 1-9 added to the skins of some creatures. If you look in the toolset and poke around with golems you'll see them. Could never figure out how to check for the specific value, Like a stone golem is immune to levels 4 and below with the item property. Instead of that, my code checks for a feat that will do the same, yet bypass the way warlock spell levels were coded - priest/mage goes up to 9, warlock goes to 4. Instead of having spells check the innate level like they should have, OEI code checks the level for the class so Eldritch Doom would check at level 4 instead of level 8.



#5
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages
Hi Saralach & All,

Believe it or not, I was not aware of this bug ... but now I am, I guess I had look at resolving it for my module too.

However, I want to get a better understanding of the problem and approach it from a slightly different angle if possible. For instance, I did a quick test and noticed (as you say) that a PC with a SR item only gets the resistance for the first time and then the resistance goes back to zero. (I'll assume the same happens with monster skins.) Furthermore, like you, I notice that feats that give SR do not have the same issue.

Therefore, this was going to be my approach, which I need to understand any potential pitfalls: Is there any reason why one cannot simply add a new feat that adds the appropriate level of SR when an item is equipped on unequipped?

Or, to put it another way: I am not as familiar with SR rules as some others, and wanted to know what I need to consider when "fixing" this problem the way I intend to try.

Any advice anybody?

Cheers,
Lance.

#6
Saralach

Saralach
  • Members
  • 18 messages

Lance,

 

The "quick and dirty" way has been around for some time, simply using the drow SR feat which gives a creature 11 + HD SR. For weaker SRs you could also use the monk feat which would only give 10 SR since it is supposed to be 10 plus monk level..

 

As I said, my feats only address spell immunity by level. My code also does not use the ResistSpell function except for spell mantles, haven't figured out how to get around that yet. So in theory, the code should not strip SR from an item/skin.

 

If you want to do SR feats, the function EffectSpellResistanceIncrease is what you're after. It sets the SR to whatever you like, does not add to any existing. So if you have an armor that gives SR22 and a feat that sets SR to 18, the engine will most likely override the armor with the feat. It shouldn't be that hard to give generic SRs to types of creatures all in one script.

 

Hope this helps.



#7
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

Lance,
 
The "quick and dirty" way has been around for some time, simply using the drow SR feat which gives a creature 11 + HD SR. For weaker SRs you could also use the monk feat which would only give 10 SR since it is supposed to be 10 plus monk level..
 
As I said, my feats only address spell immunity by level. My code also does not use the ResistSpell function except for spell mantles, haven't figured out how to get around that yet. So in theory, the code should not strip SR from an item/skin.
 
If you want to do SR feats, the function EffectSpellResistanceIncrease is what you're after. It sets the SR to whatever you like, does not add to any existing. So if you have an armor that gives SR22 and a feat that sets SR to 18, the engine will most likely override the armor with the feat. It shouldn't be that hard to give generic SRs to types of creatures all in one script.
 
Hope this helps.


Hi Saralach,

OK, I may start a new thread about SR then. :)

Thanks for the heads up.

Cheers,
Lance.

#8
Dann-J

Dann-J
  • Members
  • 3 161 messages

Spell resistance items for players should work via tag-based OnEquip and OnUnequip scripts. The OnEquip script would apply a permanent and supernatural EffectSpellResistanceIncrease() effect (tagged with a dummy spell ID). The OnUnequip script would remove that specific effect via its dummy spell ID (RemoveEffectsFromSpell in nw_i0_spells). You might have to 'plot' the equipped item to prevent players from being able to sell it straight from the equipped slot, in case doing that doesn't fire the OnUnequip script (potentially leaving the player with permanent spell resistance).

 

The applied effect should work more than once, and should also make players vulnerable to spells that decrease spell resistance.


  • GCoyote aime ceci

#9
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

Spell resistance items for players should work via tag-based OnEquip and OnUnequip scripts. The OnEquip script would apply a permanent and supernatural EffectSpellResistanceIncrease() effect (tagged with a dummy spell ID). The OnUnequip script would remove that specific effect via its dummy spell ID (RemoveEffectsFromSpell in nw_i0_spells). You might have to 'plot' the equipped item to prevent players from being able to sell it straight from the equipped slot, in case doing that doesn't fire the OnUnequip script (potentially leaving the player with permanent spell resistance).
 
The applied effect should work more than once, and should also make players vulnerable to spells that decrease spell resistance.


Hi Dann_J,

This sounds similar to what I am trying ... Check out this thread: http://forum.bioware...rking-solution/

BTW, my guess is that any equipment sold (that is equipped) would fire the OnUnEquipped hook as it is sold ... but I will double check. :) EDIT: Just checked and the code still works OK, so no exploit there.

Cheers,
Lance.

#10
SteviL

SteviL
  • Members
  • 1 messages

Hello Saralach.  

 

Let my first just say that it is wonderful finding people still active with NWN.  

Not to threadjack, but I *JUST* started using your pack a few days ago after years and years of playing with kaedrin's pack.  I like the idea of playing a hellfire warlock without the con damage via your feat.  I noticed however that I do seem to be getting the bonus hellfire damage but it is not of the divine type, it is of the essence type.  I see damages greater than 36 on non critical hits with 6d6 EB dice.  I'm just wondering if this is the way it is supposed to work with your pack (ie essence typed damage not divine)? 

 

Thank you for bringing more fun to the game

 

edit: I forgot to mention that this is happening with the original 3 level hellfire warlock class.



#11
Saralach

Saralach
  • Members
  • 18 messages

Stevil,

 

There are actually two HfW classes, the one from SoZ you're using does not get the divine damage. The one from my pack is a porting of Duffy's HfW from Combined Works. It is still on the vault, but it is incompatiple with SoZ. Duffy's HfW made the Hellfire Blast separate from Eldritch Blast and not resistable.

 

For the next version of my pack, I am abandoning the idea of PrC's. Focusing more on pacts- kind of a cross between 5th and 3.5. The idea is three archetypes, which use Charisma for the DC checks and a different stat each for secondary effects. Each pact will also affect your eldritch blast differently.

 

Fiendish: uses constitution to determine effects. channels the planes of Baator to fuel spells. Eldritch blast die increases to d8 instead of d6. Does not affect Hellfire Blast or Blood Magic

 

Fey: uses charisma to determine effects, uses illusions and channels the elements for spells. Charisma modifier is added tp Eldritch Blast damage rolls.

 

Undead/Shadow: uses intelligence to determin effects, uses necromancy in spells and can become like the undead for a time. Deal 1 extra damage with Eldritch Blast for each damage die you possess.

 

There are also a couple feats I'm using to make a blood mage type:

 

Blood Ritual: gain +1 DC to invocations and Eldritch Blast. Needed for Blood Magic.

 

Blood Magic: gain d6 damage equal to your Constitution modifier while active. Each blast deals damage equal to Constitution modifer.


  • rjshae aime ceci

#12
Saralach

Saralach
  • Members
  • 18 messages

With some insight from KevL and Lance's thread, the resist code no longer uses feats for spell immunity. The resist spell function phased out and using local ints instead to track. Granted this is only on warlock invocations... for now anyway. Not sure if I want to tackle the whole spell system with this yet. We shall see. A couple of days ago, gibberish. Not a bad turn around. Code below for those interested:

 

Spoiler