LoD_PRC8/_module/nss/hal_halqufin1.nss
Jaysyn904 94990edc60 Initial Upload
Initial Upload
2023-09-21 21:20:34 -04:00

102 lines
3.7 KiB
Plaintext

#include "nw_o0_itemmaker"
const string BANISHING_OF_THE_CURSE = "banishing_of_the_curse";
void SetLocalArrayLocation(object oidObject, string sVarName, int nVarNum, location lValue);
void SetLocalArrayLocation(object oidObject, string sVarName, int nVarNum, location lValue)
{
string sFullVarName = sVarName + IntToString(nVarNum);
SetLocalLocation(oidObject, sFullVarName, lValue);
}
location GetLocalArrayLocation(object oidObject, string sVarName, int nVarNum);
location GetLocalArrayLocation(object oidObject, string sVarName, int nVarNum)
{
string sFullVarName = sVarName + IntToString(nVarNum);
return GetLocalLocation(oidObject, sFullVarName);
}
void main()
{
object oStaff = GetInventoryDisturbItem();
if(GetTag(oStaff) == "bh_holystaafofm")
{
DestroyObject(oStaff);
int nPlaceableAmmonut = 0;
object oPartyArea;
object oChangeable;
location lChangeable;
location lReward;
string sTag;
object oArea = GetArea(OBJECT_SELF);
object oPartyM = GetFirstFactionMember(GetLastUsedBy());
while(GetIsObjectValid(oPartyM))
{
oPartyArea = GetArea(oPartyM);
if(!GetIsDM(oPartyM) && oArea == oPartyArea)
{
DelayCommand(0.7f, FadeToBlack(oPartyM));
DelayCommand(2.7f, FadeFromBlack(oPartyM));
}
oPartyM = GetNextFactionMember(GetLastUsedBy());
}
oChangeable = GetFirstObjectInArea(oArea);
while(GetIsObjectValid(oChangeable))
{
sTag = GetTag(oChangeable);
if(sTag == "MagicSparksRed")
{
lChangeable = GetLocation(oChangeable);
DestroyObject(oChangeable);
SetLocalArrayString(OBJECT_SELF, BANISHING_OF_THE_CURSE, nPlaceableAmmonut, "plc_magiccyan");
SetLocalArrayLocation(OBJECT_SELF, BANISHING_OF_THE_CURSE, nPlaceableAmmonut, lChangeable);
nPlaceableAmmonut++;
}
else if(sTag == "bh_hasove1" || sTag == "ImpalingSpearwHumanCorpse" || sTag == "Arrowfilledcorpse" || sTag == "Bloodstain" || sTag == "FlyCladPlagueVictimCorpse" || sTag == "SpearSwordfilledCorpse" || sTag == "SkullPole")
{
DestroyObject(oChangeable);
}
//Reward.
else if(sTag == "bh_axoranoi")
{
lChangeable = GetLocation(oChangeable);
lReward = lChangeable;
SetLocalArrayString(OBJECT_SELF, BANISHING_OF_THE_CURSE, nPlaceableAmmonut, "plc_solcyan");
SetLocalArrayLocation(OBJECT_SELF, BANISHING_OF_THE_CURSE, nPlaceableAmmonut, lChangeable);
nPlaceableAmmonut++;
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SUMMON_CELESTIAL), oChangeable);
DelayCommand(0.2f, AssignCommand(oChangeable, ActionSpeakString("Thank you great champion. Now we are free at last.")));
DelayCommand(1.0f, DestroyObject(oChangeable));
}
oChangeable = GetNextObjectInArea(oArea);
}
DelayCommand(2.0f, SetFogColor(FOG_TYPE_ALL, FOG_COLOR_CYAN));
DelayCommand(2.0f, SetFogAmount(FOG_TYPE_ALL, 2));
DelayCommand(2.0f, MusicBackgroundChangeNight(oArea, TRACK_TEMPLEGOOD));
DelayCommand(2.0f, MusicBackgroundChangeDay(oArea, TRACK_TEMPLEGOOD));
int nCount;
string sResRef;
location lPlace;
for(nCount = 0; nCount < nPlaceableAmmonut; nCount++)
{
sResRef = GetLocalArrayString(OBJECT_SELF, BANISHING_OF_THE_CURSE, nCount);
lPlace = GetLocalArrayLocation(OBJECT_SELF, BANISHING_OF_THE_CURSE, nCount);
CreateObject(OBJECT_TYPE_PLACEABLE, sResRef, lPlace);
}
CreateObject(OBJECT_TYPE_ITEM, "bt_xqcbba", lReward);
CreateObject(OBJECT_TYPE_ITEM, "bi_asoltoken", lReward);
}
}