Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复宠物重新召唤不满血不满蓝 #38

Merged
merged 2 commits into from
May 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/server/game/Battlefield/Zones/BattlefieldWG.cpp
Original file line number Diff line number Diff line change
@@ -845,6 +845,16 @@ void BattlefieldWG::OnPlayerJoinWar(Player* player)
RemoveAurasFromPlayer(player);

player->CastSpell(player, SPELL_RECRUIT, true);
if (player->IsMounted())
{
player->Dismount();//进冬拥湖战场下坐骑
}
player->RemoveAurasByType(SPELL_AURA_MOUNTED);
player->RemoveAurasByType(SPELL_AURA_FLY);
player->RemoveAurasByType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED);
player->RemoveAurasByType(SPELL_AURA_MOD_SHAPESHIFT);//增加检测小德飞行
player->SetSpeed(MOVE_RUN, 1, true);
player->SetSpeed(MOVE_FLIGHT, 1, true);
AddUpdateTenacity(player);

if (player->GetTeamId() == GetDefenderTeam())
9 changes: 7 additions & 2 deletions src/server/scripts/Spells/spell_dk.cpp
Original file line number Diff line number Diff line change
@@ -832,14 +832,19 @@ class spell_dk_pet_scaling : public AuraScript
if (aurEff->GetMiscValue() == STAT_STAMINA)
{
uint32 actStat = GetUnitOwner()->GetHealth();
float hppct = GetUnitOwner()->GetHealthPct() / 100.0f;//当前血量百分比
GetEffect(aurEff->GetEffIndex())->ChangeAmount(newAmount, false);
GetUnitOwner()->SetHealth(std::min<uint32>(GetUnitOwner()->GetMaxHealth(), actStat));
//GetUnitOwner()->SetHealth(std::min<uint32>(GetUnitOwner()->GetMaxHealth(), actStat));
GetUnitOwner()->SetHealth((uint32)(GetUnitOwner()->GetMaxHealth() * hppct));//按百分比更新血量

}
else
{
uint32 actStat = GetUnitOwner()->GetPower(POWER_MANA);
float pwpct = GetUnitOwner()->GetPowerPct(POWER_MANA) / 100.0f;//当前蓝量百分比
GetEffect(aurEff->GetEffIndex())->ChangeAmount(newAmount, false);
GetUnitOwner()->SetPower(POWER_MANA, std::min<uint32>(GetUnitOwner()->GetMaxPower(POWER_MANA), actStat));
//GetUnitOwner()->SetPower(POWER_MANA, std::min<uint32>(GetUnitOwner()->GetMaxPower(POWER_MANA), actStat));
GetUnitOwner()->SetPower(POWER_MANA, (uint32)(GetUnitOwner()->GetMaxPower(POWER_MANA) * pwpct));//按百分比更新蓝量
}
}
}
8 changes: 6 additions & 2 deletions src/server/scripts/Spells/spell_hunter.cpp
Original file line number Diff line number Diff line change
@@ -254,14 +254,18 @@ class spell_hun_generic_scaling : public AuraScript
if (aurEff->GetMiscValue() == STAT_STAMINA)
{
uint32 actStat = GetUnitOwner()->GetHealth();
float hppct = GetUnitOwner()->GetHealthPct() / 100.0f;//当前血量百分比
GetEffect(aurEff->GetEffIndex())->ChangeAmount(newAmount, false);
GetUnitOwner()->SetHealth(std::min<uint32>(GetUnitOwner()->GetMaxHealth(), actStat));
//GetUnitOwner()->SetHealth(std::min<uint32>(GetUnitOwner()->GetMaxHealth(), actStat));
GetUnitOwner()->SetHealth((uint32)(GetUnitOwner()->GetMaxHealth() * hppct));//按百分比更新血量
}
else
{
uint32 actStat = GetUnitOwner()->GetPower(POWER_MANA);
float pwpct = GetUnitOwner()->GetPowerPct(POWER_MANA) / 100.0f;//当前蓝量百分比
GetEffect(aurEff->GetEffIndex())->ChangeAmount(newAmount, false);
GetUnitOwner()->SetPower(POWER_MANA, std::min<uint32>(GetUnitOwner()->GetMaxPower(POWER_MANA), actStat));
//GetUnitOwner()->SetPower(POWER_MANA, std::min<uint32>(GetUnitOwner()->GetMaxPower(POWER_MANA), actStat));
GetUnitOwner()->SetPower(POWER_MANA, (uint32)(GetUnitOwner()->GetMaxPower(POWER_MANA) * pwpct));//按百分比更新蓝量
}
}
}
8 changes: 6 additions & 2 deletions src/server/scripts/Spells/spell_mage.cpp
Original file line number Diff line number Diff line change
@@ -305,14 +305,18 @@ class spell_mage_pet_scaling : public AuraScript
if (aurEff->GetMiscValue() == STAT_STAMINA)
{
uint32 actStat = GetUnitOwner()->GetHealth();
float hppct = GetUnitOwner()->GetHealthPct() / 100.0f;//当前血量百分比
GetEffect(aurEff->GetEffIndex())->ChangeAmount(newAmount, false);
GetUnitOwner()->SetHealth(std::min<uint32>(GetUnitOwner()->GetMaxHealth(), actStat));
//GetUnitOwner()->SetHealth(std::min<uint32>(GetUnitOwner()->GetMaxHealth(), actStat));
GetUnitOwner()->SetHealth((uint32)(GetUnitOwner()->GetMaxHealth() * hppct));//按百分比更新血量
}
else
{
uint32 actStat = GetUnitOwner()->GetPower(POWER_MANA);
float pwpct = GetUnitOwner()->GetPowerPct(POWER_MANA) / 100.0f;//当前蓝量百分比
GetEffect(aurEff->GetEffIndex())->ChangeAmount(newAmount, false);
GetUnitOwner()->SetPower(POWER_MANA, std::min<uint32>(GetUnitOwner()->GetMaxPower(POWER_MANA), actStat));
//GetUnitOwner()->SetPower(POWER_MANA, std::min<uint32>(GetUnitOwner()->GetMaxPower(POWER_MANA), actStat));
GetUnitOwner()->SetPower(POWER_MANA, (uint32)(GetUnitOwner()->GetMaxPower(POWER_MANA) * pwpct));//按百分比更新蓝量
}
}
}
8 changes: 6 additions & 2 deletions src/server/scripts/Spells/spell_shaman.cpp
Original file line number Diff line number Diff line change
@@ -248,14 +248,18 @@ class spell_sha_feral_spirit_scaling : public AuraScript
if (aurEff->GetMiscValue() == STAT_STAMINA)
{
uint32 actStat = GetUnitOwner()->GetHealth();
float hppct = GetUnitOwner()->GetHealthPct() / 100.0f;//当前血量百分比
GetEffect(aurEff->GetEffIndex())->ChangeAmount(newAmount, false);
GetUnitOwner()->SetHealth(std::min<uint32>(GetUnitOwner()->GetMaxHealth(), actStat));
//GetUnitOwner()->SetHealth(std::min<uint32>(GetUnitOwner()->GetMaxHealth(), actStat));
GetUnitOwner()->SetHealth((uint32)(GetUnitOwner()->GetMaxHealth() * hppct));//按百分比更新血量
}
else
{
uint32 actStat = GetUnitOwner()->GetPower(POWER_MANA);
float pwpct = GetUnitOwner()->GetPowerPct(POWER_MANA) / 100.0f;//当前蓝量百分比
GetEffect(aurEff->GetEffIndex())->ChangeAmount(newAmount, false);
GetUnitOwner()->SetPower(POWER_MANA, std::min<uint32>(GetUnitOwner()->GetMaxPower(POWER_MANA), actStat));
//GetUnitOwner()->SetPower(POWER_MANA, std::min<uint32>(GetUnitOwner()->GetMaxPower(POWER_MANA), actStat));
GetUnitOwner()->SetPower(POWER_MANA, (uint32)(GetUnitOwner()->GetMaxPower(POWER_MANA) * pwpct));//按百分比更新蓝量
}
}
}
8 changes: 6 additions & 2 deletions src/server/scripts/Spells/spell_warlock.cpp
Original file line number Diff line number Diff line change
@@ -354,14 +354,18 @@ class spell_warl_generic_scaling : public AuraScript
if (aurEff->GetMiscValue() == STAT_STAMINA)
{
uint32 actStat = GetUnitOwner()->GetHealth();
float hppct = GetUnitOwner()->GetHealthPct() / 100.0f;//当前血量百分比
GetEffect(aurEff->GetEffIndex())->ChangeAmount(newAmount, false);
GetUnitOwner()->SetHealth(std::min<uint32>(GetUnitOwner()->GetMaxHealth(), actStat));
//GetUnitOwner()->SetHealth(std::min<uint32>(GetUnitOwner()->GetMaxHealth(), actStat));
GetUnitOwner()->SetHealth((uint32)(GetUnitOwner()->GetMaxHealth() * hppct));//按百分比更新血量
}
else
{
uint32 actStat = GetUnitOwner()->GetPower(POWER_MANA);
float pwpct = GetUnitOwner()->GetPowerPct(POWER_MANA) / 100.0f;//当前蓝量百分比
GetEffect(aurEff->GetEffIndex())->ChangeAmount(newAmount, false);
GetUnitOwner()->SetPower(POWER_MANA, std::min<uint32>(GetUnitOwner()->GetMaxPower(POWER_MANA), actStat));
//GetUnitOwner()->SetPower(POWER_MANA, std::min<uint32>(GetUnitOwner()->GetMaxPower(POWER_MANA), actStat));
GetUnitOwner()->SetPower(POWER_MANA, (uint32)(GetUnitOwner()->GetMaxPower(POWER_MANA) * pwpct));//按百分比更新蓝量
}
}
}