Jump to content

synyster

Members
  • Posts

    5
  • Joined

  • Last visited

Posts posted by synyster

  1. Hello guys, I'm with a problem in the attack/hit formulas. On brAthena, when I attack another player(base attack), both on level 150, the hit is about 2k, 1k, but on rathena, the hit is about 300, 280, the same value as atq, another annoying problem is when I attack some monster without a weapon, all my hits are missed or 1. I tried to change the formulas but its not worked.

    I'm almost sure that this is the line that I have to do the modifications:

    str = (rstr*10 + dex*10/5 + status->luk*10/3 + ((TBL_PC*)bl)->status.base_level*10/4)/10;

    But changing this, or my atq will be very high or it will be very low, really tried every possibles things that I could, please help me!!

    @edit

    Problem solved! I just thought a little more and tried this:

    str = (rstr + dex*10/5 + status->luk*10/3 + ((TBL_PC*)bl)->status.base_level*10/4);

    It was perfectly the same as brAthena.

  2. Hello guys, I'm brazilian and I was using the brAthena so decided test the rAthena. I had a problem here with the max length size, that problem when the npc's name are too long.

    I looked on brAthena and could do the modification on NPC name length, to possibilite the brazilian users keep using their old npcs on rathena, so lets do it!

    First you have to open your emulator folder src/map/script.c

    if( instance_id && (nd = npc_name2id(str)) != NULL )

    {

    static char npcname[NAME_LENGTH];

    snprintf(npcname, sizeof(npcname), "dup_%d_%d", instance_id, nd->bl.id);

    script_pushconststr(st,npcname);

    }

    change the bold line to:

    static char npcname[NPC_NAME_LENGTH];

    Nice! Close the script.c and open your npc.c

    ev_db = strdb_alloc((DBOptions)(DB_OPT_DUP_KEY|DB_OPT_RELEASE_DATA),2*NAME_LENGTH+2+1);

    npcname_db = strdb_alloc(DB_OPT_BASE,NAME_LENGTH);

    static void npc_parsename(struct npc_data* nd, const char* name, const char* start, const char* buffer, const char* filepath)

    {

    const char* p;

    struct npc_data* dnd;// duplicate npc

    char newname[NAME_LENGTH];

    // parse name

    p = strstr(name,"::");

    if( p )

    {// <Display name>::<Unique name>

    size_t len = p-name;

    if( len > NAME_LENGTH )

    {

    ShowWarning("npc_parsename: Display name of '%s' is too long (len=%u) in file '%s', line'%d'. Truncating to %u characters.\n", name, (unsigned int)len, filepath, strline(buffer,start-buffer), NAME_LENGTH);

    safestrncpy(nd->name, name, sizeof(nd->name));

    }

    else

    {

    memcpy(nd->name, name, len);

    memset(nd->name+len, 0, sizeof(nd->name)-len);

    }

    len = strlen(p+2);

    if( len > NAME_LENGTH )

    ShowWarning("npc_parsename: Unique name of '%s' is too long (len=%u) in file '%s', line'%d'. Truncating to %u characters.\n", name, (unsigned int)len, filepath, strline(buffer,start-buffer), NAME_LENGTH);

    safestrncpy(nd->exname, p+2, sizeof(nd->exname));

    }

    else

    {// <Display name>

    size_t len = strlen(name);

    if( len > NAME_LENGTH )

    ShowWarning("npc_parsename: Name '%s' is too long (len=%u) in file '%s', line'%d'. Truncating to %u characters.\n", name, (unsigned int)len, filepath, strline(buffer,start-buffer), NAME_LENGTH);

    safestrncpy(nd->name, name, sizeof(nd->name));

    safestrncpy(nd->exname, name, sizeof(nd->exname));

    }

    void npc_duplicate4graveyard(struct block_list* bl, struct block_list* sbl)

    {

    char newname[NAME_LENGTH];

    static char w1[50], w2[50], w3[50], w4[50];

    const char* stat_buf = "- call from graveyard subsystem -\n";

    struct npc_data* nd; // Source NPC

    int npc_duplicate4instance(struct npc_data *snd, int m) {

    char newname[NAME_LENGTH];

    You will do the same thing right here. Change all the bold parts to NPC_NAME_LENGTH

    Open your npc.h and do the same, changing all the NAME_LENGTH TO NPC_NAME_LENGTH

    struct npc_timerevent_list {

    int timer,pos;

    };

    struct npc_label_list {

    char name[NAME_LENGTH];

    int pos;

    };

    struct npc_item_list {

    unsigned int nameid,value;

    };

    struct graveyard_info {

    char name[NAME_LENGTH]; // Name of the Victim

    char killed_by[NAME_LENGTH];

    time_t killed_time;

    };

    struct npc_data {

    struct block_list bl;

    struct unit_data ud; //Because they need to be able to move....

    struct view_data *vd;

    struct status_change sc; //They can't have status changes, but.. they want the visual opt values.

    struct npc_data *master_nd;

    short class_;

    short speed;

    char name[NAME_LENGTH+1];// display name

    char exname[NAME_LENGTH+1];// unique npc name

    Great! After that, open src/common/mmo.h and add this:

    #define NAME_LENGTH (23 + 1)

    #define NPC_NAME_LENGTH 37

    Finished! After you did it just recompile your emulator and test, in my case it worked perfectly.

    Credits: Protimus, the admin of brAthena, he was the responsable to do the source modification, I just posted here to help someone that had this problem, like me :D

    Hope you enjoy!!

    • Upvote 4
×
×
  • Create New...