Jump to content

Recommended Posts

On 5/15/2022 at 7:48 PM, darklesson said:

 

@V3ct0rColor applied! only text remain,  how about these addresses ?

 


const unsigned int WPacket__WriteString = 0x0.....;

 

my client 13X_2


const unsigned int RPacket__ReadString = 0x0.....;

 

 

WPacket::WriteString()

 

Address for GAMESERVER_136 (GameServer.exe 1.36):

const unsigned int WPacket__WriteString = 0x0051BAD0;

 

Address for GAMESERVER_138 (GameServer.exe 1.38):

const unsigned int WPacket__WriteString = 0x00524E60;

 

Function pointer signature:

// bool WPacket::WriteString(cChar *str)
typedef bool(__thiscall* WPacket__WriteString__Ptr)(void*, const char*);
WPacket__WriteString__Ptr WPacket__WriteString = (WPacket__WriteString__Ptr)(void*)(address::MOD_EXE_VERSION::WPacket__WriteString);

 

RPacket::ReadString()

 

Address for GAME_13X_2:

const unsigned int RPacket__ReadString = 0x0054FDE0;

 

Function pointer signature:

// cChar *RPacket::ReadString(uShort *len)
typedef const char *(__thiscall* RPacket__ReadString_Ptr)(void*, unsigned short *);
RPacket__ReadString_Ptr RPacket__ReadString = (RPacket__ReadString_Ptr)(void*)(address::MOD_EXE_VERSION::RPacket__ReadString);

 

 

On 5/16/2022 at 8:19 AM, gunnapong said:

Why read all but no points in my game?

I'm sorry my english @V3ct0r

1.PNG

2.PNG

3.PNG

It's hard to say what the problem is. I will check addresses for your Game.exe tomorrow.


Share this post


Link to post
Share on other sites
On 5/19/2022 at 5:28 AM, gunnapong said:

OK.thank

Looks like addresses are correct.

 

1) Add the following lines at the very beginning of the file pkodev.mod.power.client/dllmain.cpp

#define _CRT_SECURE_NO_WARNINGS
#include <iostream>

2) Then add the following code inside void Start(const char* path) function:

AllocConsole();
freopen("CONOUT$", "w", stdout);
std::cout << "Hello world!" << std::endl;

3) Add the following code:

std::cout << "bShowName = " << bShowName << std::endl;

after

// Is the display of the character's name enabled?
bool bShowName = static_cast<bool>(
	*reinterpret_cast<char*>(
		reinterpret_cast<unsigned int>(This) + 0x49
	)
);

4) Compile .dll and go to the game. Post here the output from the Game.exe console window.


Share this post


Link to post
Share on other sites
On 5/24/2022 at 2:13 PM, V3ct0r said:

Looks like addresses are correct.

 

1) Add the following lines at the very beginning of the file pkodev.mod.power.client/dllmain.cpp


#define _CRT_SECURE_NO_WARNINGS
#include <iostream>

2) Then add the following code inside void Start(const char* path) function:


AllocConsole();
freopen("CONOUT$", "w", stdout);
std::cout << "Hello world!" << std::endl;

3) Add the following code:


std::cout << "bShowName = " << bShowName << std::endl;

after


// Is the display of the character's name enabled?
bool bShowName = static_cast<bool>(
	*reinterpret_cast<char*>(
		reinterpret_cast<unsigned int>(This) + 0x49
	)
);

4) Compile .dll and go to the game. Post here the output from the Game.exe console window.

I failed to compile because I was stuck. freeopen. How to fix? @V3ct0r

1.PNG

2.PNG

Edited by gunnapong

Share this post


Link to post
Share on other sites
Quote

1) Add the following lines at the very beginning of the file pkodev.mod.power.client/dllmain.cpp


#define _CRT_SECURE_NO_WARNINGS
#include <iostream>

 

@gunnapong


Share this post


Link to post
Share on other sites

@gunnapong

 

At the beginning. Before #include <windows.h>


Share this post


Link to post
Share on other sites

@gunnapong

 

Now add:

std::cout << "power = " << cha_scene->power << std::endl;

Before:

// Build power amount string
char buf[32]{ 0x00 };
std::snprintf(buf, sizeof(buf), pkodev::global::label.c_str(), cha_scene->power);

and show the output.


Share this post


Link to post
Share on other sites

Hello @gunnapong,

 

After

    // Aligning the coordinates
    x = x - size.cx / 2;
    y = y - 24;

Add

std::cout << "x = " << x << "; y = " << y << std::endl;

And show the output.


Share this post


Link to post
Share on other sites

Hello @gunnapong,

 

That's the problem. Wrong position (x, y) of the rating label.

 

Are you sure you specified the following addresses for these objects?

// MPRender
const unsigned int MPRender = 0x006177E4;

// BOOL MPRender::WorldToScreen(float fX, float fY, float fZ, int *pnX, int *pnY)
const unsigned int MPRender__WorldToScreen = 0x00617674;

 

 

  • Thanks 1

Share this post


Link to post
Share on other sites
On 5/26/2022 at 12:53 PM, V3ct0r said:

Hello @gunnapong,

 

That's the problem. Wrong position (x, y) of the rating label.

 

Are you sure you specified the following addresses for these objects?


// MPRender
const unsigned int MPRender = 0x006177E4;

// BOOL MPRender::WorldToScreen(float fX, float fY, float fZ, int *pnX, int *pnY)
const unsigned int MPRender__WorldToScreen = 0x00617674;

 

 

 

 

Hello @V3ct0r

I entered the code you gave me.

1.PNG

Share this post


Link to post
Share on other sites

Hello @gunnapong,

 

Have no idea what is the problem. You can send me your client and server files, I will debug the mod on them.

  • Thanks 1

Share this post


Link to post
Share on other sites
On 12/14/2021 at 5:50 AM, V3ct0r said:

[Mod] Player rating system

 

screenshot_1.png

 

This mod implements a player rating system that allows players to compare their characters according to any criterion, depending on how the administrator configures the system. For example, you can define a rating as the sum of all the basic characteristics of a character (see the screenshot above) and see how much is the character stronger than another one. Or you can display the number of killed players or monsters in the rating. You can also display the amount of gold, reputation points, etc. The system is very flexible and depends on the administrator's imagination.

 

The rating is displayed above the name of the characters and is highlighted by color. After the character leaves the game, the rating will be saved in the database, so you can display the rating of the players on your website.

 

screenshot_2.gif

 

 

Requirements

 

Installed mod loading system for server and client (PKOdev.NET mod loader).

 

 

Modification information

 

Name: pkodev.mod.power;

Version: 1.1;

Author: V3ct0r;

Type: for client and server (Game.exe and GameServer.exe);

Supported executable .exe files: GAME_13X_0, GAME_13X_1, GAME_13X_2, GAME_13X_3, GAME_13X_4, GAME_13X_5, GAMESERVER_136 and GAMESERVER_138.

 

Mod update 17/01/2022

 

+ Fixed a bug where the amount of experience was not updated for the player's character when killing a monster (thanks to @Rewind and @Tera for the bug report);

+ The format for outputting the number of rating points has been moved to the pkodev.mod.power.cfg settings file on the client side:


- [{:power:}] -

screenshot_2.png

 

 

Installation

 

Server:

1) In the "GameServer\mods" directory of your server, create a "pkodev.mod.power" folder;

2) Place into it the mod DLL file "pkodev.mod.power.server.13<x>.dll" for your version of GameServer.exe;

3) In the functions.lua file ("GameServer\resource\script\calculate\") write the following script:


-- Power system (pkodev.mod.power)
-- Calculate player's character power amount
function CalculatePower(role)
	
	-- Get some character attributes
	local str = GetChaAttr(role, ATTR_STR)
	local agi = GetChaAttr(role, ATTR_AGI)
	local con = GetChaAttr(role, ATTR_CON)
	local spr = GetChaAttr(role, ATTR_STA)
	local acc = GetChaAttr(role, ATTR_DEX)
	
	-- Power formula
	local formula =  ( str + agi + con + spr + acc )
	
	-- Return calculated power amount and color
	return formula, GetPowerColor(formula)
	
end

-- Power system (pkodev.mod.power)
-- Get color of power value 
function GetPowerColor(power)

	-- Green color (0xFF00FF00)
	return 4278255360
	
end

4) In MSSQL Management Studio, execute the SQL query:


USE GameDB
ALTER TABLE character ADD power INT NOT NULL DEFAULT (0)

 

Client:

1) In the "mods" directory of your client, create a "pkodev.mod.power" folder;

2) Place the mod DLL file "pkodev.mod.power.client.13x_<x>.dll" for your version of Game.exe into it.

3) Place the mod settings file "pkodev.mod.power.cfg" into it and write the desired format for displaying the number of character rating points (marker {:power:}), for example:


- [{:power:}] -

 

 

Mod customization

 

1) In the functions.lua file, in the CalculatePower(role) function, write the code that will calculate the player's character rating. The function input is the role variable - the descriptor of the current character. At the output, the function should return the rating as an integer value. In the example above, the script calculates the rating as the sum of the character's base stats;

2) In the functions.lua file, in the GetPowerColor(power) function, write the code that will determine the rating color depending on its value - power. For example, you can make a rating less than 50 highlighted in yellow, from 50 to 100 in green, above 100 in red. The color must be written in the format 0xFFRRGGBB, in decimal notation. Example: green = 0xFF00FF00, after translate into decimal number system you will get the number 4278255360, and you need to write it into the script;

3) The mod provides for storing the character's rating in the database after leaving the game. For example, for displaying on the site in various TOPs. You can disable it if you do not need this feature. To do this, skip step 4 of the "Installation - Server" section and comment out the following lines in the source code of the server side of the mod (pkodev.mod.power.server project, dllmain.cpp file, Start() and Stop() functions), then compile the project:


DetourAttach(&(PVOID&)pkodev::pointer::CTableCha__SaveAllData, pkodev::hook::CTableCha__SaveAllData);

and


DetourDetach(&(PVOID&)pkodev::pointer::CTableCha__SaveAllData, pkodev::hook::CTableCha__SaveAllData);

4) To get the rating of a character from the database, run the SQL query:


SELECT power FROM GameDB.dbo.character WHERE cha_name = '<character name>'

5) No client side configuration required.

 

 

Download

 

1) Binary release (.dll);

2) The source code of the mod for Visual Studio 2019 Community (C++).

 

 

If you encounter any problem, bug or have any questions, then feel free to write in this thread.

hi i m tryng to input this mod on client but something happens, all mods do not show errors but this onw show, the sistem can read the mod all right but when i go login 

 

 

alright.jpg

alrt.png

Share this post


Link to post
Share on other sites
On 12/14/2021 at 6:50 AM, V3ct0r said:

[Mod] Player rating system

 

screenshot_1.png

 

This mod implements a player rating system that allows players to compare their characters according to any criterion, depending on how the administrator configures the system. For example, you can define a rating as the sum of all the basic characteristics of a character (see the screenshot above) and see how much is the character stronger than another one. Or you can display the number of killed players or monsters in the rating. You can also display the amount of gold, reputation points, etc. The system is very flexible and depends on the administrator's imagination.

 

The rating is displayed above the name of the characters and is highlighted by color. After the character leaves the game, the rating will be saved in the database, so you can display the rating of the players on your website.

 

screenshot_2.gif

 

 

Requirements

 

Installed mod loading system for server and client (PKOdev.NET mod loader).

 

 

Modification information

 

Name: pkodev.mod.power;

Version: 1.1;

Author: V3ct0r;

Type: for client and server (Game.exe and GameServer.exe);

Supported executable .exe files: GAME_13X_0, GAME_13X_1, GAME_13X_2, GAME_13X_3, GAME_13X_4, GAME_13X_5, GAMESERVER_136 and GAMESERVER_138.

 

Mod update 17/01/2022

 

+ Fixed a bug where the amount of experience was not updated for the player's character when killing a monster (thanks to @Rewind and @Tera for the bug report);

+ The format for outputting the number of rating points has been moved to the pkodev.mod.power.cfg settings file on the client side:


- [{:power:}] -

screenshot_2.png

 

 

Installation

 

Server:

1) In the "GameServer\mods" directory of your server, create a "pkodev.mod.power" folder;

2) Place into it the mod DLL file "pkodev.mod.power.server.13<x>.dll" for your version of GameServer.exe;

3) In the functions.lua file ("GameServer\resource\script\calculate\") write the following script:


-- Power system (pkodev.mod.power)
-- Calculate player's character power amount
function CalculatePower(role)
	
	-- Get some character attributes
	local str = GetChaAttr(role, ATTR_STR)
	local agi = GetChaAttr(role, ATTR_AGI)
	local con = GetChaAttr(role, ATTR_CON)
	local spr = GetChaAttr(role, ATTR_STA)
	local acc = GetChaAttr(role, ATTR_DEX)
	
	-- Power formula
	local formula =  ( str + agi + con + spr + acc )
	
	-- Return calculated power amount and color
	return formula, GetPowerColor(formula)
	
end

-- Power system (pkodev.mod.power)
-- Get color of power value 
function GetPowerColor(power)

	-- Green color (0xFF00FF00)
	return 4278255360
	
end

4) In MSSQL Management Studio, execute the SQL query:


USE GameDB
ALTER TABLE character ADD power INT NOT NULL DEFAULT (0)

 

Client:

1) In the "mods" directory of your client, create a "pkodev.mod.power" folder;

2) Place the mod DLL file "pkodev.mod.power.client.13x_<x>.dll" for your version of Game.exe into it.

3) Place the mod settings file "pkodev.mod.power.cfg" into it and write the desired format for displaying the number of character rating points (marker {:power:}), for example:


- [{:power:}] -

 

 

Mod customization

 

1) In the functions.lua file, in the CalculatePower(role) function, write the code that will calculate the player's character rating. The function input is the role variable - the descriptor of the current character. At the output, the function should return the rating as an integer value. In the example above, the script calculates the rating as the sum of the character's base stats;

2) In the functions.lua file, in the GetPowerColor(power) function, write the code that will determine the rating color depending on its value - power. For example, you can make a rating less than 50 highlighted in yellow, from 50 to 100 in green, above 100 in red. The color must be written in the format 0xFFRRGGBB, in decimal notation. Example: green = 0xFF00FF00, after translate into decimal number system you will get the number 4278255360, and you need to write it into the script;

3) The mod provides for storing the character's rating in the database after leaving the game. For example, for displaying on the site in various TOPs. You can disable it if you do not need this feature. To do this, skip step 4 of the "Installation - Server" section and comment out the following lines in the source code of the server side of the mod (pkodev.mod.power.server project, dllmain.cpp file, Start() and Stop() functions), then compile the project:


DetourAttach(&(PVOID&)pkodev::pointer::CTableCha__SaveAllData, pkodev::hook::CTableCha__SaveAllData);

and


DetourDetach(&(PVOID&)pkodev::pointer::CTableCha__SaveAllData, pkodev::hook::CTableCha__SaveAllData);

4) To get the rating of a character from the database, run the SQL query:


SELECT power FROM GameDB.dbo.character WHERE cha_name = '<character name>'

5) No client side configuration required.

 

 

Download

 

1) Binary release (.dll);

2) The source code of the mod for Visual Studio 2019 Community (C++).

 

 

If you encounter any problem, bug or have any questions, then feel free to write in this thread.

for now i can enter in game but all maps apears this way ?

unknown.png

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...