summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-04-06 16:06:28 +0000
committerai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-04-06 16:06:28 +0000
commit0a8d24ef2cb18c75f846acb3c57c4d90b2feadcd (patch)
tree977b398109feb027175652f631dbe67a9791fbd2 /src
parentdd69731e5784c8380e78d03c8971ceabdbff4ba8 (diff)
downloadhercules-0a8d24ef2cb18c75f846acb3c57c4d90b2feadcd.tar.gz
hercules-0a8d24ef2cb18c75f846acb3c57c4d90b2feadcd.tar.bz2
hercules-0a8d24ef2cb18c75f846acb3c57c4d90b2feadcd.tar.xz
hercules-0a8d24ef2cb18c75f846acb3c57c4d90b2feadcd.zip
* Fixed script command 'warpwaitingpc' not checking, whether or not the player still has required amount of Zeny (since r14765).
- Fixed warping through 'warpwaitingpc' to savepoint would take the fee twice ( missing {} ). - Fixed random warping through 'warpwaitingpc' would not take away fee Zeny at all. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14772 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/script.c38
1 files changed, 33 insertions, 5 deletions
diff --git a/src/map/script.c b/src/map/script.c
index e9e1a51c0..aad2e3049 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -9262,9 +9262,13 @@ BUILDIN_FUNC(globalmes)
return 0;
}
-/*==========================================
- * Creates a waiting room (chat room)
- *------------------------------------------*/
+/////////////////////////////////////////////////////////////////////
+// NPC waiting room (chat room)
+//
+
+/// Creates a waiting room (chat room) for this npc.
+///
+/// waitingroom "<title>",<limit>{,"<event>"{,<trigger>{,<zeny>{,<minlvl>{,<maxlvl>}}}}};
BUILDIN_FUNC(waitingroom)
{
struct npc_data* nd;
@@ -9453,20 +9457,44 @@ BUILDIN_FUNC(warpwaitingpc)
mapreg_setreg(reference_uid(add_str("$@warpwaitingpc"), i), sd->bl.id);
if( strcmp(map_name,"Random") == 0 )
+ {
+ if( cd->zeny )
+ {// fee set
+ if( (uint32)sd->status.zeny < cd->zeny )
+ {// no zeny to cover set fee
+ return 0;
+ }
+ pc_payzeny(sd, cd->zeny);
+ }
pc_randomwarp(sd,CLR_TELEPORT);
+ }
else if( strcmp(map_name,"SavePoint") == 0 )
{
if( map[sd->bl.m].flag.noteleport )
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 )
+ {// fee set
+ if( (uint32)sd->status.zeny < cd->zeny )
+ {// no zeny to cover set fee
+ return 0;
+ }
pc_payzeny(sd, cd->zeny);
+ }
+ pc_setpos(sd, sd->status.save_point.map, sd->status.save_point.x, sd->status.save_point.y, CLR_TELEPORT);
}
else
- pc_setpos(sd, mapindex_name2id(map_name), x, y, CLR_OUTSIGHT);
+ {
if( cd->zeny )
+ {// fee set
+ if( (uint32)sd->status.zeny < cd->zeny )
+ {// no zeny to cover set fee
+ return 0;
+ }
pc_payzeny(sd, cd->zeny);
+ }
+ pc_setpos(sd, mapindex_name2id(map_name), x, y, CLR_OUTSIGHT);
+ }
}
mapreg_setreg(add_str("$@warpwaitingpcnum"), i);
return 0;