[Commands] Cleanup #doanim Command. (#2540)

* [Commands] Cleanup #doanim Command.

- Cleanup messages and logic.
- Allow you to use animation names or IDs, could possibly extend this to quest API in the future.

* Update dialogue_window.h
This commit is contained in:
Kinglykrab
2022-11-14 16:38:05 -05:00
committed by GitHub
parent e5ad9264d0
commit 36887203d3
5 changed files with 161 additions and 24 deletions
+5 -11
View File
@@ -2320,24 +2320,18 @@ void Mob::ShowStats(Client* client)
}
}
void Mob::DoAnim(const int animnum, int type, bool ackreq, eqFilterType filter)
void Mob::DoAnim(const int animation_id, int animation_speed, bool ackreq, eqFilterType filter)
{
if (!attack_anim_timer.Check()) {
return;
}
auto outapp = new EQApplicationPacket(OP_Animation, sizeof(Animation_Struct));
auto *anim = (Animation_Struct *) outapp->pBuffer;
anim->spawnid = GetID();
auto *a = (Animation_Struct *) outapp->pBuffer;
if (type == 0) {
anim->action = animnum;
anim->speed = 10;
}
else {
anim->action = animnum;
anim->speed = type;
}
a->spawnid = GetID();
a->action = animation_id;
a->speed = animation_speed ? animation_speed : 10;
entity_list.QueueCloseClients(
this, /* Sender */