summaryrefslogtreecommitdiff
path: root/world/map/npc/commands/hug.txt
diff options
context:
space:
mode:
authormekolat <mekolat@users.noreply.github.com>2016-05-02 15:19:57 -0400
committermekolat <mekolat@users.noreply.github.com>2016-05-02 15:19:57 -0400
commit1e1b1410e0dc8d187f6ee3cf6098a3d7a9499ebc (patch)
treea495558ec6e1a1f189ae658085a5eabc69e83293 /world/map/npc/commands/hug.txt
parent65ec6edb3dcbf725360771f882c92a95f101743c (diff)
parent7ceca28c3b011161f67221a31cbdc4eaabcca305 (diff)
downloadserverdata-1e1b1410e0dc8d187f6ee3cf6098a3d7a9499ebc.tar.gz
serverdata-1e1b1410e0dc8d187f6ee3cf6098a3d7a9499ebc.tar.bz2
serverdata-1e1b1410e0dc8d187f6ee3cf6098a3d7a9499ebc.tar.xz
serverdata-1e1b1410e0dc8d187f6ee3cf6098a3d7a9499ebc.zip
Merge pull request #491 from mekolat/cmdalias
command modifications
Diffstat (limited to 'world/map/npc/commands/hug.txt')
-rw-r--r--world/map/npc/commands/hug.txt24
1 files changed, 24 insertions, 0 deletions
diff --git a/world/map/npc/commands/hug.txt b/world/map/npc/commands/hug.txt
new file mode 100644
index 00000000..323e0563
--- /dev/null
+++ b/world/map/npc/commands/hug.txt
@@ -0,0 +1,24 @@
+-|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); // eq: /me hugs (target)
+ registercmd "*hugs*", strnpcinfo(0); // eq: /me hugs
+ end;
+}