diff options
-rw-r--r-- | npc/craft/tweak.txt | 46 | ||||
-rw-r--r-- | npc/guilds/forge.txt | 10 | ||||
-rw-r--r-- | npc/items/shovel.txt | 1 | ||||
-rw-r--r-- | npc/scripts.conf | 1 |
4 files changed, 58 insertions, 0 deletions
diff --git a/npc/craft/tweak.txt b/npc/craft/tweak.txt new file mode 100644 index 000000000..cc8242275 --- /dev/null +++ b/npc/craft/tweak.txt @@ -0,0 +1,46 @@ +// TMW2 Script +// Author: +// Jesusalva +// Description: +// Smith System (Player, Guild, NPC) +// Notes: +// It's like smithing, but it only change an item options + +// Usage: SmithTweakSystem ({scope}) +// Scopes: CRAFT_PLAYER, CRAFT_NPC +// Returns true on success, false on failure +function script SmithTweakSystem { + // Set .scope, .knowledge and .success + .scope=getarg(0, CRAFT_PLAYER); + copyarray(.knowledge,RECIPES_EQUIPMENT,getarraysize(RECIPES_EQUIPMENT)); + .success=false; + + mes l("Which item will you tweak?"); + mesc l("WARNING, ITEM MAY BREAK"), 1; + + .@id=requestitemindex(); + mes ""; + + if (.@id < 0) + return false; + + // Clear all five options + setitemoptionbyindex(.@id, 0, 0, 0); + setitemoptionbyindex(.@id, 1, 0, 0); + setitemoptionbyindex(.@id, 2, 0, 0); + setitemoptionbyindex(.@id, 3, 0, 0); + setitemoptionbyindex(.@id, 4, 0, 0); + + // Check if you fail + if (rand(0,10000) < 200) { + mesc l("ITEM BREAKS, ALL OPTIONS LOST!"), 1; + return false; + } + + // Eh, apply some stuff for testing + setitemoptionbyindex(.@id, 0, VAR_MAXHPAMOUNT, 200); + setitemoptionbyindex(.@id, 1, VAR_STRAMOUNT, 10); + setitemoptionbyindex(.@id, 2, VAR_VITAMOUNT, -5); + mesc l("SUCCESS!"), 3; + return true; +} diff --git a/npc/guilds/forge.txt b/npc/guilds/forge.txt index 55924656e..ffb43f529 100644 --- a/npc/guilds/forge.txt +++ b/npc/guilds/forge.txt @@ -5,6 +5,16 @@ // Guild Facility - Blacksmith Area guilds,24,27,0 script Guild Blacksmith NPC_NO_SPRITE,{ + select + l("Forge a new item"), + rif(is_staff(), "Tweak an item"); + mes ""; + if (@menu == 2) { + SmithTweakSystem(); + close; + } + + // Script begins here do { mesc l("What will you forge today?"); diff --git a/npc/items/shovel.txt b/npc/items/shovel.txt index 039cfd25a..63480fb98 100644 --- a/npc/items/shovel.txt +++ b/npc/items/shovel.txt @@ -312,6 +312,7 @@ OnHour00: CursedAmmoBox,ThornAmmoBox,SacredBullet); // Extra burried treasure (25~65 over 3600 tiles: aprox. 0.70% to 1.80%) + // New Rate: 1.40% ~ 3.60% since 2019-05-27 shovel_scatter("018-1", 20, 20, 80, 80, rand(50,130), TreasureKey,CoinBag,TreasureKey,SulfurPowder,Coal, IronOre,CopperOre,LeadOre,TinOre,SilverOre,GoldOre,PlatinumOre,IridiumOre,TitaniumOre, diff --git a/npc/scripts.conf b/npc/scripts.conf index cb0a4176f..6376db465 100644 --- a/npc/scripts.conf +++ b/npc/scripts.conf @@ -78,6 +78,7 @@ // Crafting System "npc/craft/alchemy.txt", "npc/craft/smith.txt", +"npc/craft/tweak.txt", "npc/craft/recipes.txt", // custom atcommands |