How to add Starting items

Results 1 to 6 of 6
  1. #1
    Account Upgraded | Title Enabled! RGaming is online now
    MemberRank
    Jul 2009 Join Date
    PronteraLocation
    581Posts

    How to add Starting items

    Hi how can i add starting items and starting zulie ? im using evo revision 4


  2. #2
    Last of the OsRose Devs Purpleyouko is offline
    MemberRank
    Oct 2006 Join Date
    Missouri USALocation
    2,161Posts

    Re: How to add Starting items

    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

  3. #3
    Account Upgraded | Title Enabled! RGaming is online now
    MemberRank
    Jul 2009 Join Date
    PronteraLocation
    581Posts

    Re: How to add Starting items



    @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;
    			}

  4. #4
    Last of the OsRose Devs Purpleyouko is offline
    MemberRank
    Oct 2006 Join Date
    Missouri USALocation
    2,161Posts

    Re: How to add Starting items

    so what is it that you want to know?

  5. #5
    Account Upgraded | Title Enabled! RGaming is online now
    MemberRank
    Jul 2009 Join Date
    PronteraLocation
    581Posts

    Re: How to add Starting items

    FATAL Error cannot create char when i put this code what seems the error?

  6. #6
    Last of the OsRose Devs Purpleyouko is offline
    MemberRank
    Oct 2006 Join Date
    Missouri USALocation
    2,161Posts

    Re: How to add Starting items

    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



Advertisement