ModCharPacket (15)

Discussion in 'Help' started by AiroN, Dec 21, 2015.

  1. AiroN

    AiroN New Member

    Hello!

    I'm developing a script for a client that uses the product of you and I'm quite difficulties with "ModCharPacket".

    Where am I going wrong?

    Code:
    pack("cVVVVVVV", 15, intval($char_id), intval($SP), intval($XP), intval($karma), intval($PK), intval($PKpardon), intval($Duel))
    Thanks in advance.
     
  2. Xeonc

    Xeonc Administrator

    You didn't provide any error, so I don't understand what problems do you have. Packet fortmat is correct
     
  3. AiroN

    AiroN New Member

    Thanks for the answer, Xeonc!

    When i run, for example:

    Code:
    /*
    Packet = 15
    CharID = 45329
    SP = 61003124
    EXP = 2099575835
    Align/Karma = 10000
    PK kills = 123
    PKpardon = 0
    Duel/Pvp kills = 456
    */
    $send = pack("cVVVVVVV", 15, 45329, 61003124, 2099575835, 10000, 123, 0, 456);
    echo l2_cached_push(pack("s", strlen($send)+2).$send.ansi2unicode('site-atualstudio'));
    
    See what happens to the character:


    [​IMG]


    [​IMG]


    I read this post that the value provided in EXP must be "QWORD (__ int64 8 bytes)." This changes the way the EXP must be sent?
     
  4. AiroN

    AiroN New Member

    I managed!!!

    Here's the code:

    Code:
    /*
    Packet = 15
    CharID = 45329
    SP = 61003124
    EXP = 2099575835
    Align/Karma = 9999
    PK kills = 555
    PKpardon = 0
    Duel/Pvp kills = 777
    */
    
    //$send = pack("cVVVVVVV", 15, CharID, SP, EXP, ????, Align, PK, PKpardon, Duel);
    $send = pack("cVVVVVVVV", 15, 45329, 61003124, 2099575835, 0, 9999, 555, 0, 777);
    echo l2_cached_push(pack("s", strlen($send)+2).$send.ansi2unicode('site-atualstudio'));
    

    This sixth value (highlighted in red) refers to what?
    pack("cVVVVVVVV", 15, 45329, 61003124, 2099575835, 0, 9999, 555, 0, 777);
     
  5. Xeonc

    Xeonc Administrator

    That parameter is refered to EXP too, because EXP variable is in INT64, others are INT32
     
  6. AiroN

    AiroN New Member

    Can i leave 0? Without problems?
     
  7. Midont

    Midont AdvExt64 Customers (IL)

    Interlude Cached:

    function ModCharPacket($char_id, $new_SP, $new_EXP, $new_Karma, $new_PK, $new_PKP, $new_PVP) {
    $buf = pack("c", 15);
    $buf .= pack("V", $char_id);
    $buf .= pack("V", $new_SP);
    $buf .= pack("V", $new_EXP);
    $buf .= pack("V", $new_Karma);
    $buf .= pack("V", $new_PK);
    $buf .= pack("V", $new_PKP);
    $buf .= pack("V", $new_PVP);
    $buf .= $this -> tounicode($this -> webadmin);
    return $this -> CacheDInteractive($buf);
    }


    function ModChar3Packet($char_id, $add_SP, $add_EXP, $add_Karma, $add_PK, $add_PKP, $add_PVP) {
    $buf = pack("c", 29);
    $buf .= pack("V", $char_id);
    $buf .= pack("V", $add_SP);
    $buf .= pack("V", $add_EXP);
    $buf .= pack("V", $add_Karma);
    $buf .= pack("V", $add_PK);
    $buf .= pack("V", $add_PKP);
    $buf .= pack("V", $add_PVP);
    $buf .= $this -> tounicode($this -> webadmin);
    return $this -> CacheDInteractive($buf);
    }





    Php:
    $cached -> webadmin = 'AdminWEB';
    $char_id='';


    $cached -> KickCharacterPacket($char_id)); echo 'ok KICK<br>';
    $cached -> ModCharPacket($char_id,2000,2000,100,5,0,7); echo 'ok MOD<br>';
     
    Last edited: Dec 26, 2015
  8. AiroN

    AiroN New Member

    Thanks, Midont!
    Unfortunately the way cited isn't working with me. Placing "0" between EXP and Karma/Align, works perfectly. The question is whether this "0" negatively influences into something.