Re: AIP Actions
Posted: Tue Jun 04, 2019 5:37 pm
AIP_REWD_031
Nice and simple.
Makes the entity attack the same target as his owner (if he has one)
- //set monster's attack target to the same as the owner
- AIP_REWD_031
- CMap* map = GServer->MapList.Index[entity->Position->Map] //get map
- CCharacter* caller = map->GetCharInMap( entity->owner ) //get owner
- if ( caller == NULL ) //owner not found. return
- return AI_SUCCESS
- if ( !caller->CurrentAction->InCombat ) //if owner is not in combat then return
- return AI_SUCCESS
- entity->Position->source = caller->Position->current //make entity run to owner's position to join the fight
- CCharacter* target = map->GetCharInMap(caller->CurrentAction->targetID) //get target
- if ( target == NULL ) //target not found. return
- return AI_SUCCESS
- entity->StartAction( target ) //initiate combat with owners target. Packets contained in function call.
- return AI_SUCCESS
Nice and simple.
Makes the entity attack the same target as his owner (if he has one)