generated from Jaysyn/ModuleTemplate
55 lines
1.5 KiB
Plaintext
55 lines
1.5 KiB
Plaintext
// Saves the current location of the PC.
|
|
// This becomes the location returned by the GetStartingLocation command
|
|
void SetPCStartingLocation(object oPC);
|
|
// Returns the starting location of the PC
|
|
string GetPCStartingLocation(object oPC);
|
|
// sets that the player now has a valid start location
|
|
void SetHasValidStartLocation(object oPC, int nValid=TRUE);
|
|
// Returns TRUE if the PC has a valid start location
|
|
int GetHasValidStartLocation(object oPC);
|
|
|
|
|
|
void SetPCStartingLocation(object oPC)
|
|
{
|
|
// Get their craft box
|
|
object oBox=GetItemPossessedBy(oPC,"jw_crafting_gem");
|
|
string sTag=GetTag(GetArea(oPC))+"_stwp";
|
|
object oWP=GetObjectByTag(sTag);
|
|
if (!GetIsObjectValid(oWP))
|
|
{
|
|
return;
|
|
}
|
|
SetLocalString(oBox,"startloc",sTag);
|
|
SetHasValidStartLocation(oPC);
|
|
}
|
|
|
|
string GetPCStartingLocation(object oPC)
|
|
{
|
|
object oBox=GetItemPossessedBy(oPC,"jw_crafting_gem");
|
|
string sWPTag=GetLocalString(oBox,"startloc");
|
|
return sWPTag;
|
|
}
|
|
|
|
|
|
|
|
// sets that the player now has a valid start location
|
|
void SetHasValidStartLocation(object oPC, int nValid=TRUE)
|
|
{
|
|
object oBox=GetItemPossessedBy(oPC,"jw_crafting_gem");
|
|
SetLocalInt(oBox,"validstartlocx",nValid);
|
|
}
|
|
|
|
// Returns TRUE if the PC has a valid start location
|
|
int GetHasValidStartLocation(object oPC)
|
|
{
|
|
object oBox=GetItemPossessedBy(oPC,"jw_crafting_gem");
|
|
if (GetLocalInt(oBox,"validstartlocx")==TRUE)
|
|
{
|
|
return TRUE;
|
|
}
|
|
else
|
|
{
|
|
return FALSE;
|
|
}
|
|
}
|