From f6e1ed7160bd7192657fae2d1fc0edd8cad7eaab Mon Sep 17 00:00:00 2001 From: mekolat Date: Sat, 30 Apr 2016 16:54:57 -0400 Subject: add alias to pullrabbit command that uses MAGIC_SYMBOL --- world/map/npc/commands/pullrabbit.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'world/map') diff --git a/world/map/npc/commands/pullrabbit.txt b/world/map/npc/commands/pullrabbit.txt index 022f3753..9c3634a4 100644 --- a/world/map/npc/commands/pullrabbit.txt +++ b/world/map/npc/commands/pullrabbit.txt @@ -21,5 +21,6 @@ L_Inventory: OnInit: registercmd chr(ATCMD_SYMBOL) + "pullrabbit", strnpcinfo(0); + registercmd chr(MAGIC_SYMBOL) + "pullrabbit", strnpcinfo(0); // former pullrabbit invocation end; } -- cgit v1.2.3-60-g2f50 From 849099e23027d5ddb96c6616a9df835b57725b09 Mon Sep 17 00:00:00 2001 From: mekolat Date: Sat, 30 Apr 2016 16:58:26 -0400 Subject: move hug command to the commands folder --- world/map/npc/commands/_import.txt | 1 + world/map/npc/commands/hug.txt | 23 +++++++++++++++++++++++ world/map/npc/functions/hug.txt | 23 ----------------------- world/map/npc/scripts.conf | 1 - 4 files changed, 24 insertions(+), 24 deletions(-) create mode 100644 world/map/npc/commands/hug.txt delete mode 100644 world/map/npc/functions/hug.txt (limited to 'world/map') diff --git a/world/map/npc/commands/_import.txt b/world/map/npc/commands/_import.txt index 3cabe0b7..b2fe92a1 100644 --- a/world/map/npc/commands/_import.txt +++ b/world/map/npc/commands/_import.txt @@ -8,3 +8,4 @@ npc: npc/commands/pullrabbit.txt npc: npc/commands/numa.txt npc: npc/commands/destroynpc.txt npc: npc/commands/remotecmd.txt +npc: npc/commands/hug.txt diff --git a/world/map/npc/commands/hug.txt b/world/map/npc/commands/hug.txt new file mode 100644 index 00000000..f1bd2637 --- /dev/null +++ b/world/map/npc/commands/hug.txt @@ -0,0 +1,23 @@ +-|script|nonmagic-hug|32767 +{ + explode .@name$[0], @args$, "*"; // strip the trailing * + set @target_id, if_then_else(.@name$[0] != "", getcharid(3, .@name$[0]), BL_ID); + if (@target_id < 1 || !(isloggedin(@target_id))) set @target_id, BL_ID; // fallback to self + if (.@name$[0] == "Tree" || .@name$[0] == "tree") set @target_id, .tree_id; + set .@range, if_then_else(@target_id == .tree_id, 3, 6); + if (distance(BL_ID, @target_id) >= .@range) end; + if (gettimetick(2) - @hugspell_time < 3) end; + + set @hugspell_time, gettimetick(2); + misceffect FX_HUG, strcharinfo(0); + if (@target_id != BL_ID) misceffect FX_HUG, @target_id; + + if (@target_id != .tree_id) end; + callfunc "QuestTreeTouch"; + close; + +OnInit: + set .tree_id, getnpcid("#DruidTree0#_M"); + registercmd "*hugs", strnpcinfo(0); + end; +} diff --git a/world/map/npc/functions/hug.txt b/world/map/npc/functions/hug.txt deleted file mode 100644 index f1bd2637..00000000 --- a/world/map/npc/functions/hug.txt +++ /dev/null @@ -1,23 +0,0 @@ --|script|nonmagic-hug|32767 -{ - explode .@name$[0], @args$, "*"; // strip the trailing * - set @target_id, if_then_else(.@name$[0] != "", getcharid(3, .@name$[0]), BL_ID); - if (@target_id < 1 || !(isloggedin(@target_id))) set @target_id, BL_ID; // fallback to self - if (.@name$[0] == "Tree" || .@name$[0] == "tree") set @target_id, .tree_id; - set .@range, if_then_else(@target_id == .tree_id, 3, 6); - if (distance(BL_ID, @target_id) >= .@range) end; - if (gettimetick(2) - @hugspell_time < 3) end; - - set @hugspell_time, gettimetick(2); - misceffect FX_HUG, strcharinfo(0); - if (@target_id != BL_ID) misceffect FX_HUG, @target_id; - - if (@target_id != .tree_id) end; - callfunc "QuestTreeTouch"; - close; - -OnInit: - set .tree_id, getnpcid("#DruidTree0#_M"); - registercmd "*hugs", strnpcinfo(0); - end; -} diff --git a/world/map/npc/scripts.conf b/world/map/npc/scripts.conf index 0935f246..25fba83b 100644 --- a/world/map/npc/scripts.conf +++ b/world/map/npc/scripts.conf @@ -29,7 +29,6 @@ npc: npc/functions/dynamic_menu.txt npc: npc/functions/DyeConfig.txt npc: npc/functions/motd.txt npc: npc/functions/motdconfig.txt -npc: npc/functions/hug.txt // Item Functions npc: npc/items/purification_potion.txt -- cgit v1.2.3-60-g2f50 From 7ceca28c3b011161f67221a31cbdc4eaabcca305 Mon Sep 17 00:00:00 2001 From: mekolat Date: Sat, 30 Apr 2016 17:16:38 -0400 Subject: add alias to hug command --- world/map/npc/commands/hug.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'world/map') diff --git a/world/map/npc/commands/hug.txt b/world/map/npc/commands/hug.txt index f1bd2637..323e0563 100644 --- a/world/map/npc/commands/hug.txt +++ b/world/map/npc/commands/hug.txt @@ -18,6 +18,7 @@ OnInit: set .tree_id, getnpcid("#DruidTree0#_M"); - registercmd "*hugs", strnpcinfo(0); + registercmd "*hugs", strnpcinfo(0); // eq: /me hugs (target) + registercmd "*hugs*", strnpcinfo(0); // eq: /me hugs end; } -- cgit v1.2.3-60-g2f50