Index: ai_pet_dummy.cpp =================================================================== --- ai_pet_dummy.cpp (revision 4164) +++ ai_pet_dummy.cpp (working copy) @@ -202,30 +202,54 @@ m_PBattleSubTarget = NULL; //TODO: CHECK FOR STATUS EFFECTS FOR REMOVE- BREATH (higher priority than healing breaths) - // if(m_PPet->PMaster->PParty==NULL){//solo with master-kun + CBattleEntity* HBTarget = NULL; + uint16 masterHead = ((CCharEntity*)(m_PPet->PMaster))->getStorage(LOC_INVENTORY)->GetItem(((CCharEntity*)(m_PPet->PMaster))->equip[SLOT_HEAD])->getID(); - if(((CCharEntity*)(m_PPet->PMaster))->objtype == TYPE_PC && (masterHead == 12519 || masterHead == 15238)) { //Check for player & AF head, or +1 - if(m_PPet->PMaster->GetHPP() <= 50 && wyverntype == WYVERNTYPE_DEFENSIVE){//healer wyvern - m_PBattleSubTarget = m_PPet->PMaster; + bool bHigherHPThreshold = false; + + if(((CCharEntity*)(m_PPet->PMaster))->objtype == TYPE_PC && (masterHead == 12519 || masterHead == 15238 || masterHead == 27676)) //check for Drachen Armet, Drachen Armet +1 and the new Vishap Armet. + bHigherHPThreshold = true; + + uint8 HPP = m_PPet->PMaster->GetHPP(); + + if(bHigherHPThreshold && HPP <= 50 && wyverntype == WYVERNTYPE_DEFENSIVE) //Armet & Defensive only. + { + HBTarget = m_PPet->PMaster; + } + else if(HPP <= 33 && (bHigherHPThreshold && wyverntype == WYVERNTYPE_MULTIPURPOSE ||wyverntype == WYVERNTYPE_DEFENSIVE )) //check for Armet & Multipurpose or no Armet and Defensive. + { + HBTarget = m_PPet->PMaster; + } + else if(HPP <= 25 && wyverntype == WYVERNTYPE_MULTIPURPOSE) // No armet & multipurpose only. + { + HBTarget = m_PPet->PMaster; + } + + if(HBTarget == NULL && m_PPet->PMaster->PParty != NULL) //Master doesn't need to be healed, find a party member if there is a party. + { + for (uint8 i = 0; i < m_PPet->PMaster->PParty->members.size(); ++i) + { + HPP = m_PPet->PMaster->PParty->members[i]->GetHPP(); + if(bHigherHPThreshold && HPP <= 50 && wyverntype == WYVERNTYPE_DEFENSIVE) //Armet & Defensive only. + { + HBTarget = m_PPet->PMaster->PParty->members[i]; + } + else if(HPP <= 33 && (bHigherHPThreshold && wyverntype == WYVERNTYPE_MULTIPURPOSE || wyverntype == WYVERNTYPE_DEFENSIVE )) //check for Armet & Multipurpose or no Armet and Defensive. + { + HBTarget = m_PPet->PMaster->PParty->members[i]; + } + else if(HPP <= 25 && wyverntype == WYVERNTYPE_MULTIPURPOSE) // No armet & multipurpose only. + { + HBTarget = m_PPet->PMaster->PParty->members[i]; + } + if (HBTarget != NULL) + break; } - else if(m_PPet->PMaster->GetHPP() <= 33 && wyverntype == WYVERNTYPE_MULTIPURPOSE){//hybrid wyvern - m_PBattleSubTarget = m_PPet->PMaster; - } - } else { - if(m_PPet->PMaster->GetHPP() <= 33 && wyverntype == WYVERNTYPE_DEFENSIVE) - {//healer wyvern - m_PBattleSubTarget = m_PPet->PMaster; - } - else if(m_PPet->PMaster->GetHPP() <= 25 && wyverntype == WYVERNTYPE_MULTIPURPOSE) - {//hybrid wyvern - m_PBattleSubTarget = m_PPet->PMaster; - } } - // } - // else{ //group play - // //for( int i=0; i< - // } + + m_PBattleSubTarget = HBTarget; + if(m_PBattleSubTarget != NULL){ //target to heal //get highest breath for wyverns level m_PMobSkill = NULL; @@ -268,7 +292,7 @@ { //self m_PBattleSubTarget = m_PPet; } - else if(m_PMobSkill->getValidTargets() & TARGET_PLAYER_PARTY) + else if(m_PMobSkill->getValidTargets() & TARGET_PLAYER_PARTY && (m_PMobSkill->getID() != 638 && m_PMobSkill->getID() != 639 && m_PMobSkill->getID() != 640)) { m_PBattleSubTarget = m_PPet->PMaster; }