Initial Upload
Initial Upload
This commit is contained in:
47
_module/nss/dmshelper.nss
Normal file
47
_module/nss/dmshelper.nss
Normal file
@@ -0,0 +1,47 @@
|
||||
#include "x2_inc_switches"
|
||||
void main()
|
||||
{
|
||||
object oItem=GetItemActivated();
|
||||
object oActivator=GetItemActivator();
|
||||
int nEvent =GetUserDefinedItemEventNumber();
|
||||
|
||||
if (nEvent ==X2_ITEM_EVENT_UNEQUIP) return;
|
||||
if (nEvent ==X2_ITEM_EVENT_EQUIP) return;
|
||||
|
||||
if(GetTag(oItem)=="dmshelper")
|
||||
{
|
||||
if(GetIsDM(oActivator) != TRUE)
|
||||
{
|
||||
object oTest = GetFirstPC();
|
||||
string sTestName = GetPCPlayerName(oActivator);
|
||||
int nFound = FALSE;
|
||||
while (GetIsObjectValid(oTest) && (! nFound))
|
||||
{
|
||||
if (GetPCPlayerName(oTest) == sTestName)
|
||||
{
|
||||
if(GetIsDM(oTest))
|
||||
{
|
||||
nFound = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
DestroyObject(oItem);
|
||||
SendMessageToPC(oActivator,"You are mortal and this is not yours!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
oTest=GetNextPC();
|
||||
}
|
||||
}
|
||||
// get the wand's activator and target, put target info into local vars on activator
|
||||
object oMyActivator = GetItemActivator();
|
||||
object oMyTarget = GetItemActivatedTarget();
|
||||
SetLocalObject(oMyActivator, "dmwandtarget", oMyTarget);
|
||||
location lMyLoc = GetItemActivatedTargetLocation();
|
||||
SetLocalLocation(oMyActivator, "dmwandloc", lMyLoc);
|
||||
|
||||
//Make the activator start a conversation with itself
|
||||
AssignCommand(oMyActivator, ActionStartConversation(oMyActivator, "dmwand", FALSE,FALSE));
|
||||
return;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user