Wrote new code? Fixed a bug? Want to discuss technical stuff? Feel free to post it here.
Moderator: Moderators
scriptor
Noob
Posts: 2 Joined: 05 Jul 2010, 16:34
Noob?: Yes
#1
Post
by scriptor » 19 Sep 2010, 04:54
Why not adding a new Servertype "renewal"? Servers getting customized renewal packets can use the baseclass renewal.
I started adding some packets. Some were not in kRO Servertype
Code: Select all
'0446' => ['quest_notify_effect', 'V v4', [qw(npcID xPos yPos effect type)]],
'07FB' => ['skill_cast', 'a4 a4 v5 V C', [qw(sourceID targetID x y skillID unknown type wait disposable)]],
'07FF' => ['define_check', 'v', [qw(len)]],
'0810' => ['open_buying_store', 'c', [qw(number)]],
#enum enumQEFFECT {
# QEFFECT_OFF = 0,
# QEFFECT_EXC = 1, // Exclamation mark (get quest)
# QEFFECT_QUE = 2 // Question mark (turn in quest)
#};
#enum enumQTYPE {
# QTYPE_YELLOW = 0,
# QTYPE_ORANG = 1,
# QTYPE_GREEN = 2,
# QTYPE_PURPLE = 3
#};
sub quest_notify_effect {
my ($self, $args) = @_;
message "npcID: " . $args->{npcID} . "\n";
message "xPos: " . $args->{xPos} . "\n";
message "yPos: " . $args->{yPos} . "\n";
message "effect: " . $args->{effect} . "\n";
message "type: " . $args->{type} . "\n";
}
# 07FF
# FF 07 08 00 03 00 00 00
sub define_check {
my ($self, $args) = @_;
}
# 0810
# 10 08 02
sub open_buying_store {
my ($self, $args) = @_;
# Used the shop skill.
my $number = $args->{number};
message TF("You can buy %s items!\n", $number);
# TODO: mark that skill cast has been successful
}
For some i don't know how openkore team want to use them. Like quest notify show up in xkore map for example.
Will add more from time to time.
Technology
Super Moderators
Posts: 801 Joined: 06 May 2008, 12:47
Noob?: No
#2
Post
by Technology » 19 Sep 2010, 12:54
There is renewal support already, the kRO ST's are based on the old kRO sakray and on its successor, kRO RE.
The kRO ST's are much like a timeline.
It supports latest kRO, while never breaking support for older kRO versions (to support eA and etc...)
The packets that you tried to add, must be added in the right kRO ST.
One ST0 to rule them all? One PE viewer to find them!
One ST_kRO to bring them all and in the darkness bind them...
Mount Doom awaits us, fellowship of OpenKore!
kLabMouse
Administrator
Posts: 1301 Joined: 24 Apr 2008, 12:02
#3
Post
by kLabMouse » 19 Sep 2010, 18:38
If Anybody want to Implement these packets, or "Buying Store" feature.
Feel free to use following Info:
Code: Select all
// packet: 0x446
// len: 14
struct PACKET_ZC_QUEST_NOTIFY_EFFECT {
/* this+0x0 */ short PacketType
/* this+0x2 */ unsigned long npcID
/* this+0x6 */ short xPos
/* this+0x8 */ short yPos
/* this+0xa */ short effect
/* this+0xc */ short type
}
// packet: 0x7fa
// len: 8
struct PACKET_ZC_DELETE_ITEM_FROM_BODY {
/* this+0x0 */ short PacketType
/* this+0x2 */ short DeleteType {
DELETE_TYPE_NORMAL = 0x0,
DELETE_TYPE_USE_SKILL = 0x1,
DELETE_TYPE_FAIL_REFINING = 0x2,
DELETE_TYPE_CHANGE_MATERIAL = 0x3,
DELETE_TYPE_MOVETO_STORE = 0x4,
DELETE_TYPE_MOVETO_CART = 0x5,
DELETE_TYPE_SELL_ITEM = 0x6,
}
/* this+0x4 */ unsigned short Index
/* this+0x6 */ short Count
}
// packet: 0x7fb
// len: 25
struct PACKET_ZC_USESKILL_ACK2 {
/* this+0x0 */ short PacketType
/* this+0x2 */ unsigned long AID
/* this+0x6 */ unsigned long targetID
/* this+0xa */ short xPos
/* this+0xc */ short yPos
/* this+0xe */ unsigned short SKID
/* this+0x10 */ unsigned long property
/* this+0x14 */ unsigned long delayTime
/* this+0x18 */ bool isDisposable
}
// packet: 0x7fc
// len: 10
struct PACKET_ZC_CHANGE_GROUP_MASTER {
/* this+0x0 */ short PacketType
/* this+0x2 */ unsigned long OldMasterAID
/* this+0x6 */ unsigned long NewMasterAID
}
// packet: 0x7fd
// len: 7
// inner_len: *
// Note: Wery Strange Packet, one of a kind with variable inner struct
struct PACKET_ZC_BROADCASTING_SPECIAL_ITEM_OBTAIN {
/* this+0x0 */ short PacketType
/* this+0x2 */ short PacketLength
/* this+0x4 */ unsigned char type {
TYPE_BOXITEM = 0x0,
TYPE_MONSTER_ITEM = 0x1,
}
/* this+0x5 */ unsigned short ItemID
/* this+0x7 */ struct VarString Holder { // related to MSI_BROADCASTING_SPECIAL_ITEM_OBTAIN = 0x65c
/* this+0x0 */ char len
/* this+0x1 */ char Name[...]
}
if (packet.type == TYPE_BOXITEM) {
/* this+0x... */ unsigned short BoxItemID
} else if (packet.type == TYPE_MONSTER_ITEM) {
/* this+0x... */ struct VarString Monster {
/* this+0x0 */ char len
/* this+0x1 */ char Name[...]
}
}
}
// packet: 0x7fe
// len: 26
struct PACKET_ZC_PLAY_NPC_BGM {
/* this+0x0 */ short PacketType
/* this+0x2 */ char Bgm[24]
}
// packet: 0x7ff
// len: 4
// inner_len: 4
// max_inner_len: 4
struct PACKET_ZC_DEFINE_CHECK {
/* this+0x0 */ short PacketType
/* this+0x2 */ short PacketLength
/* this+0x4 */ int Result {
DEFINE__BROADCASTING_SPECIAL_ITEM_OBTAIN = 0x1,
DEFINE__RENEWAL_ADD_2 = 0x2,
DEFINE__CHANNELING_SERVICE = 0x4,
}
}
And Buying Store:
Code: Select all
// packet: 0x810
// len: 3
struct PACKET_ZC_OPEN_BUYING_STORE {
/* this+0x0 */ short PacketType
/* this+0x2 */ unsigned char count
}
// packet: 0x811
// len: 89
// inner_len: 6
struct PACKET_CZ_REQ_OPEN_BUYING_STORE {
/* this+0x0 */ short PacketType
/* this+0x2 */ short PacketLength
/* this+0x4 */ unsigned long LimitZeny
/* this+0x8 */ unsigned char result
/* this+0x9 */ char storeName[80]
/* this+0x59 */ struct TRADE_ITEM_BUYING_STORE ItemList[...] {
/* this+0x0 */ unsigned short index
/* this+0x2 */ unsigned short ITID
/* this+0x4 */ short count
}
}
// packet: 0x812
// len: 8
struct PACKET_ZC_FAILED_OPEN_BUYING_STORE_TO_BUYER {
/* this+0x0 */ short PacketType
/* this+0x2 */ short Result
/*
1 -> Chat -> Failed to open Purchasing Store. [MSGSTRING 1742]
2 -> Chat -> The total weight of the item is %d and exceeds your weight limit. Please reconfigure. [MSGSTIRNG 1743]
%d = Item Weight / 10
8 -> Chat -> Shop information is incorrect and cannot be opened. [MSGSTRING 1798]
*/
/* this+0x4 */ int total_weight
}
// packet: 0x813
// len: 12
// inner_len: 9
struct PACKET_ZC_MYITEMLIST_BUYING_STORE {
/* this+0x0 */ short PacketType
/* this+0x2 */ short PacketLength
/* this+0x4 */ unsigned long AID
/* this+0x8 */ int limitZeny
/* this+0xc */ struct BUYING_STORE_ITEMLIST ItemList[...] {
/* this+0x0 */ int price
/* this+0x4 */ short count
/* this+0x6 */ unsigned char type
/* this+0x7 */ unsigned short ITID
}
}
// packet: 0x814
// len: 86
struct PACKET_ZC_BUYING_STORE_ENTRY {
/* this+0x0 */ short PacketType
/* this+0x2 */ unsigned long makerAID
/* this+0x6 */ char storeName[80]
}
// packet: 0x815
// len: 2
struct PACKET_CZ_REQ_CLOSE_BUYING_STORE {
/* this+0x0 */ short PacketType
}
// packet: 0x816
// len: 6
struct PACKET_ZC_DISAPPEAR_BUYING_STORE_ENTRY {
/* this+0x0 */ short PacketType
/* this+0x2 */ unsigned long makerAID
}
// packet: 0x817
// len: 6
struct PACKET_CZ_REQ_CLICK_TO_BUYING_STORE {
/* this+0x0 */ short PacketType
/* this+0x2 */ unsigned long makerAID
}
// packet: 0x818
// len: 15
// inner_len: 9
struct PACKET_ZC_ACK_ITEMLIST_BUYING_STORE {
/* this+0x0 */ short PacketType
/* this+0x2 */ short PacketLength
/* this+0x4 */ unsigned long makerAID
/* this+0x8 */ unsigned long StoreID
/* this+0xc */ int limitZeny
/* this+0x10 */ struct BUYING_STORE_ITEMLIST ItemList[...] {
/* this+0x0 */ int price
/* this+0x4 */ short count
/* this+0x6 */ unsigned char type
/* this+0x7 */ unsigned short ITID
}
}
// packet: 0x819
// len: 12
// inner_len: 6
struct PACKET_CZ_REQ_TRADE_BUYING_STORE {
/* this+0x0 */ short PacketType
/* this+0x2 */ short PacketLength
/* this+0x4 */ unsigned long makerAID
/* this+0x8 */ unsigned long StoreID
/* this+0xc */ struct struct TRADE_ITEM_BUYING_STORE ItemList[...] {
/* this+0x0 */ unsigned short index
/* this+0x2 */ unsigned short ITID
/* this+0x4 */ short count
}
}
// packet: 0x81a
// len: 4
struct PACKET_ZC_FAILED_TRADE_BUYING_STORE_TO_BUYER {
/* this+0x0 */ short PacketType
/* this+0x2 */ short Result
/*
3: MSI_BUYINGSTORE_TRADE_OVERLIMITZENY
4: MSI_BUYINGSTORE_TRADE_BUYCOMPLETE
*/
}
// packet: 0x81b
// len: 10
struct PACKET_ZC_UPDATE_ITEM_FROM_BUYING_STORE {
/* this+0x0 */ short PacketType
/* this+0x2 */ unsigned short ITID
/* this+0x4 */ short count
/* this+0x6 */ int limitZeny
}
// packet: 0x81c
// len: 10
struct PACKET_ZC_ITEM_DELETE_BUYING_STORE {
/* this+0x0 */ short PacketType
/* this+0x2 */ short index
/* this+0x4 */ short count
/* this+0x6 */ int zeny
}
anicole
Noob
Posts: 8 Joined: 05 Sep 2008, 06:44
Noob?: Yes
#4
Post
by anicole » 05 Oct 2010, 13:55
kLabMouse wrote: If Anybody want to Implement these packets, or "Buying Store" feature.
Feel free to use following Info:
I encounter 'Packet parser: Unknown switch: 0446 ' while getting or adding items to storage.
The recpackets.txt looks fine. Can I solve this by adding the codes?
If I'd like to use these functions, where should I add the codes into?
Thanks.
kLabMouse
Administrator
Posts: 1301 Joined: 24 Apr 2008, 12:02
#5
Post
by kLabMouse » 05 Oct 2010, 19:58
anicole wrote:
I encounter 'Packet parser: Unknown switch: 0446 ' while getting or adding items to storage.
The recpackets.txt looks fine. Can I solve this by adding the codes?
If I'd like to use these functions, where should I add the codes into?
Thanks.
// packet: 0x446
// len: 14
struct PACKET_ZC_QUEST_NOTIFY_EFFECT {
/* this+0x0 */ short PacketType
/* this+0x2 */ unsigned long npcID
/* this+0x6 */ short xPos
/* this+0x8 */ short yPos
/* this+0xa */ short effect
/* this+0xc */ short type
}
That's not even related to Storage!
And this thread is for talk about "Renewal Support" only.
DrKN
Developers
Posts: 79 Joined: 06 Oct 2010, 09:22
Noob?: No
#6
Post
by DrKN » 13 Jan 2011, 00:45
the renewal patch of twRO will soon be released since now some packet still not yet finish checking.
Currently proved that xKore is working to my new recvpackets that means the packet length is correct.