lua
This commit is contained in:
@@ -15121,8 +15121,15 @@ void Player::CompleteQuest(uint32 quest_id)
|
||||
SetQuestSlotState(questStatus->Slot, QUEST_STATE_COMPLETE);
|
||||
|
||||
if (Quest const* qInfo = sObjectMgr->GetQuestTemplate(quest_id))
|
||||
{
|
||||
if (qInfo->HasFlag(QUEST_FLAGS_TRACKING_EVENT))
|
||||
RewardQuest(qInfo, LootItemType::Item, 0, this, false);
|
||||
|
||||
#ifdef ELUNA
|
||||
if (sWorld->GetEluna())
|
||||
sWorld->GetEluna()->OnQuestComplete(this, quest_id);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
if (sWorld->getBoolConfig(CONFIG_QUEST_ENABLE_QUEST_TRACKER)) // check if Quest Tracker is enabled
|
||||
@@ -16863,6 +16870,11 @@ void Player::KilledMonster(Creature const* creature)
|
||||
|
||||
for (int32 label : creature->GetLabels())
|
||||
UpdateQuestObjectiveProgress(QUEST_OBJECTIVE_KILL_WITH_LABEL, label, 1, creature->GetGUID());
|
||||
|
||||
#ifdef ELUNA
|
||||
if (sWorld->GetEluna())
|
||||
sWorld->GetEluna()->OnKilledMonster(this, cInfo->Entry, creature->GetGUID());
|
||||
#endif
|
||||
}
|
||||
|
||||
void Player::KilledMonsterCredit(uint32 entry, ObjectGuid guid /*= ObjectGuid::Empty*/)
|
||||
|
||||
@@ -845,6 +845,13 @@ bool Unit::HasBreakableByDamageCrowdControlAura(Unit const* excludeCasterChannel
|
||||
// Hook for OnDamage Event
|
||||
sScriptMgr->OnDamage(attacker, victim, tmpDamage);
|
||||
|
||||
#ifdef ELUNA
|
||||
if (attacker && attacker->GetMap() && attacker->GetMap()->GetEluna())
|
||||
attacker->GetMap()->GetEluna()->OnDamageDealt(attacker, victim, tmpDamage, damagetype);
|
||||
if (victim && victim->GetMap() && victim->GetMap()->GetEluna())
|
||||
victim->GetMap()->GetEluna()->OnDamageReceived(victim, attacker, tmpDamage, damagetype);
|
||||
#endif
|
||||
|
||||
// PLAYERBOT HOOK: Notify bots of damage event
|
||||
if (Playerbot::PlayerBotHooks::OnDamageDealt)
|
||||
Playerbot::PlayerBotHooks::OnDamageDealt(attacker, victim, tmpDamage, damagetype, spellProto);
|
||||
@@ -12326,6 +12333,13 @@ Aura* Unit::AddAura(SpellInfo const* spellInfo, uint32 effMask, Unit* target)
|
||||
if (Aura* aura = Aura::TryRefreshStackOrCreate(createInfo))
|
||||
{
|
||||
aura->ApplyForTargets();
|
||||
|
||||
#ifdef ELUNA
|
||||
if (target && target->GetTypeId() == TYPEID_PLAYER && target->ToPlayer()->GetSession())
|
||||
if (target->GetMap() && target->GetMap()->GetEluna())
|
||||
target->GetMap()->GetEluna()->OnAuraApplied(target, caster, spellInfo);
|
||||
#endif
|
||||
|
||||
return aura;
|
||||
}
|
||||
return nullptr;
|
||||
|
||||
@@ -67,6 +67,9 @@
|
||||
#include "Vehicle.h"
|
||||
#include "VMapManager.h"
|
||||
#include "World.h"
|
||||
#ifdef ELUNA
|
||||
#include "LuaEngine.h"
|
||||
#endif
|
||||
#include "WorldSession.h"
|
||||
#include "../../modules/Playerbot/Core/PlayerBotHooks.h"
|
||||
#include <numeric>
|
||||
@@ -3693,6 +3696,11 @@ void Spell::_cast(bool skipCheck)
|
||||
// should be done before the spell is actually executed
|
||||
sScriptMgr->OnPlayerSpellCast(playerCaster, this, skipCheck);
|
||||
|
||||
#ifdef ELUNA
|
||||
if (playerCaster->GetMap() && playerCaster->GetMap()->GetEluna())
|
||||
playerCaster->GetMap()->GetEluna()->OnCastSpell(playerCaster, this);
|
||||
#endif
|
||||
|
||||
// As of 3.0.2 pets begin attacking their owner's target immediately
|
||||
// Let any pets know we've attacked something. Check DmgClass for harmful spells only
|
||||
// This prevents spells such as Hunter's Mark from triggering pet attack
|
||||
|
||||
Reference in New Issue
Block a user