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; }