From a593fe1fbf19e988d61678ba9c00049a236baf11 Mon Sep 17 00:00:00 2001 From: HoraK-FDF Date: Sat, 7 Aug 2021 21:21:02 +0200 Subject: changed back to switch and replaced ids with constants --- npc/magic/final.txt | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/npc/magic/final.txt b/npc/magic/final.txt index 055fe495..5250bcf8 100644 --- a/npc/magic/final.txt +++ b/npc/magic/final.txt @@ -244,13 +244,21 @@ function script HUB_PCBonus { { // atm trolls can use raging, I thought it's ok since they do damage over Str and have only a range of 3 @item_crit = 0; - - if (getequipname(EQI_HEAD_TOP) == "AssassinMask" || getequipname(EQI_HEAD_TOP) == "BullHelmet") - @item_crit = 15; - else if (getequipname(EQI_HEAD_TOP) == "Monocle" || getequipname(EQI_HEAD_TOP) == "Pipe") - @item_crit = 10; - - if (getequipname(EQI_HAND_R) == "Beheader") + switch (getequipid(EQI_HEAD_TOP)) + { + case AssassinMask: + case BullHelmet: + @item_crit = 15; + break; + case Monocle: + case Pipe: + @item_crit = 10; + break; + default: + @item_crit = 0; + break; + } + if (getequipid(EQI_HAND_R) == Beheader) @item_crit -= 25; bonus bCritical, (getskilllv(SKILL_RAGING))*((readparam2(UDT_DEX)/40)+(readparam2(UDT_LUK)/30)+(@item_crit/10)+(readparam2(UDT_STR)/10)-2); -- cgit v1.2.3-60-g2f50