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

91 lines
4.2 KiB
Plaintext

// hos_equip item
void fnDoChange(string sID,int nApp,object oPC)
{ // change PC to appearance and make faction friendly
object oWP=GetWaypointByTag(sID+"_RESOURCES");
object oCr;
SetCreatureAppearanceType(oPC,nApp);
SendMessageToPC(oPC,"You feel a change take place.");
if (sID!=GetLocalString(oPC,"sTeamID"))
{ // adjust reputation
oCr=CreateObject(OBJECT_TYPE_CREATURE,sID+"0",GetLocation(oWP));
AdjustReputation(oPC,oCr,100);
} // adjust reputation
} // fnDoChange()
void main()
{
object oPC=GetPCItemLastEquippedBy();
object oItem=GetPCItemLastEquipped();
object oMod=GetModule();
int nDay=GetLocalInt(oMod,"nLastUsed"+GetResRef(oItem));
string sTag=GetTag(oItem);
int nN;
effect eVFX;
if (GetLocalInt(oPC,"bShiftNoEquip"))
{ // shape shifted - do not allow equipping - unless item is bShiftOK
if (!GetLocalInt(oItem,"bShiftOK"))
{ // not allowed while equipped
SendMessageToPC(oPC,"You cannot equip that item while shape shifted.");
AssignCommand(oPC,ClearAllActions());
AssignCommand(oPC,ActionUnequipItem(oItem));
} // not allowed while equipped
} // shape shifted - do not allow equipping - unless item is bShiftOK
if (sTag=="rts_it_op6"||sTag=="rts_it_op7"||sTag=="rts_it_op8"||sTag=="rts_it_op9")
{ // equip an infiltrator cloak
if (GetCalendarDay()!=nDay||nDay==0)
{ // okay to do the change
SetLocalInt(oMod,"nLastUsed"+GetResRef(oItem),GetCalendarDay());
SetLocalInt(oPC,"nMyAppearance",GetAppearanceType(oPC));
sTag=GetStringRight(sTag,1);
if (sTag=="6") fnDoChange("UNC",APPEARANCE_TYPE_BUGBEAR_A,oPC);
else if (sTag=="7") fnDoChange("UND",APPEARANCE_TYPE_WIGHT,oPC);
else if (sTag=="8") fnDoChange("SPID",APPEARANCE_TYPE_ETTERCAP,oPC);
else if (sTag=="9") fnDoChange("DWF",APPEARANCE_TYPE_DWARF,oPC);
} // okay to do the change
else { SendMessageToPC(oPC,"The cloak has already done its magic for the day."); }
} // equip an infiltrator cloak
if (sTag=="rts_it_op10"&&GetLocalObject(oMod,"oSoulLeech")!=oPC)
{ // equipped the soul leech ring
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_FNF_SCREEN_SHAKE),oPC,5.0);
SetLocalObject(oMod,"oSoulLeech",oPC);
SetLocalInt(oMod,"nSoulLeechSouls",0);
ExecuteScript("rts_it_op10_d",oMod);
SendMessageToPC(oPC,"Seering pain shoots through your hand and into your body. You feel different.");
} // equipped the soul leech ring
else if (sTag=="rts_it_srb"||sTag=="rts_it_sra")
{ // equipped a symbiotic ring
oMod=GetItemInSlot(INVENTORY_SLOT_RIGHTRING,oPC);
sTag=GetTag(oMod);
nN=0;
if (sTag=="rts_it_srb"||sTag=="rts_it_sra") nN++;
oMod=GetItemInSlot(INVENTORY_SLOT_LEFTRING,oPC);
sTag=GetTag(oMod);
if (sTag=="rts_it_srb"||sTag=="rts_it_sra") nN++;
if (nN==2)
{ // both rings equipped - bad things happen
DestroyObject(GetItemInSlot(INVENTORY_SLOT_RIGHTRING,oPC));
DelayCommand(0.5,DestroyObject(GetItemInSlot(INVENTORY_SLOT_LEFTRING,oPC)));
oItem=CreateObject(OBJECT_TYPE_ITEM,"rts_it_srb",GetLocation(oPC));
oItem=CreateObject(OBJECT_TYPE_ITEM,"rts_it_sra",GetLocation(oPC));
eVFX=EffectVisualEffect(VFX_COM_CHUNK_RED_LARGE);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT,eVFX,GetLocation(oPC));
eVFX=EffectDamage(GetMaxHitPoints(oPC));
DelayCommand(1.0,ApplyEffectToObject(DURATION_TYPE_INSTANT,eVFX,oPC));
} // both rings equipped - bad things happen
else
{ // one ring equipped
sTag=GetTag(oItem);
if (sTag=="rts_it_srb") eVFX=EffectVisualEffect(VFX_IMP_HEAD_NATURE);
else { eVFX=EffectVisualEffect(VFX_IMP_HEAD_HOLY); }
ApplyEffectToObject(DURATION_TYPE_INSTANT,eVFX,oPC);
SendMessageToPC(oPC,"You feel a momentary humming in your body.");
} // one ring equipped
} // equipped a symbiotic ring
else if (sTag=="rts_it_op18")
{ // spell reflector shield
SetLocalString(oPC,"sWAZOOONSPELLCASTAT","s3_spellreflect");
} // spell reflector shield
DelayCommand(1.0,ExecuteScript("hos_acp",oPC));
}