[DiscordArchive] DoZoneInCombat?
[DiscordArchive] DoZoneInCombat?
Archived author: Tea • Posted: 2023-08-30T16:44:54.596000+00:00
Original source
DoZoneInCombat?
Archived author: ModoX • Posted: 2023-08-30T16:46:04.594000+00:00
Original source
UpdateVictim is essentially victim selection, chase movement (also AttackStart stuffs), evade if no victim selectable
DoMeleeAttackIfReady has to be done manually though
Archived author: Jinnai • Posted: 2023-08-30T16:46:58.989000+00:00
Original source
```c++
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_DEADLY_POISON:
DoCastVictim(SPELL_DEADLY_POISON);
events.Repeat(12s, 16s);
break;
case EVENT_SINISTER_STRIKE:
DoCastVictim(SPELL_SINISTER_STRIKE);
events.Repeat(6s, 9s);
break;
default:
break;
}
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
}
DoMeleeAttackIfReady();
}
```
Archived author: Jinnai • Posted: 2023-08-30T16:47:11.899000+00:00
Original source
the full update part from the screenshot
Archived author: Jinnai • Posted: 2023-08-30T16:50:44.440000+00:00
Original source
pretty much the same shematic thats used absolutly everywhere in tc
Archived author: jackpoz • Posted: 2023-08-30T16:51:25.456000+00:00
Original source
yes
Archived author: jackpoz • Posted: 2023-08-30T16:53:45.195000+00:00
Original source
but if UpdateVictim returns false, it doesn't mean that there is noone attacking
Archived author: Jinnai • Posted: 2023-08-30T16:55:00.254000+00:00
Original source
that would be quite a bummer