summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author(no author) <(no author)@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-01-28 18:46:43 +0000
committer(no author) <(no author)@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-01-28 18:46:43 +0000
commit9869ec7eebde772ae9d3730a14f4831d4adfc290 (patch)
tree59565129a1915311134c29d387c265bce104858f
parent99aec0eb822ca12dde4f72b1c3bf4d5597bf0530 (diff)
downloadhercules-9869ec7eebde772ae9d3730a14f4831d4adfc290.tar.gz
hercules-9869ec7eebde772ae9d3730a14f4831d4adfc290.tar.bz2
hercules-9869ec7eebde772ae9d3730a14f4831d4adfc290.tar.xz
hercules-9869ec7eebde772ae9d3730a14f4831d4adfc290.zip
* Added DUMP_ALL_PACKETS and moved dump packets code in clif_parse a bit to support it
* Added base code for Party Item Sharing git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1009 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog.txt4
-rw-r--r--src/char/int_party.c79
-rw-r--r--src/char/inter.c2
-rw-r--r--src/char_sql/int_party.c11
-rw-r--r--src/char_sql/inter.c2
-rw-r--r--src/common/mmo.h2
-rw-r--r--src/map/atcommand.c2
-rw-r--r--src/map/clif.c51
-rw-r--r--src/map/intif.c6
-rw-r--r--src/map/intif.h2
-rw-r--r--src/map/mob.c86
-rw-r--r--src/map/party.c4
-rw-r--r--src/map/party.h2
13 files changed, 167 insertions, 86 deletions
diff --git a/Changelog.txt b/Changelog.txt
index d6c56ee44..04789d919 100644
--- a/Changelog.txt
+++ b/Changelog.txt
@@ -1,6 +1,10 @@
Date Added
01/28
+ * Added DUMP_ALL_PACKETS and moved dump packets code in clif_parse a bit to
+ support it [celest]
+ * Added base code for Party Item Sharing -- still needs some work in client-
+ server support [celest]
* new GC link http://amber.stormbirds.org/~joshs/gc6.4.tar.gz
This fixes some issues... works better
* Added macros skill_chk and skill_get to check for out of bounds errors when
diff --git a/src/char/int_party.c b/src/char/int_party.c
index 02e4a5210..3298587f1 100644
--- a/src/char/int_party.c
+++ b/src/char/int_party.c
@@ -19,7 +19,7 @@ int mapif_party_broken(int party_id, int flag);
int party_check_empty(struct party *p);
int mapif_parse_PartyLeave(int fd, int party_id, int account_id);
-// パーティデータの文字列への変換
+// パ?ティデ?タの文字列への?換
int inter_party_tostr(char *str, struct party *p) {
int i, len;
@@ -32,7 +32,7 @@ int inter_party_tostr(char *str, struct party *p) {
return 0;
}
-// パーティデータの文字列からの変換
+// パ?ティデ?タの文字列からの?換
int inter_party_fromstr(char *str, struct party *p) {
int i, j;
int tmp_int[16];
@@ -74,7 +74,7 @@ int inter_party_fromstr(char *str, struct party *p) {
return 0;
}
-// パーティデータのロード
+// パ?ティデ?タのロ?ド
int inter_party_init() {
char line[8192];
struct party *p;
@@ -117,7 +117,7 @@ int inter_party_init() {
return 0;
}
-// パーティーデータのセーブ用
+// パ?ティ?デ?タのセ?ブ用
int inter_party_save_sub(void *key, void *data, va_list ap) {
char line[8192];
FILE *fp;
@@ -129,7 +129,7 @@ int inter_party_save_sub(void *key, void *data, va_list ap) {
return 0;
}
-// パーティーデータのセーブ
+// パ?ティ?デ?タのセ?ブ
int inter_party_save() {
FILE *fp;
int lock;
@@ -146,7 +146,7 @@ int inter_party_save() {
return 0;
}
-// パーティ名検索用
+// パ?ティ名?索用
int search_partyname_sub(void *key,void *data,va_list ap) {
struct party *p = (struct party *)data,**dst;
char *str;
@@ -159,7 +159,7 @@ int search_partyname_sub(void *key,void *data,va_list ap) {
return 0;
}
-// パーティ名検索
+// パ?ティ名?索
struct party* search_partyname(char *str) {
struct party *p = NULL;
numdb_foreach(party_db, search_partyname_sub, str, &p);
@@ -185,7 +185,7 @@ int party_check_exp_share(struct party *p) {
return (maxlv == 0 || maxlv-minlv <= party_share_level);
}
-// パーティが空かどうかチェック
+// パ?ティが空かどうかチェック
int party_check_empty(struct party *p) {
int i;
@@ -214,12 +214,12 @@ int party_check_conflict_sub(void *key, void *data, va_list ap) {
account_id=va_arg(ap, int);
nick=va_arg(ap, char *);
- if (p->party_id == party_id) // 本来の所属なので問題なし
+ if (p->party_id == party_id) // 本?の所?なので問題なし
return 0;
for(i = 0; i < MAX_PARTY; i++) {
if (p->member[i].account_id == account_id && strcmp(p->member[i].name, nick) == 0) {
- // 別のパーティに偽の所属データがあるので脱退
+ // 別のパ?ティに?の所?デ?タがあるので?退
printf("int_party: party conflict! %d %d %d\n", account_id, party_id, p->party_id);
mapif_parse_PartyLeave(-1, p->party_id, account_id);
}
@@ -238,7 +238,7 @@ int party_check_conflict(int party_id, int account_id, char *nick) {
//-------------------------------------------------------------------
// map serverへの通信
-// パーティ作成可否
+// パ?ティ作成可否
int mapif_party_created(int fd,int account_id, struct party *p) {
WFIFOW(fd,0) = 0x3820;
WFIFOL(fd,2) = account_id;
@@ -257,7 +257,7 @@ int mapif_party_created(int fd,int account_id, struct party *p) {
return 0;
}
-// パーティ情報見つからず
+// パ?ティ情報見つからず
int mapif_party_noinfo(int fd, int party_id) {
WFIFOW(fd,0) = 0x3821;
WFIFOW(fd,2) = 8;
@@ -268,7 +268,7 @@ int mapif_party_noinfo(int fd, int party_id) {
return 0;
}
-// パーティ情報まとめ送り
+// パ?ティ情報まとめ送り
int mapif_party_info(int fd, struct party *p) {
unsigned char buf[4 + sizeof(struct party)];
@@ -284,7 +284,7 @@ int mapif_party_info(int fd, struct party *p) {
return 0;
}
-// パーティメンバ追加可否
+// パ?ティメンバ追加可否
int mapif_party_memberadded(int fd, int party_id, int account_id, int flag) {
WFIFOW(fd,0) = 0x3822;
WFIFOL(fd,2) = party_id;
@@ -295,7 +295,7 @@ int mapif_party_memberadded(int fd, int party_id, int account_id, int flag) {
return 0;
}
-// パーティ設定変更通知
+// パ?ティ設定?更通知
int mapif_party_optionchanged(int fd,struct party *p, int account_id, int flag) {
unsigned char buf[15];
@@ -314,7 +314,7 @@ int mapif_party_optionchanged(int fd,struct party *p, int account_id, int flag)
return 0;
}
-// パーティ脱退通知
+// パ?ティ?退通知
int mapif_party_leaved(int party_id,int account_id, char *name) {
unsigned char buf[34];
@@ -328,7 +328,7 @@ int mapif_party_leaved(int party_id,int account_id, char *name) {
return 0;
}
-// パーティマップ更新通知
+// パ?ティマップ更新通知
int mapif_party_membermoved(struct party *p, int idx) {
unsigned char buf[29];
@@ -343,7 +343,7 @@ int mapif_party_membermoved(struct party *p, int idx) {
return 0;
}
-// パーティ解散通知
+// パ?ティ解散通知
int mapif_party_broken(int party_id, int flag) {
unsigned char buf[7];
WBUFW(buf,0) = 0x3826;
@@ -355,7 +355,7 @@ int mapif_party_broken(int party_id, int flag) {
return 0;
}
-// パーティ内発言
+// パ?ティ??言
int mapif_party_message(int party_id, int account_id, char *mes, int len, int sfd) {
unsigned char buf[len+12];
@@ -373,8 +373,8 @@ int mapif_party_message(int party_id, int account_id, char *mes, int len, int sf
// map serverからの通信
-// パーティ
-int mapif_parse_CreateParty(int fd, int account_id, char *name, char *nick, char *map, int lv) {
+// パ?ティ
+int mapif_parse_CreateParty(int fd, int account_id, char *name, char *nick, char *map, int lv, int item, int item2) {
struct party *p;
int i;
@@ -401,7 +401,12 @@ int mapif_parse_CreateParty(int fd, int account_id, char *name, char *nick, char
p->party_id = party_newid++;
memcpy(p->name, name, 24);
p->exp = 0;
- p->item = 0;
+ p->item = item;
+ //<item1>アイテム?集方法。0で個人別、1でパ?ティ公有
+ //<item2>アイテム分配方法。0で個人別、1でパ?ティに均等分配
+ //difference between "collection" and "distribution" is...? ^^;
+ p->itemc = 0;
+
p->member[0].account_id = account_id;
memcpy(p->member[0].name, nick, 24);
memcpy(p->member[0].map, map, 16);
@@ -417,7 +422,7 @@ int mapif_parse_CreateParty(int fd, int account_id, char *name, char *nick, char
return 0;
}
-// パーティ情報要求
+// パ?ティ情報要求
int mapif_parse_PartyInfo(int fd, int party_id) {
struct party *p;
@@ -430,7 +435,7 @@ int mapif_parse_PartyInfo(int fd, int party_id) {
return 0;
}
-// パーティ追加要求
+// パ?ティ追加要求
int mapif_parse_PartyAddMember(int fd, int party_id, int account_id, char *nick, char *map, int lv) {
struct party *p;
int i;
@@ -468,7 +473,7 @@ int mapif_parse_PartyAddMember(int fd, int party_id, int account_id, char *nick,
return 0;
}
-// パーティー設定変更要求
+// パ?ティ?設定?更要求
int mapif_parse_PartyChangeOption(int fd, int party_id, int account_id, int exp, int item) {
struct party *p;
int flag = 0;
@@ -489,7 +494,7 @@ int mapif_parse_PartyChangeOption(int fd, int party_id, int account_id, int exp,
return 0;
}
-// パーティ脱退要求
+// パ?ティ?退要求
int mapif_parse_PartyLeave(int fd, int party_id, int account_id) {
struct party *p;
int i;
@@ -502,7 +507,7 @@ int mapif_parse_PartyLeave(int fd, int party_id, int account_id) {
memset(&p->member[i], 0, sizeof(struct party_member));
if (party_check_empty(p) == 0)
- mapif_party_info(-1, p);// まだ人がいるのでデータ送信
+ mapif_party_info(-1, p);// まだ人がいるのでデ?タ送信
return 0;
}
}
@@ -511,7 +516,7 @@ int mapif_parse_PartyLeave(int fd, int party_id, int account_id) {
return 0;
}
-// パーティマップ更新要求
+// パ?ティマップ更新要求
int mapif_parse_PartyChangeMap(int fd, int party_id, int account_id, char *map, int online, int lv) {
struct party *p;
int i;
@@ -542,7 +547,7 @@ int mapif_parse_PartyChangeMap(int fd, int party_id, int account_id, char *map,
return 0;
}
-// パーティ解散要求
+// パ?ティ解散要求
int mapif_parse_BreakParty(int fd, int party_id) {
struct party *p;
@@ -556,23 +561,23 @@ int mapif_parse_BreakParty(int fd, int party_id) {
return 0;
}
-// パーティメッセージ送信
+// パ?ティメッセ?ジ送信
int mapif_parse_PartyMessage(int fd, int party_id, int account_id, char *mes, int len) {
return mapif_party_message(party_id, account_id, mes, len, fd);
}
-// パーティチェック要求
+// パ?ティチェック要求
int mapif_parse_PartyCheck(int fd, int party_id, int account_id, char *nick) {
return party_check_conflict(party_id, account_id, nick);
}
// map server からの通信
-// ・1パケットのみ解析すること
-// ・パケット長データはinter.cにセットしておくこと
-// ・パケット長チェックや、RFIFOSKIPは呼び出し元で行われるので行ってはならない
-// ・エラーなら0(false)、そうでないなら1(true)をかえさなければならない
+// ?1パケットのみ解析すること
+// ?パケット長デ?タはinter.cにセットしておくこと
+// ?パケット長チェックや、RFIFOSKIPは呼び出し元で行われるので行ってはならない
+// ?エラ?なら0(false)、そうでないなら1(true)をかえさなければならない
int inter_party_parse_frommap(int fd) {
switch(RFIFOW(fd,0)) {
- case 0x3020: mapif_parse_CreateParty(fd, RFIFOL(fd,2), (char*)RFIFOP(fd,6), (char*)RFIFOP(fd,30), (char*)RFIFOP(fd,54), RFIFOW(fd,70)); break;
+ case 0x3020: mapif_parse_CreateParty(fd, RFIFOL(fd,2), (char*)RFIFOP(fd,6), (char*)RFIFOP(fd,30), (char*)RFIFOP(fd,54), RFIFOW(fd,70), RFIFOB(fd,72), RFIFOB(fd,73)); break;
case 0x3021: mapif_parse_PartyInfo(fd, RFIFOL(fd,2)); break;
case 0x3022: mapif_parse_PartyAddMember(fd, RFIFOL(fd,2), RFIFOL(fd,6), (char*)RFIFOP(fd,10), (char*)RFIFOP(fd,34), RFIFOW(fd,50)); break;
case 0x3023: mapif_parse_PartyChangeOption(fd, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOW(fd,10), RFIFOW(fd,12)); break;
@@ -588,7 +593,7 @@ int inter_party_parse_frommap(int fd) {
return 1;
}
-// サーバーから脱退要求(キャラ削除用)
+// サ?バ?から?退要求(キャラ削除用)
int inter_party_leave(int party_id, int account_id) {
return mapif_parse_PartyLeave(-1, party_id, account_id);
}
diff --git a/src/char/inter.c b/src/char/inter.c
index ac460d4c4..f368a48b6 100644
--- a/src/char/inter.c
+++ b/src/char/inter.c
@@ -47,7 +47,7 @@ int inter_send_packet_length[] = {
int inter_recv_packet_length[] = {
-1,-1, 7,-1, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
6,-1, 0, 0, 0, 0, 0, 0, 10,-1, 0, 0, 0, 0, 0, 0,
- 72, 6,52,14, 10,29, 6,-1, 34, 0, 0, 0, 0, 0, 0, 0,
+ 74, 6,52,14, 10,29, 6,-1, 34, 0, 0, 0, 0, 0, 0, 0,
-1, 6,-1, 0, 55,19, 6,-1, 14,-1,-1,-1, 14,19,186,-1,
5, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
diff --git a/src/char_sql/int_party.c b/src/char_sql/int_party.c
index b8a4a1160..4cafa9f4d 100644
--- a/src/char_sql/int_party.c
+++ b/src/char_sql/int_party.c
@@ -452,7 +452,7 @@ int mapif_party_message(int party_id,int account_id,char *mes,int len, int sfd)
// Create Party
-int mapif_parse_CreateParty(int fd,int account_id,char *name,char *nick,char *map,int lv)
+int mapif_parse_CreateParty(int fd,int account_id,char *name,char *nick,char *map,int lv, int item, int item2)
{
struct party *p;
if( (p=search_partyname(name))!=NULL){
@@ -470,7 +470,12 @@ int mapif_parse_CreateParty(int fd,int account_id,char *name,char *nick,char *ma
p->party_id=party_newid++;
memcpy(p->name,name,24);
p->exp=0;
- p->item=0;
+ p->item=item;
+ //<item1>アイテム?集方法。0で個人別、1でパ?ティ公有
+ //<item2>アイテム分配方法。0で個人別、1でパ?ティに均等分配
+ //difference between "collection" and "distribution" is...? ^^;
+ p->itemc = 0;
+
p->member[0].account_id=account_id;
memcpy(p->member[0].name,nick,24);
memcpy(p->member[0].map,map,16);
@@ -727,7 +732,7 @@ int mapif_parse_PartyCheck(int fd,int party_id,int account_id,char *nick)
int inter_party_parse_frommap(int fd)
{
switch(RFIFOW(fd,0)){
- case 0x3020: mapif_parse_CreateParty(fd,RFIFOL(fd,2),(char*)RFIFOP(fd,6),(char*)RFIFOP(fd,30),(char*)RFIFOP(fd,54),RFIFOW(fd,70)); break;
+ case 0x3020: mapif_parse_CreateParty(fd,RFIFOL(fd,2),(char*)RFIFOP(fd,6),(char*)RFIFOP(fd,30),(char*)RFIFOP(fd,54),RFIFOW(fd,70), RFIFOB(fd,72), RFIFOB(fd,73)); break;
case 0x3021: mapif_parse_PartyInfo(fd,RFIFOL(fd,2)); break;
case 0x3022: mapif_parse_PartyAddMember(fd,RFIFOL(fd,2),RFIFOL(fd,6),(char*)RFIFOP(fd,10),(char*)RFIFOP(fd,34),RFIFOW(fd,50)); break;
case 0x3023: mapif_parse_PartyChangeOption(fd,RFIFOL(fd,2),RFIFOL(fd,6),RFIFOW(fd,10),RFIFOW(fd,12)); break;
diff --git a/src/char_sql/inter.c b/src/char_sql/inter.c
index 6d0ed144a..d0f51f1dc 100644
--- a/src/char_sql/inter.c
+++ b/src/char_sql/inter.c
@@ -67,7 +67,7 @@ int inter_send_packet_length[]={
int inter_recv_packet_length[]={
-1,-1, 7, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
6,-1, 0, 0, 0, 0, 0, 0, 10,-1, 0, 0, 0, 0, 0, 0,
- 72, 6,52,14, 10,29, 6,-1, 34, 0, 0, 0, 0, 0, 0, 0,
+ 74, 6,52,14, 10,29, 6,-1, 34, 0, 0, 0, 0, 0, 0, 0,
-1, 6,-1, 0, 55,19, 6,-1, 14,-1,-1,-1, 14,19,186,-1,
5, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
diff --git a/src/common/mmo.h b/src/common/mmo.h
index a8722e53e..9cb9477d8 100644
--- a/src/common/mmo.h
+++ b/src/common/mmo.h
@@ -198,7 +198,7 @@ struct party {
int party_id;
char name[24];
int exp;
- int item;
+ int item, itemc;
struct party_member member[MAX_PARTY];
};
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index ff202a631..a91fe061b 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -5098,7 +5098,7 @@ int atcommand_party(
return -1;
}
- party_create(sd, party);
+ party_create(sd, party, 0, 0);
return 0;
}
diff --git a/src/map/clif.c b/src/map/clif.c
index d0bf86e27..d3b00a306 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -1,6 +1,7 @@
// $Id: clif.c 2200 2004-11-07 11:49:58Z Yor $
#define DUMP_UNKNOWN_PACKET 1
+#define DUMP_ALL_PACKETS 0
#include <stdio.h>
#include <ctype.h>
@@ -9593,7 +9594,7 @@ void clif_parse_CloseKafra(int fd, struct map_session_data *sd) {
*/
void clif_parse_CreateParty(int fd, struct map_session_data *sd) {
if (battle_config.basic_skill_check == 0 || pc_checkskill(sd,NV_BASIC) >= 7) {
- party_create(sd,(char*)RFIFOP(fd,2));
+ party_create(sd,(char*)RFIFOP(fd,2),0,0);
} else
clif_skill_fail(sd,1,0,4);
}
@@ -9604,7 +9605,7 @@ void clif_parse_CreateParty(int fd, struct map_session_data *sd) {
*/
void clif_parse_CreateParty2(int fd, struct map_session_data *sd) {
if (battle_config.basic_skill_check == 0 || pc_checkskill(sd,NV_BASIC) >= 7){
- party_create(sd,(char*)RFIFOP(fd,2));
+ party_create(sd,(char*)RFIFOP(fd,2),RFIFOB(fd,26),RFIFOB(fd,27));
} else
clif_skill_fail(sd,1,0,4);
}
@@ -10504,7 +10505,7 @@ static void (*clif_parse_func_table[MAX_PACKET_DB])(int, struct map_session_data
*------------------------------------------
*/
static int clif_parse(int fd) {
- int packet_len = 0, cmd, packet_ver;
+ int packet_len = 0, cmd, packet_ver, dump = 0;
struct map_session_data *sd;
sd = (struct map_session_data*)session[fd]->session_data;
@@ -10672,6 +10673,10 @@ static int clif_parse(int fd) {
if (RFIFOREST(fd) < packet_len)
return 0; // まだ1パケット分データが揃ってない
+ #if DUMP_ALL_PACKETS
+ dump = 1;
+ #endif
+
if (sd && sd->state.auth == 1 && sd->state.waitingdisconnect == 1) { // 切断待ちの場合パケットを処理しない
} else if (packet_db[packet_ver][cmd].func) { // packet version 5-6-7 use same functions, but size are different
@@ -10680,28 +10685,13 @@ static int clif_parse(int fd) {
} else {
// 不明なパケット
if (battle_config.error_log) {
- if (fd)
- printf("\nclif_parse: session #%d, packet 0x%x, lenght %d\n", fd, cmd, packet_len);
-#ifdef DUMP_UNKNOWN_PACKET
+#if DUMP_UNKNOWN_PACKET
{
int i;
FILE *fp;
char packet_txt[256] = "save/packet.txt";
time_t now;
- printf("---- 00-01-02-03-04-05-06-07-08-09-0A-0B-0C-0D-0E-0F");
- for(i = 0; i < packet_len; i++) {
- if ((i & 15) == 0)
- printf("\n%04X ",i);
- printf("%02X ", RFIFOB(fd,i));
- }
- if (sd && sd->state.auth) {
- if (sd->status.name != NULL)
- printf("\nAccount ID %d, character ID %d, player name %s.\n",
- sd->status.account_id, sd->status.char_id, sd->status.name);
- else
- printf("\nAccount ID %d.\n", sd->bl.id);
- } else if (sd) // not authentified! (refused by char-server or disconnect before to be authentified)
- printf("\nAccount ID %d.\n", sd->bl.id);
+ dump = 1;
if ((fp = fopen(packet_txt, "a")) == NULL) {
printf("clif.c: cant write [%s] !!! data is lost !!!\n", packet_txt);
@@ -10730,6 +10720,27 @@ static int clif_parse(int fd) {
#endif
}
}
+
+ if (dump) {
+ int i;
+ if (fd)
+ printf("\nclif_parse: session #%d, packet 0x%x, lenght %d\n", fd, cmd, packet_len);
+ printf("---- 00-01-02-03-04-05-06-07-08-09-0A-0B-0C-0D-0E-0F");
+ for(i = 0; i < packet_len; i++) {
+ if ((i & 15) == 0)
+ printf("\n%04X ",i);
+ printf("%02X ", RFIFOB(fd,i));
+ }
+ if (sd && sd->state.auth) {
+ if (sd->status.name != NULL)
+ printf("\nAccount ID %d, character ID %d, player name %s.\n",
+ sd->status.account_id, sd->status.char_id, sd->status.name);
+ else
+ printf("\nAccount ID %d.\n", sd->bl.id);
+ } else if (sd) // not authentified! (refused by char-server or disconnect before to be authentified)
+ printf("\nAccount ID %d.\n", sd->bl.id);
+ }
+
RFIFOSKIP(fd, packet_len);
return 0;
diff --git a/src/map/intif.c b/src/map/intif.c
index 3f1bbfe88..4306838aa 100644
--- a/src/map/intif.c
+++ b/src/map/intif.c
@@ -273,7 +273,7 @@ int intif_send_guild_storage(int account_id,struct guild_storage *gstor)
}
// パーティ作成要求
-int intif_create_party(struct map_session_data *sd,char *name)
+int intif_create_party(struct map_session_data *sd,char *name,int item,int item2)
{
if (CheckForCharServer())
return 0;
@@ -285,7 +285,9 @@ int intif_create_party(struct map_session_data *sd,char *name)
memcpy(WFIFOP(inter_fd,30),sd->status.name,24);
memcpy(WFIFOP(inter_fd,54),map[sd->bl.m].name,16);
WFIFOW(inter_fd,70)= sd->status.base_level;
- WFIFOSET(inter_fd,72);
+ WFIFOB(inter_fd,72)= item;
+ WFIFOB(inter_fd,73)= item2;
+ WFIFOSET(inter_fd,74);
// if(battle_config.etc_log)
// printf("intif: create party\n");
return 0;
diff --git a/src/map/intif.h b/src/map/intif.h
index 761c1ea63..a27712985 100644
--- a/src/map/intif.h
+++ b/src/map/intif.h
@@ -18,7 +18,7 @@ int intif_request_guild_storage(int account_id, int guild_id);
int intif_send_guild_storage(int account_id, struct guild_storage *gstor);
-int intif_create_party(struct map_session_data *sd,char *name);
+int intif_create_party(struct map_session_data *sd,char *name,int item,int item2);
int intif_request_partyinfo(int party_id);
int intif_party_addmember(int party_id, int account_id);
int intif_party_changeoption(int party_id, int account_id, int exp, int item);
diff --git a/src/map/mob.c b/src/map/mob.c
index 6a2666cf1..ecf3c8bdc 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -1960,7 +1960,7 @@ static int mob_delay_item_drop(int tid,unsigned int tick,int id,int data)
{
struct delay_item_drop *ditem;
struct item temp_item;
- int flag;
+ int flag, drop_flag = 1;
nullpo_retr(0, ditem=(struct delay_item_drop *)id);
@@ -1969,16 +1969,43 @@ static int mob_delay_item_drop(int tid,unsigned int tick,int id,int data)
temp_item.amount = ditem->amount;
temp_item.identify = !itemdb_isequip3(temp_item.nameid);
- if(battle_config.item_auto_get){
- if(ditem->first_sd && (flag = pc_additem(ditem->first_sd,&temp_item,ditem->amount))){
- clif_additem(ditem->first_sd,0,0,flag);
- map_addflooritem(&temp_item,1,ditem->m,ditem->x,ditem->y,ditem->first_sd,ditem->second_sd,ditem->third_sd,0);
+ if (ditem->first_sd){
+ #if 0
+ if (ditem->first_sd->status.party_id > 0){
+ struct party *p;
+ if((p=party_search(ditem->first_sd->status.party_id)) && p->item){
+ struct map_session_data *sd = NULL;
+ int i;
+ for (i = p->itemc + 1; i!=p->itemc; i++) { // initialise counter and loop through the party
+ if (i >= MAX_PARTY)
+ i = 0; // reset counter to 1st person in party so it'll stop when it reaches "itemc"
+ if ((sd=p->member[i].sd)!=NULL && sd->bl.m == ditem->first_sd->bl.m)
+ break;
+ }
+ if (sd){ // if an appropiate party member was found
+ drop_flag = 0;
+ if ((p->itemc++) >= MAX_PARTY)
+ p->itemc = 0;
+ if ((flag = pc_additem(ditem->first_sd,&temp_item,ditem->amount))) {
+ clif_additem(ditem->first_sd,0,0,flag);
+ drop_flag = 1;
+ }
+ }
+ }
+ } else
+ #endif
+ if(battle_config.item_auto_get){
+ drop_flag = 0;
+ if((flag = pc_additem(ditem->first_sd,&temp_item,ditem->amount))){
+ clif_additem(ditem->first_sd,0,0,flag);
+ drop_flag = 1;
+ }
}
- aFree(ditem);
- return 0;
}
- map_addflooritem(&temp_item,1,ditem->m,ditem->x,ditem->y,ditem->first_sd,ditem->second_sd,ditem->third_sd,0);
+ if (drop_flag) {
+ map_addflooritem(&temp_item,1,ditem->m,ditem->x,ditem->y,ditem->first_sd,ditem->second_sd,ditem->third_sd,0);
+ }
aFree(ditem);
return 0;
@@ -1991,20 +2018,47 @@ static int mob_delay_item_drop(int tid,unsigned int tick,int id,int data)
static int mob_delay_item_drop2(int tid,unsigned int tick,int id,int data)
{
struct delay_item_drop2 *ditem;
- int flag;
+ int flag, drop_flag = 1;
nullpo_retr(0, ditem=(struct delay_item_drop2 *)id);
- if(battle_config.item_auto_get){
- if(ditem->first_sd && (flag = pc_additem(ditem->first_sd,&ditem->item_data,ditem->item_data.amount))){
- clif_additem(ditem->first_sd,0,0,flag);
- map_addflooritem(&ditem->item_data,ditem->item_data.amount,ditem->m,ditem->x,ditem->y,ditem->first_sd,ditem->second_sd,ditem->third_sd,0);
+ if (ditem->first_sd){
+ #if 0
+ if (ditem->first_sd->status.party_id > 0){
+ struct party *p;
+ if((p=party_search(ditem->first_sd->status.party_id)) && p->item){
+ struct map_session_data *sd = NULL;
+ int i;
+ for (i = p->itemc + 1; i!=p->itemc; i++) { // initialise counter and loop through the party
+ if (i >= MAX_PARTY)
+ i = 0; // reset counter to 1st person in party so it'll stop when it reaches "itemc"
+ if ((sd=p->member[i].sd)!=NULL && sd->bl.m == ditem->first_sd->bl.m)
+ break;
+ }
+ if (sd){ // if an appropiate party member was found
+ drop_flag = 0;
+ if ((p->itemc++) >= MAX_PARTY)
+ p->itemc = 0;
+ if((flag = pc_additem(ditem->first_sd,&ditem->item_data,ditem->item_data.amount))){
+ clif_additem(ditem->first_sd,0,0,flag);
+ drop_flag = 1;
+ }
+ }
+ }
+ } else
+ #endif
+ if(battle_config.item_auto_get){
+ drop_flag = 0;
+ if((flag = pc_additem(ditem->first_sd,&ditem->item_data,ditem->item_data.amount))){
+ clif_additem(ditem->first_sd,0,0,flag);
+ drop_flag = 1;
+ }
}
- aFree(ditem);
- return 0;
}
- map_addflooritem(&ditem->item_data,ditem->item_data.amount,ditem->m,ditem->x,ditem->y,ditem->first_sd,ditem->second_sd,ditem->third_sd,0);
+ if (drop_flag) {
+ map_addflooritem(&ditem->item_data,ditem->item_data.amount,ditem->m,ditem->x,ditem->y,ditem->first_sd,ditem->second_sd,ditem->third_sd,0);
+ }
aFree(ditem);
return 0;
diff --git a/src/map/party.c b/src/map/party.c
index 3c3c12886..6c6bf9567 100644
--- a/src/map/party.c
+++ b/src/map/party.c
@@ -69,12 +69,12 @@ struct party* party_searchname(char *str)
return p;
}
// 作成要求
-int party_create(struct map_session_data *sd,char *name)
+int party_create(struct map_session_data *sd,char *name,int item,int item2)
{
nullpo_retr(0, sd);
if(sd->status.party_id==0)
- intif_create_party(sd,name);
+ intif_create_party(sd,name,item,item2);
else
clif_party_created(sd,2);
return 0;
diff --git a/src/map/party.h b/src/map/party.h
index 5259df7ff..203dd1057 100644
--- a/src/map/party.h
+++ b/src/map/party.h
@@ -13,7 +13,7 @@ void do_final_party(void);
struct party *party_search(int party_id);
struct party* party_searchname(char *str);
-int party_create(struct map_session_data *sd,char *name);
+int party_create(struct map_session_data *sd,char *name, int item, int item2);
int party_created(int account_id,int fail,int party_id,char *name);
int party_request_info(int party_id);
int party_invite(struct map_session_data *sd,int account_id);