|
You last visited: Today at 00:56
Advertisement
[Release] Custom Unique Notifies with IFSystemMessage Colors
Discussion on [Release] Custom Unique Notifies with IFSystemMessage Colors within the SRO PServer Guides & Releases forum part of the SRO Private Server category.
09/03/2020, 22:36
|
#16
|
elite*gold: 0
Join Date: Oct 2017
Posts: 100
Received Thanks: 19
|
Well done its do useful
|
|
|
09/04/2020, 00:23
|
#17
|
elite*gold: 0
Join Date: Apr 2020
Posts: 79
Received Thanks: 42
|
That works thanks, but how i can add a customized notify that popup after using a specific scroll notifying the player if the scroll succeeded nor failed
|
|
|
09/04/2020, 02:15
|
#18
|
elite*gold: 0
Join Date: Mar 2010
Posts: 565
Received Thanks: 226
|
Quote:
Originally Posted by irockalone
That works thanks, but how i can add a customized notify that popup after using a specific scroll notifying the player if the scroll succeeded nor failed
|
no idea
|
|
|
09/04/2020, 17:43
|
#19
|
elite*gold: 0
Join Date: Jan 2020
Posts: 243
Received Thanks: 240
|
what about Kill Notifications can you added it ?
|
|
|
09/04/2020, 21:10
|
#20
|
elite*gold: 0
Join Date: Apr 2020
Posts: 79
Received Thanks: 42
|
Quote:
Originally Posted by Goosxc
what about Kill Notifications can you added it ?
|
+1
|
|
|
09/11/2020, 14:02
|
#21
|
elite*gold: 0
Join Date: Oct 2014
Posts: 165
Received Thanks: 34
|
Thank you!
Quote:
Originally Posted by khaleed2010
Hello Everyone,
Custom Unique Notifies with IFSystemMessage Colors
Use @ for this
Credits for helper CustomUniqueNotifiers: @ from With some things changing.
Add this in DllMain.cpp
Code:
#include "CustomUniqueNotifiers.h"
//Custom Unique Notifies with IFSystemMessage Colors
CustomUniqueNotifiers::InitializeCustomUniqueNotifies();
DevKit_DLL->Source Files Create CustomUniqueNotifiers.cpp after Add this
Code:
#include "CustomUniqueNotifiers.h"
#include <memory/hook.h>
#include "CTextStringManager.h"
std::vector<std::pair<std::wstring, std::wstring>> CustomUniqueNotifiers::CustomUniqueNotifies;
std::wstring* CustomUniqueNotifiers::HasCustomUniqueNotify(std::wstring* NameStrID)
{
typedef std::vector<std::pair<std::wstring, std::wstring>>::iterator iterator_t;
for (iterator_t i = CustomUniqueNotifies.begin(); i != CustomUniqueNotifies.end(); i++)
{
if (wcscmp(i->first.c_str(), NameStrID->c_str()) == 0)
{
return &i->second;
}
}
return NULL;
}
bool CustomUniqueNotifiers::AddCustomUniqueNotify(std::wstring NameStrID, std::wstring MsgCode)
{
if (!HasCustomUniqueNotify(&NameStrID))
{
CustomUniqueNotifies.push_back(std::pair<std::wstring, std::wstring>(NameStrID, MsgCode));
return true;
}
return false;
}
bool CustomUniqueNotifiers::RemoveCustomUniqueNotify(std::wstring NameStrID)
{
for (int i = 0; i < CustomUniqueNotifies.size(); i++)
{
std::pair<std::wstring, std::wstring> notify = CustomUniqueNotifies[i];
if (wcscmp(notify.first.c_str(), NameStrID.c_str()) == 0)
{
CustomUniqueNotifies.erase(CustomUniqueNotifies.begin() + i);
return true;
}
}
return false;
}
void CustomUniqueNotifiers::InitializeCustomUniqueNotifies(void)
{
replaceOffset(0x00875444, addr_from_this(&CTextStringManager::OnUniqueNameRetrieve));
//UIIT_MSG_APPEAR_KERBEROS & UIIT_MSG_APPEAR_IVY -> textuisystem.txt
//SN_MOB_EU_KERBEROS & SN_MOB_AM_IVY -> textdata_object.txt
AddCustomUniqueNotify(std::wstring(L"SN_MOB_EU_KERBEROS"), std::wstring(L"UIIT_MSG_APPEAR_KERBEROS"));
AddCustomUniqueNotify(std::wstring(L"SN_MOB_AM_IVY"), std::wstring(L"UIIT_MSG_APPEAR_IVY"));
AddCustomUniqueNotify(std::wstring(L"SN_MOB_RM_ROC"), std::wstring(L"UIIT_MSG_APPEAR_ROC"));
}
DevKit_DLL->Header Files Create CustomUniqueNotifiers.h after Add this
Code:
#pragma once
#include <Windows.h>
#include <iostream>
#include <vector>
class CustomUniqueNotifiers
{
public:
static std::vector<std::pair<std::wstring, std::wstring>> CustomUniqueNotifies;
static std::wstring* HasCustomUniqueNotify(std::wstring* NameStrID);
static bool AddCustomUniqueNotify(std::wstring NameStrID, std::wstring MsgCode);
static bool RemoveCustomUniqueNotify(std::wstring NameStrID);
static void InitializeCustomUniqueNotifies();
};
DevKit_DLL->Source Files Create CTextStringManager.cpp after Add this
Code:
#include "CTextStringManager.h"
#include <GInterface.h>
#include "CustomUniqueNotifiers.h"
#include "IFSystemMessage.h"
#include <BSLib/multibyte.h>
const DWORD OnJE = 0x00875ABE;
const DWORD OnJNE = 0x00875449;
std::wstring* CTextStringManager::GetStringByNameStrID(std::wstring* NameStrID)
{
return reinterpret_cast <std::wstring*(__thiscall*)(CTextStringManager*, std::wstring*)>(0x008C9BB0)(this, NameStrID);
}
void CTextStringManager::OnUniqueNameRetrieve(std::wstring* NameStrID)
{
std::wstring* MsgCheck = CustomUniqueNotifiers::HasCustomUniqueNotify(NameStrID);
if (MsgCheck)
{
CGInterface* myface = CGInterface::GetInterface();
std::wstring* mymsg = this->GetStringByNameStrID(MsgCheck);
CALL(mymsg);
__asm {
add esp, 0x1C;
jmp OnJE;
}
}
this->GetStringByNameStrID(NameStrID);
__asm {
add esp, 0x1C;
jmp OnJNE;
}
}
void CTextStringManager::CALL(std::wstring* Message)
{
g_pCGInterface->ShowMessage_Notice(Message->c_str());
g_pCGInterface->ShowMessage_Quest(Message->c_str());
g_pCGInterface->ShowMessage_Warning(Message->c_str());
//IFSystemMessage Normal
//g_pCGInterface->WriteSystemMessage(SYSLOG_NONE, NameStrID->c_str());
//IFSystemMessageColors
IFSystemMessage *systemmessage = reinterpret_cast<IFSystemMessage *>(g_pCGInterface->m_IRM.GetResObj(68, 1));
systemmessage->write(0xFF, 0xff004b, Message->c_str(), 0, 1);
}
DevKit_DLL->Header Files Create CTextStringManager.h after Add this
Code:
#pragma once
#include <iostream>
class CTextStringManager
{
public:
std::wstring* GetStringByNameStrID(std::wstring* NameStrID);
void OnUniqueNameRetrieve(std::wstring* NameStrID);
void CALL(std::wstring * NameStrID);
};
ClientLib->Source Files Edit in IFSystemMessage.cpp
Code:
// CIFSystemMessage::write(int a1, int color, wchar_t* msg, int a2, int a3) .text:007B89E0 sro_client_dev.exe:$3B89E0 #3B89E0 <sub_7B89E0>
void IFSystemMessage::write(int a1, int color, const wchar_t* msg, int a2, int a3)
{
// Redirection to original client code
reinterpret_cast<void(__thiscall*)(IFSystemMessage*, int, int, wchar_t, int, int)>(0x007B89E0)(this, a1, color, reinterpret_cast<wchar_t>(msg), a2, a3);
}
ClientLib->Header Files Edit in IFSystemMessage.h
Code:
void write(int a1, int color,const wchar_t* msg, int a2, int a3);
media\server_dep\silkroad\textdata->textuisystem.txt
Code:
1 UIIT_MSG_APPEAR_KERBEROS 타림분지에 우르치가 등장하였습니다. 0 0 0 0 0 0 Cerberus has appeared on Desperado Hill. 0 0 0 0 0 0 0 0
1 UIIT_MSG_APPEAR_IVY 타클라마칸에 로드야르칸이 등장하였습니다. 0 0 0 0 0 0 Ivy has appeared on Ararat Mountain. 0 0 0 0 0 0 0 0
ClientLib->Header Files Add in GInterface.h
Code:
//GetInterface
static CGInterface* GetInterface();
ClientLib->Source Files Add in GInterface.cpp
Code:
CGInterface* CGInterface::GetInterface(void)
{
return *reinterpret_cast<CGInterface**>(0x0110F80C);
}
this system have one problem try to figure out and fix it
Good Luck to Everyone
|
Work Perfect Sir Thanks...
We Can Add Color Change When Unique Killed ?
|
|
|
09/13/2020, 20:11
|
#22
|
elite*gold: 0
Join Date: Sep 2020
Posts: 122
Received Thanks: 64
|
Editing the txt file for each new unique seems very unnecessary to me. You can determine your warning messages in the dll. No need pk2
|
|
|
09/14/2020, 01:09
|
#23
|
elite*gold: 0
Join Date: Apr 2020
Posts: 79
Received Thanks: 42
|
Quote:
Originally Posted by GameRPoP
Editing the txt file for each new unique seems very unnecessary to me. You can determine your warning messages in the dll. No need pk2
|
How?!
|
|
|
03/03/2021, 22:17
|
#24
|
elite*gold: 0
Join Date: Nov 2010
Posts: 132
Received Thanks: 9
|
have error how i cant fix it ?
|
|
|
03/04/2021, 00:32
|
#25
|
elite*gold: 0
Join Date: Mar 2010
Posts: 565
Received Thanks: 226
|
Quote:
Originally Posted by kanka5252
have error how i cant fix it ?
|
Hello,
why you add CustomUniqueNotifiers::InitializeCustomUniqueNotif ies(); out DllMain
you can add CustomUniqueNotifiers::InitializeCustomUniqueNotif ies(); after
Good Luck
|
|
|
03/07/2021, 10:48
|
#26
|
elite*gold: 0
Join Date: Nov 2010
Posts: 132
Received Thanks: 9
|
Quote:
Originally Posted by khaleed2010
Hello,
why you add CustomUniqueNotifiers::InitializeCustomUniqueNotif ies(); out DllMain
you can add CustomUniqueNotifiers::InitializeCustomUniqueNotif ies(); after
Good Luck
|
Thank u i fixed but i cant add remove notify and notify color to normal
when i add this lines
no work codes
how add kill msg?
|
|
|
03/14/2021, 19:19
|
#27
|
elite*gold: 0
Join Date: Nov 2010
Posts: 132
Received Thanks: 9
|
Khaled kill msg?
|
|
|
03/14/2021, 22:38
|
#28
|
elite*gold: 0
Join Date: Apr 2016
Posts: 201
Received Thanks: 47
|
Quote:
Originally Posted by GameRPoP
Editing the txt file for each new unique seems very unnecessary to me. You can determine your warning messages in the dll. No need pk2
|
agree with you, but choosing the traditional way lets say, may give an original sro-developer feeling but its totally wont serve the efficiency, its true
HB's great release allows us to send any messages not only the ones defined in the textuisystem... simply add a new type in the dll handling the 300C packet, connect them with your filter/db and you are fine
|
|
|
03/16/2021, 11:26
|
#29
|
elite*gold: 0
Join Date: Apr 2015
Posts: 52
Received Thanks: 16
|
well done , but what about kill notify ?
|
|
|
04/11/2021, 16:51
|
#30
|
elite*gold: 0
Join Date: Jul 2013
Posts: 12
Received Thanks: 0
|
U can help me
Quote:
Originally Posted by khaleed2010
Hello Everyone,
Custom Unique Notifies with IFSystemMessage Colors
Use @ for this
Credits for helper CustomUniqueNotifiers: @ from With some things changing.
Add this in DllMain.cpp
Code:
#include "CustomUniqueNotifiers.h"
//Custom Unique Notifies with IFSystemMessage Colors
CustomUniqueNotifiers::InitializeCustomUniqueNotifies();
DevKit_DLL->Source Files Create CustomUniqueNotifiers.cpp after Add this
Code:
#include "CustomUniqueNotifiers.h"
#include <memory/hook.h>
#include "CTextStringManager.h"
std::vector<std::pair<std::wstring, std::wstring>> CustomUniqueNotifiers::CustomUniqueNotifies;
std::wstring* CustomUniqueNotifiers::HasCustomUniqueNotify(std::wstring* NameStrID)
{
typedef std::vector<std::pair<std::wstring, std::wstring>>::iterator iterator_t;
for (iterator_t i = CustomUniqueNotifies.begin(); i != CustomUniqueNotifies.end(); i++)
{
if (wcscmp(i->first.c_str(), NameStrID->c_str()) == 0)
{
return &i->second;
}
}
return NULL;
}
bool CustomUniqueNotifiers::AddCustomUniqueNotify(std::wstring NameStrID, std::wstring MsgCode)
{
if (!HasCustomUniqueNotify(&NameStrID))
{
CustomUniqueNotifies.push_back(std::pair<std::wstring, std::wstring>(NameStrID, MsgCode));
return true;
}
return false;
}
bool CustomUniqueNotifiers::RemoveCustomUniqueNotify(std::wstring NameStrID)
{
for (int i = 0; i < CustomUniqueNotifies.size(); i++)
{
std::pair<std::wstring, std::wstring> notify = CustomUniqueNotifies[i];
if (wcscmp(notify.first.c_str(), NameStrID.c_str()) == 0)
{
CustomUniqueNotifies.erase(CustomUniqueNotifies.begin() + i);
return true;
}
}
return false;
}
void CustomUniqueNotifiers::InitializeCustomUniqueNotifies(void)
{
replaceOffset(0x00875444, addr_from_this(&CTextStringManager::OnUniqueNameRetrieve));
//UIIT_MSG_APPEAR_KERBEROS & UIIT_MSG_APPEAR_IVY -> textuisystem.txt
//SN_MOB_EU_KERBEROS & SN_MOB_AM_IVY -> textdata_object.txt
AddCustomUniqueNotify(std::wstring(L"SN_MOB_EU_KERBEROS"), std::wstring(L"UIIT_MSG_APPEAR_KERBEROS"));
AddCustomUniqueNotify(std::wstring(L"SN_MOB_AM_IVY"), std::wstring(L"UIIT_MSG_APPEAR_IVY"));
AddCustomUniqueNotify(std::wstring(L"SN_MOB_RM_ROC"), std::wstring(L"UIIT_MSG_APPEAR_ROC"));
}
DevKit_DLL->Header Files Create CustomUniqueNotifiers.h after Add this
Code:
#pragma once
#include <Windows.h>
#include <iostream>
#include <vector>
class CustomUniqueNotifiers
{
public:
static std::vector<std::pair<std::wstring, std::wstring>> CustomUniqueNotifies;
static std::wstring* HasCustomUniqueNotify(std::wstring* NameStrID);
static bool AddCustomUniqueNotify(std::wstring NameStrID, std::wstring MsgCode);
static bool RemoveCustomUniqueNotify(std::wstring NameStrID);
static void InitializeCustomUniqueNotifies();
};
DevKit_DLL->Source Files Create CTextStringManager.cpp after Add this
Code:
#include "CTextStringManager.h"
#include <GInterface.h>
#include "CustomUniqueNotifiers.h"
#include "IFSystemMessage.h"
#include <BSLib/multibyte.h>
const DWORD OnJE = 0x00875ABE;
const DWORD OnJNE = 0x00875449;
std::wstring* CTextStringManager::GetStringByNameStrID(std::wstring* NameStrID)
{
return reinterpret_cast <std::wstring*(__thiscall*)(CTextStringManager*, std::wstring*)>(0x008C9BB0)(this, NameStrID);
}
void CTextStringManager::OnUniqueNameRetrieve(std::wstring* NameStrID)
{
std::wstring* MsgCheck = CustomUniqueNotifiers::HasCustomUniqueNotify(NameStrID);
if (MsgCheck)
{
CGInterface* myface = CGInterface::GetInterface();
std::wstring* mymsg = this->GetStringByNameStrID(MsgCheck);
CALL(mymsg);
__asm {
add esp, 0x1C;
jmp OnJE;
}
}
this->GetStringByNameStrID(NameStrID);
__asm {
add esp, 0x1C;
jmp OnJNE;
}
}
void CTextStringManager::CALL(std::wstring* Message)
{
g_pCGInterface->ShowMessage_Notice(Message->c_str());
g_pCGInterface->ShowMessage_Quest(Message->c_str());
g_pCGInterface->ShowMessage_Warning(Message->c_str());
//IFSystemMessage Normal
//g_pCGInterface->WriteSystemMessage(SYSLOG_NONE, NameStrID->c_str());
//IFSystemMessageColors
IFSystemMessage *systemmessage = reinterpret_cast<IFSystemMessage *>(g_pCGInterface->m_IRM.GetResObj(68, 1));
systemmessage->write(0xFF, 0xff004b, Message->c_str(), 0, 1);
}
DevKit_DLL->Header Files Create CTextStringManager.h after Add this
Code:
#pragma once
#include <iostream>
class CTextStringManager
{
public:
std::wstring* GetStringByNameStrID(std::wstring* NameStrID);
void OnUniqueNameRetrieve(std::wstring* NameStrID);
void CALL(std::wstring * NameStrID);
};
ClientLib->Source Files Edit in IFSystemMessage.cpp
Code:
// CIFSystemMessage::write(int a1, int color, wchar_t* msg, int a2, int a3) .text:007B89E0 sro_client_dev.exe:$3B89E0 #3B89E0 <sub_7B89E0>
void IFSystemMessage::write(int a1, int color, const wchar_t* msg, int a2, int a3)
{
// Redirection to original client code
reinterpret_cast<void(__thiscall*)(IFSystemMessage*, int, int, wchar_t, int, int)>(0x007B89E0)(this, a1, color, reinterpret_cast<wchar_t>(msg), a2, a3);
}
ClientLib->Header Files Edit in IFSystemMessage.h
Code:
void write(int a1, int color,const wchar_t* msg, int a2, int a3);
media\server_dep\silkroad\textdata->textuisystem.txt
Code:
1 UIIT_MSG_APPEAR_KERBEROS 타림분지에 우르치가 등장하였습니다. 0 0 0 0 0 0 Cerberus has appeared on Desperado Hill. 0 0 0 0 0 0 0 0
1 UIIT_MSG_APPEAR_IVY 타클라마칸에 로드야르칸이 등장하였습니다. 0 0 0 0 0 0 Ivy has appeared on Ararat Mountain. 0 0 0 0 0 0 0 0
ClientLib->Header Files Add in GInterface.h
Code:
//GetInterface
static CGInterface* GetInterface();
ClientLib->Source Files Add in GInterface.cpp
Code:
CGInterface* CGInterface::GetInterface(void)
{
return *reinterpret_cast<CGInterface**>(0x0110F80C);
}
this system have one problem try to figure out and fix it
Good Luck to Everyone
|
can help me
|
|
|
Similar Threads
|
[Mini-Release] Custom Unique Notifies
05/09/2021 - SRO PServer Guides & Releases - 40 Replies
https://www.elitepvpers.com/forum/sro-pserver-guid es-releases/4806749-non-mini-release-rewriting-cli ent-notification-handler.html
|
All times are GMT +2. The time now is 00:56.
|
|