Index: conf/channels.conf =================================================================== --- conf/channels.conf (revision 17383) +++ conf/channels.conf (working copy) @@ -25,8 +25,8 @@ /* Add as many colors as you'd like. */ } - /* Allow users to create their own (private) channels through @channels command? */ - /* (must also allow players to use @channels in groups.conf) */ + /* Allow users to create their own (private) channels through @channel command? */ + /* (must also allow players to use @channel in groups.conf) */ allow_user_channel_creation: true /* "map_local_channel" is an instanced channel unique to each map. */ Index: src/map/buyingstore.c =================================================================== --- src/map/buyingstore.c (revision 17383) +++ src/map/buyingstore.c (working copy) @@ -41,7 +41,7 @@ /// Returns unique buying store id static unsigned int buyingstore_getuid(void) { - return buyingstore_nextid++; + return ++buyingstore_nextid; } Index: src/map/clif.c =================================================================== --- src/map/clif.c (revision 17383) +++ src/map/clif.c (working copy) @@ -9611,6 +9611,7 @@ (!battle_config.prevent_logout || DIFF_TICK(gettick(), sd->canlog_tick) > battle_config.prevent_logout) ) { set_eof(fd); + pc_damage_log_clear(sd,0); clif_disconnect_ack(sd, 0); } else { clif_disconnect_ack(sd, 1); @@ -9980,6 +9981,7 @@ if( !sd->sc.data[SC_CLOAKING] && !sd->sc.data[SC_HIDING] && !sd->sc.data[SC_CHASEWALK] && !sd->sc.data[SC_CLOAKINGEXCEED] && (!battle_config.prevent_logout || DIFF_TICK(gettick(), sd->canlog_tick) > battle_config.prevent_logout) ) { //Send to char-server for character selection. + pc_damage_log_clear(sd,0); chrif_charselectreq(sd, session[fd]->client_addr); } else { clif_disconnect_ack(sd, 1); Index: src/map/map.c =================================================================== --- src/map/map.c (revision 17383) +++ src/map/map.c (working copy) @@ -1724,6 +1724,7 @@ } } + pc_damage_log_clear(sd,0); party_booking_delete(sd); // Party Booking [Spiria] pc_makesavestatus(sd); pc_clean_skilltree(sd); Index: src/map/mob.c =================================================================== --- src/map/mob.c (revision 17383) +++ src/map/mob.c (working copy) @@ -2019,6 +2019,9 @@ if(md->dmglog[i].id==0) { //Store data in first empty slot. md->dmglog[i].id = char_id; md->dmglog[i].flag= flag; + + if(md->db->mexp) + pc_damage_log_add(map_charid2sd(char_id),md->bl.id); break; } if(md->dmglog[i].dmgdmglog[minpos].id = char_id; md->dmglog[minpos].flag= flag; md->dmglog[minpos].dmg = damage; + + if(md->db->mexp) + pc_damage_log_add(map_charid2sd(char_id),md->bl.id); } } return; @@ -2160,6 +2166,8 @@ case MDLF_HOMUN: dmgbltypes|= BL_HOM; break; case MDLF_PET: dmgbltypes|= BL_PET; break; } + if( md->db->mexp ) + pc_damage_log_clear(tsd,md->bl.id); } // determines, if the monster was killed by homunculus' damage only Index: src/map/pc.c =================================================================== --- src/map/pc.c (revision 17383) +++ src/map/pc.c (working copy) @@ -9962,6 +9962,64 @@ return; } +void pc_clear_log_damage_sub(int char_id, struct mob_data *md) +{ + int i; + ARR_FIND(0,DAMAGELOG_SIZE,i,md->dmglog[i].id == char_id); + if( i < DAMAGELOG_SIZE ) + { + md->dmglog[i].id=0; + md->dmglog[i].dmg=0; + md->dmglog[i].flag=0; + } +} + +void pc_damage_log_add(struct map_session_data *sd, int id) +{ + int i = 0; + + if( !sd ) + return; + + for(i = 0; i < DAMAGELOG_SIZE_PC && sd->dmglog[i].id != id; i++) + if( !sd->dmglog[i].id ) + { + sd->dmglog[i].id = id; + break; + } + return; +} + +void pc_damage_log_clear(struct map_session_data *sd, int id) +{ + int i; + struct mob_data *md = NULL; + if( !sd ) + return; + + if( !id ) + { + for(i = 0; i < DAMAGELOG_SIZE_PC; i++) // track every id + { + if( !sd->dmglog[i].id ) //skip the empty value + continue; + + if( (md = map_id2md(sd->dmglog[i].id)) ) + pc_clear_log_damage_sub(sd->status.char_id,md); + } + memset(sd->dmglog,0,sizeof(sd->dmglog)); // clear all + } + else + { + if( (md = map_id2md(id)) ) + pc_clear_log_damage_sub(sd->status.char_id,md); + + ARR_FIND(0,DAMAGELOG_SIZE_PC,i,sd->dmglog[i].id == id); // find the id position + if( i < DAMAGELOG_SIZE_PC ) + sd->dmglog[i].id = 0; + } +} + /*========================================== * pc Init/Terminate *------------------------------------------*/ Index: src/map/pc.h =================================================================== --- src/map/pc.h (revision 17383) +++ src/map/pc.h (working copy) @@ -23,6 +23,7 @@ #define MAX_PC_BONUS 10 #define MAX_PC_SKILL_REQUIRE 5 #define MAX_PC_FEELHATE 3 +#define DAMAGELOG_SIZE_PC 100 // Any idea for this value? //Equip indexes constants. (eg: sd->equip_index[EQI_AMMO] returns the index //where the arrows are equipped) @@ -515,6 +516,10 @@ const char* delunit_prevfile; int delunit_prevline; + struct { + int id; + } dmglog[DAMAGELOG_SIZE_PC]; + }; //Update this max as necessary. 55 is the value needed for Super Baby currently @@ -965,6 +970,9 @@ void pc_baselevelchanged(struct map_session_data *sd); +void pc_damage_log_add(struct map_session_data *sd, int id); +void pc_damage_log_clear(struct map_session_data *sd, int id); + #if defined(RENEWAL_DROP) || defined(RENEWAL_EXP) int pc_level_penalty_mod(struct map_session_data *sd, int mob_level, uint32 mob_race, uint32 mob_mode, int type); #endif Index: src/map/unit.c =================================================================== --- src/map/unit.c (revision 17383) +++ src/map/unit.c (working copy) @@ -1421,6 +1421,9 @@ } else skill_castend_id(ud->skilltimer,tick,src->id,0); + if( sd ) + sd->canlog_tick = gettick(); + return 1; } @@ -1554,6 +1557,9 @@ ud->skilltimer = INVALID_TIMER; skill_castend_pos(ud->skilltimer,tick,src->id,0); } + + if( sd ) + sd->canlog_tick = gettick(); return 1; } @@ -1920,6 +1926,9 @@ if(ud->state.attack_continue) ud->attacktimer = add_timer(ud->attackabletime,unit_attack_timer,src->id,0); + if( sd ) + sd->canlog_tick = gettick(); + return 1; } Index: src/map/vending.c =================================================================== --- src/map/vending.c (revision 17383) +++ src/map/vending.c (working copy) @@ -29,7 +29,7 @@ /// Returns an unique vending shop id. static int vending_getuid(void) { - return vending_nextid++; + return ++vending_nextid; } /*==========================================