summaryrefslogtreecommitdiff
path: root/npc/commands/hug.txt
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-04-09 13:33:57 -0300
committerJesusaves <cpntb1@ymail.com>2021-04-09 13:33:57 -0300
commitcf18ce071c79ae37e14ea38943e0b1d88da70a7b (patch)
treef9159c9b60b3018300dd22ffba0d797bc5e828e5 /npc/commands/hug.txt
parent8a4bf716002a017de77fe7df301ef8e4aaf00a2e (diff)
downloadserverdata-cf18ce071c79ae37e14ea38943e0b1d88da70a7b.tar.gz
serverdata-cf18ce071c79ae37e14ea38943e0b1d88da70a7b.tar.bz2
serverdata-cf18ce071c79ae37e14ea38943e0b1d88da70a7b.tar.xz
serverdata-cf18ce071c79ae37e14ea38943e0b1d88da70a7b.zip
Override
Diffstat (limited to 'npc/commands/hug.txt')
-rwxr-xr-xnpc/commands/hug.txt24
1 files changed, 24 insertions, 0 deletions
diff --git a/npc/commands/hug.txt b/npc/commands/hug.txt
new file mode 100755
index 00000000..4f7c086d
--- /dev/null
+++ b/npc/commands/hug.txt
@@ -0,0 +1,24 @@
+- script nonmagic-hug NPC32767,{
+ explode .@name$[0], @args$, "*"; // strip the trailing *
+ @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;
+ .@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;
+
+ @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;
+ @flag = 2;
+ callfunc "QuestTreeTrigger";
+ close;
+
+OnInit:
+ .tree_id = getnpcid("#DruidTree0#_M");
+ registercmd "*hugs", strnpcinfo(0); // eq: /me hugs (target)
+ registercmd "*hugs*", strnpcinfo(0); // eq: /me hugs
+ end;
+}