Browse Source

* Follow-up r17126, documented checkidle() function.
* More clearly defined variables in eA Job System documentation (bugreport:7259).
* Added missing 'stopnpctimer' in custom Cluckers script (bugreport:7260).
* Restricted skill_trap_type config to GvG only (Hercules 4c9bfed, follow-up r17109, bugreport:4832).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@17127 54d463be-8e91-2dee-dedb-b68131a5f0ec

euphyy 12 năm trước cách đây
mục cha
commit
994b566002

+ 3 - 3
conf/battle/skill.conf

@@ -276,7 +276,7 @@ invincible.nodamage: no
 // Default: yes
 dancing_weaponswitch_fix: yes
 
-// Skill Trap Type
-// 0: (official) traps only makes player unable to move after its walk path is complete, and it activates other traps on the way.
-// 1: trap makes player stop moving right when stepping over it.
+// Skill Trap Type (GvG)
+// 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

+ 17 - 13
doc/ea_job_system.txt

@@ -3,7 +3,7 @@
 //===== By: ==================================================
 //= Skotlex
 //===== Current Version: =====================================
-//= 20120610
+//= 20130209
 //===== 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.

+ 8 - 1
doc/script_commands.txt

@@ -3549,7 +3549,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.
@@ -3574,6 +3574,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()
 

+ 1 - 0
npc/custom/events/cluckers.txt

@@ -108,6 +108,7 @@ 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;

+ 1 - 1
src/map/script.c

@@ -4780,7 +4780,7 @@ BUILDIN_FUNC(callfunc)
 		st->state = END;
 		return 1;
 	}
-	
+
 	for( i = st->start+3, j = 0; i < st->end; i++, j++ )
 	{
 		struct script_data* data = push_copy(st->stack,i);

+ 1 - 1
src/map/skill.c

@@ -11459,7 +11459,7 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
 					const struct TimerData* td = tsc->data[type]?get_timer(tsc->data[type]->timer):NULL;
 					if( td )
 						sec = DIFF_TICK(td->tick, tick);
-					if( sg->unit_id == UNT_MANHOLE || battle_config.skill_trap_type ) {
+					if( sg->unit_id == UNT_MANHOLE || battle_config.skill_trap_type || !map_flag_gvg(src->bl.m) ) {
 						unit_movepos(bl, src->bl.x, src->bl.y, 0, 0);
 						clif_fixpos(bl);
 					}

+ 1 - 1
src/map/status.c

@@ -8660,7 +8660,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
 			unit_stop_walking(bl,1);
 		break;
 		case SC_ANKLE:
-			if( battle_config.skill_trap_type )
+			if( battle_config.skill_trap_type || !map_flag_gvg(bl->m) )
 				unit_stop_walking(bl,1);
 		break;
 		case SC_HIDING:

+ 3 - 3
src/map/unit.c

@@ -352,7 +352,7 @@ int unit_walktoxy( struct block_list *bl, short x, short y, int flag)
 		map_random_dir(bl, &ud->to_x, &ud->to_y);
 
 	if(ud->walktimer != INVALID_TIMER) {
-		if( !battle_config.skill_trap_type && sc && sc->data[SC_ANKLE] ) // Ankle disallows you from changing your path
+		if( !battle_config.skill_trap_type && sc && map_flag_gvg(bl->m) && sc->data[SC_ANKLE] ) // Ankle disallows you from changing your path
 		return 0;
 		// When you come to the center of the grid because the change of destination while you're walking right now
 		// Call a function from a timer unit_walktoxy_sub
@@ -429,7 +429,7 @@ int unit_walktobl(struct block_list *bl, struct block_list *tbl, int range, int
 		map_random_dir(bl, &ud->to_x, &ud->to_y);
 
 	if(ud->walktimer != INVALID_TIMER) {
-		if( !battle_config.skill_trap_type && sc && sc->data[SC_ANKLE] ) // Ankle disallows you from changing your path
+		if( !battle_config.skill_trap_type && sc && map_flag_gvg(bl->m) && sc->data[SC_ANKLE] ) // Ankle disallows you from changing your path
 		return 0;
 		ud->state.change_walk_target = 1;
 		set_mobstate(bl, flag&2);
@@ -937,7 +937,7 @@ int unit_can_move(struct block_list *bl) {
 			)
 			return 0;
 
-		if( sc->data[SC_ANKLE] && ( battle_config.skill_trap_type || !unit_is_walking(bl) ) ) // Ankle only stops you after you're done moving
+		if( sc->data[SC_ANKLE] && ( battle_config.skill_trap_type || ( !map_flag_gvg(bl->m) && !unit_is_walking(bl) ) ) ) // Ankle only stops you after you're done moving
 			return 0;
 			
 		if (sc->opt1 > 0 && sc->opt1 != OPT1_STONEWAIT && sc->opt1 != OPT1_BURNING && !(sc->opt1 == OPT1_CRYSTALIZE && bl->type == BL_MOB))