Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.04 KB | None | 0 0
  1. if(df && opc) //dethunter12 affinity proc for points from mobs.
  2.     {
  3.         vec_affinityList_t::iterator it = df->m_proto->m_affinityList.begin();
  4.         vec_affinityList_t::iterator endit = df->m_proto->m_affinityList.end();
  5.        
  6.         int point = 0;
  7.  
  8.         for(; it != endit; ++it)
  9.         {
  10.             CAffinityProto* proto = *(it);
  11.  
  12.             CAffinity* affinity = opc->m_affinityList.FindAffinity(proto->m_index);
  13.             if(affinity) //all affinitys
  14.             {
  15.                 point = proto->GetAffinityPointOfNPC(df->m_idNum); //find the mob and give the points of affinity
  16.                 int bonus = 0;
  17.                 if(opc->m_avPassiveAddition.affinity_monster > 0)
  18.                 {
  19.                     bonus += opc->m_avPassiveAddition.affinity_monster; //bonus = bonus + passive addition affinity monster
  20.                 }
  21.                 if(opc->m_avPassiveRate.affinity_monster > 0)
  22.                 {
  23.                     bonus = point * (opc->m_avPassiveRate.affinity_monster - 100) / SKILL_RATE_UNIT; //bonus = bonus + point * (passiverate - 100) / SKILL_RATE_UNIT
  24.                 }
  25.  
  26.                 affinity->AddPoint( point, opc, bonus); // add the points to the affinity after bonus is determined.
  27.             }
  28.         }
  29.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement