- //Stop all actions
- AIP_REWD_000
- entity->CurrentAction->Clear ( ) //Clear current actions
- entity->Position->destiny = entity->Position->current //Set position destiny to exactly where I am right now so I stop moving
- return AI_SUCCESS
Starting with
AIP_REWD_000
As stated at the top of the function, this command stops all actions.
First of all we clear current actions in the entity->CurrentAction[b] class. This is a new class that has been added in project 137. It is used to control all skills and actions that a player or monster may be involved in. It works as a state machine in a similar way to the way that [b]Battle does in the standard osrose server but is a lot more streamlined and efficient.
Next we make sure that the entity stops moving completely by setting its destination (destiny) position equal to its present location.