summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-25 16:52:41 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-25 16:52:41 +0000
commitc82c46496b3716a3db575d10c24843395dc1cdf4 (patch)
treebc69e4c19b3d828d9d268773ce53eb0fc38c8356 /src/map/script.c
parent95f12980263078a51a09fbe9bc76447d9cd7a1fb (diff)
downloadhercules-c82c46496b3716a3db575d10c24843395dc1cdf4.tar.gz
hercules-c82c46496b3716a3db575d10c24843395dc1cdf4.tar.bz2
hercules-c82c46496b3716a3db575d10c24843395dc1cdf4.tar.xz
hercules-c82c46496b3716a3db575d10c24843395dc1cdf4.zip
- Added script commands roclass/eaclass to enable scripts to access eA's job format. Read script_commands.txt and ea_job_system.txt for a more complete explanation of how this job system works.
- Removed doc/item.txt (seems like a totally useless file) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8480 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 16da061b5..f55a108cf 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -3901,6 +3901,8 @@ struct script_function buildin_func[] = {
{buildin_warpportal,"warpportal","iisii"},
// <--- [blackhole89]
{buildin_homunculus_evolution,"homevolution",""}, //[orn]
+ {buildin_eaclass,"eaclass","*"}, //[Skotlex]
+ {buildin_roclass,"roclass","i*"}, //[Skotlex]
{NULL,NULL,NULL},
};
@@ -7760,6 +7762,42 @@ int buildin_homunculus_evolution(struct script_state *st)
return 0;
}
+//These two functions bring the eA MAPID_* class functionality to scripts.
+int buildin_eaclass(struct script_state *st)
+{
+ int class_;
+ if( st->end>st->start+2 )
+ class_ = conv_num(st,& (st->stack->stack_data[st->start+2]));
+ else {
+ struct map_session_data *sd;
+ sd=script_rid2sd(st);
+ if (!sd) {
+ push_val(st->stack,C_INT, -1);
+ return 0;
+ }
+ class_ = sd->status.class_;
+ }
+ push_val(st->stack,C_INT, pc_jobid2mapid(class_));
+ return 0;
+}
+
+int buildin_roclass(struct script_state *st)
+{
+ int class_ =conv_num(st,& (st->stack->stack_data[st->start+2]));
+ int sex;
+ if( st->end>st->start+3 )
+ sex = conv_num(st,& (st->stack->stack_data[st->start+3]));
+ else {
+ struct map_session_data *sd;
+ if (st->rid && (sd=script_rid2sd(st)))
+ sex = sd->status.sex;
+ else
+ sex = 1; //Just use male when not found.
+ }
+ push_val(st->stack,C_INT,pc_mapid2jobid(class_, sex));
+ return 0;
+}
+
/*==========================================
*Œg‘Ñ—‘›z‰»‹@Žg—p
*------------------------------------------