Add drop highlighting effect feature (#3710)
Fixes #3610 Thanks to @Balferian, @admkakaroto and credits to @Asheraf
This commit is contained in:
parent
c71ef92fb0
commit
bde580fdbd
@ -8,4 +8,10 @@
|
|||||||
// 8 - Item will be bound item when equipped
|
// 8 - Item will be bound item when equipped
|
||||||
// 16 - Special Broadcast: When item dropped by monster and player loot it, will be broadcasted!
|
// 16 - Special Broadcast: When item dropped by monster and player loot it, will be broadcasted!
|
||||||
// 32 - Item will not be removed on consumption. Also supports 'itemskill'
|
// 32 - Item will not be removed on consumption. Also supports 'itemskill'
|
||||||
|
// 64 - Item will be displayed with a client side defined drop
|
||||||
|
// 128 - Item will be displayed with a white pillar drop effect
|
||||||
|
// 256 - Item will be displayed with a blue pillar drop effect
|
||||||
|
// 512 - Item will be displayed with a yellow pillar drop effect
|
||||||
|
// 1024 - Item will be displayed with a purple pillar drop effect
|
||||||
|
// 2048 - Item will be displayed with a orange pillar drop effect
|
||||||
// NOTE: For removing flag by import file, use "-" to remove the flag. Example, 604,-1 will removes flag 1 from Branch_Of_Dead_Tree
|
// NOTE: For removing flag by import file, use "-" to remove the flag. Example, 604,-1 will removes flag 1 from Branch_Of_Dead_Tree
|
||||||
|
@ -8,6 +8,12 @@
|
|||||||
// 8 - Item will be bound item when equipped
|
// 8 - Item will be bound item when equipped
|
||||||
// 16 - Special Broadcast: When item dropped by monster and player loot it, will be broadcasted!
|
// 16 - Special Broadcast: When item dropped by monster and player loot it, will be broadcasted!
|
||||||
// 32 - Item will not be removed on consumption. Also supports 'itemskill'
|
// 32 - Item will not be removed on consumption. Also supports 'itemskill'
|
||||||
|
// 64 - Item will be displayed with a client side defined drop
|
||||||
|
// 128 - Item will be displayed with a white pillar drop effect
|
||||||
|
// 256 - Item will be displayed with a blue pillar drop effect
|
||||||
|
// 512 - Item will be displayed with a yellow pillar drop effect
|
||||||
|
// 1024 - Item will be displayed with a purple pillar drop effect
|
||||||
|
// 2048 - Item will be displayed with a orange pillar drop effect
|
||||||
// NOTE: For removing flag by import file, use "-" to remove the flag. Example, 604,-1 will removes flag 1 from Branch_Of_Dead_Tree
|
// NOTE: For removing flag by import file, use "-" to remove the flag. Example, 604,-1 will removes flag 1 from Branch_Of_Dead_Tree
|
||||||
|
|
||||||
// Logged as Dead Branch item
|
// Logged as Dead Branch item
|
||||||
|
@ -8,6 +8,12 @@
|
|||||||
// 8 - Item will be bound item when equipped
|
// 8 - Item will be bound item when equipped
|
||||||
// 16 - Special Broadcast: When item dropped by monster and player loot it, will be broadcasted!
|
// 16 - Special Broadcast: When item dropped by monster and player loot it, will be broadcasted!
|
||||||
// 32 - Item will not be removed on consumption. Also supports 'itemskill'
|
// 32 - Item will not be removed on consumption. Also supports 'itemskill'
|
||||||
|
// 64 - Item will be displayed with a client side defined drop
|
||||||
|
// 128 - Item will be displayed with a white pillar drop effect
|
||||||
|
// 256 - Item will be displayed with a blue pillar drop effect
|
||||||
|
// 512 - Item will be displayed with a yellow pillar drop effect
|
||||||
|
// 1024 - Item will be displayed with a purple pillar drop effect
|
||||||
|
// 2048 - Item will be displayed with a orange pillar drop effect
|
||||||
// NOTE: For removing flag by import file, use "-" to remove the flag. Example, 604,-1 will removes flag 1 from Branch_Of_Dead_Tree
|
// NOTE: For removing flag by import file, use "-" to remove the flag. Example, 604,-1 will removes flag 1 from Branch_Of_Dead_Tree
|
||||||
|
|
||||||
// Logged as Dead Branch item
|
// Logged as Dead Branch item
|
||||||
|
@ -764,11 +764,15 @@ void clif_charselectok(int id, uint8 ok)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Makes an item appear on the ground.
|
/// Makes an item appear on the ground.
|
||||||
/// 009e <id>.L <name id>.W <identified>.B <x>.W <y>.W <subX>.B <subY>.B <amount>.W (ZC_ITEM_FALL_ENTRY)
|
/// 009E <id>.L <name id>.W <identified>.B <x>.W <y>.W <subX>.B <subY>.B <amount>.W (ZC_ITEM_FALL_ENTRY)
|
||||||
/// 084b <id>.L <name id>.W <type>.W <identified>.B <x>.W <y>.W <subX>.B <subY>.B <amount>.W (ZC_ITEM_FALL_ENTRY4)
|
/// 084B <id>.L <name id>.W <type>.W <identified>.B <x>.W <y>.W <subX>.B <subY>.B <amount>.W (ZC_ITEM_FALL_ENTRY4)
|
||||||
void clif_dropflooritem(struct flooritem_data* fitem)
|
/// 0ADD <id>.L <name id>.W <type>.W <identified>.B <x>.W <y>.W <subX>.B <subY>.B <amount>.W <show drop effect>.B <drop effect mode>.W (ZC_ITEM_FALL_ENTRY5)
|
||||||
|
void clif_dropflooritem(struct flooritem_data* fitem, bool canShowEffect)
|
||||||
{
|
{
|
||||||
#if PACKETVER >= 20130000
|
#if PACKETVER >= 20180418
|
||||||
|
uint8 buf[22];
|
||||||
|
uint32 header = 0xadd;
|
||||||
|
#elif PACKETVER >= 20130000
|
||||||
uint8 buf[19];
|
uint8 buf[19];
|
||||||
uint32 header=0x84b;
|
uint32 header=0x84b;
|
||||||
#else
|
#else
|
||||||
@ -795,6 +799,22 @@ void clif_dropflooritem(struct flooritem_data* fitem)
|
|||||||
WBUFB(buf, offset+13) = fitem->subx;
|
WBUFB(buf, offset+13) = fitem->subx;
|
||||||
WBUFB(buf, offset+14) = fitem->suby;
|
WBUFB(buf, offset+14) = fitem->suby;
|
||||||
WBUFW(buf, offset+15) = fitem->item.amount;
|
WBUFW(buf, offset+15) = fitem->item.amount;
|
||||||
|
#if PACKETVER >= 20180418
|
||||||
|
if( canShowEffect ){
|
||||||
|
uint8 dropEffect = itemdb_dropeffect(fitem->item.nameid);
|
||||||
|
|
||||||
|
if( dropEffect > 0 ){
|
||||||
|
WBUFB(buf, offset+17) = 1;
|
||||||
|
WBUFW(buf, offset+18) = dropEffect - 1;
|
||||||
|
}else{
|
||||||
|
WBUFB(buf, offset+17) = 0;
|
||||||
|
WBUFW(buf, offset+18) = 0;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
WBUFB(buf, offset+17) = 0;
|
||||||
|
WBUFW(buf, offset+18) = 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
clif_send(buf, packet_len(header), &fitem->bl, AREA);
|
clif_send(buf, packet_len(header), &fitem->bl, AREA);
|
||||||
}
|
}
|
||||||
|
@ -564,7 +564,7 @@ void clif_authok(struct map_session_data *sd);
|
|||||||
void clif_authrefuse(int fd, uint8 error_code);
|
void clif_authrefuse(int fd, uint8 error_code);
|
||||||
void clif_authfail_fd(int fd, int type);
|
void clif_authfail_fd(int fd, int type);
|
||||||
void clif_charselectok(int id, uint8 ok);
|
void clif_charselectok(int id, uint8 ok);
|
||||||
void clif_dropflooritem(struct flooritem_data* fitem);
|
void clif_dropflooritem(struct flooritem_data* fitem, bool canShowEffect);
|
||||||
void clif_clearflooritem(struct flooritem_data *fitem, int fd);
|
void clif_clearflooritem(struct flooritem_data *fitem, int fd);
|
||||||
|
|
||||||
void clif_clearunit_single(int id, clr_type type, int fd);
|
void clif_clearunit_single(int id, clr_type type, int fd);
|
||||||
|
@ -2407,4 +2407,9 @@
|
|||||||
packet(0x0A4C,28);
|
packet(0x0A4C,28);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// 2018-04-18bRagexeRE
|
||||||
|
#if PACKETVER >= 20180418
|
||||||
|
packet(0x0ADD, 22);
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* CLIF_PACKETDB_HPP */
|
#endif /* CLIF_PACKETDB_HPP */
|
||||||
|
@ -914,7 +914,7 @@ static bool itemdb_read_nouse(char* fields[], int columns, int current) {
|
|||||||
*/
|
*/
|
||||||
static bool itemdb_read_flag(char* fields[], int columns, int current) {
|
static bool itemdb_read_flag(char* fields[], int columns, int current) {
|
||||||
unsigned short nameid = atoi(fields[0]);
|
unsigned short nameid = atoi(fields[0]);
|
||||||
uint8 flag;
|
uint16 flag;
|
||||||
bool set;
|
bool set;
|
||||||
struct item_data *id;
|
struct item_data *id;
|
||||||
|
|
||||||
@ -933,6 +933,20 @@ static bool itemdb_read_flag(char* fields[], int columns, int current) {
|
|||||||
if (flag&16) id->flag.broadcast = 1;
|
if (flag&16) id->flag.broadcast = 1;
|
||||||
if (flag&32) id->flag.delay_consume = 2;
|
if (flag&32) id->flag.delay_consume = 2;
|
||||||
|
|
||||||
|
if( flag & 64 ){
|
||||||
|
id->flag.dropEffect = 1;
|
||||||
|
}else if( flag & 128 ){
|
||||||
|
id->flag.dropEffect = 2;
|
||||||
|
}else if( flag & 256 ){
|
||||||
|
id->flag.dropEffect = 3;
|
||||||
|
}else if( flag & 512 ){
|
||||||
|
id->flag.dropEffect = 4;
|
||||||
|
}else if( flag & 1024 ){
|
||||||
|
id->flag.dropEffect = 5;
|
||||||
|
}else if( flag & 2048 ){
|
||||||
|
id->flag.dropEffect = 6;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -839,6 +839,7 @@ struct item_data
|
|||||||
unsigned guid : 1; // This item always be attached with GUID and make it as bound item! [Cydh]
|
unsigned guid : 1; // This item always be attached with GUID and make it as bound item! [Cydh]
|
||||||
unsigned broadcast : 1; ///< Will be broadcasted if someone obtain the item [Cydh]
|
unsigned broadcast : 1; ///< Will be broadcasted if someone obtain the item [Cydh]
|
||||||
bool bindOnEquip; ///< Set item as bound when equipped
|
bool bindOnEquip; ///< Set item as bound when equipped
|
||||||
|
uint8 dropEffect; ///< Drop Effect Mode
|
||||||
} flag;
|
} flag;
|
||||||
struct {// item stacking limitation
|
struct {// item stacking limitation
|
||||||
unsigned short amount;
|
unsigned short amount;
|
||||||
@ -904,6 +905,7 @@ struct item_data* itemdb_exists(unsigned short nameid);
|
|||||||
#define itemdb_traderight(n) (itemdb_search(n)->flag.trade_restriction)
|
#define itemdb_traderight(n) (itemdb_search(n)->flag.trade_restriction)
|
||||||
#define itemdb_viewid(n) (itemdb_search(n)->view_id)
|
#define itemdb_viewid(n) (itemdb_search(n)->view_id)
|
||||||
#define itemdb_autoequip(n) (itemdb_search(n)->flag.autoequip)
|
#define itemdb_autoequip(n) (itemdb_search(n)->flag.autoequip)
|
||||||
|
#define itemdb_dropeffect(n) (itemdb_search(n)->flag.dropEffect)
|
||||||
const char* itemdb_typename(enum item_types type);
|
const char* itemdb_typename(enum item_types type);
|
||||||
const char *itemdb_typename_ammo (enum e_item_ammo ammo);
|
const char *itemdb_typename_ammo (enum e_item_ammo ammo);
|
||||||
bool itemdb_is_spellbook2(unsigned short nameid);
|
bool itemdb_is_spellbook2(unsigned short nameid);
|
||||||
|
@ -1791,7 +1791,7 @@ bool map_closest_freecell(int16 m, int16 *x, int16 *y, int type, int flag)
|
|||||||
* @param mob_id: Monster ID if dropped by monster
|
* @param mob_id: Monster ID if dropped by monster
|
||||||
* @return 0:failure, x:item_gid [MIN_FLOORITEM;MAX_FLOORITEM]==[2;START_ACCOUNT_NUM]
|
* @return 0:failure, x:item_gid [MIN_FLOORITEM;MAX_FLOORITEM]==[2;START_ACCOUNT_NUM]
|
||||||
*------------------------------------------*/
|
*------------------------------------------*/
|
||||||
int map_addflooritem(struct item *item, int amount, int16 m, int16 x, int16 y, int first_charid, int second_charid, int third_charid, int flags, unsigned short mob_id)
|
int map_addflooritem(struct item *item, int amount, int16 m, int16 x, int16 y, int first_charid, int second_charid, int third_charid, int flags, unsigned short mob_id, bool canShowEffect)
|
||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
struct flooritem_data *fitem = NULL;
|
struct flooritem_data *fitem = NULL;
|
||||||
@ -1834,7 +1834,7 @@ int map_addflooritem(struct item *item, int amount, int16 m, int16 x, int16 y, i
|
|||||||
map_addiddb(&fitem->bl);
|
map_addiddb(&fitem->bl);
|
||||||
if (map_addblock(&fitem->bl))
|
if (map_addblock(&fitem->bl))
|
||||||
return 0;
|
return 0;
|
||||||
clif_dropflooritem(fitem);
|
clif_dropflooritem(fitem,canShowEffect);
|
||||||
|
|
||||||
return fitem->bl.id;
|
return fitem->bl.id;
|
||||||
}
|
}
|
||||||
|
@ -1031,7 +1031,7 @@ bool map_addnpc(int16 m,struct npc_data *);
|
|||||||
TIMER_FUNC(map_clearflooritem_timer);
|
TIMER_FUNC(map_clearflooritem_timer);
|
||||||
TIMER_FUNC(map_removemobs_timer);
|
TIMER_FUNC(map_removemobs_timer);
|
||||||
void map_clearflooritem(struct block_list* bl);
|
void map_clearflooritem(struct block_list* bl);
|
||||||
int map_addflooritem(struct item *item, int amount, int16 m, int16 x, int16 y, int first_charid, int second_charid, int third_charid, int flags, unsigned short mob_id);
|
int map_addflooritem(struct item *item, int amount, int16 m, int16 x, int16 y, int first_charid, int second_charid, int third_charid, int flags, unsigned short mob_id, bool canShowEffect = false);
|
||||||
|
|
||||||
// instances
|
// instances
|
||||||
int map_addinstancemap(const char *name, unsigned short instance_id);
|
int map_addinstancemap(const char *name, unsigned short instance_id);
|
||||||
|
@ -2146,7 +2146,7 @@ static TIMER_FUNC(mob_delay_item_drop){
|
|||||||
struct item_drop *ditem_prev;
|
struct item_drop *ditem_prev;
|
||||||
map_addflooritem(&ditem->item_data,ditem->item_data.amount,
|
map_addflooritem(&ditem->item_data,ditem->item_data.amount,
|
||||||
list->m,list->x,list->y,
|
list->m,list->x,list->y,
|
||||||
list->first_charid,list->second_charid,list->third_charid,4,ditem->mob_id);
|
list->first_charid,list->second_charid,list->third_charid,4,ditem->mob_id,true);
|
||||||
ditem_prev = ditem;
|
ditem_prev = ditem;
|
||||||
ditem = ditem->next;
|
ditem = ditem->next;
|
||||||
ers_free(item_drop_ers, ditem_prev);
|
ers_free(item_drop_ers, ditem_prev);
|
||||||
@ -2919,7 +2919,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
|
|||||||
|
|
||||||
if((temp = pc_additem(mvp_sd,&item,1,LOG_TYPE_PICKDROP_PLAYER)) != 0) {
|
if((temp = pc_additem(mvp_sd,&item,1,LOG_TYPE_PICKDROP_PLAYER)) != 0) {
|
||||||
clif_additem(mvp_sd,0,0,temp);
|
clif_additem(mvp_sd,0,0,temp);
|
||||||
map_addflooritem(&item,1,mvp_sd->bl.m,mvp_sd->bl.x,mvp_sd->bl.y,mvp_sd->status.char_id,(second_sd?second_sd->status.char_id:0),(third_sd?third_sd->status.char_id:0),1,0);
|
map_addflooritem(&item,1,mvp_sd->bl.m,mvp_sd->bl.x,mvp_sd->bl.y,mvp_sd->status.char_id,(second_sd?second_sd->status.char_id:0),(third_sd?third_sd->status.char_id:0),1,0,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i_data->flag.broadcast)
|
if (i_data->flag.broadcast)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user