• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

[Release] Mu Online Sources

Newbie Spellweaver
Joined
Nov 2, 2007
Messages
66
Reaction score
3
Command /post source code
PHP:
void DataSendAll(unsigned char* Packet, int Length)
{
    for (int i=6400; i<7400; i++)
        if(gObjIsConnected(i))
            DataSend(i, Packet, Length);
}

void SendPost(int wId, LPCSTR Command, LPCSTR Text)
{
    if (!IsPost) return;
    if (!gObjIsConnected(wId)) return;
    if (!strcmpi(Command, "/Post"))
    {
        MessageOutput(wId, "[%s] Useage: /Post <Msg>.", szPrefix);
        MessageOutput(wId, "[%s] Price for post: %d, Minimun Level: %d", szPrefix, PostCost, PostLevel);
        return;
    }
    gObj_SetInfo(wId);
    if (gObj.Level < PostLevel)
    {
        MessageOutput(wId, "[%s] You're level is too low to post!", szPrefix);
        return;
    }
    if (gObj.Money < PostCost) 
    {
        MessageOutput(wId, "[%s] You don't have enough money to post!", szPrefix);
        return;
    }
    BYTE *Packet;
    char Message[100];
    Packet = (BYTE*) malloc(200);
    memset(Packet, 0x00, 200);
    *Packet = 0xC1;
    *(Packet+2) = 0x00;
    memcpy((Packet+3), gObj.Nick, strlen(gObj.Nick));
    sprintf(Message, "@@[Global] %s", Text);
    memcpy((Packet+13), Message, strlen(Message));
    int Len = (strlen(Message) + 0x13);
    *(Packet+1) = Len;
    DataSendAll(Packet, Len);
    int Amount = (gObj.Money - PostCost);
    gObj_Write(wId, gObj_Money, Amount);
    MoneySend(wId, Amount);
    free (Packet);

Adding new options to gameserver
PHP:
/* AddMU.cpp
made by: drakelv
Updates by: DMCahir
*/
#include "AddMU.h"
//////////////////////////////////////////////////////////////////////
// Source Start
//////////////////////////////////////////////////////////////////////
#include <string.h>
#include <windows.h>
 
extern "C" __declspec(dllexport) void OptionAndBugFix();
// Fixing Potion Bug in GS
bool PotBugFix( char * inipath ) 
{
if (GetPrivateProfileInt("GameServerNormal" , "PotionBugFix" , 1 , "./Addicted.ini")){
memset((PBYTE) FixPotionBug1 ,0x90,8 ) ; //warehouse
memset((PBYTE) FixPotionBug2 ,0x90,8 ) ; //inventory
memset((PBYTE) FixPotionBug3 ,0x90,8 ) ; 
return 1;
}
return 0;
}
// Fixing ID Code in GS for characters
bool NoIDChar( char * inipath)
{
if (GetPrivateProfileInt("GameServerNormal" , "DeleteCharWithoutID" , 1 , "./Addicted.ini")){
memset((PBYTE) FixDeleteChar, 0xEB , 1 ); //Dzēst čaru bez ID.
return 1;
}
return 0;
}
// Fixing ID Code in GS for Guilds
bool NoIDGuild( char * inipath )
{
if (GetPrivateProfileInt("GameServerNormal", "DeleteGuildWithoutID", 1, "./Addicted.ini")){
memset((PBYTE) FixDeleteGuild ,0x90 , 6 ); //Dzēst ģildi bez ID
memset((PBYTE) FixLeaveGuild ,0x90 , 2 ); //Pames ģildi bez ID
return 1;
}
return 0;
}
// Party Zen Bug Fix
// transformation ring change
 
bool TransRing( char * inipath ){
int TransformationRing = GetPrivateProfileInt("GameServerNormal", "TransformationRingInit", 0, "Addicted.ini");
DWORD dwTmp ;
dwTmp=GetPrivateProfileInt("GameServerNormal", "TransformationRing1",2, "Addicted.ini") ;
*(unsigned int *) TransformationRing1 = dwTmp ;
dwTmp=GetPrivateProfileInt("GameServerNormal", "TransformationRing2",7, "Addicted.ini") ;
*(unsigned int *) TransformationRing2 = dwTmp ;
dwTmp=GetPrivateProfileInt("GameServerNormal", "TransformationRing3",14, "Addicted.ini") ;
*(unsigned int *) TransformationRing3 = dwTmp ;
dwTmp=GetPrivateProfileInt("GameServerNormal", "TransformationRing4",8, "Addicted.ini") ;
*(unsigned int *) TransformationRing4 = dwTmp ;
dwTmp=GetPrivateProfileInt("GameServerNormal", "TransformationRing5",9, "Addicted.ini") ;
*(unsigned int *) TransformationRing5 = dwTmp ;
dwTmp=GetPrivateProfileInt("GameServerNormal", "TransformationRing6",41, "Addicted.ini") ;
*(unsigned int *) TransformationRing6 = dwTmp ;
return 1 ;
}
bool NotifyIfDllLoaded( char * inipath ){
if (GetPrivateProfileInt("GameServerNormal", "NotifyIfDllLoaded", 1, "./Addicted.ini") )
{
MessageBox ( 0 , "Addicted.Dll by drakelv has been successfully loaded. Enjoy the Game!" , "DLL Loaded!" , MB_OK );
return 1;
}
else return 0;
}
void ChaosBoxRate()
{
    DWORD dwTemp ;
    BYTE cTemp ;
    dwTemp = GetPrivateProfileIntA("GameServerNormal", "ChaosMix10",50, "./DMT.ini") ;
    *(unsigned int *) ChaosMix10 = dwTemp ;

    dwTemp = GetPrivateProfileIntA("GameServerNormal", "ChaosMix11",45, "./DMT.ini") ;
    *(unsigned int *) ChaosMix11 = dwTemp ;

    dwTemp = GetPrivateProfileIntA("GameServerNormal", "ChaosMix12",45, "./DMT.ini") ;
    *(unsigned int *) ChaosMix12 = dwTemp ;

    dwTemp = GetPrivateProfileIntA("GameServerNormal", "ChaosMix13",45, "./DMT.ini") ;
    *(unsigned int *) ChaosMix13 = dwTemp ;
}

void JewelSuccesRate()
{
    BYTE cTemp ;
    cTemp = GetPrivateProfileIntA("GameServerNormal", "SoulWithLuckSuccessRate",70, "./DMT.ini") ;
    *(unsigned char *) SoulLuckRate = cTemp ;

    cTemp = GetPrivateProfileIntA("GameServerNormal", "SoulNoLuckSuccessRate", 55, "./DMT.ini") ;
    *(unsigned char *) SoulRate = cTemp ;

    cTemp = GetPrivateProfileIntA("GameServerNormal", "LifeSuccessRate", 50, "./DMT.ini") ;
    *(unsigned char *) LifeRate = 100 - cTemp ;
}

void JewelPrices()
{
    DWORD dwTemp;

    dwTemp = GetPrivateProfileIntA("GameServerNormal", "BlessiPrice", 9000000, "./DMT.ini") ;
    *(unsigned int *) BlessPrice = dwTemp ;

    dwTemp = GetPrivateProfileIntA("GameServerNormal", "SoulPrice", 6000000, "./DMT.ini") ;
    *(unsigned int *) SoulPrice = dwTemp ;

    dwTemp = GetPrivateProfileIntA("GameServerNormal", "ChaosPrice", 810000, "./DMT.ini") ;
    *(unsigned int *) ChaosPrice = dwTemp ;

    dwTemp = GetPrivateProfileIntA("GameServerNormal", "LifePrice", 45000000, "./DMT.ini") ;
    *(unsigned int *) LifePrice = dwTemp ;

    dwTemp = GetPrivateProfileIntA("GameServerNormal", "CreationPrice", 36000000, "./DMT.ini") ;
    *(unsigned int *) CreationPrice = dwTemp ;

    dwTemp = GetPrivateProfileIntA("GameServerNormal", "GuardianPrice", 60000000, "./DMT.ini") ;
    *(unsigned int *) GuardianPrice = dwTemp ;

    dwTemp = GetPrivateProfileIntA("GameServerNormal", "PotionOfBlessPrice", 900000, "./DMT.ini") ;
    *(unsigned int *) BlessPotionPrice = dwTemp ;

    dwTemp = GetPrivateProfileIntA("GameServerNormal", "PotionOfSoulPrice", 450000, "./DMT.ini") ;
    *(unsigned int *) SoulPotionPrice = dwTemp ;
}
void OptionAndBugFix()
{
char inipath[] = "./Addicted.ini";
bool bResult ;
DWORD dwOld1,dwOld2;
LPVOID lpAddress1,lpAddress2 ;
lpAddress1 = (LPVOID) 0x00401000 ; //fix96
lpAddress2 = (LPVOID) 0x0C296000 ; //fix96
if ( VirtualProtect (lpAddress1,0x246000+0x1D000,PAGE_EXECUTE_READWRITE,&dwOld1 ) ) //fix96
{ 
if (VirtualProtect(lpAddress2,0x4000,PAGE_EXECUTE_READWRITE, &dwOld2) ) //fix96
{
bResult =FixPotionNumber( inipath );
bResult =NoIDChar( inipath );
bResult =NoIDGuild( inipath );
bResult =TransRing( inipath );
bResult =NotifyIfDllLoaded( inipath );
bResult =PartyZenFix( inipath );
}
// Gs is VirtualProtected so we need to use Vprotect function.
VirtualProtect (lpAddress1,0x246000+0x1D000,PAGE_EXECUTE_READ,&dwOld1 ); 
VirtualProtect (lpAddress2,0x4000 ,PAGE_EXECUTE_READ,&dwOld2 ); 
}
}

The .H file
PHP:
#define FixDeleteGuild 0x004431CA
#define FixLeaveGuild 0x00443320
#define FixDeleteChar 0x004328E4
#define FixPotionBug1 0x00427A71
#define FixPotionBug3 0x004CD0FF
#define FixPotionBug2 0x004CD0AE
#define FixZenParty 0x004DD318
#define TransformationRing1 0x004B472E
#define TransformationRing2 0x004B4737
#define TransformationRing3 0x004B4740
#define TransformationRing4 0x004B4749
#define TransformationRing5 0x004B4752
#define TransformationRing6 0x004B475B
//Ceny Jeweli
#define ChaosPrice 0x00508489
#define SoulPrice 0x00508446
#define BlessPrice 0x00508467
#define CreationPrice 0x005084CC
#define GuardianPrice 0x005085AA
#define LifePrice 0x005084AB

//Ceny potion
 
Last edited by a moderator:
Newbie Spellweaver
Joined
Nov 2, 2007
Messages
66
Reaction score
3
Re: [Release]Mu Online Sources

Season 3 wings mix code
go coderzfactory home page and type @ web browser showthread.php?t=3110
 
Newbie Spellweaver
Joined
Jun 18, 2007
Messages
38
Reaction score
0
Re: [Release]Mu Online Sources

Season3 quest source code work?
 
Junior Spellweaver
Joined
Feb 9, 2007
Messages
125
Reaction score
0
Re: [Release]Mu Online Sources

where i put codes?
 
Legendary Battlemage
Loyal Member
Joined
Nov 3, 2006
Messages
648
Reaction score
2
Re: [Release]Mu Online Sources

This all are collected but good job.
 
Experienced Elementalist
Joined
Dec 2, 2004
Messages
225
Reaction score
30
Re: [Release]Mu Online Sources

your post code y add points plz correct this source

Thanks
 
Newbie Spellweaver
Joined
Jul 9, 2005
Messages
12
Reaction score
0
Re: [Release]Mu Online Sources

might help to add the credits for each of these before you get flamed/spammed for not
 
Newbie Spellweaver
Joined
Nov 2, 2007
Messages
66
Reaction score
3
Re: [Release]Mu Online Sources

Read.. they all have credits!
 
Experienced Elementalist
Joined
Sep 14, 2006
Messages
229
Reaction score
0
Re: [Release]Mu Online Sources

hmm, comiling some DLLib errors :|
 
Newbie Spellweaver
Joined
Apr 30, 2007
Messages
48
Reaction score
0
Re: [Release]Mu Online Sources

Good job!
The Command /POST, works in any version, 97d for example?
----
edit
----
The code on the topic, to /post, is the same as /add.
Sry my bad eng.
 
Junior Spellweaver
Joined
Oct 17, 2007
Messages
140
Reaction score
9
Re: [Release]Mu Online Sources

gooooood job
 
Junior Spellweaver
Joined
Feb 9, 2007
Messages
125
Reaction score
0
Re: [Release]Mu Online Sources

how i atteched the DLL to the GS? and what name giving thame
 
Newbie Spellweaver
Joined
Mar 23, 2007
Messages
91
Reaction score
7
Re: [Release]Mu Online Sources

What programm i need to create dll.
and how hook dll in gs?
 
Newbie Spellweaver
Joined
Sep 17, 2007
Messages
36
Reaction score
1
Re: [Release]Mu Online Sources

good job

10/10

thanks
 
Experienced Elementalist
Joined
Sep 14, 2006
Messages
229
Reaction score
0
Re: [Release]Mu Online Sources

when attaching my DLL i have error in OllyDBG at the Assembly PERFIX CS:
anyone ?
 
iNewLegend , Leo123
Joined
Apr 26, 2006
Messages
296
Reaction score
81
Re: [Release]Mu Online Sources

you post two add commands
and you say one of this is post LOL