// zero_loc_itm
#include "x2_inc_switches"
void main()
{
int nEvent =GetUserDefinedItemEventNumber();
if(nEvent != X2_ITEM_EVENT_ACTIVATE){return;}
object oPC = GetItemActivator();
location lPCLocation = GetLocation(oPC);
//object oStone = GetItemPossessedBy(oPC, "whitestone");//Put your item tag here.
object oStone = GetItemActivated();
location lStoredLocation = GetLocalLocation(oStone, "STORED_LOCATION");
if (!GetIsObjectValid(GetAreaFromLocation(lStoredLocation)))
{
SetLocalLocation(oStone, "STORED_LOCATION", lPCLocation);
SendMessageToPC(oPC, "Your location has been saved.");
return;
}
if (GetIsObjectValid(GetAreaFromLocation(lStoredLocation)))
{
AssignCommand(oPC, ActionJumpToLocation(lStoredLocation));
DestroyObject(oStone, 1.0);
SendMessageToPC(oPC, "You have been teleported to your saved location and your stone has been destroyed.");
}
}
so this is what Lightfoot8 is suggesting. Oh and if you want to insure the item being used is your "whitestone" use
if( GetTag(oStone)==""whitestone")
{
// then script here
}
Modifié par Greyfort, 20 février 2011 - 12:17 .