[10014] Revert "[10013] Implement CONDITION_QUESTTARGET"

This reverts commit 4e460746c0947f6cfc1f1150a8eb90257819eae2.
This commit is contained in:
VladimirMangos 2010-06-01 02:23:37 +04:00
parent 59367bc19f
commit 5e526ef0d9
5 changed files with 2 additions and 71 deletions

View file

@ -7409,10 +7409,6 @@ bool PlayerCondition::Meets(Player const * player) const
return data->CheckConditionCriteriaMeet(player, value1, value2);
return false;
}
case CONDITION_QUESTTARGET:
{
return player->HasQuestObjectiveForTarget(int32(value1), !bool(value2));
}
default:
return false;
}
@ -7637,31 +7633,6 @@ bool PlayerCondition::IsValid(ConditionType condition, uint32 value1, uint32 val
break;
}
case CONDITION_QUESTTARGET:
{
if (int32(value1) > 0)
{
if (!sObjectMgr.GetCreatureTemplate(value1))
{
sLog.outErrorDb("Quest target condition has not existed creature entry %u as first arg, skipped", value1);
return false;
}
}
else if (int32(value1) < 0)
{
if (!sObjectMgr.GetGameObjectInfo(-int32(value1)))
{
sLog.outErrorDb("Quest target condition has not existed gameobject entry %u as first arg, skipped", -int32(value1));
return false;
}
}
else
{
sLog.outErrorDb("Quest target condition has not existed entry 0 as first arg, skipped");
return false;
}
break;
}
case CONDITION_NONE:
break;
}

View file

@ -317,10 +317,9 @@ enum ConditionType
CONDITION_NOITEM = 16, // item_id count
CONDITION_SPELL = 17, // spell_id 0, 1 (0: has spell, 1: hasn't spell)
CONDITION_INSTANCE_SCRIPT = 18, // map_id instance_condition_id (instance script specific enum)
CONDITION_QUESTTARGET = 19, // entry complete,for condition true entry (positive - creature entry, negative (-entry) - gameobject entry) is not rewarded quest objective in (completed, bool) state.
};
#define MAX_CONDITION 20 // maximum value in ConditionType enum
#define MAX_CONDITION 19 // maximum value in ConditionType enum
struct PlayerCondition
{

View file

@ -19842,44 +19842,6 @@ bool Player::HasQuestForGO(int32 GOId) const
return false;
}
bool Player::HasQuestObjectiveForTarget(int32 creatureOrGOId, bool incomplete /*= true*/) const
{
for( int i = 0; i < MAX_QUEST_LOG_SIZE; ++i )
{
uint32 questid = GetQuestSlotQuestId(i);
if ( questid == 0 )
continue;
QuestStatusMap::const_iterator qs_itr = mQuestStatus.find(questid);
if(qs_itr == mQuestStatus.end())
continue;
QuestStatusData const& qs = qs_itr->second;
// for incopmplete objective we need incomplete quests, for complete objective it can be complete/incomplete
if (qs.m_status == QUEST_STATUS_INCOMPLETE || !incomplete && qs.m_status == QUEST_STATUS_COMPLETE)
{
Quest const* qinfo = sObjectMgr.GetQuestTemplate(questid);
if (!qinfo)
continue;
if (GetGroup() && GetGroup()->isRaidGroup() && qinfo->IsAllowedInRaid())
continue;
for (int j = 0; j < QUEST_OBJECTIVES_COUNT; ++j)
{
// creatureOrGOId have expected signs for creature/go cases, comparison signed
if (qinfo->ReqCreatureOrGOId[j] != creatureOrGOId)
continue;
if (incomplete == (qs.m_creatureOrGOcount[j] < qinfo->ReqCreatureOrGOCount[j]))
return true;
}
}
}
return false;
}
void Player::UpdateForQuestWorldObjects()
{
if(m_clientGUIDs.empty())

View file

@ -1410,7 +1410,6 @@ class MANGOS_DLL_SPEC Player : public Unit
void ReputationChanged(FactionEntry const* factionEntry );
bool HasQuestForItem( uint32 itemid ) const;
bool HasQuestForGO(int32 GOId) const;
bool HasQuestObjectiveForTarget(int32 creatureOrGOId, bool incomplete = true) const;
void UpdateForQuestWorldObjects();
bool CanShareQuest(uint32 quest_id) const;

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "10013"
#define REVISION_NR "10014"
#endif // __REVISION_NR_H__