Rune_PRC8/_module/nss/tal_include.nss
Jaysyn904 d1c309ae63 Initial commit
Initial commit
2024-09-13 09:10:39 -04:00

54 lines
2.2 KiB
Plaintext

////////////////////////////////////////////////////////////////////////////////
//
// Talus Menu on Rest
// tal_include
// OPW Integration and Clean Up By Don Anderson
// dandersonru@msn.com
//
// Used in Rest Menu Conversation
//
////////////////////////////////////////////////////////////////////////////////
#include "nw_i0_spells"
void Scrying(object oPC,object oTarg)
{
location pcLocation=GetLocation(oPC);
float scrydur=16.0+IntToFloat(GetCasterLevel(oPC)/3);
if(GetCasterLevel(oPC)<=GetCasterLevel(oTarg))
{
if(d4()>2) SendMessageToPC(oTarg,"You sense you are being watched from afar.");
}
object oCopy=CopyObject(oPC,pcLocation,OBJECT_INVALID,GetName(oPC)+"copy");
DestroyObject(oCopy,scrydur-0.2);
RemoveSpellEffects(SPELL_CLAIRAUDIENCE_AND_CLAIRVOYANCE,oPC,oPC);
DelayCommand(scrydur+0.4,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDamage(GetMaxHitPoints(oCopy),DAMAGE_TYPE_POSITIVE,DAMAGE_POWER_NORMAL),oCopy));
AssignCommand(oCopy,ActionPlayAnimation(ANIMATION_LOOPING_CONJURE1,0.2,3600.00));
ChangeToStandardFaction(oCopy,STANDARD_FACTION_COMMONER);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_DUR_PROT_PREMONITION ),oCopy,scrydur-0.6);
SetImmortal(oCopy,TRUE);
SetCutsceneMode(oPC,TRUE);
DelayCommand(scrydur+0.5,SetCutsceneMode(oPC,FALSE));
DelayCommand(scrydur+0.5,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDamage(GetMaxHitPoints(oCopy)-GetCurrentHitPoints(oCopy),DAMAGE_TYPE_POSITIVE,DAMAGE_POWER_NORMAL),oPC));
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectEthereal(),oPC,scrydur+0.5);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_DUR_CUTSCENE_INVISIBILITY),oPC,scrydur+0.5);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectCutsceneGhost(),oPC,scrydur+0.5);
AssignCommand(oPC,ActionJumpToObject(oTarg,FALSE));
DelayCommand(scrydur-0.3,AssignCommand(oPC,ClearAllActions()));
DelayCommand(scrydur-0.7,SetPlotFlag(oPC,FALSE));
pcLocation=GetLocation(oCopy);
DelayCommand(scrydur,AssignCommand(oPC,ActionJumpToLocation(pcLocation)));
AssignCommand(oPC,ActionForceFollowObject(oTarg,1.0));
SetPlotFlag(oPC,TRUE);
}
int StartingConditional(){return TRUE;}
//void main(){}