diff options
author | Kisuka <Kisuka@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-04-05 06:00:20 +0000 |
---|---|---|
committer | Kisuka <Kisuka@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-04-05 06:00:20 +0000 |
commit | d841fc529949f361e915b73a073d1fa9d4ec60f7 (patch) | |
tree | 6a9a34b176f00c6178700a46c01d1c752821d40e /src/map/script.c | |
parent | 1bea10f578d4e8119659a0373c0a9213fdaab4d4 (diff) | |
download | hercules-d841fc529949f361e915b73a073d1fa9d4ec60f7.tar.gz hercules-d841fc529949f361e915b73a073d1fa9d4ec60f7.tar.bz2 hercules-d841fc529949f361e915b73a073d1fa9d4ec60f7.tar.xz hercules-d841fc529949f361e915b73a073d1fa9d4ec60f7.zip |
- Completed L0ne's 2007 request for 'waitingroom' to support required zeny and level.
- Updated NPC files which required the waitingroom update.
- Added Poring War script.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14765 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 58 |
1 files changed, 17 insertions, 41 deletions
diff --git a/src/map/script.c b/src/map/script.c index 3cb469ac5..e9e1a51c0 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -9262,52 +9262,24 @@ BUILDIN_FUNC(globalmes) return 0; } -///////////////////////////////////////////////////////////////////// -// NPC waiting room (chat room) -// - -/// Creates a waiting room (chat room) for this npc. -/// -/// waitingroom "<title>",<limit>,<trigger>,"<event>"; -/// waitingroom "<title>",<limit>,"<event>",<trigger>; -/// waitingroom "<title>",<limit>,"<event>"; -/// waitingroom "<title>",<limit>; +/*========================================== + * Creates a waiting room (chat room) + *------------------------------------------*/ BUILDIN_FUNC(waitingroom) { - struct npc_data* nd; - const char* title; - const char* ev = ""; - int limit; - int trigger = 0; + struct npc_data* nd; int pub = 1; - - title = script_getstr(st, 2); - limit = script_getnum(st, 3); - - if( script_hasdata(st,5) ) - { - struct script_data* last = script_getdata(st, 5); - get_val(st, last); - if( data_isstring(last) ) - {// ,<trigger>,"<event>" - trigger = script_getnum(st, 4); - ev = script_getstr(st, 5); - } - else - {// ,"<event>",<trigger> - ev = script_getstr(st, 4); - trigger = script_getnum(st,5); - } - } - else if( script_hasdata(st,4) ) - {// ,"<event>" - ev = script_getstr(st, 4); - trigger = limit; - } + const char* title = script_getstr(st, 2); + int limit = script_getnum(st, 3); + const char* ev = script_hasdata(st,4) ? script_getstr(st,4) : ""; + int trigger = script_hasdata(st,5) ? script_getnum(st,5) : limit; + int zeny = script_hasdata(st,6) ? script_getnum(st,6) : 0; + int minLvl = script_hasdata(st,7) ? script_getnum(st,7) : 1; + int maxLvl = script_hasdata(st,8) ? script_getnum(st,8) : MAX_LEVEL; nd = (struct npc_data *)map_id2bl(st->oid); if( nd != NULL ) - chat_createnpcchat(nd, title, limit, pub, trigger, ev); + chat_createnpcchat(nd, title, limit, pub, trigger, ev, zeny, minLvl, maxLvl); return 0; } @@ -9488,9 +9460,13 @@ BUILDIN_FUNC(warpwaitingpc) return 0;// can't teleport on this map pc_setpos(sd, sd->status.save_point.map, sd->status.save_point.x, sd->status.save_point.y, CLR_TELEPORT); + if( cd->zeny ) + pc_payzeny(sd, cd->zeny); } else pc_setpos(sd, mapindex_name2id(map_name), x, y, CLR_OUTSIGHT); + if( cd->zeny ) + pc_payzeny(sd, cd->zeny); } mapreg_setreg(add_str("$@warpwaitingpcnum"), i); return 0; @@ -15029,7 +15005,7 @@ struct script_function buildin_func[] = { BUILDIN_DEF(skillpointcount,""), BUILDIN_DEF(changebase,"i?"), BUILDIN_DEF(changesex,""), - BUILDIN_DEF(waitingroom,"si??"), + BUILDIN_DEF(waitingroom,"si?????"), BUILDIN_DEF(delwaitingroom,"?"), BUILDIN_DEF2(waitingroomkickall,"kickwaitingroomall","?"), BUILDIN_DEF(enablewaitingroomevent,"?"), |