Jump to content

Recommended Posts

Posted (edited)

src/map/itemdb.h

find

	 unsigned autoequip: 1;
	 unsigned buyingstore : 1;
 } flag;
 short gm_lv_trade_override;	//GM-level to override trade_restriction
};

replace with

	 unsigned autoequip: 1;
	 unsigned buyingstore : 1;
 } flag;
 unsigned ann: 1;//annouce flag
 short gm_lv_trade_override;	//GM-level to override trade_restriction
};

src/map/item.c

find

/*====================================
* read all item-related databases
*------------------------------------*/

add above

/*====================================
* read item_announce.txt
*------------------------------------*/
static bool itemdb_read_announce(char* fields[], int columns, int current)
{
unsigned short nameid;
struct item_data* id;
nameid = (unsigned short)strtoul(fields[0], NULL, 10);
if( ( id = itemdb_exists(nameid) ) == NULL )
{
	ShowWarning("itemdb_read_announce: Unknow item id '%hu'.\n", nameid);
	return false;
}

id->ann=1;
return true;
}

/*====================================

item.c

find

 sv_readdb(db_path, DBPATH"item_trade.txt",   ',', 3, 3, -1,	   &itemdb_read_itemtrade);
 sv_readdb(db_path, "item_delay.txt",   ',', 2, 2, -1, &itemdb_read_itemdelay);
 sv_readdb(db_path, "item_buyingstore.txt", ',', 1, 1, -1,		 &itemdb_read_buyingstore);

add after

 sv_readdb(db_path, "item_announce.txt", ',', 1, 1, -1,		  &itemdb_read_announce);

src/map/mob.c

find

		//A Rare Drop Global Announce by Lupus
		if( mvp_sd && drop_rate <= battle_config.rare_drop_announce )
		{
			struct item_data *i_data;
			char message[128];
			i_data = itemdb_search(ditem->item_data.nameid);
			sprintf (message, msg_txt(541), mvp_sd->status.name, md->name, i_data->jname, (float)drop_rate/100);
			//MSG: "'%s' won %s's %s (chance: %0.02f%%)"
			intif_broadcast(message,strlen(message)+1,0);
		}

add after

		if(mvp_sd) {//specify drop item announce
			struct item_data *dd = NULL;
			char anme[128];
			dd = itemdb_search(ditem->item_data.nameid);
			if(dd->ann==1){
					sprintf (anme, msg_txt(541), mvp_sd->status.name, md->name, dd->jname, (float)drop_rate/100);
				//MSG: "'%s' won %s's %s (chance: %0.02f%%)"
					intif_broadcast(anme,strlen(anme)+1,0);

			}

		}	  

find

		//A Rare MVP Drop Global Announce by Lupus
		if(temp<=battle_config.rare_drop_announce) {
			struct item_data *i_data;
			char message[128];
			i_data = itemdb_exists(item.nameid);
			sprintf (message, msg_txt(541), mvp_sd->status.name, md->name, i_data->jname, temp/100.);
			//MSG: "'%s' won %s's %s (chance: %0.02f%%)"
			intif_broadcast(message,strlen(message)+1,0);
		}

add after

		if(mvp_sd) {//specify drop item announce
			struct item_data *dd = NULL;
			char anme[128];
			dd = itemdb_search(item.nameid);
			if(dd->ann==1){
					sprintf (anme, msg_txt(541), mvp_sd->status.name, md->name, dd->jname, (float)temp/100);
				//MSG: "'%s' won %s's %s (chance: %0.02f%%)"
					intif_broadcast(anme,strlen(anme)+1,0);

			}

		}	  

db/

create a doc named item_announce.txt

//to set drop announce item id
//@reloditemdb to reload all setting
//format: item id
//512
//501
//502

don't forgot to recompile :)

sida.patchFetching info...

Edited by QQfoolsorellina
  • Upvote 2
Posted
  On 5/26/2012 at 6:05 AM, wazhanudin said:

This mod will announce all item drop by GM or only announce item listed in item_announce.txt

Thanks in advance.

No this mod will announce the drop of the monster which is listed in item_announce.txt

Example: 2423 // Variant Shoes

The player who got Variant Shoes will automatically announce.

This mod will help your server to those GM who secretly killing mvp's :))

  • 2 weeks later...
Posted

I tried using rathena, If you forgot to autoloot the card will be drop but there will be announcement that you got the card. So it is possible if it will only announce if you really get the card. Or maybe change the broadcast to: Maynard killed a "monster name" with "Card". This way it is his fault if he didnt get or if he is not autoloot enabled.

Posted
  On 6/13/2012 at 8:32 AM, maynard said:

I tried using rathena, If you forgot to autoloot the card will be drop but there will be announcement that you got the card. So it is possible if it will only announce if you really get the card. Or maybe change the broadcast to: Maynard killed a "monster name" with "Card". This way it is his fault if he didnt get or if he is not autoloot enabled.

just change all 541 to 901 in src

conf/msg_athena.conf

and add a msg

901: '%s' kill %s with  %s (chance: %0.02f%%)

  • 2 weeks later...
  • 6 months later...
  • 4 weeks later...
  • 1 month later...
  • 2 months later...
  • 3 months later...
  • 6 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...