diff options
author | Lupus <Lupus@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2005-02-26 07:40:41 +0000 |
---|---|---|
committer | Lupus <Lupus@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2005-02-26 07:40:41 +0000 |
commit | ccd3e0e2d45eac452406eab7dfcfa7a08a369042 (patch) | |
tree | d2b4a5a4deee3a0036f081707081a4e4fe668972 /src/map/npc.c | |
parent | c576ad09280dc788d9e95ca410594e88dd5fa7aa (diff) | |
download | hercules-ccd3e0e2d45eac452406eab7dfcfa7a08a369042.tar.gz hercules-ccd3e0e2d45eac452406eab7dfcfa7a08a369042.tar.bz2 hercules-ccd3e0e2d45eac452406eab7dfcfa7a08a369042.tar.xz hercules-ccd3e0e2d45eac452406eab7dfcfa7a08a369042.zip |
added new script commands
from jA
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1182 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/npc.c')
-rw-r--r-- | src/map/npc.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/map/npc.c b/src/map/npc.c index 36569eb88..c6d77c18c 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -916,6 +916,32 @@ int npc_checknear(struct map_session_data *sd,int id) } /*========================================== + * NPCのオープンチャット発言 + *------------------------------------------ + */ +int npc_globalmessage(const char *name,char *mes) +{ + struct npc_data *nd=strdb_search(npcname_db,name); + char temp[100]; + char ntemp[50]; + char *ltemp; + + if(nd==NULL) return 0; + if(name==NULL) return 0; + + ltemp=strchr(name,'#'); + if(ltemp!=NULL) { + strncpy(ntemp,name,ltemp - name); // 123#456 の # から後ろを削除する + ntemp[ltemp - name]=0x00; // strncpy のバグ?使い方間違ってる? + } + + snprintf(temp, sizeof temp ,"%s : %s",ntemp,mes); + clif_GlobalMessage(&nd->bl,temp); + + return 0; +} + +/*========================================== * クリック時のNPC処理 *------------------------------------------ */ |