summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/battle.c1
-rw-r--r--src/map/battle.h1
-rw-r--r--src/map/clif.c11
-rw-r--r--src/map/pc.c3
-rw-r--r--src/map/script.c6
-rw-r--r--src/map/script.h1
-rw-r--r--src/map/skill.c5
-rw-r--r--src/map/status.c2
-rw-r--r--src/map/unit.c21
9 files changed, 27 insertions, 24 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 7fc9ad237..949b91a29 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -5913,6 +5913,7 @@ static const struct _battle_data {
{ "skill_trap_type", &battle_config.skill_trap_type, 0, 0, 1, },
{ "item_restricted_consumption_type", &battle_config.item_restricted_consumption_type,1, 0, 1, },
{ "max_walk_path", &battle_config.max_walk_path, 17, 1, MAX_WALKPATH, },
+ { "item_enabled_npc", &battle_config.item_enabled_npc, 1, 0, 1, },
};
#ifndef STATS_OPT_OUT
/**
diff --git a/src/map/battle.h b/src/map/battle.h
index 14bd70fee..0e888fc9e 100644
--- a/src/map/battle.h
+++ b/src/map/battle.h
@@ -489,6 +489,7 @@ extern struct Battle_Config
int skill_trap_type;
int item_restricted_consumption_type;
int max_walk_path;
+ int item_enabled_npc;
} battle_config;
diff --git a/src/map/clif.c b/src/map/clif.c
index 82ff333a1..ea05baa3c 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -10207,10 +10207,10 @@ void clif_parse_EquipItem(int fd,struct map_session_data *sd)
if (index < 0 || index >= MAX_INVENTORY)
return; //Out of bounds check.
- if(sd->npc_id) {
- if (sd->npc_id != sd->npc_item_flag)
+ if( sd->npc_id )
+ if ( !sd->npc_item_flag )
return;
- } else if (sd->state.storage_flag || sd->sc.opt1)
+ else if ( sd->state.storage_flag || sd->sc.opt1 )
; //You can equip/unequip stuff while storage is open/under status changes
else if ( pc_cant_act2(sd) )
return;
@@ -10247,7 +10247,10 @@ void clif_parse_UnequipItem(int fd,struct map_session_data *sd)
return;
}
- if (sd->state.storage_flag || sd->sc.opt1)
+ if( sd->npc_id )
+ if ( !sd->npc_item_flag )
+ return;
+ else if ( sd->state.storage_flag || sd->sc.opt1 )
; //You can equip/unequip stuff while storage is open/under status changes
else if ( pc_cant_act2(sd) )
return;
diff --git a/src/map/pc.c b/src/map/pc.c
index 7eae16193..a3b1335c9 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -4232,8 +4232,7 @@ int pc_useitem(struct map_session_data *sd,int n)
nullpo_ret(sd);
- //This flag enables you to use items while in an NPC. [Skotlex]
- if( sd->npc_id && sd->npc_id != sd->npc_item_flag ){
+ if( sd->npc_id ){
#ifdef RENEWAL
clif_msg(sd, 0x783); // TODO look for the client date that has this message.
#endif
diff --git a/src/map/script.c b/src/map/script.c
index c4ee96feb..604872dfd 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -3017,6 +3017,7 @@ struct script_state* script_alloc_state(struct script_code* script, int pos, int
st->rid = rid;
st->oid = oid;
st->sleep.timer = INVALID_TIMER;
+ st->npc_item_flag = battle_config.item_enabled_npc;
return st;
}
@@ -3644,6 +3645,7 @@ static void script_attach_state(struct script_state* st)
}
sd->st = st;
sd->npc_id = st->oid;
+ sd->npc_item_flag = st->npc_item_flag; // load default.
/**
* For the Secure NPC Timeout option (check config/Secure.h) [RR]
**/
@@ -6964,7 +6966,7 @@ BUILDIN_FUNC(enableitemuse)
TBL_PC *sd;
sd=script_rid2sd(st);
if (sd)
- sd->npc_item_flag = st->oid;
+ st->npc_item_flag = sd->npc_item_flag = 1;
return 0;
}
@@ -6973,7 +6975,7 @@ BUILDIN_FUNC(disableitemuse)
TBL_PC *sd;
sd=script_rid2sd(st);
if (sd)
- sd->npc_item_flag = 0;
+ st->npc_item_flag = sd->npc_item_flag = 0;
return 0;
}
diff --git a/src/map/script.h b/src/map/script.h
index b27b3d290..3e7f3087f 100644
--- a/src/map/script.h
+++ b/src/map/script.h
@@ -132,6 +132,7 @@ struct script_state {
int bk_npcid;
unsigned freeloop : 1;// used by buildin_freeloop
unsigned op2ref : 1;// used by op_2
+ unsigned npc_item_flag : 1;
};
struct script_reg {
diff --git a/src/map/skill.c b/src/map/skill.c
index 6486d0772..8fdc09cb7 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -9227,6 +9227,11 @@ int skill_castend_id(int tid, unsigned int tick, int id, intptr_t data)
inf &= ~BCT_NEUTRAL;
}
+ if( sd && (inf2&INF2_CHORUS_SKILL) && skill_check_pc_partner(sd, ud->skill_id, &ud->skill_lv, 1, 0) < 1 ) {
+ clif_skill_fail(sd, ud->skill_id, USESKILL_FAIL_NEED_HELPER, 0);
+ break;
+ }
+
if( ud->skill_id >= SL_SKE && ud->skill_id <= SL_SKA && target->type == BL_MOB )
{
if( ((TBL_MOB*)target)->class_ == MOBID_EMPERIUM )
diff --git a/src/map/status.c b/src/map/status.c
index cf2c096c9..01f3fda1e 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -7344,7 +7344,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
#endif
break;
case SC_SUITON:
- if (!val2 || (sd && (sd->class_&MAPID_UPPERMASK) == MAPID_NINJA)) {
+ if (!val2 || (sd && (sd->class_&MAPID_BASEMASK) == MAPID_NINJA)) {
//No penalties.
val2 = 0; //Agi penalty
val3 = 0; //Walk speed penalty
diff --git a/src/map/unit.c b/src/map/unit.c
index 388c3757d..b1ca64d4c 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -1119,6 +1119,12 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui
tstatus = status_get_status_data(target);
// Record the status of the previous skill)
if(sd) {
+
+ if( (skill_get_inf2(skill_id)&INF2_ENSEMBLE_SKILL) && skill_check_pc_partner(sd, skill_id, &skill_lv, 1, 0) < 1 ) {
+ clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
+ return 0;
+ }
+
switch(skill_id){
case SA_CASTCANCEL:
if(ud->skill_id != skill_id){
@@ -1134,21 +1140,6 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui
}
sd->skill_id_old = skill_id;
break;
- case BD_LULLABY:
- case BD_RICHMANKIM:
- case BD_ETERNALCHAOS:
- case BD_DRUMBATTLEFIELD:
- case BD_RINGNIBELUNGEN:
- case BD_ROKISWEIL:
- case BD_INTOABYSS:
- case BD_SIEGFRIED:
- case CG_MOONLIT:
- if (skill_check_pc_partner(sd, skill_id, &skill_lv, 1, 0) < 1)
- {
- clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
- return 0;
- }
- break;
case WL_WHITEIMPRISON:
if( battle_check_target(src,target,BCT_SELF|BCT_ENEMY) < 0 ) {
clif_skill_fail(sd,skill_id,USESKILL_FAIL_TOTARGET,0);