diff options
author | shennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-04-20 18:05:14 +0000 |
---|---|---|
committer | shennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-04-20 18:05:14 +0000 |
commit | 92249d9f8e219916670589ba6c5f9fce47808ed8 (patch) | |
tree | 0d1b0aa06c3490b3dbf7140bebd8bda126bfd65e /src/map/intif.c | |
parent | 1b3bd9ff1725a68d66fd4015c60d6fe28e4b2334 (diff) | |
download | hercules-92249d9f8e219916670589ba6c5f9fce47808ed8.tar.gz hercules-92249d9f8e219916670589ba6c5f9fce47808ed8.tar.bz2 hercules-92249d9f8e219916670589ba6c5f9fce47808ed8.tar.xz hercules-92249d9f8e219916670589ba6c5f9fce47808ed8.zip |
Initial support for Genetic, Sorcerer and Elemental Summons. Special Thanks to 3CeAM for the base.
Notice this revision onwards requires you to update your char sql table and add the elemental sql table (check sql-files/upgrade_svn15885_log.sql)
If you step by any bugs, let us know at http://rathena.org/board/tracker/ Thank you very much.
ARRIBA ARRIBA.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15885 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/intif.c')
-rw-r--r-- | src/map/intif.c | 97 |
1 files changed, 95 insertions, 2 deletions
diff --git a/src/map/intif.c b/src/map/intif.c index 78f3d585c..ce0ad8e6a 100644 --- a/src/map/intif.c +++ b/src/map/intif.c @@ -21,6 +21,7 @@ #include "atcommand.h" #include "mercenary.h" #include "homunculus.h" +#include "elemental.h" #include "mail.h" #include "quest.h" @@ -40,7 +41,7 @@ static const int packet_len_table[]={ -1, 0, 0,14, 0, 0, 0, 0, -1,74,-1,11, 11,-1, 0, 0, //0x3840 -1,-1, 7, 7, 7,11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0x3850 Auctions [Zephyrus] -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0x3860 Quests [Kevin] [Inkfish] - -1, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0x3870 Mercenaries [Zephyrus] + -1, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 3, 3, 0, //0x3870 Mercenaries [Zephyrus] / Elemental [pakpil] 11,-1, 7, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0x3880 -1,-1, 7, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0x3890 Homunculus [albator] }; @@ -1988,6 +1989,94 @@ int intif_parse_mercenary_saved(int fd) return 0; } +/*========================================== + * Elemental's System + *------------------------------------------*/ +int intif_elemental_create(struct s_elemental *ele) +{ + int size = sizeof(struct s_elemental) + 4; + + if( CheckForCharServer() ) + return 0; + + WFIFOHEAD(inter_fd,size); + WFIFOW(inter_fd,0) = 0x307c; + WFIFOW(inter_fd,2) = size; + memcpy(WFIFOP(inter_fd,4), ele, sizeof(struct s_elemental)); + WFIFOSET(inter_fd,size); + return 0; +} + +int intif_parse_elemental_received(int fd) +{ + int len = RFIFOW(fd,2) - 5; + if( sizeof(struct s_elemental) != len ) + { + if( battle_config.etc_log ) + ShowError("intif: create elemental data size error %d != %d\n", sizeof(struct s_elemental), len); + return 0; + } + + elemental_data_received((struct s_elemental*)RFIFOP(fd,5), RFIFOB(fd,4)); + return 0; +} + +int intif_elemental_request(int ele_id, int char_id) +{ + if (CheckForCharServer()) + return 0; + + WFIFOHEAD(inter_fd,10); + WFIFOW(inter_fd,0) = 0x307d; + WFIFOL(inter_fd,2) = ele_id; + WFIFOL(inter_fd,6) = char_id; + WFIFOSET(inter_fd,10); + return 0; +} + +int intif_elemental_delete(int ele_id) +{ + if (CheckForCharServer()) + return 0; + + WFIFOHEAD(inter_fd,6); + WFIFOW(inter_fd,0) = 0x307e; + WFIFOL(inter_fd,2) = ele_id; + WFIFOSET(inter_fd,6); + return 0; +} + +int intif_parse_elemental_deleted(int fd) +{ + if( RFIFOB(fd,2) != 1 ) + ShowError("Elemental data delete failure\n"); + + return 0; +} + +int intif_elemental_save(struct s_elemental *ele) +{ + int size = sizeof(struct s_elemental) + 4; + + if( CheckForCharServer() ) + return 0; + + WFIFOHEAD(inter_fd,size); + WFIFOW(inter_fd,0) = 0x307f; + WFIFOW(inter_fd,2) = size; + memcpy(WFIFOP(inter_fd,4), ele, sizeof(struct s_elemental)); + WFIFOSET(inter_fd,size); + return 0; +} + +int intif_parse_elemental_saved(int fd) +{ + if( RFIFOB(fd,2) != 1 ) + ShowError("Elemental data save failure\n"); + + return 0; +} + //----------------------------------------------------------------- // inter serverからの通信 // エラーがあれば0(false)を返すこと @@ -2076,7 +2165,11 @@ int intif_parse(int fd) case 0x3870: intif_parse_mercenary_received(fd); break; case 0x3871: intif_parse_mercenary_deleted(fd); break; case 0x3872: intif_parse_mercenary_saved(fd); break; - +// Elemental System + case 0x387c: intif_parse_elemental_received(fd); break; + case 0x387d: intif_parse_elemental_deleted(fd); break; + case 0x387e: intif_parse_elemental_saved(fd); break; + case 0x3880: intif_parse_CreatePet(fd); break; case 0x3881: intif_parse_RecvPetData(fd); break; case 0x3882: intif_parse_SavePetOk(fd); break; |