Explorar o código

> Hercules merges:

* e9d07bd:
Fixed bug with garments not displaying properly. (bugreport:7018)

* 9f75e12:
Fixed Ankle Snare to behave as in official servers, you only stop walking when you reach your destination and activates all other traps in the path. (bugreport:4832)

* cba3bef:
New skill config - After due consideration we thought it'd be in the best interest of the community to provide a switch to this official feature since it drastically change the way traps can be used.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@17109 54d463be-8e91-2dee-dedb-b68131a5f0ec
flaid %!s(int64=12) %!d(string=hai) anos
pai
achega
7baefc8b95
Modificáronse 7 ficheiros con 29 adicións e 11 borrados
  1. 5 0
      conf/battle/skill.conf
  2. 4 0
      src/map/battle.c
  3. 2 1
      src/map/battle.h
  4. 2 4
      src/map/clif.c
  5. 4 2
      src/map/skill.c
  6. 4 2
      src/map/status.c
  7. 8 2
      src/map/unit.c

+ 5 - 0
conf/battle/skill.conf

@@ -275,3 +275,8 @@ invincible.nodamage: no
 // On official server, a fix is in place that prevents the switching of weapons to cancel songs.
 // 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 stops moving right when stepping over it.
+skill_trap_type: 0

+ 4 - 0
src/map/battle.c

@@ -5875,6 +5875,10 @@ static const struct _battle_data {
 	{ "homunculus_max_level",               &battle_config.hom_max_level,                   99,     0,      MAX_LEVEL,      },
 	{ "homunculus_S_max_level",             &battle_config.hom_S_max_level,                 150,    0,      MAX_LEVEL,      },
 	{ "mob_size_influence",					&battle_config.mob_size_influence,				0,		0,		1,				},
+	/**
+	 * Hercules
+	 **/
+	{ "skill_trap_type",                    &battle_config.skill_trap_type,                 0,      0,      1,              },
 };
 #ifndef STATS_OPT_OUT
 /**

+ 2 - 1
src/map/battle.h

@@ -483,7 +483,8 @@ extern struct Battle_Config
 	int atcommand_mobinfo_type;
 
 	int mob_size_influence; // Enable modifications on earned experience, drop rates and monster status depending on monster size. [mkbu95]
-} battle_config;
+	int skill_trap_type;
+	} battle_config;
 
 void do_init_battle(void);
 void do_final_battle(void);

+ 2 - 4
src/map/clif.c

@@ -1374,10 +1374,8 @@ int clif_spawn(struct block_list *bl)
 			if( sd->sc.data[SC_PUSH_CART] )
 				clif_status_load_notick(&sd->bl, SI_ON_PUSH_CART, 2, sd->sc.data[SC_PUSH_CART]->val1, 0, 0);
 		#endif
-		#if PACKETVER <= 20120207
 			if (sd->status.robe)
 				clif_refreshlook(bl,bl->id,LOOK_ROBE,sd->status.robe,AREA);
-		#endif
 		}
 		break;
 	case BL_MOB:
@@ -4096,7 +4094,6 @@ void clif_getareachar_unit(struct map_session_data* sd,struct block_list *bl)
 
 	if (vd->cloth_color)
 		clif_refreshlook(&sd->bl,bl->id,LOOK_CLOTHES_COLOR,vd->cloth_color,SELF);
-
 	switch (bl->type)
 	{
 	case BL_PC:
@@ -4111,6 +4108,8 @@ void clif_getareachar_unit(struct map_session_data* sd,struct block_list *bl)
 				clif_sendbgemblem_single(sd->fd,tsd);
 			if( tsd->sc.data[SC_CAMOUFLAGE] )
 				clif_status_load(bl,SI_CAMOUFLAGE,1);
+			if ( tsd->status.robe )
+				clif_refreshlook(&sd->bl,bl->id,LOOK_ROBE,tsd->status.robe,SELF);
 		}
 		break;
 	case BL_MER: // Devotion Effects
@@ -9122,7 +9121,6 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
 
 	if(sd->vd.cloth_color)
 		clif_refreshlook(&sd->bl,sd->bl.id,LOOK_CLOTHES_COLOR,sd->vd.cloth_color,SELF);
-
 	// item
 	clif_inventorylist(sd);  // inventory list first, otherwise deleted items in pc_checkitem show up as 'unknown item'
 	pc_checkitem(sd);

+ 4 - 2
src/map/skill.c

@@ -11446,8 +11446,10 @@ 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);
-					unit_movepos(bl, src->bl.x, src->bl.y, 0, 0);
-					clif_fixpos(bl);
+					if( sg->unit_id == UNT_MANHOLE || battle_config.skill_trap_type ) {
+						unit_movepos(bl, src->bl.x, src->bl.y, 0, 0);
+						clif_fixpos(bl);
+					}
 					sg->val2 = bl->id;
 				} else
 					sec = 3000; //Couldn't trap it?

+ 4 - 2
src/map/status.c

@@ -997,7 +997,6 @@ void initChangeTables(void) {
 		StatusIconChangeTable[SC_HALLUCINATION] = SI_BLANK;
 
 	/* StatusChangeState (SCS_) NOMOVE */
-	StatusChangeStateTable[SC_ANKLE]               |= SCS_NOMOVE;
 	StatusChangeStateTable[SC_AUTOCOUNTER]         |= SCS_NOMOVE;
 	StatusChangeStateTable[SC_TRICKDEAD]           |= SCS_NOMOVE;
 	StatusChangeStateTable[SC_BLADESTOP]           |= SCS_NOMOVE;
@@ -8631,7 +8630,6 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
 		case SC_CONFUSION:
 		case SC_CLOSECONFINE:
 		case SC_CLOSECONFINE2:
-		case SC_ANKLE:
 		case SC_SPIDERWEB:
 		case SC_ELECTRICSHOCKER:
 		case SC_BITE:
@@ -8647,6 +8645,10 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
 		case SC_PARALYSIS:
 			unit_stop_walking(bl,1);
 		break;
+		case SC_ANKLE:
+			if( battle_config.skill_trap_type )
+				unit_stop_walking(bl,1);
+		break;
 		case SC_HIDING:
 		case SC_CLOAKING:
 		case SC_CLOAKINGEXCEED:

+ 8 - 2
src/map/unit.c

@@ -350,6 +350,8 @@ 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->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
 		ud->state.change_walk_target = 1;
@@ -425,6 +427,8 @@ 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->data[SC_ANKLE] ) // Ankle disallows you from changing your path
+		return 0;
 		ud->state.change_walk_target = 1;
 		set_mobstate(bl, flag&2);
 		return 1;
@@ -890,8 +894,7 @@ int unit_is_walking(struct block_list *bl)
 /*==========================================
  * Determines if the bl can move based on status changes. [Skotlex]
  *------------------------------------------*/
-int unit_can_move(struct block_list *bl)
-{
+int unit_can_move(struct block_list *bl) {
 	struct map_session_data *sd;
 	struct unit_data *ud;
 	struct status_change *sc;
@@ -932,6 +935,9 @@ 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
+			return 0;
+			
 		if (sc->opt1 > 0 && sc->opt1 != OPT1_STONEWAIT && sc->opt1 != OPT1_BURNING && (sc->opt1 != OPT1_CRYSTALIZE && bl->type != BL_MOB))
 			return 0;