2025/05/10 Update
Fixed Vile Death Added ApplyFiendishTemplate() Fixed Risen Reunited.
This commit is contained in:
		
							
								
								
									
										178
									
								
								nwn/nwnprc/trunk/epicspellscripts/ep_cnv_risres.nss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										178
									
								
								nwn/nwnprc/trunk/epicspellscripts/ep_cnv_risres.nss
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,178 @@ | ||||
| //::////////////////////////////////////////////// | ||||
| //:: Risen Reunited Conversation | ||||
| //:: ep_cnv_risres | ||||
| //::////////////////////////////////////////////// | ||||
| /** @file | ||||
|     This lets you choose which party member to res | ||||
|  | ||||
|  | ||||
|     @author Stratovarius | ||||
|     @date   Created  - 11.10.2006 | ||||
| 	 | ||||
| 	@modified Jaysyn | ||||
| 	@date 2025-05-09 17:38:32 | ||||
| */ | ||||
| //::////////////////////////////////////////////// | ||||
| //::////////////////////////////////////////////// | ||||
|  | ||||
| #include "prc_alterations" | ||||
| #include "inc_dynconv" | ||||
|  | ||||
| ////////////////////////////////////////////////// | ||||
| /* Constant defintions                          */ | ||||
| ////////////////////////////////////////////////// | ||||
|  | ||||
| const int STAGE_CHOOSE_TARGET     = 0; | ||||
| const int STAGE_CONFIRMATION      = 1; | ||||
|  | ||||
| ////////////////////////////////////////////////// | ||||
| /* Aid functions                                */ | ||||
| ////////////////////////////////////////////////// | ||||
|  | ||||
|  | ||||
| void StorePCForRecovery(object oPC, object oChoice, int nChoice) | ||||
| { | ||||
| 	SetLocalObject(oPC, "RisResTarget" + IntToString(nChoice), oChoice); | ||||
| } | ||||
|  | ||||
| object RetrievePC(object oPC, int nChoice) | ||||
| { | ||||
| 	return GetLocalObject(oPC, "RisResTarget" + IntToString(nChoice)); | ||||
| } | ||||
|  | ||||
| ////////////////////////////////////////////////// | ||||
| /* Main function                                */ | ||||
| ////////////////////////////////////////////////// | ||||
|  | ||||
| void main() | ||||
| { | ||||
|     object oPC = GetPCSpeaker(); | ||||
|     /* Get the value of the local variable set by the conversation script calling | ||||
|      * this script. Values: | ||||
|      * DYNCONV_ABORTED     Conversation aborted | ||||
|      * DYNCONV_EXITED      Conversation exited via the exit node | ||||
|      * DYNCONV_SETUP_STAGE System's reply turn | ||||
|      * 0                   Error - something else called the script | ||||
|      * Other               The user made a choice | ||||
|      */ | ||||
|     int nValue = GetLocalInt(oPC, DYNCONV_VARIABLE); | ||||
|     // The stage is used to determine the active conversation node. | ||||
|     // 0 is the entry node. | ||||
|     int nStage = GetStage(oPC); | ||||
|  | ||||
|     // Check which of the conversation scripts called the scripts | ||||
|     if(nValue == 0) // All of them set the DynConv_Var to non-zero value, so something is wrong -> abort | ||||
|         return; | ||||
|  | ||||
|     if(nValue == DYNCONV_SETUP_STAGE) | ||||
|     { | ||||
|         // Check if this stage is marked as already set up | ||||
|         // This stops list duplication when scrolling | ||||
|         if(!GetIsStageSetUp(nStage, oPC)) | ||||
|         { | ||||
|             // variable named nStage determines the current conversation node | ||||
|             // Function SetHeader to set the text displayed to the PC | ||||
|             // Function AddChoice to add a response option for the PC. The responses are show in order added | ||||
| 	    if(nStage == STAGE_CHOOSE_TARGET) | ||||
|             { | ||||
|                	// Set the header | ||||
|                	string sAmount = "Which character would you like to resurrect?"; | ||||
|                 SetHeader(sAmount); | ||||
|  | ||||
|                 // This reads all of the legal choices  | ||||
|                 object oChoice = GetFirstPC(); | ||||
|                 int nChoice = 1; | ||||
| 		while (GetIsObjectValid(oChoice)) // People in party | ||||
| 		{ | ||||
| 			// If the selection is a PC | ||||
| 			if (GetIsPC(oChoice) && oChoice != oPC && GetIsDead(oChoice)) | ||||
| 			{ | ||||
| 				AddChoice(GetName(oChoice), nChoice, oPC); | ||||
| 				StorePCForRecovery(oPC, oChoice, nChoice); | ||||
| 			} | ||||
| 			nChoice += 1; | ||||
| 			oChoice = GetNextPC(); | ||||
|                 } | ||||
|  | ||||
|                 MarkStageSetUp(STAGE_CHOOSE_TARGET, oPC); // This prevents the setup being run for this stage again until MarkStageNotSetUp is called for it | ||||
|                 SetDefaultTokens(); // Set the next, previous, exit and wait tokens to default values | ||||
|             } | ||||
|             else if(nStage == STAGE_CONFIRMATION)//confirmation | ||||
|             { | ||||
|                 object oChoice = RetrievePC(oPC, GetLocalInt(oPC, "RisResChoice")); | ||||
|                 AddChoice(GetStringByStrRef(4752), TRUE); // "Yes" | ||||
|                 AddChoice(GetStringByStrRef(4753), FALSE); // "No" | ||||
|  | ||||
|                 string sText = "You have selected " + GetName(oChoice) + " as the character to resurrect.\n"; | ||||
|                 sText += "Is this correct?"; | ||||
|  | ||||
|                 SetHeader(sText); | ||||
|                 MarkStageSetUp(STAGE_CONFIRMATION, oPC); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         // Do token setup | ||||
|         SetupTokens(); | ||||
|     } | ||||
|     // End of conversation cleanup | ||||
|     else if(nValue == DYNCONV_EXITED) | ||||
|     { | ||||
|         // End of conversation cleanup | ||||
|         DeleteLocalObject(oPC, "RisResTarget" + IntToString(GetLocalInt(oPC, "RisResChoice"))); | ||||
|         DeleteLocalInt(oPC, "RisResChoice"); | ||||
|     } | ||||
|     // Abort conversation cleanup. | ||||
|     // NOTE: This section is only run when the conversation is aborted | ||||
|     // while aborting is allowed. When it isn't, the dynconvo infrastructure | ||||
|     // handles restoring the conversation in a transparent manner | ||||
|     else if(nValue == DYNCONV_ABORTED) | ||||
|     { | ||||
|         // End of conversation cleanup | ||||
|         DeleteLocalObject(oPC, "RisResTarget" + IntToString(GetLocalInt(oPC, "RisResChoice"))); | ||||
|         DeleteLocalInt(oPC, "RisResChoice"); | ||||
|     } | ||||
|     // Handle PC responses | ||||
|     else | ||||
|     { | ||||
|         // variable named nChoice is the value of the player's choice as stored when building the choice list | ||||
|         // variable named nStage determines the current conversation node | ||||
|         int nChoice = GetChoice(oPC); | ||||
|         if(nStage == STAGE_CHOOSE_TARGET) | ||||
|         { | ||||
|         	SetLocalInt(oPC, "RisResChoice", nChoice); | ||||
|             	nStage = STAGE_CONFIRMATION; | ||||
|         } | ||||
|         else if(nStage == STAGE_CONFIRMATION)//confirmation | ||||
|         { | ||||
|             // Res and Exit | ||||
|             if(nChoice == TRUE) | ||||
|             { | ||||
|             	object oChoice = RetrievePC(oPC, GetLocalInt(oPC, "RisResChoice")); | ||||
|             	// Res the target | ||||
|             	SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectResurrection(), oChoice); | ||||
| 		SPApplyEffectToObject(DURATION_TYPE_INSTANT, PRCEffectHeal(GetMaxHitPoints(oChoice) + 10, oChoice), oChoice); | ||||
| 		ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_RAISE_DEAD), GetLocation(oChoice)); | ||||
| 		 | ||||
| 		ExecuteScript("prc_pw_ressurection", oChoice); | ||||
| 		if (GetPRCSwitch(PRC_PW_DEATH_TRACKING) && GetIsPC(oChoice)) | ||||
|                 	SetPersistantLocalInt(oChoice, "persist_dead", FALSE); | ||||
|             	AssignCommand(oChoice, ActionJumpToObject(oPC)); | ||||
|  | ||||
|                 // And we're all done | ||||
|                	AllowExit(DYNCONV_EXIT_FORCE_EXIT); | ||||
|  | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 nStage = STAGE_CHOOSE_TARGET; | ||||
|                 MarkStageNotSetUp(STAGE_CHOOSE_TARGET, oPC); | ||||
|                 MarkStageNotSetUp(STAGE_CONFIRMATION, oPC); | ||||
|             } | ||||
| 	    DeleteLocalObject(oPC, "RisResTarget" + IntToString(GetLocalInt(oPC, "RisResChoice"))); | ||||
|             DeleteLocalInt(oPC, "RisResChoice"); | ||||
|         } | ||||
|  | ||||
|         // Store the stage value. If it has been changed, this clears out the choices | ||||
|         SetStage(nStage, oPC); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										49
									
								
								nwn/nwnprc/trunk/epicspellscripts/ss_ep_reunited.nss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										49
									
								
								nwn/nwnprc/trunk/epicspellscripts/ss_ep_reunited.nss
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,49 @@ | ||||
| //:://///////////////////////////////////////////// | ||||
| //:: Name      Epic Spell: Risen Reunited | ||||
| //:: FileName  ss_ep_reunited.nss | ||||
| //:://////////////////////////////////////////////9 | ||||
| /** @file Epic Spell: Risen Reunited | ||||
| School: Conjuration (Healing) | ||||
| Components: V,S | ||||
| Range: Personal | ||||
| Target: Any known deceased creature | ||||
| Duration: Instantaneous | ||||
| Saving Throw: None (harmless) | ||||
| Spell Resistance: No (harmless) | ||||
|  | ||||
| You concentrate on any deceased creature*, regardless of proximity,  | ||||
| and resurrect them. Following the instant they regain life, the spell | ||||
|  teleports the subject to your location. | ||||
|  | ||||
| *Upon casting this spell, a conversation will appear listing all  | ||||
| available players who are dead. Choose the player from this list to  | ||||
| resurrect and teleport to you. | ||||
|  | ||||
| Author:    Stratovarius | ||||
| Created:   12/10/06 | ||||
|  | ||||
| Updated: Jaysyn | ||||
| Modified: 2025-05-09 17:41:28 | ||||
| **/ | ||||
| //::////////////////////////////////////////////// | ||||
| //::////////////////////////////////////////////// | ||||
|  | ||||
| #include "prc_inc_spells" | ||||
| #include "inc_dynconv" | ||||
|  | ||||
| void main() | ||||
| { | ||||
| 	PRCSetSchool(SPELL_SCHOOL_CONJURATION); | ||||
| 	 | ||||
| 	// Run the spellhook.  | ||||
| 	if (!X2PreSpellCastCode()) return; | ||||
| 	 | ||||
| 	//Define vars | ||||
| 	object oPC = OBJECT_SELF; | ||||
|  | ||||
| 	StartDynamicConversation("ep_cnv_risres", oPC, DYNCONV_EXIT_ALLOWED_SHOW_CHOICE, FALSE, TRUE, oPC); | ||||
|  | ||||
| 	PRCSetSchool(); | ||||
| } | ||||
| 				 | ||||
| 				 | ||||
		Reference in New Issue
	
	Block a user