Log de kill en bg
Mon coté fps qui ressort Heureux

Ce patch permet d'afficher les logs de kill en bg un peu comme sur les fps multi.

Si quelqu’un a une idée pour afficher les oneshot, headshot, etc je suis preneur Heureux

Version hack (ne pas prendre ce genre d'habitude Smile
Code :
src/server/game/Battlegrounds/Battleground.cpp
@@ -1781,10 +1781,19 @@ void Battleground::HandleKillPlayer(Player* player, Player* killer)
     {
         // To be able to remove insignia -- ONLY IN Battlegrounds
         player->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
         RewardXPAtKill(killer, player);
     }
+
+    if (killer && player)
+    {
+        SendWarningToAll(LANG_KILL_PLAYER,  killer->GetSession()->GetPlayerName(), player->GetSession()->GetPlayerName());
+    }
+    else if (player)
+    {
+        SendWarningToAll(LANG_KILL_PLAYER_ALONE,  player->GetSession()->GetPlayerName());
+    }
}

// Return the player's team based on battlegroundplayer info
// Used in same faction arena matches mainly
uint32 Battleground::GetPlayerTeam(uint64 guid) const

Code :
src/server/game/Miscellaneous/Language.h
@@ -1055,10 +1055,12 @@ enum TrinityStrings
     LANG_BG_SA_H_GY_EAST                    = 10073, //The Horde captured the East Graveyard!

     // Use for custom patches             11000-11999
     LANG_AUTO_BROADCAST                 = 11000,
     LANG_INVALID_REALMID                = 11001,
+    LANG_KILL_PLAYER                    = 11002,
+    LANG_KILL_PLAYER_ALONE                    = 11003,

     // NOT RESERVED IDS                   12000-1999999999
     // `db_script_string` table index     2000000000-2000009999 (MIN_DB_SCRIPT_STRING_ID-MAX_DB_SCRIPT_STRING_ID)
     // For other tables maybe             2000010000-2147483647 (max index)
};

Patch sql
Code :
DELETE FROM `trinity_string` WHERE IN (11002, 11003);
INSERT INTO `trinity_string` VALUES (11002,'%s a tue %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO `trinity_string` VALUES (11003,'%s est mort',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);


Version utilisant les hooks donc code propre mais plus compliqué pour les débutants
Code :
src/server/game/Miscellaneous/Language.h
@@ -1055,10 +1055,12 @@ enum TrinityStrings
     LANG_BG_SA_H_GY_EAST                    = 10073, //The Horde captured the East Graveyard!

     // Use for custom patches             11000-11999
     LANG_AUTO_BROADCAST                 = 11000,
     LANG_INVALID_REALMID                = 11001,
+    LANG_KILL_PLAYER                    = 11002,
+    LANG_KILL_PLAYER_ALONE                    = 11003,

     // NOT RESERVED IDS                   12000-1999999999
     // `db_script_string` table index     2000000000-2000009999 (MIN_DB_SCRIPT_STRING_ID-MAX_DB_SCRIPT_STRING_ID)
     // For other tables maybe             2000010000-2147483647 (max index)
};

Code :
src/server/game/Scripting/ScriptLoader.cpp
@@ -1224,15 +1224,15 @@ void AddBattlegroundScripts()
#endif
}

#ifdef SCRIPTS
/* This is where custom scripts' loading functions should be declared. */
-
+void AddSC_Logkill();
#endif

void AddCustomScripts()
{
#ifdef SCRIPTS
     /* This is where custom scripts should be added. */
-
+    AddSC_Logkill();
#endif
}

Code :
src/server/scripts/Custom/CMakeLists.txt
@@ -8,8 +8,9 @@
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

set(scripts_STAT_SRCS
   ${scripts_STAT_SRCS}
+  Custom/Logkill.cpp
)

message("  -> Prepared: Custom")

Code :
src/server/scripts/Custom/Logkill.cpp
#include "ScriptPCH.h"

class Logkill : public PlayerScript
{
    public:
        Logkill() : PlayerScript("Logkill") {}

    void OnPVPKill(Player* killer, Player* killed)
    {
        Battleground* battleground1 = killer->GetBattleground();
        Battleground* battleground2 = killed->GetBattleground();
        if (battleground1 && battleground2)
        {
            if (battleground1 == battleground2)
            {
                if (killer && killed)
                {
                    battleground1->SendWarningToAll(LANG_KILL_PLAYER,  killer->GetSession()->GetPlayerName(), killed->GetSession()->GetPlayerName());
                }
                else if (killed)
                {
                    battleground1->SendWarningToAll(LANG_KILL_PLAYER_ALONE,  killed->GetSession()->GetPlayerName());
                }
            }
        }
    }
};

void AddSC_Logkill()
{
    new Logkill;
}

Patch sql
Code :
DELETE FROM `trinity_string` WHERE IN (11002, 11003);
INSERT INTO `trinity_string` VALUES (11002,'%s a tue %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO `trinity_string` VALUES (11003,'%s est mort',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);

Je n'est pas testé cette version mais elle passe à la compile Smile


Petit screen
   
Omg, j'avais prévu de faire et de distribuer un patch quasi en commun à ce que tu veux faire Pinch Hihi ...
Post mis à jour : ajout de la version avec hook
Sympa ce patch, bien joué Mathman Smile
Bonne idée le patch. Maintenant, je propose quelques améliorations :
- Les noms des joueurs pourraient être colorés selon leur faction (rouge = Horde et bleu = Alliance)
- Ajouter une option dans le fichier de configuration pour n'envoyer qu'aux groupes du joueur mort et du joueur qui a tué.
- Proposer un .diff en option

Voilà sinon bonne idée encore Smile
ok je vais voir ça

Retourner en haut Accueil