Jump to content

hachiwari

Active Member
  • Posts

    299
  • Joined

  • Last visited

  • Days Won

    1
  • Feedback

    0%

Posts posted by hachiwari

  1. function mysql_query(sql)

    user = "USER_NAME"

    pw = "PASSWORD_USER"

    local var = {}

    var.pre = ''

    if user ~= nil then

    var.pre = var.pre..' -u'..user

    end

    if pw ~= nil then

    var.pre = var.pre..' -p'..pw

    end

    var.scriptfile = 'sc_'..pc.get_name()..number(1,999)..number(2,999)..number(3,999)

    var.outputfile = 'op_'..pc.get_name()..number(1,999)..number(2,999)..number(3,999)

    sql = string.gsub(sql,'"',"'")

    var.str = "/usr/local/bin/mysql -N -L "..var.pre.." < "..var.scriptfile.." > "..var.outputfile

    script = io.open(var.scriptfile,"a+")

    script:write(sql)

    script:close()

    os.execute(var.str)

    back = io.open(var.outputfile)

    quer = back:read()

    back:flush()

    back:close()

    os.remove(var.scriptfile)

    os.remove(var.outputfile)

    return quer

    end

    *complete USER_NAME and PASSWORD_USER.

  2. Hi devs!

     

    The original equipment viewer is not updated for the new equipments I am thinking of costumes + rings + belt

    Here is the extended version.

     

    Images:

    view_equip_new.jpg


    view_equip_new2.jpg

     

     

    Here are my modified files to root and uiscript package, the .py files:

    uiEquipDialog.py

    Pastebin ~ FTP

     

    UIScriptEquipmentDialog.py

    Pastebin ~ FTP

     

    UIScriptCostumeEquipmentDialog.py

    Pastebin ~ FTP

     

    Ehm yeah this was the easiest part of this, now comin' the serverside and binary parts.

    Server:

    1.) Open gamepacket.h than search for: "typedef struct pakcet_view_equip" and replace all structure with this:

    typedef struct pakcet_view_equip
    {
    	BYTE	header;
    	DWORD	vid;
    	struct {
    		DWORD	vnum;
    		BYTE	count;
    		long	alSockets[ITEM_SOCKET_MAX_NUM];
    		TPlayerItemAttribute aAttr[ITEM_ATTRIBUTE_MAX_NUM];
    	} equips[16];
    } TPacketViewEquip;
    

    PS: lel "pakcet" xD nevermind Save&Close

     

    2.) Open char.cpp and search for this: "void CHARACTER::SendEquipment(LPCHARACTER ch)" and replace the event with this(Thanks ATAG):

    void CHARACTER::SendEquipment(LPCHARACTER ch)
    {
    	TPacketViewEquip p;
    	p.header = HEADER_GC_VIEW_EQUIP;
    	p.vid    = GetVID();
    	int pos[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 19, 20, 21, 22, 23 };
    	for (int i = 0; i < 16; i++)
    	{
    		LPITEM item = GetWear(pos[i]);
    		if (item)
    		{
    			p.equips[i].vnum = item->GetVnum();
    			p.equips[i].count = item->GetCount();
    
    			thecore_memcpy(p.equips[i].alSockets, item->GetSockets(), sizeof(p.equips[i].alSockets));
    			thecore_memcpy(p.equips[i].aAttr, item->GetAttributes(), sizeof(p.equips[i].aAttr));
    		}
    		else
    		{
    			p.equips[i].vnum = 0;
    		}
    	}
    	ch->GetDesc()->Packet(&p, sizeof(p));
    }

    Serverside done! - Build!

     

     

    Binary:

    1.) Open UserInterfacePacket.h than search for this: "typedef struct pakcet_view_equip" and replace with this:

    typedef struct pakcet_view_equip
    {
    	BYTE	header;
    	DWORD	dwVID;
    	TEquipmentItemSet equips[16];
    } TPacketGCViewEquip;
    

    PS: we met again with pakcet xD, Save&Close.

     

    2.) Open UserInterfacePythonNetworkStreamPhaseGame.cpp than search for this: "bool CPythonNetworkStream::RecvViewEquipPacket()" and replace with this:

    bool CPythonNetworkStream::RecvViewEquipPacket()
    {
    	TPacketGCViewEquip kViewEquipPacket;
    	if (!Recv(sizeof(kViewEquipPacket), &kViewEquipPacket))
    		return false;
    
    	PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "OpenEquipmentDialog", Py_BuildValue("(i)", kViewEquipPacket.dwVID));
    	for (int i = 0; i < 16; ++i)
    	{
    		TEquipmentItemSet & rItemSet = kViewEquipPacket.equips[i];
    		PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "SetEquipmentDialogItem", Py_BuildValue("(iiii)", kViewEquipPacket.dwVID, i, rItemSet.vnum, rItemSet.count));
    
    		for (int j = 0; j < ITEM_SOCKET_SLOT_MAX_NUM; ++j)
    			PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "SetEquipmentDialogSocket", Py_BuildValue("(iiii)", kViewEquipPacket.dwVID, i, j, rItemSet.alSockets[j]));
    
    		for (int k = 0; k < ITEM_ATTRIBUTE_SLOT_MAX_NUM; ++k)
    			PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "SetEquipmentDialogAttr", Py_BuildValue("(iiiii)", kViewEquipPacket.dwVID, i, k, rItemSet.aAttr[k].bType, rItemSet.aAttr[k].sValue));
    	}
    
    	return true;
    }
    

    Binaryside done! - Build!

     

     

    Ohh I almost forgot, here are the bg ^^-> bababba

    All done, press escape to exit... :)

    Thanks!

    :)

    • Metin2 Dev 7
    • Think 1
    • Good 3
    • Love 1
    • Love 6
  3. Hello. :)

    I have problem with loading sound mp3. (binary -> mainline_sg)

    Client didn't play files mp3.

    Syserr:

    0831 17:04:00737 :: CSoundManager::PlayMusic - Failed to load stream sound : BGM/login_window.mp3
    0831 17:04:04131 :: CSoundManager::PlayMusic - Failed to load stream sound : BGM/characterselect.mp3
    0831 17:04:14160 :: CSoundManager::PlayMusic - Failed to load stream sound : BGM/enter_the_east.mp3
    

    Help me! :D

×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.