Alangara_PRC8/_module/nss/mn_aidbc_haokey2.nss
Jaysyn904 86feb9ca6f Initial commit
Initial commit.
2024-06-05 21:21:06 -04:00

73 lines
1.3 KiB
Plaintext

// Key can only be removed if key is had. A section-leader may only
// remove keys from people below him. The three main leaders may remove
// keys from any underling, except for another main leader. A DM or the
// main leader may remove keys from anyone.
#include "mn_i_checkrank"
int StartingConditional()
{
int iResult;
object oPC = GetPCSpeaker();
object oTarget = GetLocalObject( oPC, "mn_target" );
object ring = GetItemPossessedBy( oTarget, "MN_AIDBR_OFFKEY" );
int hasKey = (GetIsObjectValid( ring ));
if ( hasKey == FALSE )
{
return FALSE;
}
// Check for valid rank
int rankOK = FALSE;
if ( GetIsDM( oPC ) )
{
return TRUE;
}
if (CheckRank( oPC ) == MN_AIDB_CEYAR)
{
return TRUE;
}
if ( IsTopRank( oTarget ) )
{
return FALSE;
}
if ( IsTopRank( oPC ) )
{
return TRUE;
}
if ( !IsEinunLeader( oPC ) )
{
return FALSE;
}
int rank = CheckRank( oPC );
int targetrank = CheckRank( oTarget );
if ( targetrank == MN_AIDB_ASSOCIATE )
{
return TRUE;
}
if ( rank == MN_AIDB_SHIELD )
{
return IsAran( oTarget );
}
if ( rank == MN_AIDB_HAND )
{
return IsBerok( oTarget );
}
return FALSE;
}