summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGepard <Gepard@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-06-18 01:32:01 +0000
committerGepard <Gepard@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-06-18 01:32:01 +0000
commit26a9fb42e104800fd0e8ff4cf6a830ab3ce48ac5 (patch)
tree54d34670063fc3a2eb8864ecd8cd622a72d2bdee /src
parent2d20b3feef8a0985b84108736d53f6ebc512d5dd (diff)
downloadhercules-26a9fb42e104800fd0e8ff4cf6a830ab3ce48ac5.tar.gz
hercules-26a9fb42e104800fd0e8ff4cf6a830ab3ce48ac5.tar.bz2
hercules-26a9fb42e104800fd0e8ff4cf6a830ab3ce48ac5.tar.xz
hercules-26a9fb42e104800fd0e8ff4cf6a830ab3ce48ac5.zip
Added support for NPC/PC names in 'emotion' script command. (topic:249193)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14345 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/script.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/map/script.c b/src/map/script.c
index c3ad39a8e..eef1bfcd6 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -9419,7 +9419,7 @@ BUILDIN_FUNC(gvgoff)
}
/*==========================================
* Shows an emoticon on top of the player/npc
- * emotion emotion#, <target: 0 - NPC, 1 - PC>
+ * emotion emotion#, <target: 0 - NPC, 1 - PC>, <NPC/PC name>
*------------------------------------------*/
//Optional second parameter added by [Skotlex]
BUILDIN_FUNC(emotion)
@@ -9435,11 +9435,22 @@ BUILDIN_FUNC(emotion)
player=script_getnum(st,3);
if (player) {
- TBL_PC *sd = script_rid2sd(st);
+ TBL_PC *sd = NULL;
+ if( script_hasdata(st,4) )
+ sd = map_nick2sd(script_getstr(st,4));
+ else
+ sd = script_rid2sd(st);
if (sd)
clif_emotion(&sd->bl,type);
} else
- clif_emotion(map_id2bl(st->oid),type);
+ if( script_hasdata(st,4) )
+ {
+ TBL_NPC *nd = npc_name2id(script_getstr(st,4));
+ if(nd)
+ clif_emotion(&nd->bl,type);
+ }
+ else
+ clif_emotion(map_id2bl(st->oid),type);
return 0;
}