Explorar o código

Kaahi and Arrow Shower RE fixes
- Removed Kaahi timer system (fixes #320)
* Kaahi will now heal BEFORE the damage is dealt
* Heals will no longer get lost due to timer system
* Decreased Kaahi duration 1800->350 seconds
- Implemented recent Arrow Shower Renewal updates (fixes #310)
* Arrow Shower now has 3x3 AoE on level 1~5 and 5x5 AoE on level 6~10
* Arrow Shower now has a fixed after cast delay of 500ms
* Note: The bug that causes the skill to hit twice is still present (couldn't fix it)

Playtester %!s(int64=10) %!d(string=hai) anos
pai
achega
ad8e22139f
Modificáronse 5 ficheiros con 11 adicións e 66 borrados
  1. 1 1
      db/pre-re/skill_cast_db.txt
  2. 2 2
      db/re/skill_cast_db.txt
  3. 1 1
      db/re/skill_unit_db.txt
  4. 7 2
      src/map/battle.c
  5. 0 60
      src/map/status.c

+ 1 - 1
db/pre-re/skill_cast_db.txt

@@ -750,7 +750,7 @@
 //-- SL_KAIZEL
 462,4500:4000:3500:3000:2500:2000:1500,0,0,1800000,2000,0
 //-- SL_KAAHI
-463,0,500,0,1800000,500,0
+463,0,500,0,350000,0,0
 //-- SL_KAUPE
 464,500,500,0,600000,0,0
 //-- SL_KAITE

+ 2 - 2
db/re/skill_cast_db.txt

@@ -89,7 +89,7 @@
 //-- AC_DOUBLE
 46,0,100,0,100,0,0,0
 //-- AC_SHOWER
-47,0,100,0,100,0,0,0
+47,0,500,0,100,0,0,0
 //==========================================
 
 
@@ -749,7 +749,7 @@
 //-- SL_KAIZEL
 462,3600:3200:2800:2400:2000:2000:2000:2000:2000:2000,0,0,1800000,2000,0,900:800:700:600:500:500:500:500:500:500
 //-- SL_KAAHI
-463,0,0,0,1800000,500,0,0
+463,0,0,0,350000,0,0,0
 //-- SL_KAUPE
 464,400,0,0,600000,0,0,100
 //-- SL_KAITE

+ 1 - 1
db/re/skill_unit_db.txt

@@ -36,7 +36,7 @@
  21,0x86,    ,  0, 2,1000,enemy, 0x018	//MG_THUNDERSTORM
  25,0x85,    ,  1, 0,  -1,all,   0x6003	//AL_PNEUMA
  27,0x81,0x80,  0, 0,  -1,all,   0x00E	//AL_WARP
- 47,0x86,    ,  0, 2:2:2:2:2:3:3:3:3:3,1000,enemy, 0x080	//AC_SHOWER
+ 47,0x86,    ,  0, 1:1:1:1:1:2:2:2:2:2,1000,enemy, 0x080	//AC_SHOWER
  70,0x83,    , -1, 1,1000,all,   0x018	//PR_SANCTUARY
  79,0x84,    , -1, 1,3000,enemy, 0x8018	//PR_MAGNUS
  80,0x87,0x88,  0, 1,2000,enemy, 0x4006	//WZ_FIREPILLAR

+ 7 - 2
src/map/battle.c

@@ -6824,8 +6824,13 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
 	if (tsc && tsc->data[SC_MTF_MLEATKED] && rnd()%100 < 20)
 		clif_skill_nodamage(target, target, SM_ENDURE, 5, sc_start(src, target, SC_ENDURE, 100, 5, skill_get_time(SM_ENDURE, 5)));
 
-	if(tsc && tsc->data[SC_KAAHI] && tsc->data[SC_KAAHI]->val4 == INVALID_TIMER && tstatus->hp < tstatus->max_hp)
-		tsc->data[SC_KAAHI]->val4 = add_timer(tick + skill_get_time2(SL_KAAHI,tsc->data[SC_KAAHI]->val1), kaahi_heal_timer, target->id, SC_KAAHI); //Activate heal.
+	if(tsc && tsc->data[SC_KAAHI] && tstatus->hp < tstatus->max_hp && status_charge(target, 0, tsc->data[SC_KAAHI]->val3)) {
+		int hp_heal = tstatus->max_hp - tstatus->hp;
+		if (hp_heal > tsc->data[SC_KAAHI]->val2)
+			hp_heal = tsc->data[SC_KAAHI]->val2;
+		if (hp_heal)
+			status_heal(target, hp_heal, 0, 2);
+	}
 
 	wd = battle_calc_attack(BF_WEAPON, src, target, 0, 0, flag);
 

+ 0 - 60
src/map/status.c

@@ -8359,14 +8359,6 @@ int status_change_start(struct block_list* src, struct block_list* bl,enum sc_ty
 				if(sce->val1 > val1)
 					return 1;
 				break;
-			case SC_KAAHI:
-				// Kaahi overwrites previous level regardless of existing level.
-				// Delete timer if it exists.
-				if (sce->val4 != INVALID_TIMER) {
-					delete_timer(sce->val4,kaahi_heal_timer);
-					sce->val4 = INVALID_TIMER;
-				}
-				break;
 			case SC_JAILED:
 				// When a player is already jailed, do not edit the jail data.
 				val2 = sce->val2;
@@ -9017,7 +9009,6 @@ int status_change_start(struct block_list* src, struct block_list* bl,enum sc_ty
 		case SC_KAAHI:
 			val2 = 200*val1; // HP heal
 			val3 = 5*val1; // SP cost
-			val4 = INVALID_TIMER;	// Kaahi Timer.
 			break;
 		case SC_BLESSING:
 			if ((!undead_flag && status->race!=RC_DEMON) || bl->type == BL_PC)
@@ -9985,9 +9976,6 @@ int status_change_start(struct block_list* src, struct block_list* bl,enum sc_ty
 				clif_changelook(bl,LOOK_SHIELD,0);
 				clif_changelook(bl,LOOK_CLOTHES_COLOR,vd->cloth_color);
 				break;
-			case SC_KAAHI:
-				val4 = INVALID_TIMER;
-				break;
 		}
 
 	// Values that must be set regardless of flag&4 e.g. val_flag [Ind]
@@ -10877,11 +10865,6 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
 					skill_delunitgroup(group);
 			}
 			break;
-		case SC_KAAHI:
-			// Delete timer if it exists.
-			if (sce->val4 != INVALID_TIMER)
-				delete_timer(sce->val4,kaahi_heal_timer);
-			break;
 		case SC_JAILED:
 			if(tid == INVALID_TIMER)
 				break;
@@ -11307,48 +11290,6 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
 	return 1;
 }
 
-/**
- * Special timer and heal for Kaahi status
- * @param tid: Timer ID
- * @param tick: How long before next call
- * @param id: ID of character
- * @param data: Information passed through the timer call
- * @return 1: Success 0: Fail
- */
-int kaahi_heal_timer(int tid, unsigned int tick, int id, intptr_t data)
-{
-	struct block_list *bl;
-	struct status_change *sc;
-	struct status_change_entry *sce;
-	struct status_data *status;
-	int hp;
-
-	if(!((bl=map_id2bl(id))&&
-		(sc=status_get_sc(bl)) &&
-		(sce = sc->data[SC_KAAHI])))
-		return 0;
-
-	if(sce->val4 != tid) {
-		ShowError("kaahi_heal_timer: Timer mismatch: %d != %d\n", tid, sce->val4);
-		sce->val4 = INVALID_TIMER;
-		return 0;
-	}
-
-	status=status_get_status_data(bl);
-	if(!status_charge(bl, 0, sce->val3)) {
-		sce->val4 = INVALID_TIMER;
-		return 0;
-	}
-
-	hp = status->max_hp - status->hp;
-	if (hp > sce->val2)
-		hp = sce->val2;
-	if (hp)
-		status_heal(bl, hp, 0, 2);
-	sce->val4 = INVALID_TIMER;
-	return 1;
-}
-
 /**
  * Resets timers for statuses
  * Used with reoccurring status effects, such as dropping SP every 5 seconds
@@ -12988,7 +12929,6 @@ int status_readdb(void)
 int do_init_status(void)
 {
 	add_timer_func_list(status_change_timer,"status_change_timer");
-	add_timer_func_list(kaahi_heal_timer,"kaahi_heal_timer");
 	add_timer_func_list(status_natural_heal_timer,"status_natural_heal_timer");
 	initChangeTables();
 	initDummyData();