AIP conditions
Posted: Wed May 29, 2019 7:30 pm
I have recently seen people asking about AIP formats so I thought I would bring you all up to date on what I have discovered about how to implement them while working on project 137 files which as you may or may not be aware, includes a full set of source code for client and server from a somewhat old version of evo rose.
I have converted my code into a mix of c++ and pseudo-code and will be including one condition along with explanations as to what is required to implement it per post.
To start things off here is the very simplest one of all.
Condition 000
As you can see, It is never used in any AIP file so basically we just return failure and forget about it
AI_FAILURE is not equal to returning false in the server. It actually has a real value defined as follows
AI_SUCCESS = 7
AI_FAILURE = 8
There is no really valid reason why it's done this way. It just is and it's way too much work to recode the whole thing to use true/false so it is what it is.
NEXT....
AI_COND_001
Pretty easy. Just checks if the entity has dealt or received damage and if so is it greater than iDamage as read in from position 0 in the byte array
I have converted my code into a mix of c++ and pseudo-code and will be including one condition along with explanations as to what is required to implement it per post.
To start things off here is the very simplest one of all.
Condition 000
- AIP_COND_000
- //Never used
- return AI_FAILURE
As you can see, It is never used in any AIP file so basically we just return failure and forget about it
AI_FAILURE is not equal to returning false in the server. It actually has a real value defined as follows
AI_SUCCESS = 7
AI_FAILURE = 8
There is no really valid reason why it's done this way. It just is and it's way too much work to recode the whole thing to use true/false so it is what it is.
NEXT....
AI_COND_001
- AIP_COND_001
- //Checks if the Entity has dealt or recieved damage greater than iDamage
- uint32 iDamage //Byte 0
- uint8 cRecvOrGive //Byte 4
- if( cRecvOrGive == 0 ) //received damage
- if( entity->damagerecieved > iDamage )
- return AI_SUCCESS;
- else //dealt damage
- if( entity->damagedealt > iDamage )
- return AI_SUCCESS
- //Default
- return AI_FAILURE
Pretty easy. Just checks if the entity has dealt or received damage and if so is it greater than iDamage as read in from position 0 in the byte array