From a4a56adf3d15ce65d57c2ecd4b3fbb7468ead492 Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Wed, 31 Mar 2010 16:23:52 +0400 Subject: [PATCH] Quests and combopoints should work once again. --- src/game/Player.cpp | 16 ++++++++-------- src/game/Spell.cpp | 20 +++++--------------- src/game/SpellAuras.cpp | 4 ++-- src/game/SpellEffects.cpp | 16 ++++++++-------- 4 files changed, 23 insertions(+), 33 deletions(-) diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 63cc01e22..c3d912115 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -12801,11 +12801,11 @@ void Player::PrepareQuestMenu( uint64 guid ) uint32 quest_id = i->second; QuestStatus status = GetQuestStatus( quest_id ); if ( status == QUEST_STATUS_COMPLETE && !GetQuestRewardStatus( quest_id ) ) - qm.AddMenuItem(quest_id, DIALOG_STATUS_REWARD); + qm.AddMenuItem(quest_id, 4); else if ( status == QUEST_STATUS_INCOMPLETE ) - qm.AddMenuItem(quest_id, DIALOG_STATUS_INCOMPLETE); + qm.AddMenuItem(quest_id, 4); else if (status == QUEST_STATUS_AVAILABLE ) - qm.AddMenuItem(quest_id, DIALOG_STATUS_AVAILABLE); + qm.AddMenuItem(quest_id, 2); } for(QuestRelations::const_iterator i = pObjectQR->lower_bound(pObject->GetEntry()); i != pObjectQR->upper_bound(pObject->GetEntry()); ++i) @@ -12817,9 +12817,9 @@ void Player::PrepareQuestMenu( uint64 guid ) QuestStatus status = GetQuestStatus( quest_id ); if (pQuest->IsAutoComplete() && CanTakeQuest(pQuest, false)) - qm.AddMenuItem(quest_id, DIALOG_STATUS_AVAILABLE_REP); + qm.AddMenuItem(quest_id, 4); else if ( status == QUEST_STATUS_NONE && CanTakeQuest( pQuest, false ) ) - qm.AddMenuItem(quest_id, DIALOG_STATUS_AVAILABLE); + qm.AddMenuItem(quest_id, 2); } } @@ -12832,7 +12832,7 @@ void Player::SendPreparedQuest(uint64 guid) QuestMenuItem const& qmi0 = questMenu.GetItem(0); - uint32 status = qmi0.m_qIcon; + uint32 icon = qmi0.m_qIcon; // single element case if (questMenu.MenuItemCount() == 1) @@ -12843,9 +12843,9 @@ void Player::SendPreparedQuest(uint64 guid) if (pQuest) { - if (status == DIALOG_STATUS_REWARD && !GetQuestRewardStatus(quest_id)) + if (icon == 4 && !GetQuestRewardStatus(quest_id)) PlayerTalkClass->SendQuestGiverRequestItems(pQuest, guid, CanRewardQuest(pQuest, false), true); - else if (status == DIALOG_STATUS_INCOMPLETE) + else if (icon == 4) PlayerTalkClass->SendQuestGiverRequestItems(pQuest, guid, CanRewardQuest(pQuest, false), true); // Send completable on repeatable and autoCompletable quest if player don't have quest // TODO: verify if check for !pQuest->IsDaily() is really correct (possibly not) diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index b086a5249..646fc8c18 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -353,7 +353,7 @@ Spell::Spell( Unit* Caster, SpellEntry const *info, bool triggered, ObjectGuid o UpdateOriginalCasterPointer(); for(int i = 0; i < MAX_EFFECT_INDEX; ++i) - m_currentBasePoints[i] = m_spellInfo->EffectBasePoints[i]; + m_currentBasePoints[i] = m_spellInfo->CalculateSimpleValue(SpellEffectIndex(i)); m_spellState = SPELL_STATE_NULL; @@ -3889,29 +3889,19 @@ void Spell::HandleEffects(Unit *pUnitTarget,Item *pItemTarget,GameObject *pGOTar damage = int32(CalculateDamage(i, unitTarget) * DamageMultiplier); - sLog.outDebug( "Spell %u Effect%d : %u", m_spellInfo->Id, i, eff); + sLog.outDebug("Spell %u Effect%d : %u", m_spellInfo->Id, i, eff); - if(eff TOTAL_SPELL_EFFECTS ", eff); - if (m_CastItem) - EffectEnchantItemTmp(i); - else - { - sLog.outError("SPELL: unknown effect %u spell id %u", - eff, m_spellInfo->Id); - } + sLog.outError("WORLD: Spell FX %d > TOTAL_SPELL_EFFECTS ", eff); } - */ } - void Spell::AddTriggeredSpell( uint32 spellId ) { SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId ); @@ -6265,7 +6255,7 @@ SpellCastResult Spell::CanOpenLock(SpellEffectIndex effIndex, uint32 lockId, Ski { // skill bonus provided by casting spell (mostly item spells) // add the damage modifier from the spell casted (cheat lock / skeleton key etc.) (use m_currentBasePoints, CalculateDamage returns wrong value) - uint32 spellSkillBonus = uint32(m_currentBasePoints[effIndex]+1); + uint32 spellSkillBonus = uint32(m_currentBasePoints[effIndex]); reqSkillValue = lockInfo->Skill[j]; // castitem check: rogue using skeleton keys. the skill values should not be added in this case. diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 39574624c..7f9ea4e18 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -384,7 +384,7 @@ m_isRemovedOnShapeLost(true), m_in_use(0), m_deleted(false) m_spellProto = spellproto; - m_currentBasePoints = currentBasePoints ? *currentBasePoints : m_spellProto->EffectBasePoints[eff]; + m_currentBasePoints = currentBasePoints ? *currentBasePoints : m_spellProto->EffectBasePoints[eff] + 1; m_isPassive = IsPassiveSpell(GetId()); m_positive = IsPositiveEffect(GetId(), m_effIndex); @@ -397,7 +397,7 @@ m_isRemovedOnShapeLost(true), m_in_use(0), m_deleted(false) if(!caster) { m_caster_guid = target->GetGUID(); - damage = m_currentBasePoints+1; // stored value-1 + damage = m_currentBasePoints; // stored value-1 m_maxduration = target->CalculateSpellDuration(m_spellProto, m_effIndex, target); } else diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 595471f46..dd263221e 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -2107,7 +2107,7 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx) if (!unitTarget) return; - uint32 spell_id = m_currentBasePoints[eff_idx]+1; + uint32 spell_id = m_currentBasePoints[eff_idx]; SpellEntry const* spell_proto = sSpellStore.LookupEntry(spell_id); if (!spell_proto) return; @@ -3197,9 +3197,9 @@ void Spell::DoCreateItem(SpellEffectIndex eff_idx, uint32 itemtype) int32 basePoints = m_currentBasePoints[eff_idx]; int32 randomPoints = m_spellInfo->EffectDieSides[eff_idx]; if (randomPoints) - num_to_add = basePoints + irand(1, randomPoints); + num_to_add = basePoints + irand(0, randomPoints); else - num_to_add = basePoints + 1; + num_to_add = basePoints; } else if (pProto->MaxCount == 1) num_to_add = 1; @@ -3207,7 +3207,7 @@ void Spell::DoCreateItem(SpellEffectIndex eff_idx, uint32 itemtype) { int32 basePoints = m_currentBasePoints[eff_idx]; float pointPerLevel = m_spellInfo->EffectRealPointsPerLevel[eff_idx]; - num_to_add = basePoints + 1 + uint32((player->getLevel() - m_spellInfo->spellLevel)*pointPerLevel); + num_to_add = basePoints + uint32((player->getLevel() - m_spellInfo->spellLevel)*pointPerLevel); } else num_to_add = 2; @@ -6439,11 +6439,11 @@ void Spell::EffectEnchantHeldItem(SpellEffectIndex eff_idx) if (m_spellInfo->EffectMiscValue[eff_idx]) { uint32 enchant_id = m_spellInfo->EffectMiscValue[eff_idx]; - int32 duration = GetSpellDuration(m_spellInfo); //Try duration index first .. + int32 duration = GetSpellDuration(m_spellInfo); // Try duration index first... if(!duration) - duration = m_currentBasePoints[eff_idx]+1; //Base points after .. + duration = m_currentBasePoints[eff_idx]; // Base points after... if(!duration) - duration = 10; //10 seconds for enchants which don't have listed duration + duration = 10; // 10 seconds for enchants which don't have listed duration SpellItemEnchantmentEntry const *pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id); if(!pEnchant) @@ -6704,7 +6704,7 @@ void Spell::EffectReputation(SpellEffectIndex eff_idx) Player *_player = (Player*)unitTarget; - int32 rep_change = m_currentBasePoints[eff_idx]+1; // field store reputation change -1 + int32 rep_change = m_currentBasePoints[eff_idx]; // field store reputation change -1 uint32 faction_id = m_spellInfo->EffectMiscValue[eff_idx];