Nostale bot library written in C#. May describe the current state of the game/character from packets. Multiple sources available for capturing the packets from running game.
the raid is null in case it has ended/the player has left - an event will be fired before it's deleted so other parts of the program may keep track of it. The Game is for current state, not for history.
upon joining, rdlst is sent. If the raid is null, assign the initial raid info
Members of the raid will be updated
The start is denoted either by raidbf or raid 5, decide which to choose. That puts the raid into Started state
After start, members are updated every second. The progress of the raid is loaded from raidmbf.
After boss is loaded using rboss packet, raid should move into BossFight state
After boss is killed, raidbf is sent with MissionCleared state, that moves the raid into EndedSuccessfully.
errorful states:
raidbf contains most of the errorful states, in case it's not 0 and 1, move to appropriate state
Leave should be denoted as "raid 1 1", after that the raid is set to null. Determine whether that is sent after the raid ended as well.
In case the mission is cleared, the raid should be set to null only AFTER the boss map is changed. Looks like raid leader set to null denotes that.
Handling raids is tricky as there are many packet variants, try to mimic Rutherther/Moonlight..