Fixes Vanilmirth skills

This commit is contained in:
Daegaladh 2024-09-16 18:36:05 +02:00
parent baf7ec23d8
commit c07f685a31
6 changed files with 75 additions and 79 deletions

View File

@ -31026,19 +31026,7 @@ Body:
MaxLevel: 5 MaxLevel: 5
Type: Magic Type: Magic
TargetType: Attack TargetType: Attack
Range: 15 Range: 9
Hit: Single
HitCount:
- Level: 1
Count: 1
- Level: 2
Count: 2
- Level: 3
Count: 3
- Level: 4
Count: 4
- Level: 5
Count: 5
Requires: Requires:
SpCost: SpCost:
- Level: 1 - Level: 1
@ -31055,10 +31043,10 @@ Body:
Name: HVAN_CHAOTIC Name: HVAN_CHAOTIC
Description: Benediction of Chaos Description: Benediction of Chaos
MaxLevel: 5 MaxLevel: 5
Type: Magic
TargetType: Self TargetType: Self
DamageFlags: DamageFlags:
NoDamage: true NoDamage: true
Hit: Single
AfterCastWalkDelay: 1500 AfterCastWalkDelay: 1500
Requires: Requires:
SpCost: 40 SpCost: 40
@ -31066,8 +31054,6 @@ Body:
Name: HVAN_INSTRUCT Name: HVAN_INSTRUCT
Description: Instruct Description: Instruct
MaxLevel: 5 MaxLevel: 5
DamageFlags:
NoDamage: true
- Id: 8016 - Id: 8016
Name: HVAN_EXPLOSION Name: HVAN_EXPLOSION
Description: Bio Explosion Description: Bio Explosion
@ -31079,10 +31065,13 @@ Body:
IgnoreElement: true IgnoreElement: true
IgnoreFlee: true IgnoreFlee: true
IgnoreDefCard: true IgnoreDefCard: true
Flags:
TargetTrap: true
Hit: Single Hit: Single
HitCount: 1 HitCount: 1
Element: Weapon Element: Neutral
SplashArea: 4 SplashArea: 5
Duration1: 1500
Requires: Requires:
SpCost: 1 SpCost: 1
- Id: 8018 - Id: 8018

View File

@ -43312,19 +43312,7 @@ Body:
MaxLevel: 5 MaxLevel: 5
Type: Magic Type: Magic
TargetType: Attack TargetType: Attack
Range: 15 Range: 9
Hit: Single
HitCount:
- Level: 1
Count: 1
- Level: 2
Count: 2
- Level: 3
Count: 3
- Level: 4
Count: 4
- Level: 5
Count: 5
Cooldown: Cooldown:
- Level: 1 - Level: 1
Time: 2000 Time: 2000
@ -43352,10 +43340,10 @@ Body:
Name: HVAN_CHAOTIC Name: HVAN_CHAOTIC
Description: Benediction of Chaos Description: Benediction of Chaos
MaxLevel: 5 MaxLevel: 5
Type: Magic
TargetType: Self TargetType: Self
DamageFlags: DamageFlags:
NoDamage: true NoDamage: true
Hit: Single
AfterCastWalkDelay: 1500 AfterCastWalkDelay: 1500
Cooldown: 3000 Cooldown: 3000
Requires: Requires:
@ -43364,8 +43352,6 @@ Body:
Name: HVAN_INSTRUCT Name: HVAN_INSTRUCT
Description: Instruct Description: Instruct
MaxLevel: 5 MaxLevel: 5
DamageFlags:
NoDamage: true
- Id: 8016 - Id: 8016
Name: HVAN_EXPLOSION Name: HVAN_EXPLOSION
Description: Bio Explosion Description: Bio Explosion
@ -43377,11 +43363,13 @@ Body:
IgnoreElement: true IgnoreElement: true
IgnoreFlee: true IgnoreFlee: true
IgnoreDefCard: true IgnoreDefCard: true
Flags:
TargetTrap: true
Hit: Single Hit: Single
HitCount: 1 HitCount: 1
Element: Weapon Element: Neutral
SplashArea: 4 SplashArea: 5
AfterCastActDelay: 5000 Duration1: 1500
CoolDown: 1000 CoolDown: 1000
Requires: Requires:
SpCost: 1 SpCost: 1

View File

@ -15457,6 +15457,9 @@ void clif_parse_HomMoveTo(int fd, map_session_data *sd){
else else
return; return;
if (x < 0 || y < 0 || x == bl->x || y == bl->y)
return;
unit_walktoxy(bl, x, y, 4); unit_walktoxy(bl, x, y, 4);
} }
@ -15479,7 +15482,6 @@ void clif_parse_HomAttack(int fd,map_session_data *sd)
bl = &sd->md->bl; bl = &sd->md->bl;
else return; else return;
unit_stop_attack(bl);
unit_attack(bl, target_id, action_type != 0); unit_attack(bl, target_id, action_type != 0);
} }

View File

@ -3811,12 +3811,12 @@ int64 skill_attack (int attack_type, struct block_list* src, struct block_list *
dmg.dmotion = clif_skill_damage(src,bl,tick,dmg.amotion,dmg.dmotion, damage, dmg.div_, CR_HOLYCROSS, -1, DMG_SPLASH); dmg.dmotion = clif_skill_damage(src,bl,tick,dmg.amotion,dmg.dmotion, damage, dmg.div_, CR_HOLYCROSS, -1, DMG_SPLASH);
break; break;
//Skills that need be passed as a normal attack for the client to display correctly. //Skills that need be passed as a normal attack for the client to display correctly.
case HVAN_EXPLOSION:
case NPC_SELFDESTRUCTION: case NPC_SELFDESTRUCTION:
if(src->type == BL_PC) if(src->type == BL_PC)
dmg.blewcount = 10; dmg.blewcount = 10;
dmg.amotion = 0; //Disable delay or attack will do no damage since source is dead by the time it takes effect. [Skotlex] dmg.amotion = 0; //Disable delay or attack will do no damage since source is dead by the time it takes effect. [Skotlex]
[[fallthrough]]; [[fallthrough]];
case HVAN_EXPLOSION:
case KN_AUTOCOUNTER: case KN_AUTOCOUNTER:
case NPC_CRITICALSLASH: case NPC_CRITICALSLASH:
case TF_DOUBLE: case TF_DOUBLE:
@ -4761,6 +4761,9 @@ static TIMER_FUNC(skill_timerskill){
case ABC_FRENZY_SHOT: case ABC_FRENZY_SHOT:
skill_castend_damage_id(src, target, skl->skill_id, skl->skill_lv, tick, skl->flag); skill_castend_damage_id(src, target, skl->skill_id, skl->skill_lv, tick, skl->flag);
break; break;
case HVAN_EXPLOSION:
status_kill(src);
break;
default: default:
skill_attack(skl->type,src,src,target,skl->skill_id,skl->skill_lv,tick,skl->flag); skill_attack(skl->type,src,src,target,skl->skill_id,skl->skill_lv,tick,skl->flag);
break; break;
@ -6194,16 +6197,9 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
case HVAN_CAPRICE: //[blackhole89] case HVAN_CAPRICE: //[blackhole89]
{ {
int ran=rnd()%4; static const e_skill subskills[] = { MG_COLDBOLT, MG_FIREBOLT, MG_LIGHTNINGBOLT, WZ_EARTHSPIKE };
int sid = 0; e_skill subskill_id = subskills[rnd()%ARRAYLENGTH(subskills)];
switch(ran) skill_attack(skill_get_type(subskill_id), src, src, bl, subskill_id, skill_lv, tick, flag);
{
case 0: sid=MG_COLDBOLT; break;
case 1: sid=MG_FIREBOLT; break;
case 2: sid=MG_LIGHTNINGBOLT; break;
case 3: sid=WZ_EARTHSPIKE; break;
}
skill_attack(BF_MAGIC,src,src,bl,sid,skill_lv,tick,flag|SD_LEVEL);
} }
break; break;
@ -6323,7 +6319,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
[[fallthrough]]; [[fallthrough]];
case HVAN_EXPLOSION: case HVAN_EXPLOSION:
if (src != bl) if (src != bl)
skill_attack(BF_MISC,src,src,bl,skill_id,skill_lv,tick,flag); skill_attack(skill_get_type(skill_id),src,src,bl,skill_id,skill_lv,tick,flag);
break; break;
// Celest // Celest
@ -8816,13 +8812,11 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
BF_MAGIC, src, src, skill_id, skill_lv, tick, flag, BCT_ENEMY); BF_MAGIC, src, src, skill_id, skill_lv, tick, flag, BCT_ENEMY);
break; break;
case HVAN_EXPLOSION: //[orn]
case NPC_SELFDESTRUCTION: case NPC_SELFDESTRUCTION:
//Self Destruction hits everyone in range (allies+enemies) //Self Destruction hits everyone in range (allies+enemies)
//Except for Summoned Marine spheres on non-versus maps, where it's just enemy. //Except for Summoned Marine spheres on non-versus maps, where it's just enemy.
i = ((!md || md->special_state.ai == AI_SPHERE) && !map_flag_vs(src->m))? i = ((!md || md->special_state.ai == AI_SPHERE) && !map_flag_vs(src->m))?
BCT_ENEMY:BCT_ALL; BCT_ENEMY:BCT_ALL;
clif_skill_nodamage(src, src, skill_id, -1, 1);
map_delblock(src); //Required to prevent chain-self-destructions hitting back. map_delblock(src); //Required to prevent chain-self-destructions hitting back.
map_foreachinshootrange(skill_area_sub, bl, map_foreachinshootrange(skill_area_sub, bl,
skill_get_splash(skill_id, skill_lv), BL_CHAR|BL_SKILL, skill_get_splash(skill_id, skill_lv), BL_CHAR|BL_SKILL,
@ -8832,14 +8826,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
map_freeblock_unlock(); map_freeblock_unlock();
return 1; return 1;
} }
status_damage(src, src, sstatus->max_hp,0,0,1, skill_id); status_kill(src);
if(skill_id == HVAN_EXPLOSION && src->type == BL_HOM) {
homun_data& hd = reinterpret_cast<homun_data&>( *src );
hd.homunculus.intimacy = hom_intimacy_grade2intimacy(HOMGRADE_HATE_WITH_PASSION);
clif_send_homdata( hd, SP_INTIMATE );
}
break; break;
case AL_ANGELUS: case AL_ANGELUS:
#ifdef RENEWAL #ifdef RENEWAL
@ -10695,25 +10682,26 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
clif_skill_fail( *sd, skill_id ); clif_skill_fail( *sd, skill_id );
break; break;
case HVAN_CHAOTIC: //[orn] case HVAN_CHAOTIC: //[orn]
{ i = skill_calc_heal(src, bl, skill_id, rnd_value<uint16>(1, skill_lv), true);
static const int per[5][2]={{20,50},{50,60},{25,75},{60,64},{34,67}};
int r = rnd()%100;
i = (skill_lv-1)%5;
if(r<per[i][0]) //Self
bl = src;
else if(r<per[i][1]) //Master
bl = battle_get_master(src);
else //Enemy
bl = map_id2bl(battle_gettarget(src));
if (!bl) bl = src; // Official servers send the Heal skill packet with the healed amount, and then the skill packet with 1 as healed amount
i = skill_calc_heal(src, bl, skill_id, 1+rnd()%skill_lv, true); clif_skill_nodamage(src, bl, AL_HEAL, i, 1);
//Eh? why double skill packet? clif_skill_nodamage(src, bl, skill_id, 1, 1);
clif_skill_nodamage(src,bl,AL_HEAL,i,1); status_heal(bl, i, 0, 0);
clif_skill_nodamage(src,bl,skill_id,i,1);
status_heal(bl, i, 0, 0);
}
break; break;
case HVAN_EXPLOSION:
{
clif_skill_nodamage(src, src, skill_id, skill_lv, 1);
map_foreachinshootrange(skill_area_sub, bl, skill_get_splash(skill_id, skill_lv), BL_CHAR | BL_SKILL, src, skill_id, skill_lv, tick, flag | BCT_ENEMY, skill_castend_damage_id);
homun_data& hd = reinterpret_cast<homun_data&>(*src);
hd.homunculus.intimacy = hom_intimacy_grade2intimacy(HOMGRADE_HATE_WITH_PASSION);
clif_send_homdata(hd, SP_INTIMATE);
// There's a delay between splash damage and the homunculus death
skill_addtimerskill(src, tick + skill_get_time(skill_id, skill_lv), src->id, 0, 0, skill_id, skill_lv, 0, flag);
break;
}
// Homun single-target support skills [orn] // Homun single-target support skills [orn]
case HLIF_CHANGE: case HLIF_CHANGE:
#ifndef RENEWAL #ifndef RENEWAL

View File

@ -5046,8 +5046,10 @@ int status_calc_homunculus_(struct homun_data *hd, uint8 opt)
status->def += skill_lv * 4; status->def += skill_lv * 4;
if((skill_lv = hom_checkskill(hd, HVAN_INSTRUCT)) > 0) { if((skill_lv = hom_checkskill(hd, HVAN_INSTRUCT)) > 0) {
status->int_ += 1 + skill_lv / 2 + skill_lv / 4 + skill_lv / 5; static const uint8 bonus_int[] = { 1, 2, 2, 4, 5 };
status->str += 1 + skill_lv / 3 + skill_lv / 3 + skill_lv / 4; static const uint8 bonus_str[] = { 1, 1, 3, 4, 4 };
status->int_ += bonus_int[skill_lv - 1];
status->str += bonus_str[skill_lv - 1];
} }
if((skill_lv = hom_checkskill(hd, HAMI_SKIN)) > 0) if((skill_lv = hom_checkskill(hd, HAMI_SKIN)) > 0)

View File

@ -1831,6 +1831,33 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui
target_id = target->id; target_id = target->id;
break; break;
case HVAN_CHAOTIC:
{
// Chance per skill level
static const uint8 chance_table[2][5] = {
{ 20, 50, 25, 50, 34 }, // Homunculus
{ 30, 10, 50, 4, 33 } // Master
};
uint8 chance = rnd_value(1, 100);
// Homunculus
if (chance <= chance_table[0][skill_lv - 1])
target = src;
// Master
else if (chance <= (chance_table[0][skill_lv - 1] + chance_table[1][skill_lv - 1]))
target = battle_get_master(src);
// Enemy
else
target = map_id2bl(battle_gettarget(src));
// If there's no enemy the chance reverts to the homunculus
if (target == nullptr)
target = src;
target_id = target->id;
break;
}
case MH_SONIC_CRAW: case MH_SONIC_CRAW:
case MH_TINDER_BREAKER: { case MH_TINDER_BREAKER: {
int skill_id2 = ((skill_id==MH_SONIC_CRAW)?MH_MIDNIGHT_FRENZY:MH_EQC); int skill_id2 = ((skill_id==MH_SONIC_CRAW)?MH_MIDNIGHT_FRENZY:MH_EQC);