Advertisement
Shuraken007

ida_mangos_debug

Aug 28th, 2016
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.29 KB | None | 0 0
  1. void __thiscall Player::RewardReputation(Player *this, Unit *pVictim, float rate)
  2. {
  3. unsigned int v3; // ST10_4@4
  4. ObjectMgr *v4; // eax@4
  5. int v5; // edx@11
  6. unsigned int v6; // eax@12
  7. FactionEntry *v7; // ST10_4@12
  8. ReputationMgr *v8; // eax@12
  9. int v9; // ST10_4@13
  10. FactionEntry *v10; // ST0C_4@13
  11. ReputationMgr *v11; // eax@13
  12. int v12; // ST10_4@17
  13. FactionEntry *v13; // ST0C_4@17
  14. ReputationMgr *v14; // eax@17
  15. unsigned int v15; // eax@20
  16. FactionEntry *v16; // ST10_4@20
  17. ReputationMgr *v17; // eax@20
  18. int v18; // ST10_4@21
  19. FactionEntry *v19; // ST0C_4@21
  20. ReputationMgr *v20; // eax@21
  21. int v21; // ST10_4@25
  22. FactionEntry *v22; // ST0C_4@25
  23. ReputationMgr *v23; // eax@25
  24. int v24; // eax@32
  25. unsigned int v25; // eax@33
  26. FactionEntry *v26; // ST10_4@33
  27. ReputationMgr *v27; // eax@33
  28. int v28; // ST10_4@34
  29. FactionEntry *v29; // ST0C_4@34
  30. ReputationMgr *v30; // eax@34
  31. int v31; // ST10_4@38
  32. FactionEntry *v32; // ST0C_4@38
  33. ReputationMgr *v33; // eax@38
  34. unsigned int v34; // eax@41
  35. FactionEntry *v35; // ST10_4@41
  36. ReputationMgr *v36; // eax@41
  37. int v37; // ST10_4@42
  38. FactionEntry *v38; // ST0C_4@42
  39. ReputationMgr *v39; // eax@42
  40. int v40; // ST10_4@46
  41. FactionEntry *v41; // ST0C_4@46
  42. ReputationMgr *v42; // eax@46
  43. FactionEntry *v43; // [sp+4h] [bp-58h]@1
  44. unsigned __int64 v44; // [sp+8h] [bp-54h]@41
  45. int v45; // [sp+10h] [bp-4Ch]@41
  46. FactionEntry *team2_factionEntry; // [sp+14h] [bp-48h]@37
  47. unsigned __int64 current_reputation_rank2; // [sp+18h] [bp-44h]@33
  48. int donerep2; // [sp+20h] [bp-3Ch]@33
  49. int faction; // [sp+24h] [bp-38h]@32
  50. unsigned __int8 i; // [sp+2Bh] [bp-31h]@30
  51. FactionEntry *v51; // [sp+2Ch] [bp-30h]@24
  52. unsigned __int64 v52; // [sp+30h] [bp-2Ch]@20
  53. int standing; // [sp+38h] [bp-24h]@20
  54. FactionEntry *team1_factionEntry; // [sp+3Ch] [bp-20h]@16
  55. unsigned __int64 current_reputation_rank1; // [sp+40h] [bp-1Ch]@12
  56. int donerep1; // [sp+48h] [bp-14h]@12
  57. unsigned int subfaction; // [sp+4Ch] [bp-10h]@11
  58. char f; // [sp+53h] [bp-9h]@9
  59. ReputationOnKillEntry *Rep; // [sp+54h] [bp-8h]@4
  60. Player *const thisa; // [sp+58h] [bp-4h]@1
  61.  
  62. memset(&v43, 0xCCu, 0x58u);
  63. thisa = this;
  64. if ( pVictim )
  65. {
  66. if ( !Object::isPlayer((Object *)&pVictim->vfptr) )
  67. {
  68. v3 = Object::GetEntry((Object *)&pVictim->vfptr);
  69. v4 = ANATHEMA::Singleton<ObjectMgr,ANATHEMA::SingleThreaded<ObjectMgr>,ANATHEMA::OperatorNew<ObjectMgr>,ANATHEMA::ObjectLifeTime<ObjectMgr>>::Instance();
  70. Rep = ObjectMgr::GetReputationOnKillEntry(v4, v3);
  71. if ( Rep )
  72. {
  73. if ( Rep->repfaction1 && (!Rep->team_dependent || Player::GetTeam(thisa) == 469) )
  74. {
  75. if ( isParentFaction(Rep->repfaction1) )
  76. {
  77. for ( f = 0; (signed int)(unsigned __int8)f < 4; ++f )
  78. {
  79. v5 = 16 * (unsigned __int8)getIdForParentFaction(Rep->repfaction1);
  80. subfaction = *(const unsigned int *)((char *)&GroupFaction[0][(unsigned __int8)f] + v5);
  81. if ( subfaction )
  82. {
  83. v6 = Unit::getLevel(pVictim);
  84. donerep1 = Player::CalculateReputationGain(thisa, 0, Rep->repvalue1, subfaction, v6, 0);
  85. donerep1 = j___ftol2_sse((double)donerep1 * rate);
  86. HIDWORD(current_reputation_rank1) = DBCStorage<FactionEntry>::LookupEntry(&sFactionStore, subfaction);
  87. v7 = (FactionEntry *)HIDWORD(current_reputation_rank1);
  88. v8 = Player::GetReputationMgr(thisa);
  89. LODWORD(current_reputation_rank1) = ReputationMgr::GetRank(v8, v7);
  90. if ( current_reputation_rank1 <= Rep->reputation_max_cap1 )
  91. {
  92. v9 = donerep1;
  93. v10 = (FactionEntry *)HIDWORD(current_reputation_rank1);
  94. v11 = Player::GetReputationMgr(thisa);
  95. ReputationMgr::ModifyReputation(v11, v10, v9);
  96. }
  97. if ( HIDWORD(current_reputation_rank1) && Rep->is_teamaward1 )
  98. {
  99. team1_factionEntry = DBCStorage<FactionEntry>::LookupEntry(
  100. &sFactionStore,
  101. *(_DWORD *)(HIDWORD(current_reputation_rank1) + 72));
  102. if ( team1_factionEntry )
  103. {
  104. v12 = donerep1 / 2;
  105. v13 = team1_factionEntry;
  106. v14 = Player::GetReputationMgr(thisa);
  107. ReputationMgr::ModifyReputation(v14, v13, v12);
  108. }
  109. }
  110. }
  111. }
  112. }
  113. else
  114. {
  115. v15 = Unit::getLevel(pVictim);
  116. standing = Player::CalculateReputationGain(thisa, 0, Rep->repvalue1, Rep->repfaction1, v15, 0);
  117. standing = j___ftol2_sse((double)standing * rate);
  118. HIDWORD(v52) = DBCStorage<FactionEntry>::LookupEntry(&sFactionStore, Rep->repfaction1);
  119. v16 = (FactionEntry *)HIDWORD(v52);
  120. v17 = Player::GetReputationMgr(thisa);
  121. LODWORD(v52) = ReputationMgr::GetRank(v17, v16);
  122. if ( v52 <= Rep->reputation_max_cap1 )
  123. {
  124. v18 = standing;
  125. v19 = (FactionEntry *)HIDWORD(v52);
  126. v20 = Player::GetReputationMgr(thisa);
  127. ReputationMgr::ModifyReputation(v20, v19, v18);
  128. }
  129. if ( HIDWORD(v52) )
  130. {
  131. if ( Rep->is_teamaward1 )
  132. {
  133. v51 = DBCStorage<FactionEntry>::LookupEntry(&sFactionStore, *(_DWORD *)(HIDWORD(v52) + 72));
  134. if ( v51 )
  135. {
  136. v21 = standing / 2;
  137. v22 = v51;
  138. v23 = Player::GetReputationMgr(thisa);
  139. ReputationMgr::ModifyReputation(v23, v22, v21);
  140. }
  141. }
  142. }
  143. }
  144. }
  145. if ( Rep->repfaction2 && (!Rep->team_dependent || Player::GetTeam(thisa) == 67) )
  146. {
  147. if ( isParentFaction(Rep->repfaction2) )
  148. {
  149. for ( i = 0; (signed int)i < 4; ++i )
  150. {
  151. v24 = 16 * (unsigned __int8)getIdForParentFaction(Rep->repfaction2);
  152. faction = *(const unsigned int *)((char *)&GroupFaction[0][i] + v24);
  153. if ( faction )
  154. {
  155. v25 = Unit::getLevel(pVictim);
  156. donerep2 = Player::CalculateReputationGain(thisa, 0, Rep->repvalue2, faction, v25, 0);
  157. donerep2 = j___ftol2_sse((double)donerep2 * rate);
  158. HIDWORD(current_reputation_rank2) = DBCStorage<FactionEntry>::LookupEntry(&sFactionStore, faction);
  159. v26 = (FactionEntry *)HIDWORD(current_reputation_rank2);
  160. v27 = Player::GetReputationMgr(thisa);
  161. LODWORD(current_reputation_rank2) = ReputationMgr::GetRank(v27, v26);
  162. if ( current_reputation_rank2 <= Rep->reputation_max_cap2 )
  163. {
  164. v28 = donerep2;
  165. v29 = (FactionEntry *)HIDWORD(current_reputation_rank2);
  166. v30 = Player::GetReputationMgr(thisa);
  167. ReputationMgr::ModifyReputation(v30, v29, v28);
  168. }
  169. if ( HIDWORD(current_reputation_rank2) )
  170. {
  171. if ( Rep->is_teamaward2 )
  172. {
  173. team2_factionEntry = DBCStorage<FactionEntry>::LookupEntry(
  174. &sFactionStore,
  175. *(_DWORD *)(HIDWORD(current_reputation_rank2) + 72));
  176. if ( team2_factionEntry )
  177. {
  178. v31 = donerep2 / 2;
  179. v32 = team2_factionEntry;
  180. v33 = Player::GetReputationMgr(thisa);
  181. ReputationMgr::ModifyReputation(v33, v32, v31);
  182. }
  183. }
  184. }
  185. }
  186. }
  187. }
  188. else
  189. {
  190. v34 = Unit::getLevel(pVictim);
  191. v45 = Player::CalculateReputationGain(thisa, 0, Rep->repvalue2, Rep->repfaction2, v34, 0);
  192. v45 = j___ftol2_sse((double)v45 * rate);
  193. HIDWORD(v44) = DBCStorage<FactionEntry>::LookupEntry(&sFactionStore, Rep->repfaction2);
  194. v35 = (FactionEntry *)HIDWORD(v44);
  195. v36 = Player::GetReputationMgr(thisa);
  196. LODWORD(v44) = ReputationMgr::GetRank(v36, v35);
  197. if ( v44 <= Rep->reputation_max_cap2 )
  198. {
  199. v37 = v45;
  200. v38 = (FactionEntry *)HIDWORD(v44);
  201. v39 = Player::GetReputationMgr(thisa);
  202. ReputationMgr::ModifyReputation(v39, v38, v37);
  203. }
  204. if ( HIDWORD(v44) )
  205. {
  206. if ( Rep->is_teamaward2 )
  207. {
  208. v43 = DBCStorage<FactionEntry>::LookupEntry(&sFactionStore, *(_DWORD *)(HIDWORD(v44) + 72));
  209. if ( v43 )
  210. {
  211. v40 = v45 / 2;
  212. v41 = v43;
  213. v42 = Player::GetReputationMgr(thisa);
  214. ReputationMgr::ModifyReputation(v42, v41, v40);
  215. }
  216. }
  217. }
  218. }
  219. }
  220. }
  221. }
  222. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement