Jelajahi Sumber

- Modified party_item_share_type config setting so that using 1 disables item-sharing from non-mob loot (player dropped items or pet loot) and 2 enables round-robin instead of random sharing. Using 3 obviously is enabling both 1 and 2.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7898 54d463be-8e91-2dee-dedb-b68131a5f0ec
skotlex 19 tahun lalu
induk
melakukan
830106c6f9
7 mengubah file dengan 17 tambahan dan 8 penghapusan
  1. 4 0
      Changelog-Trunk.txt
  2. 5 2
      conf-tmpl/battle/party.conf
  3. 1 0
      db/const.txt
  4. 1 1
      src/map/mob.c
  5. 4 3
      src/map/party.c
  6. 1 1
      src/map/party.h
  7. 1 1
      src/map/pc.c

+ 4 - 0
Changelog-Trunk.txt

@@ -4,6 +4,10 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
 2006/07/26
+	* Modified party_item_share_type config setting so that using 1 disables
+	  item-sharing from non-mob loot (player dropped items or pet loot) and 2
+	  enables round-robin instead of random sharing. Using 3 obviously is
+	  enabling both 1 and 2. [Skotlex]
 	* Added battle_get_master which returns the master bl of a given object.
 	  [Skotlex]
 	* Recoded battle_check_target to use battle_get_master, the src/target

+ 5 - 2
conf-tmpl/battle/party.conf

@@ -35,8 +35,11 @@ show_steal_in_same_party: no
 show_party_share_picker: no
 
 // Method of distribution when item party share is enabled in a party:
-// 0: Random (item goes to a random party member)
-// 1: Round Robin (items are distributed evenly and in order among members)
+// 
+// 0: Normal (item goes to a random party member)
+// 1: Item Share is disabled for non-mob drops (player/pet drops)
+// 2: Round Robin (items are distributed evenly and in order among members)
+// 3: 1+2
 party_item_share_type: 0
 
 // Is exp sharing disabled for idle members in the party?

+ 1 - 0
db/const.txt

@@ -79,6 +79,7 @@ Job_Star_Gladiator2	4048
 Job_Soul_Linker	4049
 
 Option_Wedding	4096
+Option_Xmas 32768
 
 bc_all	0
 bc_map	1

+ 1 - 1
src/map/mob.c

@@ -1481,7 +1481,7 @@ static void mob_item_drop(struct mob_data *md, struct item_drop_list *dlist, str
 			dlist->first_sd->status.party_id?
 				party_search(dlist->first_sd->status.party_id):
 				NULL,
-			dlist->first_sd,&ditem->item_data) == 0
+			dlist->first_sd,&ditem->item_data,dlist->first_sd->bl.id) == 0
 		) {
 			ers_free(item_drop_ers, ditem);
 			return;

+ 4 - 3
src/map/party.c

@@ -734,13 +734,14 @@ int party_exp_share(struct party_data *p,struct block_list *src,unsigned int bas
 	return 0;
 }
 
-int party_share_loot(struct party_data *p, TBL_PC *sd, struct item *item_data)
+//Does party loot. first holds the id of the player who has time priority to take the item.
+int party_share_loot(struct party_data *p, TBL_PC *sd, struct item *item_data, int first)
 {
 	TBL_PC *target=NULL;
 	int i;
-	if (p && p->party.item&2) {
+	if (p && p->party.item&2 && (first || !(battle_config.party_share_type&1))) {
 		//item distribution to party members.
-		if (battle_config.party_share_type) { //Round Robin
+		if (battle_config.party_share_type&2) { //Round Robin
 			TBL_PC *psd;
 			i = p->itemc;
 			do {

+ 1 - 1
src/map/party.h

@@ -40,7 +40,7 @@ int party_check_conflict(struct map_session_data *sd);
 int party_skill_check(struct map_session_data *sd, int party_id, int skillid, int skilllv);
 int party_send_xy_clear(struct party_data *p);
 int party_exp_share(struct party_data *p,struct block_list *src,unsigned int base_exp,unsigned int job_exp,int zeny);
-int party_share_loot(struct party_data *p, TBL_PC *sd, struct item *item_data);
+int party_share_loot(struct party_data *p, TBL_PC *sd, struct item *item_data, int type);
 int party_send_dot_remove(struct map_session_data *sd);
 int party_sub_count(struct block_list *bl, va_list ap);
 int party_foreachsamemap(int (*func)(struct block_list *,va_list),struct map_session_data *sd,int type,...);

+ 1 - 1
src/map/pc.c

@@ -2759,7 +2759,7 @@ int pc_takeitem(struct map_session_data *sd,struct flooritem_data *fitem)
 	}
 	//This function takes care of giving the item to whoever should have it
 	//considering party-share options.
-	if ((flag = party_share_loot(p,sd,&fitem->item_data))) {
+	if ((flag = party_share_loot(p,sd,&fitem->item_data, fitem->first_get_id))) {
 		clif_additem(sd,0,0,flag);
 		return 1;
 	}