diff options
author | Wushin <pasekei@gmail.com> | 2015-05-06 13:02:58 -0500 |
---|---|---|
committer | Wushin <pasekei@gmail.com> | 2015-05-06 13:02:58 -0500 |
commit | 80d274fb48eafda9881bcdacf84a3b76599b2a60 (patch) | |
tree | 4f7aea9c6efe98b8330ba2afe62a16c255204f10 | |
parent | 535f89f055ce211f483e09f8680f10b14d87b92d (diff) | |
parent | 5fc7747131ced6b764d5b6b87657150cc63fd1aa (diff) | |
download | tmwa-80d274fb48eafda9881bcdacf84a3b76599b2a60.tar.gz tmwa-80d274fb48eafda9881bcdacf84a3b76599b2a60.tar.bz2 tmwa-80d274fb48eafda9881bcdacf84a3b76599b2a60.tar.xz tmwa-80d274fb48eafda9881bcdacf84a3b76599b2a60.zip |
Merge pull request #16 from Rawng/walkpathfixtest
Send test 0x0225 packet with servers mob walkpath.
-rw-r--r-- | src/map/clif.cpp | 27 | ||||
-rwxr-xr-x | tools/protocol.py | 22 |
2 files changed, 48 insertions, 1 deletions
diff --git a/src/map/clif.cpp b/src/map/clif.cpp index 243ffaf..d327286 100644 --- a/src/map/clif.cpp +++ b/src/map/clif.cpp @@ -821,7 +821,33 @@ void clif_mob007b(dumb_ptr<mob_data> md, Buffer& buf) buf = create_fpacket<0x007b, 60>(fixed_7b); } +/*========================================== + * Packet to send server's mob walkpath data + *------------------------------------------ + */ +static +int clif_0225_being_move3(dumb_ptr<mob_data> md) +{ + Packet_Head<0x0225> head_225; + std::vector<Packet_Repeat<0x0225>> repeat_225; + + head_225.magic_packet_length = md->walkpath.path_len + 14; + head_225.id = md->bl_id; + head_225.speed = battle_get_speed(md); + head_225.x_position = md->bl_x; + head_225.y_position = md->bl_y; + for (int i = 0; i < md->walkpath.path_len; i++) + { + Packet_Repeat<0x0225> move_225; + move_225.move = md->walkpath.path[i]; + repeat_225.push_back(move_225); + } + + Buffer buf = create_vpacket<0x0225, 14, 1>(head_225, repeat_225); + clif_send(buf, md, SendWho::AREA); + return 0; +} /*========================================== * *------------------------------------------ @@ -2341,6 +2367,7 @@ int clif_movemob(dumb_ptr<mob_data> md) Buffer buf; clif_mob007b(md, buf); clif_send(buf, md, SendWho::AREA); + clif_0225_being_move3(md); return 0; } diff --git a/tools/protocol.py b/tools/protocol.py index 7547bc6..688821f 100755 --- a/tools/protocol.py +++ b/tools/protocol.py @@ -4653,7 +4653,27 @@ def build_context(): # 0x0222 define='CMSG_CHAT_MESSAGE2', # 0x0223 define='SMSG_BEING_CHAT2', # 0x0224 define='SMSG_PLAYER_CHAT2', - # 0x0225 define='SMSG_BEING_MOVE3', + map_user.s(0x0225, 'being move 3', + define='SMSG_BEING_MOVE3', + head=[ + at(0, u16, 'packet id'), + at(2, u16, 'packet length'), + at(4, block_id, 'id'), + at(8, interval16, 'speed'), + at(10, u16, 'x position'), + at(12, u16, 'y position'), + ], + head_size=14, + repeat=[ + at(0, dir, 'move'), + ], + repeat_size=1, + pre=[NOTHING], + post=[PRETTY], + desc=''' + Send mob walkpath data to client + ''', + ) # 0x0226 define='SMSG_MAP_MASK', # 0x0227 define='SMSG_MAP_MUSIC', # 0x0228 define='SMSG_NPC_CHANGETITLE', |