Despawn Creature after 5 Min.

Hello,

how could i despawn a creature summoned by an Item after 5 Minutes (ore less)?

unit->SummonCreature(entry, x, y, z, o, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, despawntime);
Something like this.

unit should be the player. Other arguments are rather self explanatory.

I know that thay, thanks anyway. The Problem ist, the Item is already existing and the creature is summoned by a spell.

Well … you could attach an SAI script to the creature.

SMART_EVENT_RESET or something like that

and then

SMART_ACTION_FORCE_DESPAWN

http://collab.kpsn.org/display/tc/smart_scripts

I made this 2 years ago, about:

INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES (128, 0, 140, 0, 25, 0, 100, 0, 0, 0, 0, 0, 41, 10000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Teleporter despawn script');