What's new

-Tibia 7.60 [76] Huczu Server Log HIT!

Volde

Banned
Joined
Feb 26, 2017
Messages
33
Reaction score
0
Witam o to KOD w 100% Dzia?aj?cy, zrobiony przez mojego znajomego z Realu. Huczu/Sid .

Chat.cpp:
Pod:
Chat::Chat()
{
// Create the default channels
ChatChannel *newChannel;

Dodaj:
#ifdef HUCZU_SERVER_LOG
newChannel = new ChatChannel(0x02, "Server Log");
if(newChannel)
m_normalChannels[0x02] = newChannel;
#endif

Upewnij si? ?e numer kana?u 0x02 jest wolny.

Game.cpp:
Pod:
O
TSYS_THREAD_LOCK_CLASS lockClass(gameLock, "Game::creatureTalkToChannel");
Dodaj:
#ifdef HUCZU_SERVER_LOG
if(player && channelId == 0x02)
return;
#endif
Player.cpp:
Na koncu:
#ifdef HUCZU_SERVER_LOG
void Player::sendFromSystem(SpeakClasses type, const std::string &text){
client->sendFromSystem(type, text);
}
#endif

Player.h:
W public:
#ifdef HUCZU_SERVER_LOG
void sendFromSystem(SpeakClasses type, const std::string &text);
#endif
Protocol.h:
Pod:
virtual void RemoveItemContainer(NetworkMessage &msg,unsigned char cid,unsigned short slot) = 0;
Dodaj:
#ifdef HUCZU_SERVER_LOG
virtual void sendFromSystem(SpeakClasses type, const std::string &text) = 0;
virtual void AddSystemSpeak(NetworkMessage &msg, SpeakClasses type, std::string text, unsigned short channelId) = 0;
#endif
Protocol76.cpp:
Pod:
g_chat.removeUserFromChannel(player, channelId);
Dodaj:
#ifdef HUCZU_SERVER_LOG
if(channelId == 0x02)
sendChannel(0x02, "Server Log");
#endif

Nad:
void Protocol76::sendToChannel(const Creature * creature, SpeakClasses type, const std::string &text, unsigned short channelId)

Dodaj:
#ifdef HUCZU_SERVER_LOG
void Protocol76::sendFromSystem(SpeakClasses type, const std::string &text)
{
NetworkMessage newmsg;
AddSystemSpeak(newmsg, type, text, 0x02);
WriteBuffer(newmsg);
}

void Protocol76::AddSystemSpeak(NetworkMessage &msg, SpeakClasses type, std::string text, unsigned short channelId)
{
msg.AddByte(0xAA);
msg.AddString("System");
msg.AddByte(type);
switch(type){
case SPEAK_SAY:
case SPEAK_WHISPER:
case SPEAK_CHANNEL_Y:
case SPEAK_CHANNEL_R1:
case SPEAK_CHANNEL_R2:
case SPEAK_CHANNEL_O:
msg.AddU16(channelId);
break;
}
msg.AddString(text);
}
#endif
i Pod:
AddPlayerInventoryItem(msg,player, 10);
Dodaj:
#ifdef HUCZU_SERVER_LOG
NetworkMessage newmsg;
newmsg.AddByte(0xAC);
newmsg.AddU16(0x02);
newmsg.AddString("Server Log");
WriteBuffer(newmsg);
#endif
Protocol76.h:
Pod:
virtual void sendIcons(int icons);
Dodaj:
#ifdef HUCZU_SERVER_LOG
virtual void sendFromSystem(SpeakClasses type, const std::string &text);
virtual void AddSystemSpeak(NetworkMessage &msg, SpeakClasses type, std::string text, unsigned short channelId);
#endif
Teraz wg schematu:
Przykladowo w funkcji:
void Game::CreateDamageUpdate(Creature* creature, Creature* attackCreature, int damage)

zamien:
player->sendTextMessage(MSG_EVENT, dmgmesg.str().c_str());
na:
#ifdef HUCZU_SERVER_LOG
player->sendFromSystem(SPEAK_CHANNEL_O, dmgmesg.str().c_str());
#else
player->sendTextMessage(MSG_EVENT, dmgmesg.str().c_str());
#endif
W przypadku loot info:
Zamien:
atakujacy->sendTextMessage(MSG_INFO, ss.str().c_str());
na:
#ifdef HUCZU_SERVER_LOG
atakujacy->sendFromSystem(SPEAK_CHANNEL_O, ss.str().c_str());
#else
atakujacy->sendTextMessage(MSG_INFO, ss.str().c_str());
#endif
i tak wszedzie gdzie pragniesz. Wystarczy znalezc czesc komunikatu i tam podmienic na cos podobnego jak wyzej podane.
dostepne kolory to zolty, pomaranczowy i czerwony. Probowalem bialy ale niestety nie dziala. W razie problemow zapraszam na gg.

Nie zapomnij do projektu dodac:
-DHUCZU_SERVER_LOG
 

askara76

Advanced User
Joined
Oct 31, 2016
Messages
180
Reaction score
7
Odp: [76] Huczu Server Log HIT!

Jeszcze si? nie dowiedzia?em na czym ten kod polega, napisz mi do czego on s?u?y. Bo na marne nikt nie chce zasmieca? sw?j silnik. :)
 

Bruce

Active User
Joined
Dec 13, 2008
Messages
112
Reaction score
6
Age
29
Odp: [76] Huczu Server Log HIT!

Jeszcze si? nie dowiedzia?em na czym ten kod polega, napisz mi do czego on s?u?y. Bo na marne nikt nie chce zasmieca? sw?j silnik. :)

Pokazuje otrzymane obra?enia na oddzielnym kanale o nazwie "Server Log". Co? jak na real Tibi

#topic
Aby kod skompilowa? si? poprawnie potrzeba jeszcze zadeklarowa? pomara?czowy kolor w const76.h

pod na przyk?ad
Code:
 SPEAK_BROADCAST		= 0x09,
doda?
Code:
SPEAK_CHANNEL_O		= 0x0C

Pozdrawiam
 
Top