Jump to content
  • 0

Packet Len - More Autospells issue


LotharAxe

Question


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  8
  • Reputation:   2
  • Joined:  10/12/18
  • Last Seen:  

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?

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  236
  • Reputation:   189
  • Joined:  11/27/11
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  8
  • Reputation:   2
  • Joined:  10/12/18
  • Last Seen:  

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.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  351
  • Reputation:   263
  • Joined:  09/08/13
  • Last Seen:  

@LotharAxe 

Send me your EXE.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  236
  • Reputation:   189
  • Joined:  11/27/11
  • Last Seen:  

1 hour ago, Functor said:

@LotharAxe 

Send me your EXE.

Ah yes, it's possible if you modify client part. You tell to your exe that the size is bigger.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  351
  • Reputation:   263
  • Joined:  09/08/13
  • Last Seen:  

Yes, and modify the code of processing 0x1CD packet.

Edited by Functor
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  8
  • Reputation:   2
  • Joined:  10/12/18
  • Last Seen:  

19 hours ago, Functor said:

@LotharAxe 

Send me your EXE.

Here it is, is this link fine?

https://drive.google.com/file/d/1yB6skhjuCKDfwUGUo8d9bLjzECiWJUHm/view?usp=sharing

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  351
  • Reputation:   263
  • Joined:  09/08/13
  • Last Seen:  

@LotharAxe

https://mega.nz/#!oFtghCgS!reLQeWP2dXrRe2jaEEF5YFywI8quS025QM9C7u_oSIQ

+ You have to use your modified "src" with changed packet size to 54 bytes.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  8
  • Reputation:   2
  • Joined:  10/12/18
  • Last Seen:  

4 hours ago, Functor said:

@LotharAxe

https://mega.nz/#!oFtghCgS!reLQeWP2dXrRe2jaEEF5YFywI8quS025QM9C7u_oSIQ

+ You have to use your modified "src" with changed packet size to 54 bytes.

Worked perfectly, now I can select between the 13 different spells! Thank you so much for your kind assistance!

May I ask how you modified the client?

Link to comment
Share on other sites

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.

×
×
  • Create New...