diff options
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/atcommand.c | 66 | ||||
-rw-r--r-- | src/map/atcommand.h | 1 | ||||
-rw-r--r-- | src/map/battle.c | 12 | ||||
-rw-r--r-- | src/map/log.c | 10 | ||||
-rw-r--r-- | src/map/map.c | 2 | ||||
-rw-r--r-- | src/map/map.h | 4 | ||||
-rw-r--r-- | src/map/pc.c | 2 | ||||
-rw-r--r-- | src/map/skill.c | 5 | ||||
-rw-r--r-- | src/map/status.c | 4 |
9 files changed, 48 insertions, 58 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index cad421633..49af1a70f 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -77,7 +77,6 @@ ACMD_FUNC(heal); ACMD_FUNC(item);
ACMD_FUNC(item2);
ACMD_FUNC(itemreset);
-ACMD_FUNC(itemcheck);
ACMD_FUNC(baselevelup);
ACMD_FUNC(joblevelup);
ACMD_FUNC(help);
@@ -356,7 +355,6 @@ static AtCommandInfo atcommand_info[] = { { AtCommand_Item, "@item", 60, atcommand_item },
{ AtCommand_Item2, "@item2", 60, atcommand_item2 },
{ AtCommand_ItemReset, "@itemreset", 40, atcommand_itemreset },
- { AtCommand_ItemCheck, "@itemcheck", 60, atcommand_itemcheck },
{ AtCommand_BaseLevelUp, "@lvup", 60, atcommand_baselevelup },
{ AtCommand_BaseLevelUp, "@blevel", 60, atcommand_baselevelup },
{ AtCommand_BaseLevelUp, "@baselvlup", 60, atcommand_baselevelup },
@@ -525,7 +523,7 @@ static AtCommandInfo atcommand_info[] = { { AtCommand_Trade, "@trade", 60, atcommand_trade },
{ AtCommand_Send, "@send", 60, atcommand_send },
{ AtCommand_SetBattleFlag, "@setbattleflag", 99, atcommand_setbattleflag },
- { AtCommand_UnMute, "@unmute", 60, atcommand_unmute }, // [Valaris]
+ { AtCommand_UnMute, "@unmute", 80, atcommand_unmute }, // [Valaris]
{ AtCommand_Clearweather, "@clearweather", 99, atcommand_clearweather }, // Dexity
{ AtCommand_UpTime, "@uptime", 1, atcommand_uptime }, // by MC Cameri
{ AtCommand_ChangeSex, "@changesex", 60, atcommand_changesex }, // by MC Cameri <- do we still need this? [Foruken] <- why not? [Skotlex]
@@ -2756,20 +2754,6 @@ int atcommand_itemreset( }
/*==========================================
- *
- *------------------------------------------
- */
-int atcommand_itemcheck(
- const int fd, struct map_session_data* sd,
- const char* command, const char* message)
-{
- nullpo_retr(-1, sd);
- pc_checkitem(sd);
-
- return 0;
-}
-
-/*==========================================
* Atcommand @lvlup
*------------------------------------------
*/
@@ -7167,12 +7151,12 @@ atcommand_killer( const char* command, const char* message)
{
nullpo_retr(-1, sd);
- sd->special_state.killer = !sd->special_state.killer;
+ sd->state.killer = !sd->state.killer;
- if(sd->special_state.killer)
+ if(sd->state.killer)
clif_displaymessage(fd, msg_txt(241));
- else
- clif_displaymessage(fd, msg_txt(242));
+ else
+ clif_displaymessage(fd, msg_txt(287));
return 0;
}
@@ -7188,12 +7172,12 @@ atcommand_killable( const char* command, const char* message)
{
nullpo_retr(-1, sd);
- sd->special_state.killable = !sd->special_state.killable;
+ sd->state.killable = !sd->state.killable;
- if(sd->special_state.killable)
+ if(sd->state.killable)
clif_displaymessage(fd, msg_txt(242));
- else
- clif_displaymessage(fd, msg_txt(241));
+ else
+ clif_displaymessage(fd, msg_txt(288));
return 0;
}
@@ -7215,14 +7199,14 @@ atcommand_charkillable( return -1;
if((pl_sd=map_nick2sd((char *) message)) == NULL)
- return -1;
+ return -1;
- pl_sd->special_state.killable = !pl_sd->special_state.killable;
+ pl_sd->state.killable = !pl_sd->state.killable;
- if(pl_sd->special_state.killable)
- clif_displaymessage(fd, "The player is now killable");
- else
- clif_displaymessage(fd, "The player is no longer killable");
+ if(pl_sd->state.killable)
+ clif_displaymessage(fd, msg_txt(289));
+ else
+ clif_displaymessage(fd, msg_txt(290));
return 0;
}
@@ -9511,12 +9495,12 @@ atcommand_charkillableid( if((pl_sd= (struct map_session_data *) session[session_id]->session_data) == NULL)
return -1;
- pl_sd->special_state.killable = !pl_sd->special_state.killable;
+ pl_sd->state.killable = !pl_sd->state.killable;
- if(pl_sd->special_state.killable)
- clif_displaymessage(fd, "The player is now killable");
- else
- clif_displaymessage(fd, "The player is no longer killable");
+ if(pl_sd->state.killable)
+ clif_displaymessage(fd, msg_txt(289));
+ else
+ clif_displaymessage(fd, msg_txt(290));
}
else
{
@@ -9550,14 +9534,14 @@ atcommand_charkillableid2( if ((session_id=accountid2sessionid(aid))!=0)
{
if((pl_sd= (struct map_session_data *) session[session_id]->session_data) == NULL)
- return -1;
+ return -1;
- pl_sd->special_state.killable = !pl_sd->special_state.killable;
+ pl_sd->state.killable = !pl_sd->state.killable;
- if(pl_sd->special_state.killable)
- clif_displaymessage(fd, "The player is now killable");
+ if(pl_sd->state.killable)
+ clif_displaymessage(fd, msg_txt(289));
else
- clif_displaymessage(fd, "The player is no longer killable");
+ clif_displaymessage(fd, msg_txt(290));
}
else
{
diff --git a/src/map/atcommand.h b/src/map/atcommand.h index f33e49ba5..d3d746bf2 100644 --- a/src/map/atcommand.h +++ b/src/map/atcommand.h @@ -44,7 +44,6 @@ enum AtCommandType { AtCommand_Item,
AtCommand_Item2,
AtCommand_ItemReset,
- AtCommand_ItemCheck,
AtCommand_BaseLevelUp,
AtCommand_JobLevelUp,
AtCommand_H,
diff --git a/src/map/battle.c b/src/map/battle.c index 6e52cb267..bd9800ffa 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -2722,9 +2722,13 @@ struct Damage battle_calc_attack( int attack_type, memset(&d,0,sizeof(d)); break; } - if (d.damage + d.damage2 < 1 && d.dmg_lv != ATK_LUCKY) - //Miss/Absorbed + if (d.damage + d.damage2 < 1) + { //Miss/Absorbed + //Weapon attacks should go through to cause additional effects. + if (d.dmg_lv != ATK_LUCKY && attack_type&(BF_MAGIC|BF_MISC)) + d.dmg_lv = ATK_FLEE; d.dmotion = 0; + } return d; } @@ -3182,7 +3186,7 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f TBL_PC *sd = (TBL_PC*)t_bl; if (sd->state.monster_ignore && t_bl != s_bl && flag&BCT_ENEMY) return 0; //Global inmunity to attacks. - if (sd->special_state.killable && t_bl != s_bl) + if (sd->state.killable && t_bl != s_bl) { state |= BCT_ENEMY; //Universal Victim strip_enemy = 0; @@ -3241,7 +3245,7 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f case BL_PC: { TBL_PC *sd = (TBL_PC*) s_bl; - if (sd->special_state.killer && s_bl != t_bl) + if (sd->state.killer && s_bl != t_bl) { state |= BCT_ENEMY; //Is on a killing rampage :O strip_enemy = 0; diff --git a/src/map/log.c b/src/map/log.c index c850bab65..cbcdaf0f7 100644 --- a/src/map/log.c +++ b/src/map/log.c @@ -71,7 +71,7 @@ int log_branch(struct map_session_data *sd) #endif
FILE *logfp;
- if(log_config.enable_logs <= 0)
+ if(!log_config.enable_logs)
return 0;
nullpo_retr(0, sd);
#ifndef TXT_ONLY
@@ -168,7 +168,7 @@ int log_pick(struct map_session_data *sd, char *type, int mob_id, int nameid, in int log_zeny(struct map_session_data *sd, char *type, struct map_session_data *src_sd, int amount)
{
// FILE *logfp;
- if(log_config.enable_logs <= 0 || (log_config.zeny!=1 && abs(amount)<log_config.zeny))
+ if(!log_config.enable_logs || (log_config.zeny!=1 && abs(amount)<log_config.zeny))
return 0;
nullpo_retr(0, sd);
@@ -200,7 +200,7 @@ int log_mvpdrop(struct map_session_data *sd, int monster_id, int *log_mvp) {
FILE *logfp;
- if(log_config.enable_logs <= 0)
+ if(!log_config.enable_logs)
return 0;
nullpo_retr(0, sd);
#ifndef TXT_ONLY
@@ -235,7 +235,7 @@ int log_atcommand(struct map_session_data *sd, const char *message) char t_msg[MESSAGE_SIZE*2+1]; //These are the contents of an @ call, so there shouldn't be overflow danger here?
#endif
- if(log_config.enable_logs <= 0)
+ if(!log_config.enable_logs)
return 0;
nullpo_retr(0, sd);
#ifndef TXT_ONLY
@@ -270,7 +270,7 @@ int log_npc(struct map_session_data *sd, const char *message) char t_msg[255+1]; //it's 255 chars MAX.
#endif
- if(log_config.enable_logs <= 0)
+ if(!log_config.enable_logs)
return 0;
nullpo_retr(0, sd);
#ifndef TXT_ONLY
diff --git a/src/map/map.c b/src/map/map.c index 1f4a2ec4b..62570b913 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -502,6 +502,8 @@ int map_moveblock(struct block_list *bl, int x1, int y1, unsigned int tick) { status_change_end(bl, SC_CLOSECONFINE2, -1); // if (sc->data[SC_BLADESTOP].timer != -1) //Won't stop when you are knocked away, go figure... // status_change_end(bl, SC_BLADESTOP, -1); + if (sc->data[SC_BASILICA].timer != -1) + status_change_end(bl, SC_BASILICA, -1); } } if (moveblock) map_delblock_sub(bl,0); diff --git a/src/map/map.h b/src/map/map.h index 0ce66d6b5..5ba672cd7 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -540,13 +540,13 @@ struct map_session_data { unsigned blockedmove :1;
unsigned using_fake_npc :1;
unsigned rewarp :1; //Signals that a player should warp as soon as he is done loading a map. [Skotlex]
+ unsigned killer : 1;
+ unsigned killable : 1;
unsigned short autoloot;
struct guild *gmaster_flag;
} state;
struct {
unsigned char no_weapon_damage, no_magic_damage, no_misc_damage;
- unsigned killer : 1;
- unsigned killable : 1;
unsigned restart_full_recover : 1;
unsigned no_castcancel : 1;
unsigned no_castcancel2 : 1;
diff --git a/src/map/pc.c b/src/map/pc.c index 2095a8ff0..909233ddb 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -2425,6 +2425,8 @@ int pc_insert_card(struct map_session_data *sd,int idx_card,int idx_equip) //Check validity if( nameid <= 0 || cardid <= 0 || + sd->status.inventory[idx_equip].amount < 1 || //These two should never be required due to pc_delitem zero'ing the data. + sd->status.inventory[idx_card].amount < 1 || (sd->inventory_data[idx_equip]->type!=IT_WEAPON && sd->inventory_data[idx_equip]->type!=IT_ARMOR)|| sd->inventory_data[idx_card]->type!=IT_CARD || // Prevent Hack [Ancyker] sd->status.inventory[idx_equip].identify==0 || diff --git a/src/map/skill.c b/src/map/skill.c index 43c1cdc4c..d4fbd4972 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -6094,9 +6094,7 @@ int skill_castend_pos2 (struct block_list *src, int x, int y, int skillid, int s case HP_BASILICA: skill_clear_unitgroup(src); sg = skill_unitsetting(src,skillid,skilllv,x,y,0); - sc_start4(src,type,100, - skilllv,0,BCT_SELF,sg->group_id, - skill_get_time(skillid,skilllv)); + sc_start(src,type,100,skilllv,skill_get_time(skillid,skilllv)); flag|=1; break; case CG_HERMODE: @@ -7355,7 +7353,6 @@ int skill_unit_onout (struct skill_unit *src, struct block_list *bl, unsigned in if (sc && sc->data[type].timer!=-1) status_change_end(bl,type,-1); break; - case UNT_BASILICA: //Clear basilica if the owner moved [Skotlex] case UNT_HERMODE: //Clear Hermode if the owner moved. if (sc && sc->data[type].timer!=-1 && sc->data[type].val3 == BCT_SELF && sc->data[type].val4 == sg->group_id) status_change_end(bl,type,-1); diff --git a/src/map/status.c b/src/map/status.c index 40d9351c9..83f4aa4aa 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -5925,10 +5925,12 @@ int status_change_end( struct block_list* bl , int type,int tid ) } break; case SC_HERMODE: - case SC_BASILICA: //Clear the skill area. [Skotlex] if(sc->data[type].val3 == BCT_SELF) skill_clear_unitgroup(bl); break; + case SC_BASILICA: //Clear the skill area. [Skotlex] + skill_clear_unitgroup(bl); + break; case SC_MOONLIT: //Clear the unit effect. [Skotlex] skill_setmapcell(bl,CG_MOONLIT, sc->data[SC_MOONLIT].val1, CELL_CLRMOONLIT); break; |