diff options
author | Jesusaves <cpntb1@ymail.com> | 2019-05-24 22:16:50 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2019-05-24 22:16:50 -0300 |
commit | eee8b9997ad63cc136adc6d158086304c6293dd2 (patch) | |
tree | 85d4ad1aa701e99315e1d368a92221b652cbc8b9 /npc/craft/smith.txt | |
parent | 357b89c0f566b84af625c659fcc34ab5089ad2ab (diff) | |
download | serverdata-eee8b9997ad63cc136adc6d158086304c6293dd2.tar.gz serverdata-eee8b9997ad63cc136adc6d158086304c6293dd2.tar.bz2 serverdata-eee8b9997ad63cc136adc6d158086304c6293dd2.tar.xz serverdata-eee8b9997ad63cc136adc6d158086304c6293dd2.zip |
Move craft/ to toplevel
Diffstat (limited to 'npc/craft/smith.txt')
-rw-r--r-- | npc/craft/smith.txt | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/npc/craft/smith.txt b/npc/craft/smith.txt new file mode 100644 index 000000000..d75f30d92 --- /dev/null +++ b/npc/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; +} |