summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--db/re/item_db.conf51
-rw-r--r--npc/items/inc_sc_bonus.txt48
-rw-r--r--npc/scripts.conf1
3 files changed, 100 insertions, 0 deletions
diff --git a/db/re/item_db.conf b/db/re/item_db.conf
index 9174ec7f0..bd56d8db7 100644
--- a/db/re/item_db.conf
+++ b/db/re/item_db.conf
@@ -2816,6 +2816,57 @@ item_db: (
sc_start SC_INCHIT,20000,40;
">
},
+{
+ Id: 648
+ AegisName: "IncLukAPotion"
+ Name: "Inc Luck Potion"
+ Type: "IT_USABLE"
+ Buy: 1000000
+ Sell: 0
+ Weight: 20
+ Refine: false
+ Script: <"
+ @min = 5;
+ @max = 10;
+ @delay = 20;
+ @type = SC_INCLUK;
+ doevent "inc_sc_bonus::OnUse";
+ ">
+},
+{
+ Id: 649
+ AegisName: "IncLukBPotion"
+ Name: "Inc Luck+ Potion"
+ Type: "IT_USABLE"
+ Buy: 1000000
+ Sell: 0
+ Weight: 20
+ Refine: false
+ Script: <"
+ @min = 10;
+ @max = 20;
+ @delay = 15;
+ @type = SC_INCLUK;
+ doevent "inc_sc_bonus::OnUse";
+ ">
+},
+{
+ Id: 650
+ AegisName: "IncLukCPotion"
+ Name: "Inc Luck++ Potion"
+ Type: "IT_USABLE"
+ Buy: 1000000
+ Sell: 0
+ Weight: 20
+ Refine: false
+ Script: <"
+ @min = 20;
+ @max = 30;
+ @delay = 10;
+ @type = SC_INCLUK;
+ doevent "inc_sc_bonus::OnUse";
+ ">
+},
// Mounts (690 to 699, probably there will be extra IDs)
{
diff --git a/npc/items/inc_sc_bonus.txt b/npc/items/inc_sc_bonus.txt
new file mode 100644
index 000000000..a4f7cdac5
--- /dev/null
+++ b/npc/items/inc_sc_bonus.txt
@@ -0,0 +1,48 @@
+// TMW-2 Script.
+// Author:
+// Jesusalva
+// Description:
+// Applies effects for INC_* (STR doesn't exist)
+// Valid values: INCAGI INCVIT INCINT INCDEX INCLUK INCHIT
+/// Untested Values: INCHIT INCFLEE INCMHP INCMSP WALKSPEED INVINCIBLE
+//
+// Variables:
+// @delay Second of buffing
+// @min Min amount of type
+// @max Max amount of type
+// @type SC_*
+
+- script inc_sc_bonus -1,{
+OnUse:
+ if (@delay <= 0) close;
+
+ // Get the bonus value
+ .@bonus=rand(@min, @max);
+
+ // Remaining time and effect conversion
+ @v=getstatus(@type, 1);
+ @t=getstatus(@type, 5);
+
+ // Convert remaining time to seconds, rounded down
+ if (@t > 1000)
+ @t=@t/1000;
+ else
+ @t=0;
+
+ // If there was effect previously, get ponderate average
+ if (@v > 0)
+ @v=(.@bonus*@delay+@v*@t)/(@t+@delay);
+ else
+ @v=.@bonus;
+
+ // Update time value to ms and to stack
+ @t+=@delay;
+ @t*=1000;
+
+ // Restart the bonus
+ sc_end @type;
+ sc_start @type,@t,@v;
+
+ close;
+}
+
diff --git a/npc/scripts.conf b/npc/scripts.conf
index 4bf722fdf..05a55604c 100644
--- a/npc/scripts.conf
+++ b/npc/scripts.conf
@@ -27,6 +27,7 @@
"npc/functions/scoreboards.txt",
"npc/functions/random-talk.txt",
"npc/items/rand_sc_heal.txt",
+"npc/items/inc_sc_bonus.txt",
"npc/commands/event.txt",
// config script