Advertisement
Guest User

Untitled

a guest
Apr 19th, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.73 KB | None | 0 0
  1. PlayerClassLevelInfo target_classInfo;
  2. PlayerClassLevelInfo owner_classInfo;
  3.  
  4. float targetBaseHealth = 0.0f;
  5. float ownerBaseHealth = 0.0f;
  6. int incBaseHealth = 0;
  7.  
  8. for (uint32 i = MIN_CLASSES; i < MAX_CLASSES; i++)
  9. {
  10.     if (i == 6 || i == 10)
  11.         continue;
  12.  
  13.     sObjectMgr.GetPlayerClassLevelInfo(i, target_level, &target_classInfo);
  14.     sObjectMgr.GetPlayerClassLevelInfo(i, owner_level, &owner_classInfo);
  15.  
  16.     targetBaseHealth += target_classInfo.basehealth;
  17.     ownerBaseHealth += owner_classInfo.basehealth;
  18.  
  19.     incBaseHealth++;
  20. }
  21.  
  22. targetBaseHealth /= incBaseHealth;
  23. ownerBaseHealth /= incBaseHealth;
  24.  
  25. float damage_percent = olddamage / ownerBaseHealth;
  26. float damage_scaled = damage_percent * targetBaseHealth;
  27.  
  28. damage = damage_scaled;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement