/pack and /unpack Jewels Source Code

Results 1 to 4 of 4
  1. #1
    Account Upgraded | Title Enabled! nofeara is offline
    MemberRank
    Nov 2009 Join Date
    510Posts

    /pack and /unpack Jewels Source Code

    Hello Folks!

    Do you have a source file wherein i can look to implement /pack and /unpack jewels source codes? I am using muemu files and wanted to add these codes.

    I found this thread but i think the source link was missing:
    https://forum.ragezone.com/f197/rele...3/index24.html

    If you can link me to or provide the codes :D will be very much appreciated.


  2. #2

    Re: /pack and /unpack Jewels Source Code

    @nofeara

    here is a link to that source if it helps

    https://www.mediafire.com/file/y137r...ource.rar/file

  3. #3
    Account Upgraded | Title Enabled! nofeara is offline
    MemberRank
    Nov 2009 Join Date
    510Posts

    Re: /pack and /unpack Jewels Source Code

    its quite sad the source only shows these commands

    command.cpp
    #include "StdAfx.h"

    // Custom Commands
    void MakeCommand(int aIndex,char* Message)
    {
    if(!_strcmpi("/make",Message))
    {
    GCServerMsgStringSend("Usage: /make <type> <index> <lvl> <skill> <luck> <opt> <exc>",aIndex,1);
    return;
    }

    if(strlen(Message) < 1)
    {
    GCServerMsgStringSend("Usage: /make <type> <index> <lvl> <skill> <luck> <opt> <exc>",aIndex,1);
    return;
    }

    int Spaces = 0;

    for(int i = 0; i < strlen(Message); i++)
    {
    if(Message[i] == ' ')
    {
    Spaces++;
    }
    }

    if(Spaces < 6)
    {
    GCServerMsgStringSend("Please re-check the code string you gave.",aIndex,1);
    return;
    }

    int ItemType,ItemNr,ItemLevel,ItemSkill,ItemLuck,ItemOpt,ItemExc;
    sscanf(Message,"%d %d %d %d %d %d %d",&ItemType,&ItemNr,&ItemLevel,&ItemSkill,&ItemLuck,&ItemOpt,&ItemExc);

    DWORD Item = ItemType * 512 + ItemNr;

    ItemSerialCreateSend(aIndex,gObj[aIndex].MapNumber,gObj[aIndex].X,gObj[aIndex].Y,Item,ItemLevel,0,ItemSkill,ItemLuck,ItemOpt,aIndex,ItemExc,0);

    GCServerMsgStringSend("Item created successfully.",aIndex,1);
    }

    void InitCommands(int aIndex,unsigned char* Protocol)
    {
    /*char CommandMake[] = "/make";
    if(!memcmp(&Protocol[13],CommandMake,strlen(CommandMake)))
    {
    MakeCommand(aIndex,(char*)Protocol+13+strlen(CommandMake));
    }*/
    }
    command.h:
    #ifndef __COMMANDS_H__
    #define __COMMANDS_H__

    // Function Headers
    void InitCommands(int aIndex,unsigned char* Protocol);

    #endif

  4. #4
    C++ Developer zipper20032 is offline
    MemberRank
    Oct 2006 Join Date
    0x198837ADLocation
    663Posts

    Re: /pack and /unpack Jewels Source Code

    These sources are actually sources to a DLL which is injected into GameServer.exe.

    Why don't you make your own /pack, /unpack commands?
    I mean you have to think about the game logic and how it's gonna be done and that's all.

    How "pack" command should be done:

    - Iterate through inventory for "bless" jewel
    - Count them separated
    - Delete them in the iteration
    - Make a new item jewel packed added to your first free inventory position

    How "unpack" command should be done:
    - Search the position of the "packed" jewel by iterating through inventory to search for that
    - Get the amount of packed jewel
    - Delete this packed jewel
    - For Loop (int i = 0; i<numberOfPackedJewel) and make new jewel to be added into the first free position in inventory in this loop

    I think you already have functions to add items into the first free position.



Advertisement