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!

How to add Starting items

Status
Not open for further replies.
Last of the OsRose Devs
Loyal Member
Joined
Oct 15, 2006
Messages
2,154
Reaction score
101
new characters are created in the charserver
CharPackets.cpp
bool CCharServer::pakCreateChar( CCharClient* thisclient, CPacket* P )

Look for the part that looks something like this
Code:
if(!DB->QExecute("INSERT INTO characters (account_name, char_name, face, hairStyle, sex) VALUES('%s','%s',%i,%i,%i)", thisclient->username, newname.c_str(), face, hairstyle, sex))
       return false;
    unsigned int mid = (unsigned)mysql_insert_id( DB->Mysql );
    MYSQL_ROW row;
    if(!DB->QExecute("INSERT INTO items VALUES(%i,29,3,0,40,100,3,1,0,0,0,0,0)", mid))
        return false;
    if(!DB->QExecute("INSERT INTO items VALUES(%i,29,5,0,40,100,6,1,0,0,0,0,0)", mid))
        return false;
    if(!DB->QExecute("INSERT INTO items VALUES(%i,1,8,0,40,100,7,1,0,0,0,0,0)", mid))
        return false;

    if(sex==0)
    {
        if(!DB->QExecute("INSERT INTO items VALUES(%i,222,2,0,40,100,12,1,0,0,0,0,0)", mid))
            return false;
     }
    else
    {
        if(!DB->QExecute("INSERT INTO items VALUES(%i,221,2,0,40,100,12,1,0,0,0,0,0)", mid))
            return false;
    }
it might look a bit different in DR4 as this is taken from DR1.5 (drop-rev) which is the one I currently have open in my code editor.
Either way the principle is the same. this code inserts values into your new character in the database so just modify it to add whatever you like
 
Joined
Jul 18, 2009
Messages
658
Reaction score
75
REMOVED
Purpleyouko Help please

here is the code

Code:
	if(!DB->QExecute("INSERT INTO characters (account_name, char_name, face, hairStyle, sex, hairColor) VALUES('%s','%s',%i,%i,%i, %i)", thisclient->username, name.c_str(), face, hairstyle, sex, haircolor))
	   return false;
	unsigned int mid = (unsigned)mysql_insert_id( DB->Mysql );

	for(int i=0; i<ItemNewChar.size();i++)
	{
		if(ItemNewChar[i]->sex == 2 || ItemNewChar[i]->sex == sex)
		{
			if(ItemNewChar[i]->premium == true && thisclient->premium == false)
				continue;

    if(!DB->QExecute("INSERT INTO items VALUES(%i,29,3,0,40,100,3,1,0,0,0,0,0)", mid))
        return false;
    if(!DB->QExecute("INSERT INTO items VALUES(%i,29,5,0,40,100,6,1,0,0,0,0,0)", mid))
        return false;
    if(!DB->QExecute("INSERT INTO items VALUES(%i,1,8,0,40,100,7,1,0,0,0,0,0)", mid))
        return false;

    if(sex==0)
    {
        if(!DB->QExecute("INSERT INTO items VALUES(%i,222,2,0,40,100,12,1,0,0,0,0,0)", mid))
            return false;
     }
    else
    {
        if(!DB->QExecute("INSERT INTO items VALUES(%i,221,2,0,40,100,12,1,0,0,0,0,0)", mid))
            return false;
			}
 
Last of the OsRose Devs
Loyal Member
Joined
Oct 15, 2006
Messages
2,154
Reaction score
101
so what is it that you want to know?
 
Last of the OsRose Devs
Loyal Member
Joined
Oct 15, 2006
Messages
2,154
Reaction score
101
you didn't just paste my code in did you?

You are supposed to find where that code exists in your own source then change the values in the queries to put in the items that you want
 
Status
Not open for further replies.
Back
Top