diff options
author | Mysteries <mysteriousragnarok@hotmail.com> | 2013-02-10 22:22:23 -0500 |
---|---|---|
committer | Mysteries <mysteriousragnarok@hotmail.com> | 2013-02-10 22:22:23 -0500 |
commit | 56a20bb18d6fde61bb82cf160a131eb54d464148 (patch) | |
tree | 6c3aa9dfa71e3c4e464fc86f611c40088bf8edd3 | |
parent | a2b070b52f1a48dc83ea540fd124c4e47022624a (diff) | |
download | hercules-56a20bb18d6fde61bb82cf160a131eb54d464148.tar.gz hercules-56a20bb18d6fde61bb82cf160a131eb54d464148.tar.bz2 hercules-56a20bb18d6fde61bb82cf160a131eb54d464148.tar.xz hercules-56a20bb18d6fde61bb82cf160a131eb54d464148.zip |
Merged rAthena Changes
- Added checkidle() command that was present in rAthena since r17126
- Documented checkidle() function
- More clearly defined variables in eA Job System documentation
- Added missing 'stopnpctimer' in custom Cluckers script
-rw-r--r-- | conf/battle/skill.conf | 6 | ||||
-rw-r--r-- | doc/ea_job_system.txt | 30 | ||||
-rw-r--r-- | doc/script_commands.txt | 9 | ||||
-rw-r--r-- | npc/custom/events/cluckers.txt | 7 | ||||
-rw-r--r-- | src/map/script.c | 18 |
5 files changed, 49 insertions, 21 deletions
diff --git a/conf/battle/skill.conf b/conf/battle/skill.conf index ecb2dd00a..622ce7877 100644 --- a/conf/battle/skill.conf +++ b/conf/battle/skill.conf @@ -277,6 +277,6 @@ invincible.nodamage: no dancing_weaponswitch_fix: yes // Skill Trap Type (GvG) -// 0: (official) traps in GvG only makes player unable to move after its walk path is complete, and it activates other traps on the way. -// 1: trap in GvG makes player stop moving right when stepping over it. -skill_trap_type: 0 +// 0: (official) Traps in GvG only make player stop moving after its walk path is complete, and it activates other traps on the way. +// 1: Traps in GvG make player stop moving right when stepping over it. +skill_trap_type: 0
\ No newline at end of file diff --git a/doc/ea_job_system.txt b/doc/ea_job_system.txt index e25f10689..034b4a617 100644 --- a/doc/ea_job_system.txt +++ b/doc/ea_job_system.txt @@ -3,7 +3,7 @@ //===== By: ================================================== //= Skotlex //===== Current Version: ===================================== -//= 20120610 +//= 2013-02-10 //===== Description: ========================================= //= A reference description of eA's inner job system (for use //= in scripts through the eaclass and roclass script commands). @@ -19,7 +19,7 @@ Preface: The eA Job System: ------------------------------------------------------------------------------- - Since the code also required to do this kind of checks for various skills (The Soul Linker Spirit buffs specially come to mind), an alternate job ID system was developed, which attempts to make more sense and make it easier to check where a particular job stands in relation to the rest. + Since the code also required to do this kind of checks for various skills (the Soul Linker Spirit buffs specifically come to mind), an alternate job ID system was developed, which attempts to make more sense and make it easier to check where a particular job stands in relation to the rest. The scheme consists in that every job can be broken down by 3 criteria: @@ -84,53 +84,57 @@ If we had used addition, we would have gotten a completely different result. The EAJL (eA Job Level) constants ------------------------------------------------------------------------------- - There are a few constants which can be used to filter out and make job comparisons easier. + There are a few constants which can be used to filter out and make job comparisons easier. The comparisons involve eA job IDs, not classic job IDs, using the eaclass() command explained in the next section. + + set @eac, eaclass(); EAJL_2_1: Checks if the class is a 2-1 class: - if (@job&EAJL_2_1) + if (@eac&EAJL_2_1) mes "Using the classic 2-1 job, huh?"; EAJL_2_2: - Checks if the class is 2-2. + Checks if the class is a 2-2 class: + if (@eac&EAJL_2_2) + mes "Oh, a 2-2 job!"; EAJL_2: Checks if the class is a 2nd Class. If the check fails, you can be sure the character is a first class. - if (!(@job&EAJL_2)) + if (!(@eac&EAJL_2)) mes "Will you wait until Job 50 to change?"; EAJL_UPPER: Check if a class is Rebirth/Advanced: - if(@job&EAJL_UPPER) + if(@eac&EAJL_UPPER) mes "It must have taken you a LONG time..."; EAJL_BABY: Check if a class is an adopted class. - if (@job&EAJL_BABY) + if (@eac&EAJL_BABY) mes "Don't you hate being weak?"; EAJL_THIRD: Checks if a class is a third job. - if(@job&EAJL_THIRD) + if(@eac&EAJL_THIRD) mes "Wow, you've really grown!"; EAJ_UPPERMASK: The upper mask can be used to "strip" the upper/baby characteristics of a class, used when you want to know if someone is a certain class regardless of rebirth/adopted status. For example, the following code would go through for Monks, Champions and Baby Monks: - if ((@job&EAJ_UPPERMASK) == EAJ_MONK) + if ((@eac&EAJ_UPPERMASK) == EAJ_MONK) mes "Aren't knuckles such a cool weapon?"; Note that if instead of EAJ_MONK you used EAJ_CHAMPION or EAJ_BABY_MONK, the check would had never passed, since the upper/baby state has been removed from the original job when checking. EAJ_BASEMASK: This mask strips also the 2nd class attributes. It can be used to check against the basic job of a character. For example, the following code would go through for Merchants (+Baby Merchant and High Merchant), Blacksmiths (+Baby blacksmiths and Whitesmith) and Alchemist (+Baby Alchemist and +Creator): - if ((@job&EAJ_BASEMASK) == EAJ_MERCHANT) + if ((@eac&EAJ_BASEMASK) == EAJ_MERCHANT) mes "Why I can't have discount like you guys do?"; Note that, like before, if you try to check versus any of the other classes (High merchant, blacksmith, etc) instead of basic merchant, the check will always fail for the same reasons previously explained. EAJ_THIRDMASK: This mask strips 3rd class attributes. It will give the "normal" class of a third job, regardless of rebirth/adopted status. When used on non-third class characters, it will return the second job, or, if that also doesn't exist, the first. - if ((@job&EAJ_THIRDMASK) == EAJ_WARLOCK_T) + if ((@eac&EAJ_THIRDMASK) == EAJ_WARLOCK_T) mes "You've gone through rebirth, I see."; The script commands eaclass, roclass: @@ -189,5 +193,5 @@ About Novices and Super Novices: So as you can see, on this job system, the Super Novice is treated as the 2-1 job of a Novice, and the Novice job it's at the same level of the other 1st jobs. Even though that may seem like a hindrance, it makes it very easy to add a check to discard Novice types from a quest: - if ((@job&EAJ_BASEMASK) == EAJ_NOVICE) + if ((eaclass()&EAJ_BASEMASK) == EAJ_NOVICE) //Novice class detected. diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 3c93490bb..cd08e618c 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -3545,7 +3545,7 @@ warg and 0 if they don't. --------------------------------------- -*checkvending({"<player name>"}) +*checkvending({"<Player Name>"}) *checkchatting({"<Player Name>"}) Checks if the player is vending or in a chatroom. @@ -3570,6 +3570,13 @@ Examples: --------------------------------------- +*checkidle({"<Player Name>"}) + + Returns the time, in seconds, that the specified player has been idle. + Name is optional, and defaults to the attached player if omitted. + +--------------------------------------- + *agitcheck() *agitcheck2() diff --git a/npc/custom/events/cluckers.txt b/npc/custom/events/cluckers.txt index bc9899488..cf296cb18 100644 --- a/npc/custom/events/cluckers.txt +++ b/npc/custom/events/cluckers.txt @@ -1,11 +1,9 @@ -//===== rAthena Script ======================================= +//===== Hercules Script ======================================= //= Cluck! Cluck! Boom! //===== By: ================================================== //= Keale //===== Current Version: ===================================== //= 1.2a -//===== Compatible With: ===================================== -//= rAthena SVN //===== Description: ========================================= //= Click the chicken and try retrieve the item at a low //= chance. If you fail he will nuke, freeze, stone, @@ -108,8 +106,9 @@ OnTimer30000: end; OnTimer40000: announce "GO! Click the chicken to get the prize!",bc_blue; + stopnpctimer; if (!$cluck_item_id) set $cluck_item_id,512; if (!$cluck_item_amount) set $cluck_item_amount,1; set .startcluck,1; end; -} +}
\ No newline at end of file diff --git a/src/map/script.c b/src/map/script.c index a6d588113..b89121ee4 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -14968,6 +14968,23 @@ BUILDIN_FUNC(checkchatting) // check chatting [Marka] return 0; } +BUILDIN_FUNC(checkidle) +{ + TBL_PC *sd = NULL; + + if (script_hasdata(st, 2)) + sd = map_nick2sd(script_getstr(st, 2)); + else + sd = script_rid2sd(st); + + if (sd) + script_pushint(st, DIFF_TICK(last_tick, sd->idletime)); + else + script_pushint(st, 0); + + return 0; +} + BUILDIN_FUNC(searchitem) { struct script_data* data = script_getdata(st, 2); @@ -17689,6 +17706,7 @@ struct script_function buildin_func[] = { BUILDIN_DEF(roclass,"i?"), //[Skotlex] BUILDIN_DEF(checkvending,"?"), BUILDIN_DEF(checkchatting,"?"), + BUILDIN_DEF(checkidle,"?"), BUILDIN_DEF(openmail,""), BUILDIN_DEF(openauction,""), BUILDIN_DEF(checkcell,"siii"), |