summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/map/clif.c2
-rw-r--r--src/map/intif.c89
-rw-r--r--src/map/map.h2
-rw-r--r--src/map/mob.c14
-rw-r--r--src/map/pc.c8
-rw-r--r--src/map/skill.c52
-rw-r--r--src/map/status.c1
7 files changed, 95 insertions, 73 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 77e50d0d6..d8195fb0a 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -5946,7 +5946,7 @@ int clif_item_repair_list(struct map_session_data *sd,struct map_session_data *d
WFIFOW(fd,2)=c*13+4;
WFIFOSET(fd,WFIFOW(fd,2));
sd->state.produce_flag = 1;
- sd->repair_target=dstsd;
+ sd->repair_target=dstsd->bl.id;
}else
clif_skill_fail(sd,sd->skillid,0,0);
diff --git a/src/map/intif.c b/src/map/intif.c
index 6b53d5c0d..0046d0c0c 100644
--- a/src/map/intif.c
+++ b/src/map/intif.c
@@ -902,24 +902,29 @@ int intif_parse_LoadStorage(int fd) {
struct storage *stor;
struct map_session_data *sd;
RFIFOHEAD(fd);
-
+
+ sd=map_id2sd( RFIFOL(fd,4) );
+ if(sd==NULL){
+ if(battle_config.error_log)
+ ShowError("intif_parse_LoadStorage: user not found %d\n",RFIFOL(fd,4));
+ return 1;
+ }
+
stor = account2storage( RFIFOL(fd,4));
if (stor->storage_status == 1) { // Already open.. lets ignore this update
if (battle_config.error_log)
- ShowWarning("intif_parse_LoadStorage: storage received for a client already open\n");
- return 0;
+ ShowWarning("intif_parse_LoadStorage: storage received for a client already open (User %d:%d)\n", sd->status.account_id, sd->status.char_id);
+ return 1;
}
-
- if (RFIFOW(fd,2)-8 != sizeof(struct storage)) {
+ if (stor->dirty) { // Already have storage, and it has been modified and not saved yet! Exploit! [Skotlex]
if (battle_config.error_log)
- ShowError("intif_parse_LoadStorage: data size error %d %d\n", RFIFOW(fd,2)-8, sizeof(struct storage));
+ ShowWarning("intif_parse_LoadStorage: received storage for an already modified non-saved storage! (User %d:%d)\n", sd->status.account_id, sd->status.char_id);
return 1;
}
- sd=map_id2sd( RFIFOL(fd,4) );
- if(sd==NULL){
- if(battle_config.error_log)
- ShowError("intif_parse_LoadStorage: user not found %d\n",RFIFOL(fd,4));
+ if (RFIFOW(fd,2)-8 != sizeof(struct storage)) {
+ if (battle_config.error_log)
+ ShowError("intif_parse_LoadStorage: data size error %d %d\n", RFIFOW(fd,2)-8, sizeof(struct storage));
return 1;
}
if(battle_config.save_log)
@@ -952,34 +957,44 @@ int intif_parse_LoadGuildStorage(int fd)
int guild_id;
RFIFOHEAD(fd);
guild_id = RFIFOL(fd,8);
- if(guild_id > 0) {
- gstor=guild2storage(guild_id);
- if(!gstor) {
- if(battle_config.error_log)
- ShowWarning("intif_parse_LoadGuildStorage: error guild_id %d not exist\n",guild_id);
- return 1;
- }
- if( RFIFOW(fd,2)-12 != sizeof(struct guild_storage) ){
- gstor->storage_status = 0;
- if(battle_config.error_log)
- ShowError("intif_parse_LoadGuildStorage: data size error %d %d\n",RFIFOW(fd,2)-12 , sizeof(struct guild_storage));
- return 1;
- }
- sd=map_id2sd( RFIFOL(fd,4) );
- if(sd==NULL){
- if(battle_config.error_log)
- ShowError("intif_parse_LoadGuildStorage: user not found %d\n",RFIFOL(fd,4));
- return 1;
- }
- if(battle_config.save_log)
- ShowInfo("intif_open_guild_storage: %d\n",RFIFOL(fd,4) );
- memcpy(gstor,RFIFOP(fd,12),sizeof(struct guild_storage));
- gstor->storage_status = 1;
- sd->state.storage_flag = 2;
- clif_guildstorageitemlist(sd,gstor);
- clif_guildstorageequiplist(sd,gstor);
- clif_updateguildstorageamount(sd,gstor);
+ if(guild_id <= 0)
+ return 1;
+ sd=map_id2sd( RFIFOL(fd,4) );
+ if(sd==NULL){
+ if(battle_config.error_log)
+ ShowError("intif_parse_LoadGuildStorage: user not found %d\n",RFIFOL(fd,4));
+ return 1;
+ }
+ gstor=guild2storage(guild_id);
+ if(!gstor) {
+ if(battle_config.error_log)
+ ShowWarning("intif_parse_LoadGuildStorage: error guild_id %d not exist\n",guild_id);
+ return 1;
}
+ if (gstor->storage_status == 1) { // Already open.. lets ignore this update
+ if (battle_config.error_log)
+ ShowWarning("intif_parse_LoadGuildStorage: storage received for a client already open (User %d:%d)\n", sd->status.account_id, sd->status.char_id);
+ return 1;
+ }
+ if (gstor->dirty) { // Already have storage, and it has been modified and not saved yet! Exploit! [Skotlex]
+ if (battle_config.error_log)
+ ShowWarning("intif_parse_LoadGuildStorage: received storage for an already modified non-saved storage! (User %d:%d)\n", sd->status.account_id, sd->status.char_id);
+ return 1;
+ }
+ if( RFIFOW(fd,2)-12 != sizeof(struct guild_storage) ){
+ gstor->storage_status = 0;
+ if(battle_config.error_log)
+ ShowError("intif_parse_LoadGuildStorage: data size error %d %d\n",RFIFOW(fd,2)-12 , sizeof(struct guild_storage));
+ return 1;
+ }
+ if(battle_config.save_log)
+ ShowInfo("intif_open_guild_storage: %d\n",RFIFOL(fd,4) );
+ memcpy(gstor,RFIFOP(fd,12),sizeof(struct guild_storage));
+ gstor->storage_status = 1;
+ sd->state.storage_flag = 2;
+ clif_guildstorageitemlist(sd,gstor);
+ clif_guildstorageequiplist(sd,gstor);
+ clif_updateguildstorageamount(sd,gstor);
return 0;
}
int intif_parse_SaveGuildStorage(int fd)
diff --git a/src/map/map.h b/src/map/map.h
index 3f7226eba..28a1748d6 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -516,7 +516,7 @@ struct map_session_data {
//unsigned int skillstatictimer[MAX_SKILL];
unsigned short timerskill_count; // [celest]
int cloneskill_id;
- struct map_session_data *repair_target;
+ int repair_target;
int invincible_timer;
unsigned int canact_tick;
diff --git a/src/map/mob.c b/src/map/mob.c
index 3fc896391..cf7791127 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -2209,12 +2209,11 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
return 0;
}
-/* The stop walking code is triggered in battle_walkdelay which is invoked from clif_damage after a timer.
- * So the mob should stop walking in sync with the time the "attack" hits the mob. If this is bugged then the
- * fault must be looked at in battle_walkdelay, not here. [Skotlex]
- if(md->sc_data[SC_ENDURE].timer == -1) // Stop the walking [Lance]
- mob_stop_walking(md,1);
-*/
+ if(md->sc_count) {
+ if(md->sc_data[SC_CONFUSION].timer != -1)
+ status_change_end(&md->bl, SC_CONFUSION, -1);
+ }
+
if(damage > max_hp>>2)
skill_stop_dancing(&md->bl);
@@ -2590,7 +2589,8 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
intif_GMmessage(message,strlen(message)+1,0);
}
// Announce first, or else ditem will be freed. [Lance]
- mob_item_drop(md, tick+base_drop_delay+i, ditem, 0, drop_rate);
+ // By popular demand, use base drop rate for autoloot code. [Skotlex]
+ mob_item_drop(md, tick+base_drop_delay+i, ditem, 0, md->db->dropitem[i].p);
}
// Ore Discovery [Celest]
diff --git a/src/map/pc.c b/src/map/pc.c
index adc090e87..afafbe4c8 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -818,6 +818,8 @@ int pc_authok(struct map_session_data *sd, int login_id2, time_t connect_until_t
// Notify everyone that this char logged in [Skotlex].
clif_foreachclient(clif_friendslist_toggle_sub, sd->status.account_id, sd->status.char_id, 1);
+ //Prevent S. Novices from getting the no-death bonus just yet. [Skotlex]
+ sd->die_counter=-1;
sd->feel_level=-1;
//Until the reg values arrive, set them to not require trigger...
sd->state.event_death = 1;
@@ -906,7 +908,8 @@ int pc_reg_received(struct map_session_data *sd)
sd->change_level = pc_readglobalreg(sd,"jobchange_level");
sd->die_counter = pc_readglobalreg(sd,"PC_DIE_COUNTER");
-
+ if (!sd->die_counter && (sd->class_&MAPID_UPPERMASK) == MAPID_SUPER_NOVICE)
+ status_calc_pc(sd, 0); //Check +10 to all stats bonus.
if (pc_checkskill(sd, TK_MISSION)) {
sd->mission_mobid = pc_readglobalreg(sd,"TK_MISSION_ID");
sd->mission_count = pc_readglobalreg(sd,"TK_MISSION_COUNT");
@@ -5328,7 +5331,8 @@ int pc_damage(struct block_list *src,struct map_session_data *sd,int damage)
status_change_end(&sd->bl, SC_GRAVITATION, -1);
}
}
-
+ if (sd->sc_data[SC_CONFUSION].timer != -1)
+ status_change_end(&sd->bl, SC_CONFUSION, -1);
}
// 演奏/ダンスの中?
diff --git a/src/map/skill.c b/src/map/skill.c
index b7426beff..c6d627582 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -902,9 +902,9 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int
if (dstsd && dstsd->status.sp < 5*tsc_data[SC_KAAHI].val1)
; //Not enough SP to cast
else {
- rate = battle_heal(bl, bl, 200*tsc_data[SC_KAAHI].val1, -5*tsc_data[SC_KAAHI].val1, 1);
+ battle_heal(bl, bl, 200*tsc_data[SC_KAAHI].val1, -5*tsc_data[SC_KAAHI].val1, 1);
if(dstsd && dstsd->fd)
- clif_heal(dstsd->fd,SP_HP,rate);
+ clif_heal(dstsd->fd,SP_HP,200*tsc_data[SC_KAAHI].val1);
}
}
}
@@ -2732,7 +2732,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl,int s
if (!(flag&1) && sc_data && sc_data[SC_SPIRIT].timer != -1 && sc_data[SC_SPIRIT].val2 == SL_MONK)
{ //Becomes a splash attack when Soul Linked.
map_foreachinarea(skill_area_sub,
- bl->m,bl->x-5,bl->y-5,bl->x+5,bl->y+5,BL_CHAR,
+ bl->m,bl->x-2,bl->y-2,bl->x+2,bl->y+2,BL_CHAR,
src,skillid,skilllv,tick, flag|BCT_ENEMY|1,
skill_castend_damage_id);
} else
@@ -9365,39 +9365,41 @@ void skill_repairweapon(struct map_session_data *sd, int idx)
int material;
int materials[4] = { 1002, 998, 999, 756 };
struct item *item;
+ struct map_session_data *target_sd;
nullpo_retv(sd);
- nullpo_retv(sd->repair_target);
-
+ target_sd = map_id2sd(sd->repair_target);
+ sd->repair_target = 0;
+ if (!target_sd) //Failed....
+ return;
if(idx==0xFFFF) // No item selected ('Cancel' clicked)
return;
+ if(idx < 0 || idx >= MAX_INVENTORY)
+ return; //Invalid index??
- item = &sd->repair_target->status.inventory[idx];
+ item = &target_sd->status.inventory[idx];
+ if(item->nameid <= 0 || item->attribute == 0)
+ return; //Again invalid item....
- if(sd!=sd->repair_target && !battle_check_range(&sd->bl,&sd->repair_target->bl,skill_get_range2(&sd->bl, sd->skillid,sd->skilllv))){
+ if(sd!=target_sd && !battle_check_range(&sd->bl,&target_sd->bl,skill_get_range2(&sd->bl, sd->skillid,sd->skilllv))){
clif_item_repaireffect(sd,item->nameid,1);
return;
}
- if(idx >= 0 && idx < MAX_INVENTORY) {
- if(item->nameid > 0 && item->attribute == 1 ) {
- if (itemdb_type(item->nameid)==4)
- material = materials [itemdb_wlv(item->nameid)-1]; // Lv1/2/3/4 weapons consume 1 Iron Ore/Iron/Steel/Rough Oridecon
- else
- material = materials [2]; // Armors consume 1 Steel
- if (pc_search_inventory(sd,material) < 0 ) {
- clif_skill_fail(sd,sd->skillid,0,0);
- return;
- }
- item->attribute=0;
- clif_equiplist(sd->repair_target);
- pc_delitem(sd,pc_search_inventory(sd,material),1,0);
- clif_item_repaireffect(sd,item->nameid,0);
- if(sd!=sd->repair_target)
- clif_item_repaireffect(sd->repair_target,item->nameid,0);
- sd->repair_target=NULL;
- }
+ if (itemdb_type(item->nameid)==4)
+ material = materials [itemdb_wlv(item->nameid)-1]; // Lv1/2/3/4 weapons consume 1 Iron Ore/Iron/Steel/Rough Oridecon
+ else
+ material = materials [2]; // Armors consume 1 Steel
+ if (pc_search_inventory(sd,material) < 0 ) {
+ clif_skill_fail(sd,sd->skillid,0,0);
+ return;
}
+ item->attribute=0;
+ clif_equiplist(target_sd);
+ pc_delitem(sd,pc_search_inventory(sd,material),1,0);
+ clif_item_repaireffect(sd,item->nameid,0);
+ if(sd!=target_sd)
+ clif_item_repaireffect(target_sd,item->nameid,0);
}
/*==========================================
diff --git a/src/map/status.c b/src/map/status.c
index 28896aceb..53e6009e9 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -570,6 +570,7 @@ void initStatusIconChangeTable(void) {
StatusIconChangeTable[SC_REJECTSWORD] = SI_REJECTSWORD;
StatusIconChangeTable[SC_MARIONETTE] = SI_MARIONETTE;
StatusIconChangeTable[SC_MARIONETTE2] = SI_MARIONETTE2;
+ StatusIconChangeTable[SC_BLEEDING] = SI_BLEEDING;
StatusIconChangeTable[SC_MOONLIT] = SI_MOONLIT;
StatusIconChangeTable[SC_DEVOTION] = SI_DEVOTION;
StatusIconChangeTable[SC_STEELBODY] = SI_STEELBODY;