Jump to content
  • 0

Packet Len - More Autospells issue


Question

Posted

Hi everyone, I've been trying to increase the amount of spells that can be selected for the Autospell skill of the Sage.

From my investigation, I found a code that might be the one responsible for allowing you to pick certain spells in the menu that appears once you use the skill.

The code I've changed is as follows:

/// Presents a list of skills that can be auto-spelled (ZC_AUTOSPELLLIST).
/// 01cd { <skill id>.L }*7
void clif_autospell(struct map_session_data *sd,uint16 skill_lv)
{
    int fd;

    nullpo_retv(sd);

    fd=sd->fd;
    WFIFOHEAD(fd,packet_len(0x1cd));
    WFIFOW(fd, 0)=0x1cd;

    if(skill_lv>0 && pc_checkskill(sd,MG_NAPALMBEAT)>0)
        WFIFOL(fd,2)= MG_NAPALMBEAT;
    else
        WFIFOL(fd,2)= 0x00000000;
    if(skill_lv>1 && pc_checkskill(sd,MG_COLDBOLT)>0)
        WFIFOL(fd,6)= MG_COLDBOLT;
    else
        WFIFOL(fd,6)= 0x00000000;
    if(skill_lv>1 && pc_checkskill(sd,MG_FIREBOLT)>0)
        WFIFOL(fd,10)= MG_FIREBOLT;
    else
        WFIFOL(fd,10)= 0x00000000;
    if(skill_lv>1 && pc_checkskill(sd,MG_LIGHTNINGBOLT)>0)
        WFIFOL(fd,14)= MG_LIGHTNINGBOLT;
    else
        WFIFOL(fd,14)= 0x00000000;
    if(skill_lv>4 && pc_checkskill(sd,MG_SOULSTRIKE)>0)
        WFIFOL(fd,18)= MG_SOULSTRIKE;
    else
        WFIFOL(fd,18)= 0x00000000;
    if(skill_lv>7 && pc_checkskill(sd, MG_THUNDERSTORM)>0)
        WFIFOL(fd,22)= MG_THUNDERSTORM;
    else
        WFIFOL(fd,22)= 0x00000000;
    if(skill_lv>9 && pc_checkskill(sd,MG_FROSTDIVER)>0)
        WFIFOL(fd,26)= MG_FROSTDIVER;
    else
        WFIFOL(fd,26)= 0x00000000;
    if (skill_lv > 0 && pc_checkskill(sd, MG_FIREBALL) > 0)
        WFIFOL(fd, 30) = MG_FIREBALL;
    else
        WFIFOL(fd, 30) = 0x00000000;
    if (skill_lv > 0 && pc_checkskill(sd, MG_STONECURSE) > 0)
        WFIFOL(fd, 34) = MG_STONECURSE;
    else
        WFIFOL(fd, 34) = 0x00000000;
    if (skill_lv > 0 && pc_checkskill(sd, SA_DISPELL) > 0)
        WFIFOL(fd, 38) = SA_DISPELL;
    else
        WFIFOL(fd, 38) = 0x00000000;
    if (skill_lv > 0 && pc_checkskill(sd, WZ_EARTHSPIKE) > 0)
        WFIFOL(fd, 42) = WZ_EARTHSPIKE;
    else
        WFIFOL(fd, 42) = 0x00000000;
    if (skill_lv > 0 && pc_checkskill(sd, WZ_HEAVENDRIVE) > 0)
        WFIFOL(fd, 46) = WZ_HEAVENDRIVE;
    else
        WFIFOL(fd, 46) = 0x00000000;
    if (skill_lv > 0 && pc_checkskill(sd, SA_SPELLBREAKER) > 0)
        WFIFOL(fd, 50) = SA_SPELLBREAKER;
    else
        WFIFOL(fd, 50) = 0x00000000;

    WFIFOSET(fd,packet_len(0x1cd));
    sd->menuskill_id = SA_AUTOSPELL;
    sd->menuskill_val = skill_lv;

Sadly this doesn't work, as only the first 7 skills can be selected in the menu.

I assume the problem is with the package size, which is 0x1cd. But I don't understand this number. Why is it 0x1cd? What is its function? If I increase it in a specific correct amount, can I increase the amount of skills in the package from 7 to 13? Or am I insane and looking at the wrong part of the code?

8 answers to this question

Recommended Posts

  • 0
Posted

Unfortunately you cannot increase content in a client packet... Because client won't be able to understand longer packet than usual.

But if you wanna experience it, go in clif_packetdb.hpp and replace :

packet(0x01cd,30);

by :

packet(0x01cd,54);

PS : 0x1cd is the packet id.

 

  • Upvote 1
  • 0
Posted
54 minutes ago, Vykimo said:

Unfortunately you cannot increase content in a client packet... Because client won't be able to understand longer packet than usual.

But if you wanna experience it, go in clif_packetdb.hpp and replace :


packet(0x01cd,30);

by :


packet(0x01cd,54);

PS : 0x1cd is the packet id.

 

Thank you so much for answering, now I understand better what is happening.

Unfortunately, as you expected, it didn't work. The game crashed as soon as I casted Autospell.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...