Jelajahi Sumber

Fixed Grand Cross and Grand Darkness (#6927)

- Fixes #6647 (b)
- Related to #1140
- Follow-up to ce4aed2
- Re-implemented Grand Cross / Grand Darkness
- Both skills can hit up to 4 times
- Each cell of both skills will stop dealing damage if it dealt damage at least 3 times
- The interval is now fixed to 300ms regardless of how many targets are on a single cell
Playtester 3 tahun lalu
induk
melakukan
cfa9776a28
4 mengubah file dengan 24 tambahan dan 9 penghapusan
  1. 7 2
      conf/battle/skill.conf
  2. 2 1
      db/pre-re/skill_db.yml
  3. 2 1
      db/re/skill_db.yml
  4. 13 5
      src/map/skill.cpp

+ 7 - 2
conf/battle/skill.conf

@@ -174,8 +174,13 @@ sense_type: 1
 finger_offensive_type: 0
 
 // Grandcross Settings (Don't mess with these)
-// If set to no, hit interval is increased based on the amount of mobs standing on the same cell
-// (means that when there's stacked mobs in the same cell, they won't receive all hits)
+// Officially, Grand Cross has four damage waves, but each cell will stop
+// dealing damage on the next wave after it already dealt at least 3 hits.
+// A moving monster can take up to 4 hits, while a stack of monsters may only
+// take 1-3 hits.
+// Set this to yes if you want all waves to deal damage to all targets.
+// Hint: If you want to reduce the number of waves, you need to reduce the
+// duration of the skill (e.g. to 800ms for three damage waves).
 gx_allhit: no
 
 // Grandcross display type (Default 1)

+ 2 - 1
db/pre-re/skill_db.yml

@@ -9214,7 +9214,8 @@ Body:
     HitCount: 1
     Element: Dark
     AfterCastWalkDelay: 1000
-    Duration1: 30000
+    Duration1: 950
+    Duration2: 30000
     Unit:
       Id: Dummyskill
       Layout: -1

+ 2 - 1
db/re/skill_db.yml

@@ -9534,7 +9534,8 @@ Body:
     HitCount: 1
     Element: Dark
     AfterCastWalkDelay: 1000
-    Duration1: 18000
+    Duration1: 950
+    Duration2: 18000
     Unit:
       Id: Dummyskill
       Layout: -1

+ 13 - 5
src/map/skill.cpp

@@ -1526,7 +1526,7 @@ int skill_additional_effect(struct block_list* src, struct block_list *bl, uint1
 		break;
 
 	case NPC_GRANDDARKNESS:
-		sc_start(src, bl, SC_BLIND, 100, skill_lv, skill_get_time(skill_id, skill_lv));
+		sc_start(src, bl, SC_BLIND, 100, skill_lv, skill_get_time2(skill_id, skill_lv));
 		attack_type |= BF_WEAPON;
 		break;
 
@@ -14735,6 +14735,10 @@ std::shared_ptr<s_skill_unit_group> skill_unitsetting(struct block_list *src, ui
 			case NJ_KAENSIN:
 				unit_val2 = group->val2;
 				break;
+			case CR_GRANDCROSS:
+			case NPC_GRANDDARKNESS:
+				unit_val1 = (skill_get_time(skill_id, skill_lv) / interval); //Default: 950/300 = 3 hits
+				break;
 			case WZ_ICEWALL:
 				unit_val1 = 200 + 200*skill_lv;
 				unit_val2 = map_getcell(src->m, ux, uy, CELL_GETTYPE);
@@ -15241,9 +15245,6 @@ int skill_unit_onplace_timer(struct skill_unit *unit, struct block_list *bl, t_t
 		if (diff < 0)
 			return 0;
 		ts->tick = tick+sg->interval;
-
-		if ((skill_id==CR_GRANDCROSS || skill_id==NPC_GRANDDARKNESS) && !battle_config.gx_allhit)
-			ts->tick += (t_tick)sg->interval*(map_count_oncell(bl->m,bl->x,bl->y,BL_CHAR,0)-1);
 	}
 
 	// Wall of Thorn damaged by Fire element unit [Cydh]
@@ -15339,6 +15340,12 @@ int skill_unit_onplace_timer(struct skill_unit *unit, struct block_list *bl, t_t
 						}
 					}
 					break;
+				case CR_GRANDCROSS:
+				case NPC_GRANDDARKNESS:
+					if(!battle_config.gx_allhit)
+						unit->val1--;
+					skill_attack(skill_get_type(sg->skill_id),ss,&unit->bl,bl,sg->skill_id,sg->skill_lv,tick,0);
+					break;
 				default:
 					skill_attack(skill_get_type(sg->skill_id),ss,&unit->bl,bl,sg->skill_id,sg->skill_lv,tick,0);
 			}
@@ -20693,7 +20700,8 @@ static int skill_unit_timer_sub(DBKey key, DBData *data, va_list ap)
 			}
 		}
 		else if (group->skill_id == WZ_METEOR || group->skill_id == SU_CN_METEOR || group->skill_id == SU_CN_METEOR2 || 
-			group->skill_id == AG_VIOLENT_QUAKE_ATK || group->skill_id == AG_ALL_BLOOM_ATK || group->skill_id == AG_ALL_BLOOM_ATK2) {
+			group->skill_id == AG_VIOLENT_QUAKE_ATK || group->skill_id == AG_ALL_BLOOM_ATK || group->skill_id == AG_ALL_BLOOM_ATK2 ||
+			((group->skill_id == CR_GRANDCROSS || group->skill_id == NPC_GRANDDARKNESS) && unit->val1 <= 0)) {
 			skill_delunit(unit);
 			return 0;
 		}