mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-13 22:01:04 -04:00
38 lines
658 B
Plaintext
38 lines
658 B
Plaintext
|
|
include library.callable;
|
|
include library.utils;
|
|
|
|
|
|
trigger OnInitialize()
|
|
{
|
|
int expirationTime = getIntObjVar(self, "mount_vendor.create");
|
|
|
|
if (getGameTime() > expirationTime)
|
|
messageTo(self, "expireAndCleanup", null, 0, false);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
messageHandler expireAndCleanup()
|
|
{
|
|
obj_id currentPet = callable.getCDCallable(self);
|
|
|
|
if(isIdValid(currentPet) && exists(currentPet))
|
|
{
|
|
// pet is out, is it mounted?
|
|
obj_id riderId = getRiderId(currentPet);
|
|
|
|
if (isIdValid(riderId))
|
|
{
|
|
// dismount
|
|
dismountCreature(riderId);
|
|
}
|
|
}
|
|
|
|
setObjVar( self, "pet.isDead", true );
|
|
destroyObject(self);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|