Jump to content

Add support for CONDITION_TITLE


Guest timmit

Recommended Posts

рус Условия наличие титула, некоторые квестеры и трейдеры требуют титул. Ждать под каждый квест и вендор сд2 скрипта долго.

eng Adds to gossip system condition of title, some Quester and traders require a title. Wait for each quest and merchant scriptdev2 script for a long time.

diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp
index d9ca721..c85516d 100644
--- a/src/game/ObjectMgr.cpp
+++ b/src/game/ObjectMgr.cpp
@@ -7471,6 +7471,8 @@ bool PlayerCondition::Meets(Player const * player) const
        }
        case CONDITION_NOITEM:
            return !player->HasItemCount(value1, value2);
+        case CONDITION_TITLE:
+            return player->HasTitle(value1);
        default:
            return false;
    }
@@ -7667,6 +7669,15 @@ bool PlayerCondition::IsValid(ConditionType condition, uint32 value1, uint32 val
            }

            break;
+        case CONDITION_TITLE:
+        {
+            if (!sCharTitleStore.LookupEntry(value1))
+            {
+                sLog.outErrorDb("Specified non-existed title  %u, skipped", value1);
+                return false;
+            }
+
+            break;
        }
        case CONDITION_NONE:
            break;
diff --git a/src/game/ObjectMgr.h b/src/game/ObjectMgr.h
index 0097673..a936f37 100644
--- a/src/game/ObjectMgr.h
+++ b/src/game/ObjectMgr.h
@@ -314,9 +314,10 @@ enum ConditionType
    CONDITION_RACE_CLASS            = 14,                   // race_mask    class_mask
    CONDITION_LEVEL                 = 15,                   // player_level 0, 1 or 2 (0: equal to, 1: equal or higher than, 2: equal or less than)
    CONDITION_NOITEM                = 16,                   // item_id      count
+    CONDITION_TITLE                 = 17,                   // title_id     0
};

-#define MAX_CONDITION                 17                    // maximum value in ConditionType enum
+#define MAX_CONDITION                 18                    // maximum value in ConditionType enum

struct PlayerCondition
{

Link to comment
Share on other sites

  • 1 year later...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use