There is a new struct TimedAction
Code: Select all
struct TimedAction {
int32 spawn_id;
int32 action_id;
};
action_id = the action to apply (from the visual_states table in the DB)
Finally you will call ZoneServer::AddTimedAction(TimedAction* action, int32 time), time is when you want the action to go off in milliseconds, so if you want the action to go off in 1 sec you would pass 1000.
Here is an example for knockdown
Code: Select all
Spawn* spawn = client->GetPlayer()->GetTarget();
if (spawn) {
// Start the knockdown animation
spawn->SetTempActionState(11767);
// After 1 sec switch to the idle
TimedAction* act1 = new TimedAction();
act1->spawn_id = spawn->GetID();
act1->action_id = 11769;
client->GetCurrentZone()->AddTimedAction(act1, 1000);
// After 1 sec in idle switch to get up (2 seconds from now)
TimedAction* act2 = new TimedAction();
act2->spawn_id = spawn->GetID();
act2->action_id = 11768;
client->GetCurrentZone()->AddTimedAction(act2, 2000);
// After 3 sec for the get up animation clear the action states (5 seconds from now)
TimedAction* act3 = new TimedAction();
act3->spawn_id = spawn->GetID();
act3->action_id = -1;
client->GetCurrentZone()->AddTimedAction(act3, 5000);
}