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

58 lines
2.1 KiB
Plaintext

////////////////////////////////////////////////////////////////////////////////
//
// Olander's AI
// oai_cust_atck
// by Don Anderson
// dandersonru@msn.com
//
// Place your custom Physically Attacked requirements here.
//
////////////////////////////////////////////////////////////////////////////////
//DMFI CODE ADDITIONS*****************************
void SafeFaction(object oCurrent, object oAttacker)
{
AssignCommand(oAttacker, ClearAllActions());
AssignCommand(oCurrent, ClearAllActions());
// * Note: waiting for Sophia to make SetStandardFactionReptuation to clear all personal reputation
if (GetStandardFactionReputation(STANDARD_FACTION_COMMONER, oAttacker) <= 10)
{ SetLocalInt(oAttacker, "NW_G_Playerhasbeenbad", 10); // * Player bad
SetStandardFactionReputation(STANDARD_FACTION_COMMONER, 80, oAttacker);
}
if (GetStandardFactionReputation(STANDARD_FACTION_MERCHANT, oAttacker) <= 10)
{ SetLocalInt(oAttacker, "NW_G_Playerhasbeenbad", 10); // * Player bad
SetStandardFactionReputation(STANDARD_FACTION_MERCHANT, 80, oAttacker);
}
if (GetStandardFactionReputation(STANDARD_FACTION_DEFENDER, oAttacker) <= 10)
{ SetLocalInt(oAttacker, "NW_G_Playerhasbeenbad", 10); // * Player bad
SetStandardFactionReputation(STANDARD_FACTION_DEFENDER, 80, oAttacker);
}
}
//END DMFI CODE ADDITIONS*************************
void main()
{
//Example
/*
ExecuteScript("blah_blah", OBJECT_SELF);
*/
/******************************************************************************/
//:: PLACE CUSTOM PERCEIVE STUFF BELOW HERE
object oAttacker = GetLastAttacker();
//DMFI CODE ADDITIONS*****************************
if ((GetIsPC(oAttacker) && (GetLocalInt(GetModule(), "dmfi_safe_factions")==1)))
{
SafeFaction(OBJECT_SELF, oAttacker);
SpeakString("DM ALERT: Default non-hostile faction member attacked. Player: "+GetName(oAttacker), TALKVOLUME_SILENT_SHOUT);
SendMessageToAllDMs("DMFI Safe Faction setting is currently set to ignore.");
SendMessageToPC(oAttacker, "Script Fired.");
return;
}
//END DMFI CODE ADDITIONS****************************
}