Files
HeroesStone_PRC8/_module/nss/sbr_onacquire.nss
Jaysyn904 1eefc84201 Initial Commit
Initial Commit.
2025-09-14 15:40:46 -04:00

49 lines
1.5 KiB
Plaintext

//::///////////////////////////////////////////////
//:: Name Demetrious' Supply Based Rest
//:: FileName SBR_onacquire
//:://////////////////////////////////////////////
// http://nwvault.ign.com/Files/scripts/data/1055903555000.shtml
// This script should be executed by your module OnAcquireItem event.
#include "sbr_include"
void main()
{
object oItem = GetModuleItemAcquired();
object oGiver = GetModuleItemAcquiredFrom();
object oPC = GetItemPossessor(oItem);
string sItemTag = GetTag(oItem);
if (
(sItemTag == SBR_DM_WIDGET) &&
(! (GetIsDM(oPC) || GetIsDMPossessed(oPC)) )
)
{
LogMessage(LOG_PC, oPC, GetName(oItem)+" is a DM only item! Automatically destroying.");
LogMessage(LOG_FILE_DM_ALL, oPC, GetName(oPC)+" acquired an SBR DM Widget and it was destroyed.");
DestroyObject(oItem);
}
if (sItemTag == SBR_KIT_WOODLAND)
{
int nRang = FALSE;
// Woodland kits can only be possessed by ranger/druids and DMs.
if (GetLevelByClass(CLASS_TYPE_RANGER, oPC)>=1)
nRang = TRUE;
if (GetLevelByClass(CLASS_TYPE_DRUID, oPC)>=1)
nRang = TRUE;
if (GetIsDM(oPC) || GetIsDMPossessed(oPC))
nRang = TRUE;
if (!nRang)
{
LogMessage(LOG_PC, oPC, "You don't have the skills to use this item.");
LogMessage(LOG_PC_SERVER, oPC, "OOC: Woodland kits can only be carried by rangers/druids.");
DestroyObject(oItem);
CreateKit(oPC, sItemTag, TRUE);
}
}
}