Rutherther / NosSmooth

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.
MIT License
6 stars 3 forks source link

Add raids processing #42

Closed Rutherther closed 1 year ago

Rutherther commented 1 year ago

Handling raids is tricky as there are many packet variants, try to mimic Rutherther/Moonlight..

Rutherther commented 1 year ago

How to obtain raid info:

  1. 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.
  2. upon joining, rdlst is sent. If the raid is null, assign the initial raid info
  3. Members of the raid will be updated
  4. The start is denoted either by raidbf or raid 5, decide which to choose. That puts the raid into Started state
  5. After start, members are updated every second. The progress of the raid is loaded from raidmbf.
  6. After boss is loaded using rboss packet, raid should move into BossFight state
  7. After boss is killed, raidbf is sent with MissionCleared state, that moves the raid into EndedSuccessfully. errorful states:
  8. raidbf contains most of the errorful states, in case it's not 0 and 1, move to appropriate state
  9. 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.