@@ -1855,15 +1855,15 @@ Unit *PlayerbotAI::FindAttacker( ATTACKERINFOTYPE ait, Unit *victim )
return a;
}
void PlayerbotAI::SetCombatOrderByStr( std::string str, Unit *target ) {
CombatOrderType co;
- if( str == "tank" ) co = ORDERS_TANK;
- else if( str == "assist" ) co = ORDERS_ASSIST;
- else if( str == "heal" ) co = ORDERS_HEAL;
+ if( str == "tank" ) co = ORDERS_TANK;
+ else if( str == "assist" ) co = ORDERS_ASSIST;
+ else if( str == "heal" ) co = ORDERS_HEAL;
else if( str == "protect" ) co = ORDERS_PROTECT;
- else co = ORDERS_RESET;
+ else co = ORDERS_RESET;
SetCombatOrder( co, target );
}
void PlayerbotAI::SetCombatOrder( CombatOrderType co, Unit *target ) {
if( (co == ORDERS_ASSIST || co == ORDERS_PROTECT) && !target )
@@ -1872,10 +1872,14 @@ void PlayerbotAI::SetCombatOrder( CombatOrderType co, Unit *target ) {
m_combatOrder = ORDERS_NONE;
m_targetAssist = 0;
m_targetProtect = 0;
return;
}
+ if( co == ORDERS_TANK )
+ m_combatOrder = ORDERS_TANK;
+ if( co == ORDERS_HEAL )
+ m_combatOrder = ORDERS_HEAL;
if( co == ORDERS_PROTECT )
m_targetProtect = target;
else if( co == ORDERS_ASSIST )
m_targetAssist = target;
if( (co&ORDERS_PRIMARY) )
This should do the trip to allow bots to role as tankers and healers. The rest is about to script 'em.