Initial upload
Initial upload. PRC8 has been added. Module compiles, PRC's default AI & treasure scripts have been integrated. Started work on top hak for SLA / Ability / Scripting modifications.
This commit is contained in:
60
_module/nss/dmw_activate.nss
Normal file
60
_module/nss/dmw_activate.nss
Normal file
@@ -0,0 +1,60 @@
|
||||
//dmw_activate
|
||||
|
||||
// ** This script goes in the OnItemActivation event of your Module
|
||||
// ** Properties. It checks to see if the item used is a DM Helper
|
||||
// ** And if so, and the user isnt a DM, destroys it, otherwise it
|
||||
// ** Starts the DM Helper working.
|
||||
|
||||
void main()
|
||||
{
|
||||
object oItem=GetItemActivated();
|
||||
object oActivator=GetItemActivator();
|
||||
|
||||
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", TRUE));
|
||||
return;
|
||||
}
|
||||
|
||||
if(GetTag(oItem)=="AutoFollow")
|
||||
{
|
||||
object oTarget = GetItemActivatedTarget();
|
||||
|
||||
if(GetIsObjectValid(oTarget))
|
||||
{
|
||||
AssignCommand ( oActivator, ActionForceFollowObject(oTarget));
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user