HoS_PRC8/_mod/_module/nss/rts_it_mag30.nss
Jaysyn904 04165202c0 Initial upload
Initial upload
2024-11-25 19:36:07 -05:00

85 lines
3.1 KiB
Plaintext

/////////////////////////////////////////////////////////////////////////////////
// Real Time Strategy - NWN - Mind Control Device
//===============================================================================
// By Deva Bryson Winblood. 03/11/2003
/////////////////////////////////////////////////////////////////////////////////
#include "rtsh_multiplay"
void fnGoHostile(object oC)
{ // go hostile
DeleteLocalInt(oC,"bMindControlled");
AssignCommand(oC,ClearAllActions());
AssignCommand(oC,ActionSpeakString("My head!!! AGGHHHH Buzzing and voices!!!"));
ChangeToStandardFaction(oC,STANDARD_FACTION_HOSTILE);
SetLocalInt(oC,"nMState",0);
} // fnGoHostile()
void fnMindControl()
{ // PURPOSE: Run the scripts for a unit possessively
if (GetLocalInt(OBJECT_SELF,"bMindControlled"))
{ // okay to execute
SetLocalInt(OBJECT_SELF,"bGNBDisabled",TRUE);
SetLocalInt(OBJECT_SELF,"nGNBDisabled",TRUE);
ExecuteScript("rts_unit_ai",OBJECT_SELF);
DelayCommand(6.0,fnMindControl());
} // okay to execute
else
{ // cleanup
DeleteLocalInt(OBJECT_SELF,"bGNBDisabled");
DeleteLocalInt(OBJECT_SELF,"nGNBDisabled");
} // cleanup
} // fnMindControl()
void main()
{
object oPC=GetItemActivator();
object oTarget=GetItemActivatedTarget();
int nMana=fnGetTeamMana(oPC);
string sID=GetLocalString(oPC,"sTeamID");
int nWillSave=GetWillSavingThrow(oTarget);
effect eBeam=EffectBeam(VFX_BEAM_MIND,oPC,BODY_NODE_HAND,FALSE);
object oThrone=GetObjectByTag(sID);
object oTemp;
string sStartID=GetLocalString(oTarget,"sTeamID");
if (oTarget!=OBJECT_INVALID)
{ // valid target
if (nMana>169)
{ // enough mana
SendMessageToPC(oPC,"You use 170 mana to try to mind control the "+GetName(oTarget));
nWillSave=nWillSave+d20();
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eBeam,oTarget,6.0);
nMana=nMana-170;
fnSetTeamMana(oPC,nMana);
if (nWillSave<26)
{ // failed to save
SetIsTemporaryFriend(oPC,oTarget);
SetIsTemporaryFriend(oTarget,oPC);
SetLocalString(oTarget,"sTeamID",sID);
SetLocalInt(oTarget,"nMState",5);
SetLocalObject(oTarget,"oDestWP",oPC);
SetLocalInt(oTarget,"bMindControlled",TRUE);
oTemp=GetObjectByTag(sID+"_PROXY");
DelayCommand(2.0,AssignCommand(oTarget,ClearAllActions()));
DelayCommand(3.0,ChangeFaction(oTarget,oTemp));
//DelayCommand(4.0,DestroyObject(oTemp));
DelayCommand(5.0,AssignCommand(oTarget,ActionSpeakString("I am yours to command great one.")));
DelayCommand(HoursToSeconds(24*17),fnGoHostile(oTarget));
if (GetStringLength(sStartID)<1) AssignCommand(oTarget,fnMindControl());
SendMessageToPC(oPC,"This mind control will last 17 days.");
} // failed to save
else
{
SendMessageToPC(oPC,"The target made its will save. It is not controlled!");
SetIsTemporaryEnemy(oPC,oTarget);
SetIsTemporaryEnemy(oTarget,oPC);
}
} // enough mana
else
SendMessageToPC(oPC,"This item requires 170 mana to use.");
} // valid target
else
SendMessageToPC(oPC,"That is NOT a valid target.");
}