mob respond to players' actions, that's certain.
but is it actually a blocking point?
the fact that the mob does not generate event when there are no players is definitely something that does not matter ... since there are no players to be involved in this event.
if I rewrite the requirement "after ~ 6 hours, altar should remove himself" as "after ~ 6 hours, any actions on altar remove it", the coding becomes obvious.
Code:
-- -----------------------------
-- AI script for test mob 58 (or any other)
-- -----------------------------
Mob = LuaMob(CMob)
-- -----------------------------
-- instance members
dwDeathTime = 0
-- -----------------------------
function Init()
-- set death time to current time + 6 hrs
-- (see http://lua-users.org/wiki/OsLibraryTutorial)
-- dwDeathTime = os.time() + 6 * 60 * 60
-- set delay to 30 sec for tests
dwDeathTime = os.time() + 30
-- Mob:LuaSay('Mob:Initied', 20)
end
-- -----------------------------
function OnMoveEnd( dwTime )
end
-- -----------------------------
function OnAttacked( dwTime, dwCharID )
-- this callback is never called by my ps_game
end
-- -----------------------------
-- invoked each time a new aggro / attack occurs
function OnAttackable( dwTime, dwCharID )
Mob:LuaSay('Mob:OnAttackable', 20)
-- test for new aggro/attack after a reset
if (os.time() > dwDeathTime) then
Mob:LuaDeleteMob( 58, 1, 0.0, 0.0 )
end
end
-- -----------------------------
function OnNormalReset( dwTime )
end
-- -----------------------------
function OnDeath( dwTime, dwAttackedCount )
end
-- -----------------------------
function OnReturnHome( dwTime, dwAttackedCount )
end
-- -----------------------------
function WhileCombat( dwTime, dwHPPercent, dwAttackedCount )
-- debug feedback
Mob:LuaSay('in combat at ' .. os.time() .. ' HP: ' .. dwHPPercent .. ' Count: ' .. dwAttackedCount, 20 )
if (os.time() > dwDeathTime) then
Mob:LuaDeleteMob( 58, 1, 0.0, 0.0 )
end
end
with my ps_game the OnAttacked() callback is never invoked, I so don't use in to ckeck status.
the LuaGetMobUID

is also not present in my ps_game, I so hard code the mob ID '58' of course one would prefer to dynamically recover the ID of the mob to remove it.
when the mob lost aggro (reset) and returns to home, it resets its HP but all LUA data are kept inchanged, this include our 'dwDeathTime' variable as well as some parameters transmitted to methods (including dwAttackedCount that will count the number of attacks received by the mob during its whole life); the mob can so remove itself after a given delay or a number of attacks.
also, since the dwDeathTime is not resetted, the counter (actually the dead line) will be valid forever and the test in OnAttackable will remove the mob (little visual glitch) if an aggro starts while the 6hr are elapsed.
this grants the requirement "the mob leasts for at most 6 hrs" (it can be present a longer time but only if there are no players to be aware of that).
OOH it is not possible to grant that "the mob (altar) is replaced by another mob (altar) after exactly 6 hrs", still it can be replaced by another mob as soon as the delay is expired *and* a player aggros or attacks it.