summaryrefslogtreecommitdiff
path: root/npc/functions
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-03-13 16:57:08 -0300
committerJesusaves <cpntb1@ymail.com>2019-03-13 16:57:08 -0300
commit06305a2f1f4a0dca0fe94a93f894065cc04d7a84 (patch)
tree8f590e5c8734499f6c745a53944114b5e414b451 /npc/functions
parentbd8c1bf6d2b5112e63a078507e351baed7a977eb (diff)
downloadserverdata-06305a2f1f4a0dca0fe94a93f894065cc04d7a84.tar.gz
serverdata-06305a2f1f4a0dca0fe94a93f894065cc04d7a84.tar.bz2
serverdata-06305a2f1f4a0dca0fe94a93f894065cc04d7a84.tar.xz
serverdata-06305a2f1f4a0dca0fe94a93f894065cc04d7a84.zip
Add the Blacksmith to Saulc's Castle so it can be tested >.>
Diffstat (limited to 'npc/functions')
-rw-r--r--npc/functions/craft/alchemy.txt3
-rw-r--r--npc/functions/craft/smith.txt41
2 files changed, 41 insertions, 3 deletions
diff --git a/npc/functions/craft/alchemy.txt b/npc/functions/craft/alchemy.txt
index d0b8efa01..227e9e546 100644
--- a/npc/functions/craft/alchemy.txt
+++ b/npc/functions/craft/alchemy.txt
@@ -28,9 +28,6 @@ function script AlchemySystem {
if (.@entry < 0) {
.success=false;
} else {
- // Check against COOKING_RECIPES
- // using CraftCarpCocktail for example (Craft ID)
- // Checking somehow if you know it (array_find?)
if (.scope == CRAFT_NPC || .knowledge[.@entry]) {
usecraft .@craft;
.success=true;
diff --git a/npc/functions/craft/smith.txt b/npc/functions/craft/smith.txt
new file mode 100644
index 000000000..d75f30d92
--- /dev/null
+++ b/npc/functions/craft/smith.txt
@@ -0,0 +1,41 @@
+// TMW2 Script
+// Author:
+// Jesusalva
+// Description:
+// Smith System (Player, Guild, NPC)
+// Notes:
+// Base for Evol MR
+
+// Usage: SmithSystem ({scope})
+// Scopes: CRAFT_NPC, CRAFT_PLAYER, CRAFT_GUILD
+// If an invalid scope is passed, .knowledge won't be set but will be required
+// Returns true on success, false on failure
+function script SmithSystem {
+ // Set .scope, .knowledge and .success
+ .scope=getarg(0, CRAFT_PLAYER);
+ if (.scope == CRAFT_PLAYER)
+ copyarray(.knowledge,RECIPES_EQUIPMENT,getarraysize(RECIPES_EQUIPMENT));
+ else if (.scope == CRAFT_GUILD)
+ copyarray(.knowledge,$@RECIPES_EQUIPMENT[getcharid(2)],getarraysize($@RECIPES_EQUIPMENT[getcharid(2)]));
+ .success=false;
+
+ setskin "craft4";
+ .@var$ = requestcraft(4);
+ .@craft = initcraft(.@var$);
+ .@entry = findcraftentry(.@craft, CRAFT_EQUIPMENT);
+ if (debug || $@GM_OVERRIDE) mes "found craft entry: " + .@entry;
+ if (debug || $@GM_OVERRIDE) mes "knowledge value: " + .knowledge[.@entry];
+ if (.@entry < 0) {
+ .success=false;
+ } else {
+ if (.scope == CRAFT_NPC || .knowledge[.@entry]) {
+ usecraft .@craft;
+ .success=true;
+ } else {
+ .success=false;
+ }
+ }
+ deletecraft .@craft;
+ setskin "";
+ return .success;
+}