summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormekolat <mekolat@users.noreply.github.com>2016-04-19 11:23:01 -0400
committermekolat <mekolat@users.noreply.github.com>2016-04-19 11:23:01 -0400
commitef9c36da33a3d9b40d64ee6d1b31e35196fe0bb7 (patch)
treefeb4c2c04c7b0990644e0660f82b6b30314c0088
parent2ee0dad877778ff8325bc1a2fca89357675dbeb6 (diff)
downloadserverdata-ef9c36da33a3d9b40d64ee6d1b31e35196fe0bb7.tar.gz
serverdata-ef9c36da33a3d9b40d64ee6d1b31e35196fe0bb7.tar.bz2
serverdata-ef9c36da33a3d9b40d64ee6d1b31e35196fe0bb7.tar.xz
serverdata-ef9c36da33a3d9b40d64ee6d1b31e35196fe0bb7.zip
fix `hug` spell
-rw-r--r--world/map/npc/functions/hug.txt6
1 files changed, 4 insertions, 2 deletions
diff --git a/world/map/npc/functions/hug.txt b/world/map/npc/functions/hug.txt
index a663ea1d..d8fc81df 100644
--- a/world/map/npc/functions/hug.txt
+++ b/world/map/npc/functions/hug.txt
@@ -1,13 +1,15 @@
-|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);
+ 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, 3;
+ set .@range, if_then_else(@target_id == .tree_id, 3, 6);
if (distance(BL_ID, @target_id) >= .@range) end;
+
misceffect FX_HUG, strcharinfo(0);
if (@target_id != BL_ID) misceffect FX_HUG, @target_id;
+
if (@target_id != .tree_id) end;
callfunc "QuestTreeTouch";
close;