mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-26 15:16:24 +00:00
Merge branch 'azerothcore:master' into Playerbot
This commit is contained in:
@@ -452,7 +452,9 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, ObjectGuid npcGU
|
||||
|
||||
uint8 playerLevel = _session->GetPlayer() ? _session->GetPlayer()->getLevel() : 0;
|
||||
data << uint32(quest->GetRewOrReqMoney(playerLevel));
|
||||
data << uint32(quest->XPValue(playerLevel) * _session->GetPlayer()->GetQuestRate());
|
||||
uint32 questXp = uint32(quest->XPValue(playerLevel) * _session->GetPlayer()->GetQuestRate());
|
||||
sScriptMgr->OnQuestComputeXP(_session->GetPlayer(), quest, questXp);
|
||||
data << questXp;
|
||||
}
|
||||
|
||||
// rewarded honor points. Multiply with 10 to satisfy client
|
||||
@@ -680,7 +682,9 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* quest, ObjectGuid npcGUI
|
||||
uint8 playerLevel = _session->GetPlayer() ? _session->GetPlayer()->getLevel() : 0;
|
||||
|
||||
data << uint32(quest->GetRewOrReqMoney(playerLevel));
|
||||
data << uint32(quest->XPValue(playerLevel) * _session->GetPlayer()->GetQuestRate());
|
||||
uint32 questXp = uint32(quest->XPValue(playerLevel) * _session->GetPlayer()->GetQuestRate());
|
||||
sScriptMgr->OnQuestComputeXP(_session->GetPlayer(), quest, questXp);
|
||||
data << questXp;
|
||||
|
||||
// rewarded honor points. Multiply with 10 to satisfy client
|
||||
data << uint32(10 * quest->CalculateHonorGain(_session->GetPlayer()->GetQuestLevel(quest)));
|
||||
|
||||
@@ -600,6 +600,11 @@ void Player::CompleteQuest(uint32 quest_id)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!sScriptMgr->OnBeforePlayerQuestComplete(this, quest_id))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
SetQuestStatus(quest_id, QUEST_STATUS_COMPLETE);
|
||||
|
||||
auto log_slot = FindQuestSlot(quest_id);
|
||||
|
||||
@@ -1788,14 +1788,42 @@ SpellCastResult SpellInfo::CheckTarget(Unit const* caster, WorldObject const* ta
|
||||
// Not allow disarm unarmed player
|
||||
if (Mechanic == MECHANIC_DISARM)
|
||||
{
|
||||
if (unitTarget->GetTypeId() == TYPEID_PLAYER)
|
||||
bool valid = false;
|
||||
for (uint8 i = BASE_ATTACK; i < MAX_ATTACK; ++i)
|
||||
{
|
||||
Player const* player = unitTarget->ToPlayer();
|
||||
if (!player->GetWeaponForAttack(BASE_ATTACK, true))
|
||||
return SPELL_FAILED_TARGET_NO_WEAPONS;
|
||||
AuraType disarmAuraType = SPELL_AURA_MOD_DISARM;
|
||||
switch (i)
|
||||
{
|
||||
case OFF_ATTACK:
|
||||
disarmAuraType = SPELL_AURA_MOD_DISARM_OFFHAND;
|
||||
break;
|
||||
case RANGED_ATTACK:
|
||||
disarmAuraType = SPELL_AURA_MOD_DISARM_RANGED;
|
||||
break;
|
||||
}
|
||||
|
||||
if (HasAura(disarmAuraType))
|
||||
{
|
||||
if (Player const* player = unitTarget->ToPlayer())
|
||||
{
|
||||
if (player->GetWeaponForAttack(WeaponAttackType(BASE_ATTACK + i), true))
|
||||
{
|
||||
valid = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (unitTarget->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + i))
|
||||
{
|
||||
valid = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!unitTarget->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID))
|
||||
|
||||
if (!valid)
|
||||
{
|
||||
return SPELL_FAILED_TARGET_NO_WEAPONS;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user