Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void __thiscall Player::RewardReputation(Player *this, Unit *pVictim, float rate)
- {
- unsigned int v3; // ST10_4@4
- ObjectMgr *v4; // eax@4
- int v5; // edx@11
- unsigned int v6; // eax@12
- FactionEntry *v7; // ST10_4@12
- ReputationMgr *v8; // eax@12
- int v9; // ST10_4@13
- FactionEntry *v10; // ST0C_4@13
- ReputationMgr *v11; // eax@13
- int v12; // ST10_4@17
- FactionEntry *v13; // ST0C_4@17
- ReputationMgr *v14; // eax@17
- unsigned int v15; // eax@20
- FactionEntry *v16; // ST10_4@20
- ReputationMgr *v17; // eax@20
- int v18; // ST10_4@21
- FactionEntry *v19; // ST0C_4@21
- ReputationMgr *v20; // eax@21
- int v21; // ST10_4@25
- FactionEntry *v22; // ST0C_4@25
- ReputationMgr *v23; // eax@25
- int v24; // eax@32
- unsigned int v25; // eax@33
- FactionEntry *v26; // ST10_4@33
- ReputationMgr *v27; // eax@33
- int v28; // ST10_4@34
- FactionEntry *v29; // ST0C_4@34
- ReputationMgr *v30; // eax@34
- int v31; // ST10_4@38
- FactionEntry *v32; // ST0C_4@38
- ReputationMgr *v33; // eax@38
- unsigned int v34; // eax@41
- FactionEntry *v35; // ST10_4@41
- ReputationMgr *v36; // eax@41
- int v37; // ST10_4@42
- FactionEntry *v38; // ST0C_4@42
- ReputationMgr *v39; // eax@42
- int v40; // ST10_4@46
- FactionEntry *v41; // ST0C_4@46
- ReputationMgr *v42; // eax@46
- FactionEntry *v43; // [sp+4h] [bp-58h]@1
- unsigned __int64 v44; // [sp+8h] [bp-54h]@41
- int v45; // [sp+10h] [bp-4Ch]@41
- FactionEntry *team2_factionEntry; // [sp+14h] [bp-48h]@37
- unsigned __int64 current_reputation_rank2; // [sp+18h] [bp-44h]@33
- int donerep2; // [sp+20h] [bp-3Ch]@33
- int faction; // [sp+24h] [bp-38h]@32
- unsigned __int8 i; // [sp+2Bh] [bp-31h]@30
- FactionEntry *v51; // [sp+2Ch] [bp-30h]@24
- unsigned __int64 v52; // [sp+30h] [bp-2Ch]@20
- int standing; // [sp+38h] [bp-24h]@20
- FactionEntry *team1_factionEntry; // [sp+3Ch] [bp-20h]@16
- unsigned __int64 current_reputation_rank1; // [sp+40h] [bp-1Ch]@12
- int donerep1; // [sp+48h] [bp-14h]@12
- unsigned int subfaction; // [sp+4Ch] [bp-10h]@11
- char f; // [sp+53h] [bp-9h]@9
- ReputationOnKillEntry *Rep; // [sp+54h] [bp-8h]@4
- Player *const thisa; // [sp+58h] [bp-4h]@1
- memset(&v43, 0xCCu, 0x58u);
- thisa = this;
- if ( pVictim )
- {
- if ( !Object::isPlayer((Object *)&pVictim->vfptr) )
- {
- v3 = Object::GetEntry((Object *)&pVictim->vfptr);
- v4 = ANATHEMA::Singleton<ObjectMgr,ANATHEMA::SingleThreaded<ObjectMgr>,ANATHEMA::OperatorNew<ObjectMgr>,ANATHEMA::ObjectLifeTime<ObjectMgr>>::Instance();
- Rep = ObjectMgr::GetReputationOnKillEntry(v4, v3);
- if ( Rep )
- {
- if ( Rep->repfaction1 && (!Rep->team_dependent || Player::GetTeam(thisa) == 469) )
- {
- if ( isParentFaction(Rep->repfaction1) )
- {
- for ( f = 0; (signed int)(unsigned __int8)f < 4; ++f )
- {
- v5 = 16 * (unsigned __int8)getIdForParentFaction(Rep->repfaction1);
- subfaction = *(const unsigned int *)((char *)&GroupFaction[0][(unsigned __int8)f] + v5);
- if ( subfaction )
- {
- v6 = Unit::getLevel(pVictim);
- donerep1 = Player::CalculateReputationGain(thisa, 0, Rep->repvalue1, subfaction, v6, 0);
- donerep1 = j___ftol2_sse((double)donerep1 * rate);
- HIDWORD(current_reputation_rank1) = DBCStorage<FactionEntry>::LookupEntry(&sFactionStore, subfaction);
- v7 = (FactionEntry *)HIDWORD(current_reputation_rank1);
- v8 = Player::GetReputationMgr(thisa);
- LODWORD(current_reputation_rank1) = ReputationMgr::GetRank(v8, v7);
- if ( current_reputation_rank1 <= Rep->reputation_max_cap1 )
- {
- v9 = donerep1;
- v10 = (FactionEntry *)HIDWORD(current_reputation_rank1);
- v11 = Player::GetReputationMgr(thisa);
- ReputationMgr::ModifyReputation(v11, v10, v9);
- }
- if ( HIDWORD(current_reputation_rank1) && Rep->is_teamaward1 )
- {
- team1_factionEntry = DBCStorage<FactionEntry>::LookupEntry(
- &sFactionStore,
- *(_DWORD *)(HIDWORD(current_reputation_rank1) + 72));
- if ( team1_factionEntry )
- {
- v12 = donerep1 / 2;
- v13 = team1_factionEntry;
- v14 = Player::GetReputationMgr(thisa);
- ReputationMgr::ModifyReputation(v14, v13, v12);
- }
- }
- }
- }
- }
- else
- {
- v15 = Unit::getLevel(pVictim);
- standing = Player::CalculateReputationGain(thisa, 0, Rep->repvalue1, Rep->repfaction1, v15, 0);
- standing = j___ftol2_sse((double)standing * rate);
- HIDWORD(v52) = DBCStorage<FactionEntry>::LookupEntry(&sFactionStore, Rep->repfaction1);
- v16 = (FactionEntry *)HIDWORD(v52);
- v17 = Player::GetReputationMgr(thisa);
- LODWORD(v52) = ReputationMgr::GetRank(v17, v16);
- if ( v52 <= Rep->reputation_max_cap1 )
- {
- v18 = standing;
- v19 = (FactionEntry *)HIDWORD(v52);
- v20 = Player::GetReputationMgr(thisa);
- ReputationMgr::ModifyReputation(v20, v19, v18);
- }
- if ( HIDWORD(v52) )
- {
- if ( Rep->is_teamaward1 )
- {
- v51 = DBCStorage<FactionEntry>::LookupEntry(&sFactionStore, *(_DWORD *)(HIDWORD(v52) + 72));
- if ( v51 )
- {
- v21 = standing / 2;
- v22 = v51;
- v23 = Player::GetReputationMgr(thisa);
- ReputationMgr::ModifyReputation(v23, v22, v21);
- }
- }
- }
- }
- }
- if ( Rep->repfaction2 && (!Rep->team_dependent || Player::GetTeam(thisa) == 67) )
- {
- if ( isParentFaction(Rep->repfaction2) )
- {
- for ( i = 0; (signed int)i < 4; ++i )
- {
- v24 = 16 * (unsigned __int8)getIdForParentFaction(Rep->repfaction2);
- faction = *(const unsigned int *)((char *)&GroupFaction[0][i] + v24);
- if ( faction )
- {
- v25 = Unit::getLevel(pVictim);
- donerep2 = Player::CalculateReputationGain(thisa, 0, Rep->repvalue2, faction, v25, 0);
- donerep2 = j___ftol2_sse((double)donerep2 * rate);
- HIDWORD(current_reputation_rank2) = DBCStorage<FactionEntry>::LookupEntry(&sFactionStore, faction);
- v26 = (FactionEntry *)HIDWORD(current_reputation_rank2);
- v27 = Player::GetReputationMgr(thisa);
- LODWORD(current_reputation_rank2) = ReputationMgr::GetRank(v27, v26);
- if ( current_reputation_rank2 <= Rep->reputation_max_cap2 )
- {
- v28 = donerep2;
- v29 = (FactionEntry *)HIDWORD(current_reputation_rank2);
- v30 = Player::GetReputationMgr(thisa);
- ReputationMgr::ModifyReputation(v30, v29, v28);
- }
- if ( HIDWORD(current_reputation_rank2) )
- {
- if ( Rep->is_teamaward2 )
- {
- team2_factionEntry = DBCStorage<FactionEntry>::LookupEntry(
- &sFactionStore,
- *(_DWORD *)(HIDWORD(current_reputation_rank2) + 72));
- if ( team2_factionEntry )
- {
- v31 = donerep2 / 2;
- v32 = team2_factionEntry;
- v33 = Player::GetReputationMgr(thisa);
- ReputationMgr::ModifyReputation(v33, v32, v31);
- }
- }
- }
- }
- }
- }
- else
- {
- v34 = Unit::getLevel(pVictim);
- v45 = Player::CalculateReputationGain(thisa, 0, Rep->repvalue2, Rep->repfaction2, v34, 0);
- v45 = j___ftol2_sse((double)v45 * rate);
- HIDWORD(v44) = DBCStorage<FactionEntry>::LookupEntry(&sFactionStore, Rep->repfaction2);
- v35 = (FactionEntry *)HIDWORD(v44);
- v36 = Player::GetReputationMgr(thisa);
- LODWORD(v44) = ReputationMgr::GetRank(v36, v35);
- if ( v44 <= Rep->reputation_max_cap2 )
- {
- v37 = v45;
- v38 = (FactionEntry *)HIDWORD(v44);
- v39 = Player::GetReputationMgr(thisa);
- ReputationMgr::ModifyReputation(v39, v38, v37);
- }
- if ( HIDWORD(v44) )
- {
- if ( Rep->is_teamaward2 )
- {
- v43 = DBCStorage<FactionEntry>::LookupEntry(&sFactionStore, *(_DWORD *)(HIDWORD(v44) + 72));
- if ( v43 )
- {
- v40 = v45 / 2;
- v41 = v43;
- v42 = Player::GetReputationMgr(thisa);
- ReputationMgr::ModifyReputation(v42, v41, v40);
- }
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement