diff options
Diffstat (limited to 'src/map/pc.cpp')
-rw-r--r-- | src/map/pc.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/map/pc.cpp b/src/map/pc.cpp index 929143c..db3b372 100644 --- a/src/map/pc.cpp +++ b/src/map/pc.cpp @@ -2731,7 +2731,8 @@ int pc_attack(dumb_ptr<map_session_data> sd, BlockId target_id, int type) if (bl->bl_type == BL::NPC) { // monster npcs [Valaris] - npc_click(sd, target_id); + if (battle_get_class(bl) != INVISIBLE_CLASS && !pc_isdead(sd)) + npc_click(sd, target_id); return 0; } @@ -3352,13 +3353,10 @@ int pc_damage(dumb_ptr<block_list> src, dumb_ptr<map_session_data> sd, if (src && src->bl_type == BL::PC) { // [Fate] PK death, trigger scripts - argrec_t arg[3] = + argrec_t arg[1] = { - {"@killerrid"_s, static_cast<int32_t>(unwrap<BlockId>(src->bl_id))}, {"@victimrid"_s, static_cast<int32_t>(unwrap<BlockId>(sd->bl_id))}, - {"@victimlvl"_s, sd->status.base_level}, }; - npc_event_doall_l(stringish<ScriptLabel>("OnPCKilledEvent"_s), sd->bl_id, arg); npc_event_doall_l(stringish<ScriptLabel>("OnPCKillEvent"_s), src->bl_id, arg); sd->state.pvp_rank = 0; @@ -3487,7 +3485,10 @@ int pc_readparam(dumb_ptr<block_list> bl, SP type) case SP::INT: case SP::DEX: case SP::LUK: - val = battle_get_stat(type, bl); + if (bl && bl->bl_type == BL::PC) + val = bl->is_player()->status.attrs[sp_to_attr(type)]; + else + val = battle_get_stat(type, bl); break; case SP::SPEED: val = battle_get_speed(bl).count(); @@ -3531,6 +3532,12 @@ int pc_readparam(dumb_ptr<block_list> bl, SP type) case SP::CHAR_ID: val = sd ? unwrap<CharId>(sd->status_key.char_id) : 0; break; + case SP::ELTLVL: + val = static_cast<int>(battle_get_element(sd).level); + break; + case SP::ELTTYPE: + val = static_cast<int>(battle_get_element(sd).element); + break; } return val; |