Jump to content

[patch][8190] Universal KillCredit


Guest GriffonHeart

Recommended Posts

This patch uses new in 3.1 fields unk1 and unk2. These new fields are KillCredit1 and KillCredit2

This patch will allow to remove many scripts in ACID

DOWNLOAD NOW!

Patch:

diff --git a/src/game/Creature.h b/src/game/Creature.h
index 416f747..f171dbd 100644
--- a/src/game/Creature.h
+++ b/src/game/Creature.h
@@ -157,8 +157,7 @@ struct CreatureInfo
{
    uint32  Entry;
    uint32  HeroicEntry;
-    uint32  unk1;
-    uint32  unk2;
+    uint32  KillCredit[2];
    uint32  DisplayID_A[2];
    uint32  DisplayID_H[2];
    char*   Name;
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index f81ef2e..e3f529e 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -13384,6 +13384,16 @@ void Player::ItemRemovedQuestCheck( uint32 entry, uint32 count )
    UpdateForQuestWorldObjects();
}

+void Player::KilledMonster( uint32 entry1, uint32 entry2, uint32 entry3, uint64 guid )
+{
+    if(entry1)
+        KilledMonster(entry1,guid);
+    if(entry2)
+        KilledMonster(entry2,guid);
+    if(entry3)
+        KilledMonster(entry3,guid);
+}
+
void Player::KilledMonster( uint32 entry, uint64 guid )
{
    uint32 addkillcount = 1;
@@ -18901,7 +18911,7 @@ bool Player::RewardPlayerAndGroupAtKill(Unit* pVictim)
                    {
                        // normal creature (not pet/etc) can be only in !PvP case
                        if(pVictim->GetTypeId()==TYPEID_UNIT)
-                            pGroupGuy->KilledMonster(pVictim->GetEntry(), pVictim->GetGUID());
+                            pGroupGuy->KilledMonster(pVictim->GetEntry(),
((Creature*)pVictim)->GetCreatureInfo()->KillCredit[0],((Creature*)pVictim)->GetCreatureInfo()->KillCredit[1], pVictim->GetGUID());
                    }
                }
            }
@@ -18926,7 +18936,7 @@ bool Player::RewardPlayerAndGroupAtKill(Unit* pVictim)

            // normal creature (not pet/etc) can be only in !PvP case
            if(pVictim->GetTypeId()==TYPEID_UNIT)
-                KilledMonster(pVictim->GetEntry(),pVictim->GetGUID());
+                KilledMonster(pVictim->GetEntry(),
((Creature*)pVictim)->GetCreatureInfo()->KillCredit[0],((Creature*)pVictim)->GetCreatureInfo()->KillCredit[1], pVictim->GetGUID());
        }
    }
    return xp || honored_kill;
@@ -20462,4 +20472,4 @@ void Player::BuildTeleportAckMsg( WorldPacket *data, float x, float y, float z,
bool Player::HasMovementFlag( MovementFlags f ) const
{
    return m_movementInfo.HasMovementFlag(f);
-}
\\ No newline at end of file
+}
diff --git a/src/game/Player.h b/src/game/Player.h
index efe279b..9eba54f 100644
--- a/src/game/Player.h
+++ b/src/game/Player.h
@@ -1289,6 +1289,7 @@ class MANGOS_DLL_SPEC Player : public Unit
        void GroupEventHappens( uint32 questId, WorldObject const* pEventObject );
        void ItemAddedQuestCheck( uint32 entry, uint32 count );
        void ItemRemovedQuestCheck( uint32 entry, uint32 count );
+        void KilledMonster( uint32 entry1, uint32 entry2, uint32 entry3, uint64 guid );
        void KilledMonster( uint32 entry, uint64 guid );
        void CastedCreatureOrGO( uint32 entry, uint64 guid, uint32 spell_id );
        void TalkedToCreature( uint32 entry, uint64 guid );
diff --git a/src/game/QueryHandler.cpp b/src/game/QueryHandler.cpp
index fd7846b..69be7e1 100644
--- a/src/game/QueryHandler.cpp
+++ b/src/game/QueryHandler.cpp
@@ -189,8 +189,8 @@ void WorldSession::HandleCreatureQueryOpcode( WorldPacket & recv_data )
        data << uint32(ci->type);                           // CreatureType.dbc
        data << uint32(ci->family);                         // CreatureFamily.dbc
        data << uint32(ci->rank);                           // Creature Rank (elite, boss, etc)
-        data << uint32(ci->unk1);                           // new in 3.1, creature entry?
-        data << uint32(ci->unk2);                           // new in 3.1, creature entry?
+        data << uint32(ci->KillCredit[0]);                  // new in 3.1, kill credit
+        data << uint32(ci->KillCredit[1]);                  // new in 3.1, kill credit
        data << uint32(ci->DisplayID_A[0]);                 // modelid_male1
        data << uint32(ci->DisplayID_H[0]);                 // modelid_female1 ?
        data << uint32(ci->DisplayID_A[1]);                 // modelid_male2 ?

SQL:

ALTER TABLE `creature_template`
   CHANGE COLUMN `unk1` `KillCredit1` int(11) unsigned NOT NULL default '0',
   CHANGE COLUMN `unk2` `KillCredit2` int(11) unsigned NOT NULL default '0';

-------------------------------------------

Cross posting from http://getmangos.ru/forum/showthread.php?t=20778

Link to comment
Share on other sites

×
×
  • 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