Merge branch 'master' into questXPHook
This commit is contained in:
@@ -37,9 +37,9 @@ void AddGossipItemFor(Player* player, uint32 icon, std::string const& text, uint
|
||||
}
|
||||
|
||||
// Uses gossip item info from DB
|
||||
void AddGossipItemFor(Player* player, uint32 gossipMenuID, uint32 gossipMenuItemID, uint32 sender, uint32 action)
|
||||
void AddGossipItemFor(Player* player, uint32 gossipMenuID, uint32 gossipMenuItemID, uint32 sender, uint32 action, uint32 boxMoney /*= 0*/)
|
||||
{
|
||||
player->PlayerTalkClass->GetGossipMenu().AddMenuItem(gossipMenuID, gossipMenuItemID, sender, action);
|
||||
player->PlayerTalkClass->GetGossipMenu().AddMenuItem(gossipMenuID, gossipMenuItemID, sender, action, boxMoney);
|
||||
}
|
||||
|
||||
void SendGossipMenuFor(Player* player, uint32 npcTextID, ObjectGuid const guid)
|
||||
|
||||
@@ -91,7 +91,7 @@ void AddGossipItemFor(Player* player, uint32 icon, std::string const& text, uint
|
||||
void AddGossipItemFor(Player* player, uint32 icon, std::string const& text, uint32 sender, uint32 action, std::string const& popupText, uint32 popupMoney, bool coded);
|
||||
|
||||
// Uses gossip item info from DB
|
||||
void AddGossipItemFor(Player* player, uint32 gossipMenuID, uint32 gossipMenuItemID, uint32 sender, uint32 action);
|
||||
void AddGossipItemFor(Player* player, uint32 gossipMenuID, uint32 gossipMenuItemID, uint32 sender, uint32 action, uint32 boxMoney = 0);
|
||||
|
||||
// Send menu text
|
||||
void SendGossipMenuFor(Player* player, uint32 npcTextID, ObjectGuid const guid);
|
||||
|
||||
@@ -662,7 +662,10 @@ enum BG_AV_CreaturePlace
|
||||
AV_CPLACE_TRIGGER18 = 319,
|
||||
AV_CPLACE_TRIGGER19 = 320,
|
||||
|
||||
AV_CPLACE_MAX = 321
|
||||
AV_CPLACE_MAX = 321,
|
||||
|
||||
AV_CPLACE_A_BOSS = 381,
|
||||
AV_CPLACE_H_BOSS = 445
|
||||
};
|
||||
|
||||
//x, y, z, o
|
||||
|
||||
@@ -425,8 +425,14 @@ bool Creature::InitEntry(uint32 Entry, const CreatureData* data)
|
||||
SetNativeDisplayId(displayID);
|
||||
|
||||
// Load creature equipment
|
||||
if (!data || data->equipmentId == 0) // use default from the template
|
||||
LoadEquipment(0); // 0 means no equipment for creature table
|
||||
if (!data)
|
||||
{
|
||||
LoadEquipment(); // use default from the template
|
||||
}
|
||||
else if (data->equipmentId == 0)
|
||||
{
|
||||
LoadEquipment(0); // 0 means no equipment for creature table
|
||||
}
|
||||
else
|
||||
{
|
||||
m_originalEquipmentId = data->equipmentId;
|
||||
|
||||
@@ -74,8 +74,9 @@ void GossipMenu::AddMenuItem(int32 menuItemId, uint8 icon, std::string const& me
|
||||
* @param menuItemId Gossip menu item id.
|
||||
* @param sender Identifier of the current menu.
|
||||
* @param action Custom action given to OnGossipHello.
|
||||
* @param boxMoney Custom price for pop-up box. If > 0, it will replace DB value.
|
||||
*/
|
||||
void GossipMenu::AddMenuItem(uint32 menuId, uint32 menuItemId, uint32 sender, uint32 action)
|
||||
void GossipMenu::AddMenuItem(uint32 menuId, uint32 menuItemId, uint32 sender, uint32 action, uint32 boxMoney)
|
||||
{
|
||||
/// Find items for given menu id.
|
||||
GossipMenuItemsMapBounds bounds = sObjectMgr->GetGossipMenuItemsMapBounds(menuId);
|
||||
@@ -126,7 +127,7 @@ void GossipMenu::AddMenuItem(uint32 menuId, uint32 menuItemId, uint32 sender, ui
|
||||
}
|
||||
|
||||
/// Add menu item with existing method. Menu item id -1 is also used in ADD_GOSSIP_ITEM macro.
|
||||
AddMenuItem(-1, itr->second.OptionIcon, strOptionText, sender, action, strBoxText, itr->second.BoxMoney, itr->second.BoxCoded);
|
||||
AddMenuItem(-1, itr->second.OptionIcon, strOptionText, sender, action, strBoxText, boxMoney ? boxMoney : itr->second.BoxMoney, itr->second.BoxCoded);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -165,7 +165,7 @@ public:
|
||||
~GossipMenu();
|
||||
|
||||
void AddMenuItem(int32 menuItemId, uint8 icon, std::string const& message, uint32 sender, uint32 action, std::string const& boxMessage, uint32 boxMoney, bool coded = false);
|
||||
void AddMenuItem(uint32 menuId, uint32 menuItemId, uint32 sender, uint32 action);
|
||||
void AddMenuItem(uint32 menuId, uint32 menuItemId, uint32 sender, uint32 action, uint32 boxMoney);
|
||||
|
||||
void SetMenuId(uint32 menu_id) { _menuId = menu_id; }
|
||||
[[nodiscard]] uint32 GetMenuId() const { return _menuId; }
|
||||
|
||||
@@ -3009,11 +3009,18 @@ SpellMissInfo Unit::MagicSpellHitResult(Unit* victim, SpellInfo const* spellInfo
|
||||
thisLevel = std::max<int32>(thisLevel, spellInfo->SpellLevel);
|
||||
int32 levelDiff = int32(victim->getLevelForTarget(this)) - thisLevel;
|
||||
|
||||
int32 MISS_CHANCE_MULTIPLIER = sWorld->getRate(
|
||||
int32 MISS_CHANCE_MULTIPLIER;
|
||||
if (sWorld->getBoolConfig(CONFIG_MISS_CHANCE_MULTIPLIER_ONLY_FOR_PLAYERS) && GetTypeId() != TYPEID_PLAYER) // keep it as it was originally (7 and 11)
|
||||
{
|
||||
MISS_CHANCE_MULTIPLIER = victim->GetTypeId() == TYPEID_PLAYER ? 7 : 11;
|
||||
}
|
||||
else
|
||||
{
|
||||
MISS_CHANCE_MULTIPLIER = sWorld->getRate(
|
||||
victim->GetTypeId() == TYPEID_PLAYER
|
||||
? RATE_MISS_CHANCE_MULTIPLIER_TARGET_PLAYER
|
||||
: RATE_MISS_CHANCE_MULTIPLIER_TARGET_CREATURE
|
||||
);
|
||||
: RATE_MISS_CHANCE_MULTIPLIER_TARGET_CREATURE);
|
||||
}
|
||||
|
||||
// Base hit chance from attacker and victim levels
|
||||
int32 modHitChance = levelDiff < 3
|
||||
|
||||
@@ -1235,9 +1235,6 @@ void GameEventMgr::ApplyNewEvent(uint16 event_id)
|
||||
|
||||
LOG_DEBUG("gameevent", "GameEvent {} \"{}\" started.", event_id, mGameEvent[event_id].description);
|
||||
|
||||
//! Run SAI scripts with SMART_EVENT_GAME_EVENT_END
|
||||
RunSmartAIScripts(event_id, true);
|
||||
|
||||
// spawn positive event tagget objects
|
||||
GameEventSpawn(event_id);
|
||||
// un-spawn negative event tagged objects
|
||||
@@ -1255,6 +1252,9 @@ void GameEventMgr::ApplyNewEvent(uint16 event_id)
|
||||
// update bg holiday
|
||||
UpdateBattlegroundSettings();
|
||||
|
||||
//! Run SAI scripts with SMART_EVENT_GAME_EVENT_START
|
||||
RunSmartAIScripts(event_id, true);
|
||||
|
||||
// If event's worldstate is 0, it means the event hasn't been started yet. In that case, reset seasonal quests.
|
||||
// When event ends (if it expires or if it's stopped via commands) worldstate will be set to 0 again, ready for another seasonal quest reset.
|
||||
if (sWorld->getWorldState(event_id) == 0)
|
||||
|
||||
@@ -9246,6 +9246,7 @@ void ObjectMgr::LoadBroadcastTextLocales()
|
||||
return;
|
||||
}
|
||||
|
||||
uint32 locales_count = 0;
|
||||
do
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
@@ -9265,9 +9266,10 @@ void ObjectMgr::LoadBroadcastTextLocales()
|
||||
|
||||
AddLocaleString(fields[2].Get<std::string>(), locale, bct->second.MaleText);
|
||||
AddLocaleString(fields[3].Get<std::string>(), locale, bct->second.FemaleText);
|
||||
locales_count++;
|
||||
} while (result->NextRow());
|
||||
|
||||
LOG_INFO("server.loading", ">> Loaded {} Broadcast Text Locales in {} ms", uint32(_broadcastTextStore.size()), GetMSTimeDiffToNow(oldMSTime));
|
||||
LOG_INFO("server.loading", ">> Loaded {} Broadcast Text Locales in {} ms", locales_count, GetMSTimeDiffToNow(oldMSTime));
|
||||
LOG_INFO("server.loading", " ");
|
||||
}
|
||||
|
||||
|
||||
@@ -6377,6 +6377,14 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SPELL_AURA_MOD_SHAPESHIFT:
|
||||
{
|
||||
if (m_caster && m_caster->HasAura(23397)) // Nefarian Class Call (Warrior): Berserk -- Nefertum: I don't really like this but I didn't find another way.
|
||||
{
|
||||
return SPELL_FAILED_NOT_SHAPESHIFT;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1590,6 +1590,19 @@ void Spell::EffectHeal(SpellEffIndex /*effIndex*/)
|
||||
addhealth = unitTarget->SpellHealingBonusTaken(caster, m_spellInfo, addhealth, HEAL);
|
||||
}
|
||||
|
||||
// Implemented this way as there is no other way to do it currently (that I know :P)...
|
||||
if (caster->ToPlayer() && caster->ToPlayer()->HasAura(23401)) // Nefarian Corrupted Healing (priest)
|
||||
{
|
||||
if (m_spellInfo->Effects[EFFECT_0].ApplyAuraName != SPELL_AURA_PERIODIC_HEAL ||
|
||||
m_spellInfo->Effects[EFFECT_1].ApplyAuraName != SPELL_AURA_PERIODIC_HEAL ||
|
||||
m_spellInfo->Effects[EFFECT_2].ApplyAuraName != SPELL_AURA_PERIODIC_HEAL)
|
||||
{
|
||||
m_damage = 0;
|
||||
caster->CastSpell(unitTarget, 23402, false); // Nefarian Corrupted Healing Periodic Damage effect.
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
m_damage -= addhealth;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4154,6 +4154,20 @@ void SpellMgr::LoadSpellInfoCorrections()
|
||||
spellInfo->Effects[EFFECT_1].SpellClassMask[1] = 0x00020000;
|
||||
});
|
||||
|
||||
// Nefarian: Shadowbolt, Shadow Command
|
||||
ApplySpellFix({ 22667, 22677 }, [](SpellInfo* spellInfo)
|
||||
{
|
||||
spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(152); // 150 yards
|
||||
});
|
||||
|
||||
// Shadowbolt Volley
|
||||
ApplySpellFix({ 22665 }, [](SpellInfo* spellInfo)
|
||||
{
|
||||
spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(152); // 150 yards
|
||||
spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(41); // 150 yards
|
||||
spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
|
||||
});
|
||||
|
||||
// Manastorm
|
||||
ApplySpellFix({ 21097 }, [](SpellInfo* spellInfo)
|
||||
{
|
||||
@@ -4180,6 +4194,12 @@ void SpellMgr::LoadSpellInfoCorrections()
|
||||
spellInfo->AuraInterruptFlags |= AURA_INTERRUPT_FLAG_CHANGE_MAP;
|
||||
});
|
||||
|
||||
// Improved Blessing Protection (Nefarian Class Call)
|
||||
ApplySpellFix({ 23415 }, [](SpellInfo* spellInfo)
|
||||
{
|
||||
spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_TARGET_ENEMY);
|
||||
});
|
||||
|
||||
// Bestial Wrath
|
||||
ApplySpellFix({ 19574 }, [](SpellInfo* spellInfo)
|
||||
{
|
||||
|
||||
@@ -173,6 +173,7 @@ enum WorldBoolConfigs
|
||||
CONFIG_REALM_LOGIN_ENABLED,
|
||||
CONFIG_PLAYER_SETTINGS_ENABLED,
|
||||
CONFIG_ALLOW_JOIN_BG_AND_LFG,
|
||||
CONFIG_MISS_CHANCE_MULTIPLIER_ONLY_FOR_PLAYERS,
|
||||
BOOL_CONFIG_VALUE_COUNT
|
||||
};
|
||||
|
||||
|
||||
@@ -572,8 +572,9 @@ void World::LoadConfigSettings(bool reload)
|
||||
rate_values[RATE_ARENA_POINTS] = sConfigMgr->GetOption<float>("Rate.ArenaPoints", 1.0f);
|
||||
rate_values[RATE_INSTANCE_RESET_TIME] = sConfigMgr->GetOption<float>("Rate.InstanceResetTime", 1.0f);
|
||||
|
||||
rate_values[RATE_MISS_CHANCE_MULTIPLIER_TARGET_CREATURE] = sConfigMgr->GetOption<float>("Rate.MissChanceMultiplier.TargetCreature", 11.0f);
|
||||
rate_values[RATE_MISS_CHANCE_MULTIPLIER_TARGET_PLAYER] = sConfigMgr->GetOption<float>("Rate.MissChanceMultiplier.TargetPlayer", 7.0f);
|
||||
rate_values[RATE_MISS_CHANCE_MULTIPLIER_TARGET_CREATURE] = sConfigMgr->GetOption<float>("Rate.MissChanceMultiplier.TargetCreature", 11.0f);
|
||||
rate_values[RATE_MISS_CHANCE_MULTIPLIER_TARGET_PLAYER] = sConfigMgr->GetOption<float>("Rate.MissChanceMultiplier.TargetPlayer", 7.0f);
|
||||
m_bool_configs[CONFIG_MISS_CHANCE_MULTIPLIER_ONLY_FOR_PLAYERS] = sConfigMgr->GetOption<bool>("Rate.MissChanceMultiplier.OnlyAffectsPlayer", false);
|
||||
|
||||
rate_values[RATE_TALENT] = sConfigMgr->GetOption<float>("Rate.Talent", 1.0f);
|
||||
if (rate_values[RATE_TALENT] < 0.0f)
|
||||
|
||||
Reference in New Issue
Block a user