aboutsummaryrefslogtreecommitdiff
path: root/src/server/game
diff options
context:
space:
mode:
authorSubv <s.v.h21@hotmail.com>2012-02-11 19:23:40 -0500
committerSubv <s.v.h21@hotmail.com>2012-02-11 19:23:40 -0500
commit0d77ae8fc1b166e4d431a269bf76a3931466c0c3 (patch)
tree4cd235dab7f373d72c4e76ce9cf3798a1a78e17e /src/server/game
parentff9830c18d86889207198db2658eaa4ac9c119d4 (diff)
parentb0145e3b39c57bbbec22a3f280c9f37373f4b989 (diff)
Merge branch 'master' of https://github.com/TrinityCore/TrinityCore
Diffstat (limited to 'src/server/game')
-rwxr-xr-xsrc/server/game/Conditions/ConditionMgr.cpp29
-rwxr-xr-xsrc/server/game/Conditions/ConditionMgr.h4
-rwxr-xr-xsrc/server/game/Quests/QuestDef.cpp4
3 files changed, 33 insertions, 4 deletions
diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp
index 7f47b282a1d..6f380bb5d8a 100755
--- a/src/server/game/Conditions/ConditionMgr.cpp
+++ b/src/server/game/Conditions/ConditionMgr.cpp
@@ -312,6 +312,16 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo)
condMeets = CompareValues(static_cast<ComparisionType>(mConditionValue2), unit->GetHealthPct(), static_cast<float>(mConditionValue1));
break;
}
+ case CONDITION_WORLD_STATE:
+ {
+ condMeets = mConditionValue2 == sWorld->getWorldState(mConditionValue1);
+ break;
+ }
+ case CONDITION_PHASEMASK:
+ {
+ condMeets = object->GetPhaseMask() & mConditionValue1;
+ break;
+ }
default:
condMeets = false;
break;
@@ -1673,6 +1683,25 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
case CONDITION_AREAID:
case CONDITION_INSTANCE_DATA:
break;
+ case CONDITION_WORLD_STATE:
+ {
+ if (!sWorld->getWorldState(cond->mConditionValue1))
+ {
+ sLog->outErrorDb("World state condition has non existing world state in value1 (%u), skipped", cond->mConditionValue1);
+ return false;
+ }
+ if (cond->mConditionValue3)
+ sLog->outErrorDb("World state condition has useless data in value3 (%u)!", cond->mConditionValue3);
+ break;
+ }
+ case CONDITION_PHASEMASK:
+ {
+ if (cond->mConditionValue2)
+ sLog->outErrorDb("Phasemask condition has useless data in value2 (%u)!", cond->mConditionValue2);
+ if (cond->mConditionValue3)
+ sLog->outErrorDb("Phasemask condition has useless data in value3 (%u)!", cond->mConditionValue3);
+ break;
+ }
default:
break;
}
diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h
index 8e133d31a82..f3e9c728ac1 100755
--- a/src/server/game/Conditions/ConditionMgr.h
+++ b/src/server/game/Conditions/ConditionMgr.h
@@ -41,7 +41,7 @@ enum ConditionType
CONDITION_QUESTREWARDED = 8, // quest_id 0 0 true if quest_id was rewarded before
CONDITION_QUESTTAKEN = 9, // quest_id 0, 0 true while quest active
CONDITION_DRUNKENSTATE = 10, // DrunkenState 0, 0 true if player is drunk enough
- CONDITION_UNUSED_11 = 11,
+ CONDITION_WORLD_STATE = 11, // index value 0 true if world has the value for the index
CONDITION_ACTIVE_EVENT = 12, // event_id 0 0 true if event is active
CONDITION_INSTANCE_DATA = 13, // entry data 0 true if data is set in current instance
CONDITION_QUEST_NONE = 14, // quest_id 0 0 true if doesn't have quest saved
@@ -56,7 +56,7 @@ enum ConditionType
CONDITION_AREAID = 23, // area_id 0 0 true if in area_id
CONDITION_ITEM_TARGET = 24, // ItemRequiredTargetType, TargetEntry, 0
CONDITION_SPELL = 25, // spell_id 0 0 true if player has learned spell
- CONDITION_UNUSED_26 = 26,
+ CONDITION_PHASEMASK = 26, // phasemask 0 0 true if object is in phasemask
CONDITION_LEVEL = 27, // level ComparisonType 0 true if unit's level is equal to param1 (param2 can modify the statement)
CONDITION_QUEST_COMPLETE = 28, // quest_id 0 0 true if player has quest_id with all objectives complete, but not yet rewarded
CONDITION_NEAR_CREATURE = 29, // creature entry distance 0 true if there is a creature of entry in range
diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp
index 18340ea224b..173df8dc809 100755
--- a/src/server/game/Quests/QuestDef.cpp
+++ b/src/server/game/Quests/QuestDef.cpp
@@ -212,12 +212,12 @@ int32 Quest::GetRewOrReqMoney() const
bool Quest::IsAutoAccept() const
{
- return sWorld->getBoolConfig(CONFIG_QUEST_IGNORE_AUTO_ACCEPT) ? false : Flags & QUEST_FLAGS_AUTO_ACCEPT;
+ return sWorld->getBoolConfig(CONFIG_QUEST_IGNORE_AUTO_ACCEPT) ? false : (Flags & QUEST_FLAGS_AUTO_ACCEPT);
}
bool Quest::IsAutoComplete() const
{
- return sWorld->getBoolConfig(CONFIG_QUEST_IGNORE_AUTO_COMPLETE) ? false : Method == 0 || HasFlag(QUEST_FLAGS_AUTOCOMPLETE);
+ return sWorld->getBoolConfig(CONFIG_QUEST_IGNORE_AUTO_COMPLETE) ? false : (Method == 0 || HasFlag(QUEST_FLAGS_AUTOCOMPLETE));
}
bool Quest::IsAllowedInRaid() const