summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/login/login.c2
-rw-r--r--src/map/battle.c6
-rw-r--r--src/map/clif.c20
-rw-r--r--src/map/pc.c14
-rw-r--r--src/map/script.c7
-rw-r--r--src/map/skill.c3
-rw-r--r--src/map/unit.c1
7 files changed, 36 insertions, 17 deletions
diff --git a/src/login/login.c b/src/login/login.c
index 5a6ed4829..839e3f2e5 100644
--- a/src/login/login.c
+++ b/src/login/login.c
@@ -3031,7 +3031,7 @@ int parse_admin(int fd) {
int lan_subnetcheck(long *p) {
int i;
- unsigned char *sbn, *msk, *src = (unsigned char *)p;
+ unsigned char *sbn, *msk/*, *src = (unsigned char *)p*/;
for(i=0; i<subnet_count; i++) {
diff --git a/src/map/battle.c b/src/map/battle.c
index 1cce2fcba..6acee440e 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -1377,6 +1377,9 @@ static struct Damage battle_calc_weapon_attack(
case AS_SONICBLOW:
skillratio += -50+5*skill_lv;
break;
+ case AS_VENOMKNIFE:
+ flag.cardfix = 0;
+ break;
case TF_SPRINKLESAND:
skillratio += 30;
break;
@@ -1639,7 +1642,8 @@ static struct Damage battle_calc_weapon_attack(
if(sc->data[SC_EDP].timer != -1 &&
skill_num != ASC_BREAKER &&
- skill_num != ASC_METEORASSAULT)
+ skill_num != ASC_METEORASSAULT &&
+ skill_num != AS_VENOMKNIFE)
ATK_ADDRATE(sc->data[SC_EDP].val3);
}
diff --git a/src/map/clif.c b/src/map/clif.c
index 198b7de79..0eaab5ce3 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -8489,8 +8489,10 @@ void clif_parse_GetCharNameRequest(int fd, struct map_session_data *sd) {
if (!bl) return;
sc = status_get_sc(bl);
- if (sc && sc->option&OPTION_INVISIBLE && !disguised(bl) && pc_isGM(sd) < battle_config.hack_info_GM_level)
- {
+ if (sc && sc->option&OPTION_INVISIBLE && !disguised(bl) &&
+ bl->type != BL_NPC && //Skip hidden NPCs which can be seen using Maya Purple
+ pc_isGM(sd) < battle_config.hack_info_GM_level
+ ) {
//GM characters (with client side GM enabled are able to see invisible stuff) [Lance]
//Asked name of invisible player, this shouldn't be possible!
//Possible bot? Thanks to veider and qspirit
@@ -9703,14 +9705,17 @@ void clif_parse_UseSkillToId(int fd, struct map_session_data *sd) {
if(target_id<0 && -target_id == sd->bl.id) // for disguises [Valaris]
target_id = sd->bl.id;
-
+
+ if(sd->menuskill_id)
+ return; //Can't use skills while a menu is open.
+
if (sd->skillitem == skillnum) {
if (skilllv != sd->skillitemlv)
skilllv = sd->skillitemlv;
unit_skilluse_id(&sd->bl, target_id, skillnum, skilllv);
return;
}
-
+
sd->skillitem = sd->skillitemlv = 0;
if (skillnum == MO_EXTREMITYFIST) {
if ((sd->sc.data[SC_COMBO].timer == -1 ||
@@ -9801,7 +9806,11 @@ void clif_parse_UseSkillToPosSub(int fd, struct map_session_data *sd, int skilll
if(sd->sc.option&(OPTION_WEDDING|OPTION_XMAS))
return;
+ if(sd->menuskill_id)
+ return; //Can't use skills while a menu is open.
+
pc_delinvincibletimer(sd);
+
if (sd->skillitem == skillnum) {
if (skilllv != sd->skillitemlv)
skilllv = sd->skillitemlv;
@@ -9864,6 +9873,9 @@ void clif_parse_UseSkillMap(int fd,struct map_session_data *sd)
if(sd->sc.option&(OPTION_WEDDING|OPTION_XMAS))
return;
+ if(sd->menuskill_id && sd->menuskill_id != RFIFOW(fd,2))
+ return; //Can't use skills while a menu is open.
+
pc_delinvincibletimer(sd);
skill_castend_map(sd,RFIFOW(fd,2),(char*)RFIFOP(fd,4));
diff --git a/src/map/pc.c b/src/map/pc.c
index 88b7fde40..1dd9fa7f3 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -1193,7 +1193,7 @@ static int pc_bonus_autospell_del(struct s_autospell *spell, int max, short id,
if (i<0) return 0; //Nothing to substract from.
j = i;
- for(; i>=0 && rate > 0; i--)
+ for(; i>=0 && rate>0; i--)
{
if (spell[i].id != id || spell[i].lv != lv) continue;
if (rate >= spell[i].rate) {
@@ -1207,6 +1207,13 @@ static int pc_bonus_autospell_del(struct s_autospell *spell, int max, short id,
rate = 0;
}
}
+ if (rate > 0 && ++j < max)
+ { //Tag this as "pending" autospell to remove.
+ spell[j].id = id;
+ spell[j].lv = lv;
+ spell[j].rate = -rate;
+ spell[j].card_id = 0;
+ }
return rate;
}
@@ -1216,12 +1223,13 @@ static int pc_bonus_autospell(struct s_autospell *spell, int max, short id, shor
pc_bonus_autospell_del(spell, max, id, lv, -rate, card_id);
for (i = 0; i < max && spell[i].id; i++) {
- if (spell[i].card_id == card_id &&
+ if ((spell[i].card_id == card_id || !spell[i].card_id) &&
spell[i].id == id && spell[i].lv == lv)
{
- if (!battle_config.autospell_stacking)
+ if (!battle_config.autospell_stacking && spell[i].rate > 0)
return 0;
rate += spell[i].rate;
+ if (rate < 0) card_id = 0; //Reduced from debted autospell.
break;
}
}
diff --git a/src/map/script.c b/src/map/script.c
index c8d1ef2a8..e3341d546 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -12936,16 +12936,13 @@ BUILDIN_FUNC(getvariableofnpc)
st->state = END;
return 1;
}
- else if( nd == NULL || nd->bl.subtype != SCRIPT || nd->u.scr.script == NULL )
+ if( nd == NULL || nd->bl.subtype != SCRIPT || nd->u.scr.script == NULL )
{// NPC not found or has no script
ShowError("script: getvariableofnpc: can't find npc %s\n", npc_name);
st->state = END;
return 1;
}
- else
- {// push variable reference
- push_val2(st->stack, C_NAME, num, &nd->u.scr.script->script_vars );
- }
+ push_val2(st->stack, C_NAME, num, &nd->u.scr.script->script_vars );
}
return 0;
}
diff --git a/src/map/skill.c b/src/map/skill.c
index e70aa222e..8a46abe2a 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -851,9 +851,6 @@ int skillnotok (int skillid, struct map_session_data *sd)
if (battle_config.gm_skilluncond && pc_isGM(sd) >= battle_config.gm_skilluncond)
return 0; // gm's can do anything damn thing they want
- if(sd->menuskill_id && skillid != sd->menuskill_id)
- return 1; //Can't use skills while a menu is open.
-
// Check skill restrictions [Celest]
if(!map_flag_vs(m) && skill_get_nocast (skillid) & 1)
return 1;
diff --git a/src/map/unit.c b/src/map/unit.c
index 79dcd3a80..984867cfe 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -809,6 +809,7 @@ int unit_skilluse_id2(struct block_list *src, int target_id, int skill_num, int
//Target_id checking.
if(skillnotok(skill_num, sd)) // [MouseJstr]
return 0;
+
switch(skill_num)
{ //Check for skills that auto-select target
case MO_CHAINCOMBO: