diff options
author | shennetsind <notind@gmail.com> | 2013-05-30 21:19:18 -0700 |
---|---|---|
committer | shennetsind <notind@gmail.com> | 2013-05-30 21:19:18 -0700 |
commit | 271ab61a287c2708e050d350bb84054c9fb88e47 (patch) | |
tree | 5b9ee841149df8748de3cd8084f245f1060c030a | |
parent | 28972aa0ae33d45c8305a72342695cd6549d81eb (diff) | |
parent | f1936fb677d1b86164b455c67e539db15eb92d31 (diff) | |
download | hercules-271ab61a287c2708e050d350bb84054c9fb88e47.tar.gz hercules-271ab61a287c2708e050d350bb84054c9fb88e47.tar.bz2 hercules-271ab61a287c2708e050d350bb84054c9fb88e47.tar.xz hercules-271ab61a287c2708e050d350bb84054c9fb88e47.zip |
Merge pull request #34 from CairoLee/master
Merge checkhomcall Script Command from rAthena
-rw-r--r-- | doc/script_commands.txt | 15 | ||||
-rw-r--r-- | src/map/script.c | 26 |
2 files changed, 40 insertions, 1 deletions
diff --git a/doc/script_commands.txt b/doc/script_commands.txt index af3d90262..47b2c5db6 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -5636,6 +5636,19 @@ IDs. Returns 1 upon success and 0 for all failures. +--------------------------------------- + +*checkhomcall() + +This function checks if the attached player's Homunculus is active, +and will return the following values: + -1: The player has no Homunculus. + 0: The player's Homunculus is active. + 1: The player's Homunculus is vaporized. + 2: The player's Homunculus is in morph state. + +--------------------------------------- + *gethominfo(<type>) This function works as a direct counterpart of 'getpetinfo': @@ -8125,4 +8138,4 @@ Example: *qiclear(<queue_iterator_id>) deletes a queue iterator from memory, returns 1 when it fails, 0 otherwise. ----------------------------------------
\ No newline at end of file +--------------------------------------- diff --git a/src/map/script.c b/src/map/script.c index d08827a34..019b17cff 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -9804,6 +9804,31 @@ BUILDIN(homunculus_shuffle) { return true; } +/*========================================== + * Check for homunculus state. + * Return: -1 = No homunculus + * 0 = Homunculus is active + * 1 = Homunculus is vaporized (rest) + * 2 = Homunculus is in morph state + *------------------------------------------*/ +BUILDIN(checkhomcall) +{ + TBL_PC *sd = script_rid2sd(st); + TBL_HOM *hd; + + if( sd == NULL ) + return false; + + hd = sd->hd; + + if( !hd ) + script_pushint(st, -1); + else + script_pushint(st, hd->homunculus.vaporize); + + return true; +} + //These two functions bring the eA MAPID_* class functionality to scripts. BUILDIN(eaclass) { @@ -17710,6 +17735,7 @@ void script_parse_builtin(void) { BUILDIN_DEF2(homunculus_evolution,"homevolution",""), //[orn] BUILDIN_DEF2(homunculus_mutate,"hommutate","?"), BUILDIN_DEF2(homunculus_shuffle,"homshuffle",""), //[Zephyrus] + BUILDIN_DEF(checkhomcall,""), BUILDIN_DEF(eaclass,"?"), //[Skotlex] BUILDIN_DEF(roclass,"i?"), //[Skotlex] BUILDIN_DEF(checkvending,"?"), |