65 lines
1.6 KiB
Plaintext
65 lines
1.6 KiB
Plaintext
//Script Name: invroom_ou
|
|
//////////////////////////////////////////
|
|
//Created By: Genisys (Guile)
|
|
//Created On: 8/05/08
|
|
/////////////////////////////////////////
|
|
/*
|
|
This script goes in the OnUsed Event of
|
|
a placeable object that is useable and
|
|
does not have an inventory. It will
|
|
teleport the PC to the Inventory Room,
|
|
where they can have thier inventory
|
|
sorted into bags. (They lose all previous
|
|
bags in their inventory)
|
|
*/
|
|
////////////////////////////////////////
|
|
string sDeny;
|
|
|
|
//Main Script
|
|
void main()
|
|
{
|
|
|
|
object oPC = GetLastUsedBy();
|
|
|
|
|
|
//If the system is in use, don't allow anyone to enter!
|
|
if (GetLocalInt(oPC, "INVUSE")== 1)
|
|
{
|
|
sDeny="Inventory Room In Use, Try again later.";
|
|
|
|
SendMessageToPC(oPC, sDeny);
|
|
|
|
return;
|
|
}
|
|
|
|
//Otherwise set that the room is in use!
|
|
//This allows the PC into the room!!
|
|
SetLocalInt(oPC, "INVROOMUSER", 1);
|
|
|
|
//Note this variable is removed when the PC leaves the area!
|
|
SetLocalInt(GetModule(), "INVUSE", 1);
|
|
|
|
object oTarget;
|
|
location lTarget;
|
|
oTarget = GetWaypointByTag("isystemway");
|
|
|
|
lTarget = GetLocation(oTarget);
|
|
|
|
if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return;
|
|
|
|
SetLocalLocation(oPC, "inv_loc", GetLocation(oPC));
|
|
|
|
AssignCommand(oPC, ClearAllActions());
|
|
|
|
DelayCommand(3.0, AssignCommand(oPC, ActionJumpToLocation(lTarget)));
|
|
|
|
oTarget = oPC;
|
|
|
|
int nInt;
|
|
nInt = GetObjectType(oTarget);
|
|
|
|
if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), oTarget);
|
|
else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oTarget));
|
|
|
|
}
|