Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

PristonTale Source Code (2012)

Newbie Spellweaver
Joined
Oct 7, 2012
Messages
18
Reaction score
14
hey fellows!

To make it works properly, you have to update the item table checksum or you'll get DC(4) :glare:

file : sinItem.cpp
class: cItem
method: int CheckItemTable();

PHP:
	for(int i = 0; i < MAX_ITEM; i++)
	{
		if(sItem[i].CODE)
		{
			CheckSumItemDataADD += sItem[i].CODE * i;
			CheckSumItemDataADD += sItem[i].h * i;
			CheckSumItemDataADD += sItem[i].w * i;
			CheckSumItemDataADD += sItem[i].Class * i;
			CheckSumItemDataADD += sItem[i].ItemPosition * i;

		}
	}
	const DWORD CheckSumItemData = 2285641345; // CHECKSUM HEREEEEEE!
	
	if(CheckSumItemData != CheckSumItemDataADD)
		SendSetHackUser(101); // ( Hacking alert (101)

	return TRUE;

==================================================================================

Another problem I found is:

Attack Packet Endcoding.

file : Damage.cpp
function: int RecvDamagePacketModule(TRANS_FUNC_MEMORY *lpTransFuncModule);

original function:

PHP:
int RecvDamagePacketModule( TRANS_FUNC_MEMORY *lpTransFuncModule )
{
	char *lpBuff;

	lpBuff = new char[lpTransFuncModule->size];
	memcpy( lpBuff , lpTransFuncModule->szData , lpTransFuncModule->Param[0] );

	fnEncodeDamagePacket = (LPFN_EncodeDamagePacket)lpBuff;

//	if ( (wLimitDamage[3]^wLimitDamage[5])==0 )
//		SendMaxDamageToServer( 0,0,0 );

	ZeroMemory( wLimitDamage , sizeof(WORD)*8 );

	return TRUE;
}

Although the new function works perfectly and memcpy as well, when you try to call fnEncodeDamagePacket (void*) the game crash.

I don't know why, but the game just can't call function allocated with new operator :huh:

#edit:

Now I know :$:

The 'solution' I have done is:

PHP:
int RecvDamagePacketModule(TRANS_FUNC_MEMORY *lpTransFuncModule)
{
	void *lpBuff = VirtualAlloc(NULL, lpTransFuncModule->size, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE);

	MoveMemory(lpBuff, lpTransFuncModule->szData, lpTransFuncModule->Param[0]);

	fnEncodeDamagePacket = (LPFN_EncodeDamagePacket)lpBuff;

	//	if ( (wLimitDamage[3]^wLimitDamage[5])==0 )
	//		SendMaxDamageToServer( 0,0,0 );

	ZeroMemory(wLimitDamage, sizeof(WORD) * 8);

	return TRUE;
}

There are more functions that has this problem. It will work for all of them.

The problem is I didn't call VirtualFree anywhere.

=====================================================

oh I almost forgot :blush:

The Focus changed "protection"

In few words, this protection will disconnect you if you change windows Focus ( genius! :thumbdown:)

PHP:
#define msg1101		"%d:%d:%d - Name:( %s ) / IP ( %s ) Focus Changed ( %s )\r\n"

file: OnServer.cpp
function: int RecvMessage( smTHREADSOCK *SockInfo );

PHP:
case smTRANSCODE_FINDCRACK2:
		lpBuff = &SockInfo->Buff[8];
		smTransCommand.WParam = 1101; // the Focus Changed id
		smTransCommand.LParam = (DWORD)lpBuff;
		smTransCommand.SParam = 0;
		RecordHackLogFile( lpPlayInfo , &smTransCommand );
		//DisconnectUser( lpsmSock );
		lpPlayInfo->dwTime_Disconnect = dwTime;

		smTransCommand.code = smTRANSCODE_CLOSECLIENT;
		smTransCommand.size = sizeof( smTRANS_COMMAND );
		lpsmSock->Send2( (char *)&smTransCommand , smTransCommand.size , TRUE );
		break;

this smTRANSCODE_FINDCRACK2 opCode is sent to server in this function:

file: netplay.cpp
function: int SendCrackWindow( HWND hWnd );

PHP:
int SendCrackWindow( HWND hWnd ) // I think this function's name is self explanatory
{
	char *szName;
	char TransBuff[1024];
	int len;

	//크랙 발견
	if ( smWsockServer ) {

		szName = TransBuff+8;
		GetWindowText( hWnd , szName , 32 );
		len = lstrlen( szName ) + 9;
		((int *)TransBuff)[0] = len;
		((int *)TransBuff)[1] = smTRANSCODE_FINDCRACK2;

		smWsockServer->Send2( TransBuff , len , TRUE );
	}
	return TRUE;
}

file: netplay.cpp
function: int NetWorkPlay();

PHP:
HWND	hWnd;

	if ( (PlayCounter&0x1FF)==0 && !smConfig.DebugMode ) {
		hWnd = WinFocusCrack();
		//윈도우 포커스를 감시
		if ( hWnd ) {
			//크랙 윈도우 신고
			SendCrackWindow( hWnd );
		}
	}

Just delete above code from the source and you'll not get this sh** log anymore :eek:tt1:

#
file: smwsock.cpp
function: DWORD WINAPI smTransSendThreadProc( void *pInfo )

PHP:
if ( stats!=BuffLen ) 
{
stats = stats;
}

*** is that? :mad:

Well, you know what to do. :closedeyes:

#

I hope that will help us somewhat. :thumbup1:
 
Last edited:
Newbie Spellweaver
Joined
Oct 7, 2012
Messages
18
Reaction score
14
You're welcome :):

I found other things to fix. When I get a good number I'll post here.

I wanted to know what are the purpose of these functions:

file: playsub.cpp
function: DWORD Check_CodeSafe(DWORD dwStartFunc);

file: playsub.cpp
function: DWORD Check_CodeSafe2();

Check_CodeSafe(DWORD dwStartFunc) function receives as parameter dwStartFunc, but in the scope of the function, it assigns another value to dwStartFunc without even using it first... why?!?!? :$:

PHP:
dwStartFunc = 0x4c11cc;
 

drz

Junior Spellweaver
Joined
Jun 7, 2013
Messages
145
Reaction score
71
These function should prevent the changing of some Function-Calls like GameInit(), InitD3D(). But i dont know, why they overwrite the StartFunc param. Maybe thats why the client crash some times.
 
Newbie Spellweaver
Joined
Jun 3, 2013
Messages
33
Reaction score
6
Hi guys,
Is it possible to use this source to add tier 5 and new classes ?
One could copy the code for the pike, paste, transform into assassin, recompile....
If its possible:
ZynesteEvil - PristonTale Source Code (2012) - RaGEZONE Forums
 
RZA-PT | KilroyPT
Joined
Aug 27, 2007
Messages
936
Reaction score
85
@drz you might know, is there something in here where we specify the .exe name for the client side?
i've found if I name my client side anything other than admin it just wont connect to the server, name it admin and it works again :/
 

drz

Junior Spellweaver
Joined
Jun 7, 2013
Messages
145
Reaction score
71
You cant talk about this source-client exe. I've renamed it multiple times and was never disconnect. I dont know what files are you use.
 
RZA-PT | KilroyPT
Joined
Aug 27, 2007
Messages
936
Reaction score
85
yea was talking more in general than just these.
all good, might try utilise these more
 
Newbie Spellweaver
Joined
Jun 13, 2016
Messages
50
Reaction score
1
hi all pro
can you help me
how to run game.exe normal window.
When i test it . Run full screen on desktop.
the code full screen config wrong
i had rebuild with
_window_debug
but it not run normal window.

thank you somuch.
 
Newbie Spellweaver
Joined
Jun 13, 2016
Messages
50
Reaction score
1
How to add Tier 5 and new class.
I had found many source. but i cant add new class and tier 5 skill
Every body can add code. Please tell me about new code.

Help me !
Thank so much
 
Last edited:
Skilled Illusionist
Joined
Jul 21, 2006
Messages
318
Reaction score
2
Thanks for sharing...after so many years it came out.anyone still working on it?
 
Last edited:
Initiate Mage
Joined
Apr 8, 2020
Messages
2
Reaction score
0
I'm late to the party here but, is the code still available somewhere else? Both mega links posted earlier are now gone. Also, would it be possible to add it to a repository somewhere so everyone can jointly improve it?
 
Joined
Jul 24, 2006
Messages
883
Reaction score
581
Newbie Spellweaver
Joined
Jun 13, 2006
Messages
40
Reaction score
2
Hello everyone, I like Pt very much. I installed XP, VC2002 and sdk8 0 but no matter how it is set during compilation, an error is reported. How can I solve it? I like the source code 2002. If I want to compile successfully, I can't solve it after trying my best and setting. I'm the VC2002 version. What runtime should I lack? Please help me

SunnyZ
brunomomesso
Click image for larger version.

Name: 111.png
Views: 0
Size: 66.5 KB
ID: 170769





Winmain.obj : error LNK2001: unresolved external symbol "struct _RTL_CRITICAL_SECTION cSection_Main" (?cSection_Main@@3U_RTL_CRITICAL_SECTION@@A)
Winmain.obj : error LNK2019: unresolved external symbol "int __cdecl CheckJTS_ptr(char *,int)" (?CheckJTS_ptr@@YAHPADH@Z) referenced in function "int __cdecl CheckCode_2Byte(char *)" (?CheckCode_2Byte@@YAHPAD@Z)
Winmain.obj : error LNK2019: unresolved external symbol "int __cdecl TJBscrollWheel(int)" (?TJBscrollWheel@@YAHH@Z) referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z)
Winmain.obj : error LNK2019: unresolved external symbol "public: int __thiscall cSINHELP::sinGetScrollMove(int)" (?sinGetScrollMove@cSINHELP@@QAEHH@Z) referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z)
Winmain.obj : error LNK2001: unresolved external symbol "int * g_FzmMouseButton" (?g_FzmMouseButton@@3PAHA)
Winmain.obj : error LNK2001: unresolved external symbol "int g_iFzmCursorFocusGame" (?g_iFzmCursorFocusGame@@3HA)
Winmain.obj : error LNK2019: unresolved external symbol "void __cdecl ParkSetMicOnOFF(void)" (?ParkSetMicOnOFF@@YAXXZ) referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z)
Winmain.obj : error LNK2019: unresolved external symbol "void __cdecl ParkSetMicOnOFF(void)" (?ParkSetMicOnOFF@@YAXXZ) referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z)
Winmain.obj : error LNK2019: unresolved external symbol "void __cdecl clan_Mouse(int,unsigned int)" (?clan_Mouse@@YAXHI@Z) referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z)
Winmain.obj : error LNK2019: unresolved external symbol "public: int __thiscall cHELPPET::petOnOff(char *)" (?PetOnOff@cHELPPET@@QAEHPAD@Z) referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z)
Winmain.obj : error LNK2001: unresolved external symbol "int keydownEnt" (?keydownEnt@@3HA)
Winmain.obj : error LNK2019: unresolved external symbol "public: int __thiscall CMicVolume::Init(void)" (?Init@CMicVolume@@QAEHXZ) referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z)
Winmain.obj : error LNK2001: unresolved external symbol "class CMicVolume cmicvol" (?cmicvol@@3VCMicVolume@@A)
Winmain.obj : error LNK2001: unresolved external symbol "int micInit" (?micInit@@3HA)
Winmain.obj : error LNK2001: unresolved external symbol "int vrunRuning" (?vrunRuning@@3HA)
Winmain.obj : error LNK2019: unresolved external symbol "int __cdecl KeyFullZoomMap(unsigned int)" (?KeyFullZoomMap@@YAHI@Z) referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z)
Winmain.obj : error LNK2019: unresolved external symbol "void __cdecl PacketParsing(void)" (?PacketParsing@@YAXXZ) referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z)
Winmain.obj : error LNK2019: unresolved external symbol "void __cdecl MainFullZoomMap(void)" (?MainFullZoomMap@@YAXXZ) referenced in function "void __cdecl PlayMain(void)" (?PlayMain@@YAXXZ)
Winmain.obj : error LNK2019: unresolved external symbol "public: int __thiscall cSINHELP::sinGetHelpShowFlag(void)" (?sinGetHelpShowFlag@cSINHELP@@QAEHXZ) referenced in function "void __cdecl PlayMain(void)" (?PlayMain@@YAXXZ)
Winmain.obj : error LNK2019: unresolved external symbol "int __cdecl ActionGameMain(void)" (?ActionGameMain@@YAHXZ) referenced in function "void __cdecl PlayMain(void)" (?PlayMain@@YAXXZ)
Winmain.obj : error LNK2019: unresolved external symbol "int __cdecl UnlockSpeedProtect(class smCHAR *)" (?UnlockSpeedProtect@@YAHPAVsmCHAR@@@Z) referenced in function "void __cdecl PlayD3D(void)" (?PlayD3D@@YAXXZ)
Winmain.obj : error LNK2019: unresolved external symbol "int __cdecl LockSpeedProtect(class smCHAR *)" (?LockSpeedProtect@@YAHPAVsmCHAR@@@Z) referenced in function "void __cdecl PlayD3D(void)" (?PlayD3D@@YAXXZ)
Winmain.obj : error LNK2019: unresolved external symbol "void __cdecl MainBellatraFontEffect(void)" (?MainBellatraFontEffect@@YAXXZ) referenced in function "void __cdecl PlayD3D(void)" (?PlayD3D@@YAXXZ)
Winmain.obj : error LNK2001: unresolved external symbol "short * ActionMouseClick" (?ActionMouseClick@@3PAFA)
Winmain.obj : error LNK2019: unresolved external symbol "void __cdecl g_IsCheckClanMember(class smCHAR *)" (?g_IsCheckClanMember@@YAXPAVsmCHAR@@@Z) referenced in function "int __cdecl SetMousePlay(int)" (?SetMousePlay@@YAHH@Z)
Winmain.obj : error LNK2019: unresolved external symbol "int __cdecl CreateWinIntThread(void)" (?CreateWinIntThread@@YAHXZ) referenced in function "int __cdecl GameInit(void)" (?GameInit@@YAHXZ)
Winmain.obj : error LNK2019: unresolved external symbol "void __cdecl CreateFontImage(void)" (?CreateFontImage@@YAXXZ) referenced in function "int __cdecl GameInit(void)" (?GameInit@@YAHXZ)
Winmain.obj : error LNK2019: unresolved external symbol "void __cdecl CreateBeforeFullZoomMap(void)" (?CreateBeforeFullZoomMap@@YAXXZ) referenced in function "int __cdecl GameInit(void)" (?GameInit@@YAHXZ)
Winmain.obj : error LNK2019: unresolved external symbol "void __cdecl DestroyBellatraFontEffect(void)" (?DestroyBellatraFontEffect@@YAXXZ) referenced in function "int __cdecl GameClose(void)" (?GameClose@@YAHXZ)
Winmain.obj : error LNK2019: unresolved external symbol "void __cdecl DestroyWinIntThread(void)" (?DestroyWinIntThread@@YAXXZ) referenced in function "int __cdecl GameClose(void)" (?GameClose@@YAHXZ)
Winmain.obj : error LNK2001: unresolved external symbol "unsigned long dwDebugAreaCount" (?dwDebugAreaCount@@3KA)
Winmain.obj : error LNK2001: unresolved external symbol "unsigned long dwDebugAreaConnCount" (?dwDebugAreaConnCount@@3KA)
Winmain.obj : error LNK2001: unresolved external symbol "unsigned long * dwDebugAreaIP" (?dwDebugAreaIP@@3PAKA)
Winmain.obj : error LNK2001: unresolved external symbol "unsigned long dwDebugAreaStep" (?dwDebugAreaStep@@3KA)
Winmain.obj : error LNK2019: unresolved external symbol "void __cdecl DrawBellatraFontEffect(void)" (?DrawBellatraFontEffect@@YAXXZ) referenced in function "int __cdecl DrawGameState(void)" (?DrawGameState@@YAHXZ)
Winmain.obj : error LNK2001: unresolved external symbol "int ActionDashMode" (?ActionDashMode@@3HA)
Winmain.obj : error LNK2019: unresolved external symbol "void __cdecl DrawFullZoomMap(void)" (?DrawFullZoomMap@@YAXXZ) referenced in function _smPlayD3D@24
Winmain.obj : error LNK2019: unresolved external symbol "int __cdecl DrawSky(int,int,int,int,int,int)" (?DrawSky@@YAHHHHHHH@Z) referenced in function _smPlayD3D@24
Winmain.obj : error LNK2001: unresolved external symbol "int ktj_imsiDRAWinfo" (?ktj_imsiDRAWinfo@@3HA)
Winmain.obj : error LNK2019: unresolved external symbol "public: __thiscall Mini_Dump::Mini_Dump(void)" (??0Mini_Dump@@QAE@XZ) referenced in function _$E8
game.exe : fatal error LNK1120: 810 unresolved externals

Build log was saved at "file://c:\Source\J_Server\runmap3d___Win32_Debug\BuildLog.htm"
runmap3d - 1083 error(s), 41 warning(s)
 
Initiate Mage
Joined
Sep 5, 2022
Messages
2
Reaction score
1
[help]how to change cilent language and complied game.exe

Japanese build is set as default one.
runmap3d.sln => clean & build.


To make an english build you will have to do some more things.


language.h
modify lines
Code:
//#define _LANGUAGE_JAPANESE
//#define _LANGUAGE_JAPANESE_FIELDLEVEL
..
#define _LANGUAGE_ENGLISH
#define _LANGUAGE_ENGLISH_FIELDLEVEL


copy Japanese\J_Set_EventSpawn.h to English\E_Set_EventSpawn.h
perform translations...


copy from Japanese\J_ServerMsg.h line 119 and translate
to English\E_ServerMsg.h line 244
Code:
char *szMiniMorif = "ミニモリプ";
char *szWantedMorif = "ブラックモリプ";


copy from Japanese\J_ServerMsg.h (eof) and translate
to English\E_ServerMsg.h (eof)
Code:
////////////////////////////////////////////////////////////////////////


////////BlessCastleMonster_20100526
char *szMon_FireCrystal = "ファイアクリスタル";  
char *szMon_LightningCrystal = "ライトニングクリスタル";
char *szMon_IceCrystal = "アイスクリスタル";
char *szMon_TowerCrystal = "タワークリスタル";
char *szMon_Castledoor = "城門";


char *szMon_Curse_Soldier_A = "呪われた民兵";
char *szMon_Curse_Soldier_B = "呪われた警備兵";
char *szMon_Curse_Soldier_C = "呪われた守護兵";
char *szMon_Castledoor_Soldier = "城門守護兵";


char *szEvent_HopeMsg_StateInit = "レッドストーンの再配布をお願いします。";
char *StateInitEvent1 = "クリス:用意したレッドストーンは全て交換されてしまった。";
char *StateInitEvent2 = "クリス:君はもう貰ってる。もっと欲しければアイテムショップに行ってみなさい。";
char *StateInitEvent3 = "レッドストーン";
char *StateInitEvent4 = "クリス:リカルテンは素晴らしい町でしょ?アイテム配給所にアイテムを送りましたよ!";


copy from Japanese\J_ServerMsg.h line 272 and translate
to English\E_ServerMsg.h line 243(above earlier code)
Code:
// Chichen_Day
#define PAPACHICHEN_CHAT_MAX        7
char *szPaPaChichenChatMsg[PAPACHICHEN_CHAT_MAX] = {
    "涼しくなってきたな。いっぱい食べないと!",
    "お前がうちの子を殴ったのか?",
    "鋭利なくちばしでお前をつついてやる!",
    "涼しくなるとなぜか仲間が減ってしまうんだ…",
    "バタバタ~私のキックの味わってみろ~",
    "フライドチキンと味付けチキンどっちがいい?",
    "なんといってもこれからは水炊きが最高!"
};




#define PAPACHICHEN_CHAT_DROP_MAX        5
char *szPaPaChichenChatDropMsg[PAPACHICHEN_CHAT_DROP_MAX] = {
    "信じられない~私がやられるなんて。。",
    "私を殴っても心は痛まないの?",
    "クオオオオオオ!",
    "信じられない!お前の名前を覚えてやる。",
    "次にはお前にやられない。きっとだぞ!"
};


modify English\E_HoTextFile.h
Code:
char *HoTextLoginMessage[20] = ....
...
                "Return value is 7",
                "Return value is 9"
                };


modify in HoBaram\HoLogin.cpp line 3740
Code:
                }
            }
#endif
//// KYLE ///// 일본어IME /////////////////////////////////////////////////////////////////////////////End////
into
Code:
                }
#endif
            }
//// KYLE ///// 일본어IME /////////////////////////////////////////////////////////////////////////////End////


copy from Japanese\J_sinMsg.h and translate
to English\E_sinMsg.h anywhere
Code:
//ケレタ鄙・- シレ クニソタア・
char *WatermelonItem    = "7個のスイカを"; // シレ 7ーウ
//ケレタ鄙・- ネ」ケレ クニソタア・
char *PumpkinItem = "7個のかぼちゃを"; // ネ」ケレ 7ーウ
//ケレタ鄙・- ケ翩マエテタヌ シメソ・タフコ・ニョ
char *StarItem = "7個の星のかけら"; // コー 7ーウ
//タ蠎ー - ケ゚キサナクタホ テハトンクエ クニソタ
char *ValentineItem = "7個のチョコレート "; // ケ゚キサナクタホ テハトンクエ 7ーウ
//ケレタ鄙・- ア箍」ククキ・
char *PristonAlphabetItem = "7個の アルファベットを";
char *CandydaysItem = "7個のキャンディを";
char *ExpireItem = "期間満了";
...
char *MagicalGreenEmeraldItem = "7個のエメラルドを";    
char *MagicalGreenJadeItem = "7個のヒスイを";        


char *TearOfKaraItem    ="7個のカラの涙を"; //- Here (^_^)


char *FindinvestigatorItem = " ";  //- Here (^_^)
char *FindinvestigatorNineItem = "ナインペンダント";  //- Here (^_^)
char *FindinvestigatorTaleItem = "テイルペンダント";  //- Here (^_^)
...
char *BillingMagicForceName = "マジックフォース";
char *MagicForceName = "マジック";
...
 char *InventoryFull = "インベントリ 空間不足";
char *InvenSpaceSecure = "空間を確保してください";
...
// ケレタ鄙・- コホスコナヘ セニタフナロ 
// セニタフナロ チ、コク グステチ・
char *BoosterItemInfo[] ={
    {"一定時間、生命力を\r"},  
    {"一定時間、気力を\r"},
    {"一定時間、体力を\r"},
    0,
};
char *BoosterItemInfo2[] ={
    {"15%上昇させる\r"},
    {"15%上昇させる\r"},
    {"15%上昇させる\r"},
    0,
};


runmap3d.sln => clean & build... Now it builds the English version.
Although some arrays may be missing some elements, etc, this is up for you guys to fix.
It may even be more stable to start and modify / translate the Japanese base to your needs.



sir,i follow your guide ,change the language and complied the server.exe ,but i when i start the game , the language is not changed,so can u tell me how to change the cilent language,thank u!
 
Back
Top