Quests and combopoints should work once again.

This commit is contained in:
tomrus88 2010-03-31 16:23:52 +04:00
parent 50bed7c7da
commit a4a56adf3d
4 changed files with 23 additions and 33 deletions

View file

@ -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)

View file

@ -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;
@ -3896,21 +3896,11 @@ void Spell::HandleEffects(Unit *pUnitTarget,Item *pItemTarget,GameObject *pGOTar
//sLog.outDebug( "WORLD: Spell FX %d < TOTAL_SPELL_EFFECTS ", eff);
(*this.*SpellEffects[eff])(i);
}
/*
else
{
sLog.outDebug( "WORLD: Spell FX %d > 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 )
{
@ -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.

View file

@ -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

View file

@ -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,9 +6439,9 @@ 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
@ -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];