mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-21 12:47:07 +00:00
Core/Scripts: fix Nightfall proc chance and reduce it for victims with level above 60. (#3304)
* Core/Scripts: fix Nightfall proc chance and reduce it for victims with level above 60
Adding a TrinityCore commit eac9c1f0b9
* Update rev_1597581112860069800.sql
* Update rev_1597581112860069800.sql
Co-authored-by: Francesco Borzì <borzifrancesco@gmail.com>
Co-authored-by: Stefano Borzì <stefanoborzi32@gmail.com>
This commit is contained in:
@@ -234,6 +234,30 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
// Only used currently for
|
||||
// 19169: Nightfall
|
||||
class item_generic_limit_chance_above_60 : public ItemScript
|
||||
{
|
||||
public:
|
||||
item_generic_limit_chance_above_60() : ItemScript("item_generic_limit_chance_above_60") { }
|
||||
|
||||
bool OnCastItemCombatSpell(Player* /*player*/, Unit* victim, SpellInfo const* /*spellInfo*/, Item* /*item*/) override
|
||||
{
|
||||
// spell proc chance gets severely reduced on victims > 60 (formula unknown)
|
||||
if (victim->getLevel() > 60)
|
||||
{
|
||||
// gives ~0.1% proc chance at lvl 70
|
||||
float const lvlPenaltyFactor = 9.93f;
|
||||
float const failureChance = (victim->getLevel() - 60) * lvlPenaltyFactor;
|
||||
|
||||
// base ppm chance was already rolled, only roll success chance
|
||||
return !roll_chance_f(failureChance);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_item_scripts()
|
||||
{
|
||||
new item_only_for_flight();
|
||||
@@ -244,4 +268,5 @@ void AddSC_item_scripts()
|
||||
new item_disgusting_jar();
|
||||
new item_petrov_cluster_bombs();
|
||||
new item_captured_frog();
|
||||
new item_generic_limit_chance_above_60();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user