Prechádzať zdrojové kódy

Direction fixes
- Updated the config setting attack_direction_change from 15 to 0 (official value); that means that a unit's direction will no longer change when it attacks; knock-back effects from e.g. Firewall will depend on the last direction the target walked into instead (bugreport:1322)
- Ensured that the default direction of a monster is always "north", so that immobile monsters will now always be knocked back to the south by e.g. Firewall on default settings, unless a skill like e.g. Backstab changes their direction (bugreport:1322)

Playtester 10 rokov pred
rodič
commit
d20ac845d1
3 zmenil súbory, kde vykonal 8 pridanie a 2 odobranie
  1. 6 1
      conf/battle/battle.conf
  2. 1 0
      src/map/mob.c
  3. 1 1
      src/map/unit.c

+ 6 - 1
conf/battle/battle.conf

@@ -102,7 +102,12 @@ weapon_defense_type: 0
 magic_defense_type: 0
 
 // Change attacker's direction to face opponent on every attack? (Note 3)
-attack_direction_change: 15
+// NOTE: On official servers knockback of some skills like Firewall is always based on the
+// last direction walked. Even when attacking in a completely different direction, the
+// knockback direction won't change, so e.g. if you walk north and then attack an enemy to
+// the south you will still be knocked back to the south by Firewall. Immobile monsters
+// will always be knocked back to the south as their default direction is north.
+attack_direction_change: 0
 
 // For those who is set, their innate attack element is "not elemental"
 // (100% versus on all defense-elements) (Note 3)

+ 1 - 0
src/map/mob.c

@@ -952,6 +952,7 @@ int mob_spawn (struct mob_data *md)
 	md->move_fail_count = 0;
 	md->ud.state.attack_continue = 0;
 	md->ud.target_to = 0;
+	md->ud.dir = 0;
 	if( md->spawn_timer != INVALID_TIMER ) {
 		delete_timer(md->spawn_timer, mob_delayspawn);
 		md->spawn_timer = INVALID_TIMER;

+ 1 - 1
src/map/unit.c

@@ -2538,7 +2538,7 @@ static int unit_attack_timer_sub(struct block_list* src, int tid, unsigned int t
 
 	if( DIFF_TICK(ud->attackabletime,tick) <= 0 ) {
 		if (battle_config.attack_direction_change && (src->type&battle_config.attack_direction_change))
-			ud->dir = map_calc_dir(src, target->x,target->y );
+			ud->dir = map_calc_dir(src, target->x, target->y);
 
 		if(ud->walktimer != INVALID_TIMER)
 			unit_stop_walking(src,1);