39 lines
1.2 KiB
Plaintext
39 lines
1.2 KiB
Plaintext
//::///////////////////////////////////////////////
|
|
//:: teleporttobind.nss
|
|
//::
|
|
//:://////////////////////////////////////////////
|
|
/*
|
|
Player transports to last recall-bind position.
|
|
*/
|
|
//:://////////////////////////////////////////////
|
|
//:: Created By:
|
|
//:: Created On:
|
|
//:://////////////////////////////////////////////
|
|
#include "nw_i0_plot"
|
|
|
|
int CanAffordIt()
|
|
{
|
|
int nCost = 0; //Change 0 to the number of gold to take from Player
|
|
//As the cost of portal use.
|
|
// * remove the gold from the player
|
|
// * I'm having the player remove it from himself
|
|
// * but since I'm also destroying it, this will work
|
|
if (GetGold(GetPCSpeaker()) >= nCost)
|
|
{
|
|
TakeGold(nCost, GetPCSpeaker());
|
|
return TRUE;
|
|
}
|
|
return FALSE;
|
|
}
|
|
|
|
void main()
|
|
{
|
|
CanAffordIt();
|
|
location lLoc = GetLocalLocation(GetPCSpeaker(), "NW_L_LOC_RECALL");
|
|
// * Portal stores last location to jump to for future players
|
|
SetLocalInt(OBJECT_SELF, "NW_L_LOC_EVERUSED", 1);
|
|
SetLocalLocation(OBJECT_SELF, "NW_L_LOC_LAST_RECALL", lLoc);
|
|
ApplyEffectAtLocation(DURATION_TYPE_PERMANENT, EffectVisualEffect(VFX_IMP_UNSUMMON), lLoc);
|
|
AssignCommand(GetPCSpeaker(), JumpToLocation(lLoc));
|
|
}
|