summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--db/pre-re/item_db.conf32
-rw-r--r--npc/items/require_stat.txt16
2 files changed, 16 insertions, 32 deletions
diff --git a/db/pre-re/item_db.conf b/db/pre-re/item_db.conf
index c0b98c8e..ff2f96d1 100644
--- a/db/pre-re/item_db.conf
+++ b/db/pre-re/item_db.conf
@@ -874,9 +874,7 @@ item_db: (
BindOnEquip: false
Subtype: "W_2HSTAFF"
OnEquipScript: <"
- set @bStat, readparam(bInt);
- set @minbStatVal, 60;
- callfunc "RequireStat";
+ callfunc "RequireStat", bInt, 60, EQI_HAND_R;
">
},
{
@@ -900,9 +898,7 @@ item_db: (
BindOnEquip: false
Subtype: "W_STAFF"
OnEquipScript: <"
- set @bStat, readparam(bInt);
- set @minbStatVal, 5;
- callfunc "RequireStat";
+ callfunc "RequireStat", bInt, 5, EQI_HAND_R;
">
},
{
@@ -973,9 +969,7 @@ item_db: (
BindOnEquip: false
Subtype: "W_BOW"
OnEquipScript: <"
- set @bStat, readparam(bDex);
- set @minbStatVal, 80;
- callfunc "RequireStat";
+ callfunc "RequireStat", bDex, 80, EQI_HAND_R;
bonus2 bHPDrainRate, 100, -2;
bonus bAspdRate, 20;
bonus bMaxHP, -150;
@@ -6251,12 +6245,8 @@ item_db: (
BindOnEquip: false
Delay: 0
OnEquipScript: <"
- set @bStat, readparam(bInt);
- set @minbStatVal, 70;
- callfunc "RequireStat";
- set @bStat, readparam(bVit);
- set @minbStatVal, 40;
- callfunc "RequireStat";
+ callfunc "RequireStat", bInt, 70, EQI_HEAD_MID;
+ callfunc "RequireStat", bVit, 40, EQI_HEAD_MID;
bonus bSpeedAddRate, -15;
bonus bDef2Rate, -40;
bonus bMdef, 60;
@@ -10923,15 +10913,9 @@ item_db: (
BindOnEquip: false
Delay: 0
OnEquipScript: <"
- set @bStat, readparam(bStr);
- set @minbStatVal, 70;
- callfunc "RequireStat";
- set @bStat, readparam(bVit);
- set @minbStatVal, 50;
- callfunc "RequireStat";
- set @bStat, readparam(bLuk);
- set @minbStatVal, 50;
- callfunc "RequireStat";
+ callfunc "RequireStat", bStr, 70, EQI_HEAD_TOP;
+ callfunc "RequireStat", bVit, 50, EQI_HEAD_TOP;
+ callfunc "RequireStat", bLuk, 50, EQI_HEAD_TOP;
bonus bAtkRange, -10;
bonus bDoubleAddRate, 20;
bonus bStr, 10;
diff --git a/npc/items/require_stat.txt b/npc/items/require_stat.txt
index cd274b62..7ff2b101 100644
--- a/npc/items/require_stat.txt
+++ b/npc/items/require_stat.txt
@@ -1,13 +1,13 @@
-
+// Unequip if stat not enough
+// callfunc "RequireStat", bDex, 80, EQI_HAND_R;
function script RequireStat {
- @bStatVal = @bStat;
+ .@stat = getarg(0);
+ .@min = getarg(1);
+ .@me = getarg(2);
+ .@val = readparam(.@stat);
// If the requirement isn't met, we set an unequip trigger.
// The item is now removed.
- if (@bStat < @minbStatVal)
- goto L_Unequip;
- return;
-
-L_Unequip:
- callfunc "UnequipLater";
+ if (.@val < .@min)
+ unequip(.@me);
return;
}