Fixed enemy target and moved it back to skill.cpp
This commit is contained in:
parent
4c5ad8d667
commit
d2c9e90725
@ -10692,6 +10692,38 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
|
||||
break;
|
||||
case HVAN_CHAOTIC:
|
||||
{
|
||||
// Chance per skill level
|
||||
static const uint8 chance_homunculus[5] = {
|
||||
20,
|
||||
50,
|
||||
25,
|
||||
50,
|
||||
34
|
||||
};
|
||||
static const uint8 chance_master[5] = {
|
||||
static_cast<uint8>(chance_homunculus[0] + 30),
|
||||
static_cast<uint8>(chance_homunculus[1] + 10),
|
||||
static_cast<uint8>(chance_homunculus[2] + 50),
|
||||
static_cast<uint8>(chance_homunculus[3] + 4),
|
||||
static_cast<uint8>(chance_homunculus[4] + 33)
|
||||
};
|
||||
|
||||
uint8 chance = rnd_value(1, 100);
|
||||
|
||||
// Homunculus
|
||||
if (chance <= chance_homunculus[skill_lv - 1])
|
||||
bl = src;
|
||||
// Master
|
||||
else if (chance <= chance_master[skill_lv - 1])
|
||||
bl = battle_get_master(src);
|
||||
// Enemy (A random enemy targeting the master)
|
||||
else
|
||||
bl = battle_gettargeted(battle_get_master(src));
|
||||
|
||||
// If there's no enemy the chance reverts to the homunculus
|
||||
if (bl == nullptr)
|
||||
bl = src;
|
||||
|
||||
int32 heal = skill_calc_heal(src, bl, skill_id, rnd_value<uint16>(1, skill_lv), true);
|
||||
|
||||
// Official servers send the Heal skill packet with the healed amount, and then the skill packet with 1 as healed amount
|
||||
|
||||
@ -1831,42 +1831,6 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui
|
||||
|
||||
target_id = target->id;
|
||||
break;
|
||||
case HVAN_CHAOTIC:
|
||||
{
|
||||
// Chance per skill level
|
||||
static const uint8 chance_homunculus[5] = {
|
||||
20,
|
||||
50,
|
||||
25,
|
||||
50,
|
||||
34
|
||||
};
|
||||
static const uint8 chance_master[5] = {
|
||||
static_cast<uint8>( chance_homunculus[0] + 30 ),
|
||||
static_cast<uint8>( chance_homunculus[1] + 10 ),
|
||||
static_cast<uint8>( chance_homunculus[2] + 50 ),
|
||||
static_cast<uint8>( chance_homunculus[3] + 4 ),
|
||||
static_cast<uint8>( chance_homunculus[4] + 33 )
|
||||
};
|
||||
|
||||
uint8 chance = rnd_value(1, 100);
|
||||
|
||||
// Homunculus
|
||||
if (chance <= chance_homunculus[skill_lv - 1])
|
||||
target = src;
|
||||
// Master
|
||||
else if (chance <= chance_master[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_TINDER_BREAKER: {
|
||||
int skill_id2 = ((skill_id==MH_SONIC_CRAW)?MH_MIDNIGHT_FRENZY:MH_EQC);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user