diff options
-rw-r--r-- | npc/functions/refine.txt | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/npc/functions/refine.txt b/npc/functions/refine.txt index 79ec82f5a..e940ab635 100644 --- a/npc/functions/refine.txt +++ b/npc/functions/refine.txt @@ -19,13 +19,25 @@ function script refineMaster { mesq l("And if the item breaks, that's your loss. What to refine?"); next; + function rif_refine { + .@slot = getarg(0); + .@text = getarg(1); + // Two-handed weapons are already handled under EQI_HAND_R + if (.@slot == EQI_HAND_L && (getequipid(EQI_HAND_L) == getequipid(EQI_HAND_R))) + return ""; + if (getequipisequiped(.@slot) && getequipisenableref(.@slot)) + return l(.@text, getequipname(.@slot)); + return ""; + } + // Dark magic from hercules used, take care menuint l("Nothing, thanks"), 0, - rif(getequipisequiped(EQI_HEAD_MID), l("My chestplate, @@", getequipname(EQI_HEAD_MID))), EQI_HEAD_MID, - rif(getequipisequiped(EQI_HAND_R), l("My weapon, @@", getequipname(EQI_HAND_R))), EQI_HAND_R, - rif(getequipisequiped(EQI_HAND_L) && getequipid(EQI_HAND_L) != getequipid(EQI_HAND_R), l("My shield, @@", getequipname(EQI_HAND_L))), EQI_HAND_L, - rif(getequipisequiped(EQI_HEAD_TOP), l("My helmet, @@", getequipname(EQI_HEAD_TOP))), EQI_HEAD_TOP, + rif_refine(EQI_HEAD_TOP, "My helmet, @@"), EQI_HEAD_TOP, + rif_refine(EQI_HEAD_MID, "My chestplate, @@"), EQI_HEAD_MID, + rif_refine(EQI_HAND_R, "My weapon, @@"), EQI_HAND_R, + rif_refine(EQI_HAND_L, "My shield, @@"), EQI_HAND_L, + rif_refine(EQI_SHOES, "My footwear, @@"), EQI_SHOES, l("Item break? Too dangerous! I don't want it!!"), 0; |