From 890700b108fd4f1ea0b748b6a4eb0b49d85c90ab Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Thu, 30 May 2019 15:46:44 -0300 Subject: Several fixes and now NPCs have their own craft system. So NPCs craft now may give bonuses too - existing craft bonuses maintaned. --- npc/003-3/malindou.txt | 33 ++++++++++++++++++++ npc/003-8/intensebeard.txt | 2 +- npc/012-5/nicholas.txt | 6 +++- npc/craft/options.txt | 69 +++++++++++++++++++++++++++++++++++++++++ npc/functions/clientversion.txt | 3 +- 5 files changed, 110 insertions(+), 3 deletions(-) (limited to 'npc') diff --git a/npc/003-3/malindou.txt b/npc/003-3/malindou.txt index 0942e7765..5e574978e 100644 --- a/npc/003-3/malindou.txt +++ b/npc/003-3/malindou.txt @@ -352,6 +352,39 @@ OnInit: query_sql("ALTER TABLE picklog MODIFY COLUMN `opt_val3` SMALLINT(5) NOT NULL DEFAULT '0';"); query_sql("ALTER TABLE picklog MODIFY COLUMN `opt_val4` SMALLINT(5) NOT NULL DEFAULT '0';"); + // Replace all BugSlayer, ShortGladius, RealBronzeGladius and Backsword + // With a version containing the critical damage option (bCritAtkRate) + // auction table have no faulty items, nor do carts nor do I care w/ rodex + // by the time this query was writen + // IOPT_CRITDMG id is 199 + query_sql("UPDATE `inventory` SET `opt_idx0` = '199', `opt_val0` = '30'"+ + " WHERE `nameid`="+BugSlayer); + query_sql("UPDATE `storage` SET `opt_idx0` = '199', `opt_val0` = '30'"+ + " WHERE `nameid`="+BugSlayer); + query_sql("UPDATE `guild_storage` SET `opt_idx0` = '199', `opt_val0` = '30'"+ + " WHERE `nameid`="+BugSlayer); + + query_sql("UPDATE `inventory` SET `opt_idx0` = '199', `opt_val0` = '30'"+ + " WHERE `nameid`="+ShortGladius); + query_sql("UPDATE `storage` SET `opt_idx0` = '199', `opt_val0` = '30'"+ + " WHERE `nameid`="+ShortGladius); + query_sql("UPDATE `guild_storage` SET `opt_idx0` = '199', `opt_val0` = '30'"+ + " WHERE `nameid`="+ShortGladius); + + query_sql("UPDATE `inventory` SET `opt_idx0` = '199', `opt_val0` = '30'"+ + " WHERE `nameid`="+RealBronzeGladius); + query_sql("UPDATE `storage` SET `opt_idx0` = '199', `opt_val0` = '30'"+ + " WHERE `nameid`="+RealBronzeGladius); + query_sql("UPDATE `guild_storage` SET `opt_idx0` = '199', `opt_val0` = '30'"+ + " WHERE `nameid`="+RealBronzeGladius); + + query_sql("UPDATE `inventory` SET `opt_idx0` = '199', `opt_val0` = '30'"+ + " WHERE `nameid`="+Backsword); + query_sql("UPDATE `storage` SET `opt_idx0` = '199', `opt_val0` = '30'"+ + " WHERE `nameid`="+Backsword); + query_sql("UPDATE `guild_storage` SET `opt_idx0` = '199', `opt_val0` = '30'"+ + " WHERE `nameid`="+Backsword); + $UPDATE=1558965422; debugmes ""; debugmes "* picklog options Update"; diff --git a/npc/003-8/intensebeard.txt b/npc/003-8/intensebeard.txt index 7fdbbd854..f82d41e4e 100644 --- a/npc/003-8/intensebeard.txt +++ b/npc/003-8/intensebeard.txt @@ -133,7 +133,7 @@ else mesc l("Not enough Monster Points!"), 1; break; - + } } while (@menu != 1); close; diff --git a/npc/012-5/nicholas.txt b/npc/012-5/nicholas.txt index c600a099e..9bcb9eb6e 100644 --- a/npc/012-5/nicholas.txt +++ b/npc/012-5/nicholas.txt @@ -59,7 +59,10 @@ delitem .@base1, .@amon1; delitem .@base2, .@amon2; Zeny = Zeny - .@price; - getitem .@prize, 1; + if (array_find(.WeaponCraft, .@prize) >= 0) + CsysNpcCraft(.@prize, IOPT_CRITDMG, rand(28,32)); + else + getitem .@prize, 1; .@xp=getiteminfo(.@base1, ITEMINFO_SELLPRICE)*.@amon1+getiteminfo(.@base2, ITEMINFO_SELLPRICE)*.@amon2; .@xp=.@xp*2/3; getexp .@xp, rand(1,10); @@ -216,6 +219,7 @@ OnInit: .sex = G_MALE; .distance = 5; + setarray .WeaponsCraft, WoodenSword, BugSlayer, ShortGladius, RealBronzeGladius, Backsword; end; OnClock0009: diff --git a/npc/craft/options.txt b/npc/craft/options.txt index 02b088e32..8e6d61edd 100644 --- a/npc/craft/options.txt +++ b/npc/craft/options.txt @@ -695,3 +695,72 @@ function script csysGUI_RaiseOpt { return false; } + + + + + + + + + + + + + + + + + + + + + + + + +//////////////////////////////////////// +///////////////// +/////// +// Misc Functions for Options Craft + +// CsysNpcCraft( itemid, {bonus 1, value 1], {bonus 2, value 2}... ) +// Create a craft item in a NPC's stead. Needless to say, never fails. +function script CsysNpcCraft { + // Illegal param number + if (getargcount() % 2 != 1) + return Exception("Invalid craft NPC argument count", RB_DEFAULT|RB_IRCBROADCAST); + + // Setup variables + .@it=getarg(0); + .@opt1=getarg(1,0); + .@val1=getarg(2,0); + .@opt2=getarg(3,0); + .@val2=getarg(4,0); + .@opt3=getarg(5,0); + .@val3=getarg(6,0); + .@opt4=getarg(7,0); + .@val4=getarg(8,0); + .@opt5=getarg(9,0); + .@val5=getarg(10,0); + + getitem(.@it, 1); + delinventorylist(); // Needed, because we'll rely on rfind() + getinventorylist(); + .@index=array_rfind(@inventorylist_id, .@it); + + // Apply the bonuses if needed + if (.@opt1) + setitemoptionbyindex(.@it, 0, .@opt1, .@val1); + if (.@opt2) + setitemoptionbyindex(.@it, 1, .@opt2, .@val2); + if (.@opt3) + setitemoptionbyindex(.@it, 2, .@opt3, .@val3); + if (.@opt4) + setitemoptionbyindex(.@it, 3, .@opt4, .@val4); + if (.@opt5) + setitemoptionbyindex(.@it, 4, .@opt5, .@val5); + + return; +} + diff --git a/npc/functions/clientversion.txt b/npc/functions/clientversion.txt index 300ce1343..4ea4a0da5 100644 --- a/npc/functions/clientversion.txt +++ b/npc/functions/clientversion.txt @@ -246,7 +246,8 @@ function script clientupdater { // seg mai 27 21:22:55 -03 2019 if (UPDATE < 1559002975) { UPDATE=1559002975; - dispbottom l("New game setting to change Shovel behavior, use @ucp to change."); + if (countitem(IronShovel) + countitem(SteelShovel)) + dispbottom l("Shovel have been changed, right-click it to bury items."); } -- cgit v1.2.3-70-g09d2