Aller au contenu

Photo

Ghosts and possession...


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

#1
MokahTGS

MokahTGS
  • Members
  • 946 messages
 I'm trying to find interesting ways for encounters to challenge players and one section of my work has a large, very old crypt and I was thinking it would be really neat if the ghosts within did a little more than just attack the player.

Since I'm using the SoZ party system, the player will have 3-4 party members, and I'd love a way for ghosts to posess the players party members forcing the player to deal with the posession before they can destroy the ghost.  

Are there any NWN2 scripts out there that handle this sort of behavior?  I don't see anything on the vault except for NWN scripts and I'm not sure if they will translate.

#2
rjshae

rjshae
  • Members
  • 4 485 messages
Perhaps you could temporarily replace the companions with henchmen clones then handle it through conversations and factions?

#3
Tchos

Tchos
  • Members
  • 5 042 messages
How in-depth do you want the possession to go? What would they say or do? More than the ghosts putting the party members under the effect of a domination spell, I guess you're asking?

#4
Lugaid of the Red Stripes

Lugaid of the Red Stripes
  • Members
  • 955 messages
I know copy object applied to a PC will spit out a hostile creature, you could do that, hide the original, and then add a script set to manage death and exorcism.

#5
Dann-J

Dann-J
  • Members
  • 3 161 messages
If it's an intermittent possession, you could have a script apply EffectInsane() to a companion at random intervals. You could allow them to make a will save to prevent the spirit taking control.

As well as their random violent outbursts, you could apply some sort of penalty for the duration of the possession (whether or not the spirit is in control). Their constant internal battle might reduce certain skills, such as concentration, or anything that requires dexterity (tumble, trap setting, rogue skills, etc). Random Tourette-like outbursts might also force a character out of certain combat modes (especially stealth).

#6
Morbane

Morbane
  • Members
  • 1 883 messages
it could be done with active feats forced on the pcs - with persistent vfx (enter, hb, exit) for other party members - e.g. negative levels, impairments, etc. to go a bit further the hb would apply to the possessed pc - the scripting would be tricky but entirely doable.

#7
Morbane

Morbane
  • Members
  • 1 883 messages
 oh man - multiple possessions on one pc - i might go there...

:devil:

#8
Morbane

Morbane
  • Members
  • 1 883 messages
here is a script designed to be an active feat hb for a lycanthropy feat - in this case the pc has some control - but you can see in the scripting that ability can be moderated into different personalities for each possession - ooh, i feel evil now >:)
#include "a_include_mor"
#include "a_inc_lycanthrope"

void main()
{
	//SendMessageToPC(GetFirstPC(FALSE), "Active Cycling");

	
	object oSelf = GetAreaOfEffectCreator();
	location lSelf = GetLocation(oSelf);
	
	SetGlobalInt("is_poly", TRUE);
	
	if(GetIsDone(oSelf, "act_buff") == FALSE)
	{
		SkillBuff(oSelf, 5);
		Regeneration(oSelf, 4, RoundsToSeconds(3));
		effect eDamIncr = VersusRacialTypeEffect(EffectDamageIncrease(d8(), DAMAGE_TYPE_PIERCING, 1), RACIAL_TYPE_UNDEAD);
		ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDamIncr, oSelf, RoundsToSeconds(50));
		ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectDetectUndead(), oSelf);
		
		SetIsDone(oSelf, "act_buff", TRUE);
		
	}
	
	int nMurder = GetGlobalInt("murder");
	int nWis = GetAbilityModifier(ABILITY_WISDOM, oSelf);
	int nDC = (16 + nMurder) - nWis;
	int nCur = GetCurrentHitPoints(oSelf);
	int nMax = GetMaxHitPoints(oSelf);
	
	
	object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_ASTRONOMIC, lSelf, TRUE, OBJECT_TYPE_CREATURE);
	while(GetIsObjectValid(oTarget))
	{
		if(oTarget == oSelf)
		{
			//SendMessageToPC(GetFirstPC(FALSE), "Skip oSelf");
			oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_ASTRONOMIC, lSelf, TRUE, OBJECT_TYPE_CREATURE);
		}
		
		//SendMessageToPC(GetFirstPC(FALSE), "Is Valid");
		
		if(GetIsInCombat(oSelf) == TRUE)
		{	
			//SendMessageToPC(GetFirstPC(FALSE), "In Combat");
			
			if(GetIsEnemy(oTarget, oSelf))
			{
				//SendMessageToPC(GetFirstPC(FALSE), "Is Enemy");
				
				if(IsVampire(oTarget))
				{
					//SendMessageToPC(GetFirstPC(FALSE), "Is Vampire");
					
					ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectModifyAttacks(2), oSelf, RoundsToSeconds(d6()));
					
					if(GetPlayerCurrentTarget(oSelf) == oTarget && IsVampire(oTarget) == TRUE)
					{
						if(GetIsDone(oTarget, "sMax") == FALSE)
						{
							ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectMaxDamage(), oTarget, RoundsToSeconds(d4()));
							ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectMaxDamage(), oSelf, RoundsToSeconds(d4()));
							SetIsDone(oTarget, "sMax");
						}
						
					}//effect max dam
					
				}//vampire
				
				if(IsUsingSilver(oTarget))
				{
					//SendMessageToPC(GetFirstPC(FALSE), "IsUsingSilver");
					
					if(GetGlobalInt("is_poly") == TRUE && GetLastDamager(oSelf) == oTarget)
					{
						if(GetIsDone(oTarget, "sApplyConfuse") == FALSE)
						{
							ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectConfused(), oSelf, RoundsToSeconds(d4()));
							//SendMessageToPC(GetFirstPC(FALSE), "Confusion Applied");
							SetIsDone(oTarget, "sApplyConfuse");
							
						}
						
						if(GetAttemptedAttackTarget() == oSelf && IsUsingSilver(oTarget) && GetIsDone(oTarget, "sMax") == FALSE)
						{
							ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectMaxDamage(), oTarget, RoundsToSeconds(d4()));
							SetIsDone(oTarget, "sMax", TRUE);
						}
					}
					
				}//IsSilver
				
			}//IsEnemy
			
		}//InCombat
		
		oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_ASTRONOMIC, lSelf, TRUE, OBJECT_TYPE_CREATURE);
	}//while
	
	if(GetIsInCombat(oSelf) == FALSE)
	{
		//SendMessageToPC(GetFirstPC(FALSE), "Non-Combat");
		
		RevertEffects(oSelf);
		
		SkillBuff(oSelf, 5);
		
		ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectDetectUndead(), oSelf);
		
		Regeneration(oSelf, 3, RoundsToSeconds(2));
		
		if(GetGlobalInt("murder") > 21)
		{
			
			if(GetIsDone(oSelf, "sRecord_Act") == FALSE)
			{
				FeatAdd(oSelf, Feat_Lycanthrope, TRUE, TRUE, TRUE);
				
				nMurder = GetGlobalInt("murder");
				
				//SendMessageToPC(GetFirstPC(FALSE), "Act_nMurder = " + IntToString(nMurder));
				
				FeatRemove(oSelf, Feat_Lycanthropy_Act);
				
				SetIsDone(oSelf, "sRecord_Act");
				
				TransformRestore(oSelf);
				
				SetGlobalInt("is_poly", FALSE);
				
				SetGlobalInt("murder", 0);
				
				
			}
			
			
		}//New Murder
		
	}//combat false
	
	//SendMessageToPC(GetFirstPC(FALSE), "Final_Act_nMurder = " + IntToString(nMurder));
	
}//main


#9
Morbane

Morbane
  • Members
  • 1 883 messages
after thinking about what all i have just said - i think a PASSIVE FEAT is what you want - active feats can be turned on or off afaicr

#10
MokahTGS

MokahTGS
  • Members
  • 946 messages
I've been thinking through this and what I want these ghosts to do, and really I want the player to have to switch targets mid fight.  If I were to use domination, all the player would have to do is kill the ghost and the domination would end.  

True ghostly posession has the ghost entering the body and you no longer have a ghost to target and must get the ghost out of the host body to kill it.  That is the delema I want to introduce.

Such a fight happened in NWN with the Intelect Devourer taking control of thralls that you then had to target and kill.  Killing your own party members is pretty evil...but I guess I'm a jerk.

I of course have no idea how to script such a thing.  :(

#11
kevL

kevL
  • Members
  • 4 056 messages

Mokah wrote...

If I were to use domination, all the player would have to do is kill the ghost and the domination would end.


set the ghost scripthidden until the domination ends

#12
MokahTGS

MokahTGS
  • Members
  • 946 messages

MokahTGS wrote...
I of course have no idea how to script such a thing.  :(



#13
kevL

kevL
  • Members
  • 4 056 messages
Here's the first half, if you want to go this route.

It doesn't have to be Domination per se; in fact so far i can't think of a good way to remove this .... short of, uh, enDEADment.


Actually a good dispell or rest could do it ... but that can be prevented ( or not ),

try it out, i used a wraith

#14
Dann-J

Dann-J
  • Members
  • 3 161 messages
The script hidden 'ghost' could keep running its HB script, that checks whether the dominated creature is still within its power. If not (dominated creature dead/dying, spell cast to negate it, etc) then it could re-emerge from hiding and start the process all over again (resetting all necessary variables in the process).

#15
Morbane

Morbane
  • Members
  • 1 883 messages
FEATS

no - really -

I would like to emphasise that adding and removing a feat is MUCH cleaner - and portable as well: within the game world that is

:devil::?:innocent:

Modifié par Morbane, 17 mai 2013 - 06:53 .


#16
kevL

kevL
  • Members
  • 4 056 messages
DJ: yah that's the ticket!

I feel it still needs an extra safety though; I mean, this is so friggin gamebreaking if something goes wrong. ( like, during the 0.2 sec delay before ScriptHidden engages, although that could be reversed: scripthidden first, then Possess. But scripthidden itself isn't exactly invulnerability... ) Something like a heartbeat on the area/module that's ( also? ) doing checks for IsValid.

i wouldna want to adulterate 'nw_g0_dominate'


Morbane, why add line to Feat.2da when you'd just have to run a script like this to call an additional 'feat' script? The AI isn't going to up & doFeat just because it's in the .2da

#17
Morbane

Morbane
  • Members
  • 1 883 messages
to me it seems more manageable - but your right - a script is called anyway - a small script tho - addfeat and removefeat can be plopped in anywhere is what i am hinting at

-or i just like modding 2das

:whistle:

Modifié par Morbane, 17 mai 2013 - 08:50 .


#18
kevL

kevL
  • Members
  • 4 056 messages
i admit there is a beauty to it -- esp. if PCs got to use it too

(neglecting the passive/active difference atm)

#19
MokahTGS

MokahTGS
  • Members
  • 946 messages
So what are the players options when a party member gets possessed? If they kill the party member, what happens? Are there other options that would end the possession?

#20
kamal_

kamal_
  • Members
  • 5 240 messages

MokahTGS wrote...

So what are the players options when a party member gets possessed? If they kill the party member, what happens? Are there other options that would end the possession?

Normally you'd need to do something to break the posession. But exactly what would normally be story based, do you pour holy water on them, recruit a priest to exorcise them? Maybe some of the planar banishment type spells would work?

#21
I_Raps

I_Raps
  • Members
  • 1 262 messages
Beating them to death works on Red Wizards possessed by evil hags, I'm told.

You could also come up with a custom Exorcism ritual, perhaps on a scroll or tome.  Or you could hold them underwater until they drown and the possessor has to come out.  The possibilities are as boundless as your sadistic streak allows.

Modifié par I_Raps, 18 mai 2013 - 12:19 .


#22
kevL

kevL
  • Members
  • 4 056 messages
And... do you really want to publicize it...

#23
MokahTGS

MokahTGS
  • Members
  • 946 messages
Well the question generally covers what are possibilities in the current system. Are there in-game ways to break possession currently? Would those in-game methods work with that above script?

I'm not really looking for a total rewrite of how things work...this is just one monster after all...

Modifié par MokahTGS, 18 mai 2013 - 01:24 .


#24
I_Raps

I_Raps
  • Members
  • 1 262 messages
A custom script that doesn't just use a standard spell will not be affected by any Dispel Magics, etc. Unless you make it so in the script.*

Dispel Magic, Greater DM, Remove Curse, Song of Freedom, Dismissal, Banishment, Greater Restoration, Word of Faith - all could logically work, though none of them explicitly cover ghostly possession in their descriptions.  Maybe even Turn Undead.

******************************

* I should say "should not be affected."  If all you're doing is adding a standard effect, then those spells may very well work without further ado.

Modifié par I_Raps, 18 mai 2013 - 01:38 .


#25
kevL

kevL
  • Members
  • 4 056 messages
I suggest either activating an item or casting a spell on the target ( perhaps from among a group of spells )

dispel magic looks like it won't work (unless it's among the group), death/respawn should work but haven't tried the default scripts, and resting did work for me ( but i wasn't using defaults, so test test ).


You could even run a script from a conversation ...

... any event that runs a script: onAttacked, onDeath, onSpellCastAt, onEnterArea, onExitArea, etc. although some are more problematic than others,

I suspect that either using a tag-based item or from a conversation is easiest -- the onEvent slots of the possessed character would seem to require mucking with EventHandlers and possibly setting the character as player-unpossessable. Although as a game device i'd prefer the onSpellCastAt mechanic,


but Consider a player going solo: deep dada

EDIT:

here's a thought: give the character a chance per rnd. to expell the ghost based on Wis.

Modifié par kevL, 18 mai 2013 - 02:26 .