Jump to content

[patch] WotLK Reputation Tabards


Auntie Mangos

Recommended Posts

Tinkered on this for a little while, ended with this after some research (8584 version)

diff --git "a\\src\\\\game\\\\Player.cpp" "b\\\\src\\\\game\\\\Player.cpp"
index bae8ce3..6b52469 100644
--- "a\\\\src\\\\game\\\\Player.cpp"
+++ "b\\\\src\\\\game\\\\Player.cpp"
@@ -5878,11 +5878,39 @@ void Player::RewardReputation(Unit *pVictim, float rate)
    if(!Rep)
        return;

+    uint32 Repfaction1 = Rep->repfaction1;
+    uint32 Repfaction2 = Rep->repfaction2;
+    uint32 tabardFactionID = 0;
+    
+    // Championning tabard reputation system
+    // aura 57818 is a hidden aura common to northrend tabards allowing championning.
+    if(HasAura(57818))
+    {
+        InstanceTemplate const* mInstance = objmgr.GetInstanceTemplate(pVictim->GetMapId());
+        MapEntry const* StoredMap = sMapStore.LookupEntry(pVictim->GetMapId());
+
+        // only for expansion 2 map (wotlk), and : heroic mode or a min level >= lv75 
+        // entering a lv80 designed instance require a min level>=75. note : min level != suggested level
+        if (StoredMap->Expansion() == 2 && ( mInstance->levelMin >= 75 || pVictim->GetMap()->IsHeroic() ) )
+        {     	
+            Item* pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_TABARD );
+            if(pItem)
+            {
+                tabardFactionID = pItem->GetProto()->RequiredReputationFaction;
+                if (tabardFactionID) 
+                {
+                     Repfaction1 = tabardFactionID;
+                     Repfaction2 = tabardFactionID;
+                }
+            }
+        }
+    }
+
    if(Rep->repfaction1 && (!Rep->team_dependent || GetTeam()==ALLIANCE))
    {
-        int32 donerep1 = CalculateReputationGain(pVictim->getLevel(), Rep->repvalue1, Rep->repfaction1, false);
+        int32 donerep1 = CalculateReputationGain(pVictim->getLevel(), Rep->repvalue1, Repfaction1, false);
        donerep1 = int32(donerep1*rate);
-        FactionEntry const *factionEntry1 = sFactionStore.LookupEntry(Rep->repfaction1);
+        FactionEntry const *factionEntry1 = sFactionStore.LookupEntry(Repfaction1);
        uint32 current_reputation_rank1 = GetReputationMgr().GetRank(factionEntry1);
        if (factionEntry1 && current_reputation_rank1 <= Rep->reputation_max_cap1)
            GetReputationMgr().ModifyReputation(factionEntry1, donerep1);
@@ -5898,9 +5926,9 @@ void Player::RewardReputation(Unit *pVictim, float rate)

    if(Rep->repfaction2 && (!Rep->team_dependent || GetTeam()==HORDE))
    {
-        int32 donerep2 = CalculateReputationGain(pVictim->getLevel(), Rep->repvalue2, Rep->repfaction2, false);
+        int32 donerep2 = CalculateReputationGain(pVictim->getLevel(), Rep->repvalue2, Repfaction2, false);
        donerep2 = int32(donerep2*rate);
-        FactionEntry const *factionEntry2 = sFactionStore.LookupEntry(Rep->repfaction2);
+        FactionEntry const *factionEntry2 = sFactionStore.LookupEntry(Repfaction2);
        uint32 current_reputation_rank2 = GetReputationMgr().GetRank(factionEntry2);
        if (factionEntry2 && current_reputation_rank2 <= Rep->reputation_max_cap2)
            GetReputationMgr().ModifyReputation(factionEntry2, donerep2);

It allows setting any reputation for each dungeon (as example, violet hold give kirin tor reputation), and works with normal dungeons designed for lv80 as they require a lv 75 minimum level to enter. Which is different than the suggested minimum level for the instance, usually at min level+2

Thanks to eNeRGy and kohl for their work, helped me a lot understanding what was doable with mangos

Link to comment
Share on other sites

  • Replies 56
  • Created
  • Last Reply

Top Posters In This Topic

  • 2 weeks later...
  • 3 weeks later...

Tested patch from post #24 and works perfectly on revision 8797. But i'm not sure about adding reputation to player without tabard. In this case, whole tabard championing is useless. Maybe, some non-existing faction can be used for all dungeons in northrend, but it will make many errors in log.

Link to comment
Share on other sites

Tested patch from post #24 and works perfectly on revision 8797. But i'm not sure about adding reputation to player without tabard. In this case, whole tabard championing is useless. Maybe, some non-existing faction can be used for all dungeons in northrend, but it will make many errors in log.

while you are not wearing any of this tabards, than your must gain reputation with Aliance Vanguard/Horde Expedition. But this will need clarification from retail, what reputation are you gaining, because aliance vanguard/horde expedition factions standings are cumulated from the four subfactions, divided by 2, so, if you have two of this subfactions on exalted, you have exalted aliance vanguard/horde expedition. So it needs clarification, if you really (without tabard) gain reputation with aliance vanguard/horde expedition (then it must break rule about adding and dividing subfactions reputations), or if you gain reputation with one of the subfactions (and to main faction as well) - this will not break the rule. If the second option is correct, then we must also investigate, how to choose subfacion, to which the reputation will be added and if two subfactions are on exalted, we should stop adding the reputation

Link to comment
Share on other sites

ok..so...i asked one of my friends who plays on offi...wthout tabard, player have to gain reputatino with Horde Expedition/Aliance Vanguard...last question is, how many reputation has player to gain after kill trash mobs/bosses...i will ask and post here later :)

EDIT: Sorry for many misstypes...whole night working on server :) but i have also values :) 250rep bosses, 10rep elite trash, 5rep non-elite trash

Link to comment
Share on other sites

ok..so...i asked one of my friends who plays on offi...wthout tabard, player have to gain reputatino with Horde Expedition/Aliance Vanguard...last question is, how many reputation has player to gain after kill trash mobs/bosses...i will ask and post here later :)

EDIT: Sorry for many misstypes...whole night working on server :) but i have also values :) 250rep bosses, 10rep elite trash, 5rep non-elite trash

30 rep for big trashes also (such as Abominations in utgarde)
Link to comment
Share on other sites

  • 2 months later...
  • 2 weeks later...

Updated for 9203. Remember, it's restricted to dungeons only.

Author : eNeRGy, Kolh, Popovk

diff --git "a\\\\src\\\\game\\\\Player.cpp" "b\\\\src\\\\game\\\\Player.cpp"
index ed9e795..2c6c09b 100644
--- "a\\\\src\\\\game\\\\Player.cpp"
+++ "b\\\\src\\\\game\\\\Player.cpp"
@@ -5972,11 +5972,38 @@ void Player::RewardReputation(Unit *pVictim, float rate)
    if(!Rep)
        return;

+     uint32 Repfaction1 = Rep->repfaction1;
+     uint32 Repfaction2 = Rep->repfaction2;
+     uint32 tabardFactionID = 0;
+     
+     // Championning tabard reputation system
+     // aura 57818 is a hidden aura common to northrend tabards allowing championning.
+     if(pVictim->GetMap()->IsDungeon() && HasAura(57818))
+     {
+         InstanceTemplate const* mInstance = sObjectMgr.GetInstanceTemplate(pVictim->GetMapId());
+         MapEntry const* StoredMap = sMapStore.LookupEntry(pVictim->GetMapId());
+
+         // only for expansion 2 map (wotlk), and : min level >= lv75 or dungeon only heroic mod
+         // entering a lv80 designed instance require a min level>=75. note : min level != suggested level
+         if ( StoredMap->Expansion() == 2 && ( mInstance->levelMin >= 75 || pVictim->GetMap()->GetDifficulty() == DUNGEON_DIFFICULTY_HEROIC ) )
+         {             
+             if( Item* pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_TABARD ) )
+             {                 
+                 if ( tabardFactionID = pItem->GetProto()->RequiredReputationFaction ) 
+                 {
+                      Repfaction1 = tabardFactionID;
+                      Repfaction2 = tabardFactionID;
+                 }
+             }
+         }
+     }
+
+
    if(Rep->repfaction1 && (!Rep->team_dependent || GetTeam()==ALLIANCE))
    {
-        int32 donerep1 = CalculateReputationGain(pVictim->getLevel(), Rep->repvalue1, Rep->repfaction1, false);
+        int32 donerep1 = CalculateReputationGain(pVictim->getLevel(), Rep->repvalue1, Repfaction1, false);
        donerep1 = int32(donerep1*rate);
-        FactionEntry const *factionEntry1 = sFactionStore.LookupEntry(Rep->repfaction1);
+        FactionEntry const *factionEntry1 = sFactionStore.LookupEntry(Repfaction1);
        uint32 current_reputation_rank1 = GetReputationMgr().GetRank(factionEntry1);
        if (factionEntry1 && current_reputation_rank1 <= Rep->reputation_max_cap1)
            GetReputationMgr().ModifyReputation(factionEntry1, donerep1);
@@ -5992,9 +6019,9 @@ void Player::RewardReputation(Unit *pVictim, float rate)

    if(Rep->repfaction2 && (!Rep->team_dependent || GetTeam()==HORDE))
    {
-        int32 donerep2 = CalculateReputationGain(pVictim->getLevel(), Rep->repvalue2, Rep->repfaction2, false);
+        int32 donerep2 = CalculateReputationGain(pVictim->getLevel(), Rep->repvalue2, Repfaction2, false);
        donerep2 = int32(donerep2*rate);
-        FactionEntry const *factionEntry2 = sFactionStore.LookupEntry(Rep->repfaction2);
+        FactionEntry const *factionEntry2 = sFactionStore.LookupEntry(Repfaction2);
        uint32 current_reputation_rank2 = GetReputationMgr().GetRank(factionEntry2);
        if (factionEntry2 && current_reputation_rank2 <= Rep->reputation_max_cap2)
            GetReputationMgr().ModifyReputation(factionEntry2, donerep2);

Link to comment
Share on other sites

I think eNeRGy means something like this:

In DB, fill reputation gain of all related cretures (in heroics and 80 lvl dungeons) to alliance vanguard/horde expedition factions.

Then on creature kill, check if creture has reputation setted to those two factions.

If no, then add reputation normally to setted fraction as it is on database.

If yes, then check if player has tabard equipped.

If he hasnt, then add reputation to aliance vanguard/horde expedition factions.

If he has, then add reputation to faction represented by tabard.

Link to comment
Share on other sites

I think eNeRGy means something like this:

In DB, fill reputation gain of all related cretures (in heroics and 80 lvl dungeons) to alliance vanguard/horde expedition factions.

Then on creature kill, check if creture has reputation setted to those two factions.

If no, then add reputation normally to setted fraction as it is on database.

If yes, then check if player has tabard equipped.

If he hasnt, then add reputation to aliance vanguard/horde expedition factions.

If he has, then add reputation to faction represented by tabard.

Yep. We have implemented reputation gain system, and we know it's right, because there is some exceptions - some mobs shouldn't give rep, some should give more rep, so there is no need in re-implementing it in formulas.

Link to comment
Share on other sites

Why we ever need to check expansion, map, or level? Just fill db with right values (reputation without tabard), and add aura check with faction replace... Just like in first post :)

depends, blizzlike functionnality restrict it to wotlk dungeons in heroic mode, or lv80 dungeons in normal mode.

Without the restrictions, you could use one of those tabard to farm mobs giving a reputation bonus anywhere

Link to comment
Share on other sites

depends, blizzlike functionnality restrict it to wotlk dungeons in heroic mode, or lv80 dungeons in normal mode.

Without the restrictions, you could use one of those tabard to farm mobs giving a reputation bonus anywhere

I think you didnt understand this. When you kill creature, which gives aliance vanguard/horde expedition reputation (this must be set in database), then check for tabard and add reputation depending on tabard. If creature has in database any other faction than aliance vanguard/horde expedition, then add reputation normally to faction which is in database for this creture. So if it is implemented this way, you cant farm aliance vanguard/horde expedition reputation anywhere in the world, but only on mobs, which has the aliance vanguard/horde expedition faction setted in database.

Link to comment
Share on other sites

I do understand perfectly, Ceris. Thing is, eNeRGy original patch check for a mob giving vanguard + horde expedition reputation. The version I did from his doesn't care about the reputation type. Thus allowing without any support some special case like the violet hold where the default reputation you gain here on offi is kirin tor.

The counterpart of this more blizzlike version is that without the dungeons level+map restrictions, those tabards work anywhere, even non wotlk areas.

And if you want it to be integrated into mangos main code, it needs to be blizzlike.

Link to comment
Share on other sites

I do understand perfectly, Ceris. Thing is, eNeRGy original patch check for a mob giving vanguard + horde expedition reputation. The version I did from his doesn't care about the reputation type. Thus allowing without any support some special case like the violet hold where the default reputation you gain here on offi is kirin tor.

The counterpart of this more blizzlike version is that without the dungeons level+map restrictions, those tabards work anywhere, even non wotlk areas.

And if you want it to be integrated into mangos main code, it needs to be blizzlike.

Blizzlike. And no hacky...

Sorry, i forgot Violet Hold.

I think we can add new column in creature_onkill_reputation, which will contain tabard aura ID. If player with that aura(57818 in wotlk) kills that creature, then we should replace faction with tabard's faction. It will be more generic - if in Cataclysm we'll see same system(i think we will), we just can fill table with new mobs and new championing aura ID, without code editing. There is only one question - will Cataclysm championing be released with tabard? i think yes. Well, i'll take some time in next couple of days, and may be post new version.

Link to comment
Share on other sites

The idea for an additional column is interesting, it would only require db support instead of code+db in case of a new aura.

And you're right about having championning in Cataclysm, the system by itself is very nice and completly in the current way blizzard are handling their game. It would be very surprising from them not keeping this.

What could be expected is having different championning auras depending of the extension, thus differents ids (and restrictions).

Link to comment
Share on other sites

  • 2 months later...
The aura column in the db definitely seems the way to go, it wouldn't be too hard to implement either.

http://paste2.org/p/776750

+

http://paste2.org/p/776749

now you just need to fill this field.

maybe something like this... but there is no check if instance required 80 level :/

update creature_onkill_reputation set ChampioningAura=57818 where RewOnKillRepFaction1=1037 or RewOnKillRepFaction2=1052;

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use