Jump to content

timmit

Members
  • Posts

    2
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

timmit's Achievements

Newbie

Newbie (1/3)

0

Reputation

  1. рус Условия наличие титула, некоторые квестеры и трейдеры требуют титул. Ждать под каждый квест и вендор сд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 {
  2. diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index b887961..f8b041d 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -7389,6 +7389,8 @@ bool PlayerCondition::Meets(Player const * player) const return player->HasAura(value1, SpellEffectIndex(value2)); case CONDITION_ITEM: return player->HasItemCount(value1, value2); + case CONDITION_NOITEM: + return player->!HasItemCount(value1, 1); case CONDITION_ITEM_EQUIPPED: return player->HasItemOrGemWithIdEquipped(value1,1); case CONDITION_ZONEID: @@ -7484,6 +7486,16 @@ bool PlayerCondition::IsValid(ConditionType condition, uint32 value1, uint32 val } break; } + case CONDITION_NOITEM: + { + ItemPrototype const *proto = ObjectMgr::GetItemPrototype(value1); + if(!proto) + { + sLog.outErrorDb("Item condition requires to have non existing item (%u), skipped", value1); + return false; + } + break; + } case CONDITION_ITEM_EQUIPPED: { ItemPrototype const *proto = ObjectMgr::GetItemPrototype(value1); diff --git a/src/game/ObjectMgr.h b/src/game/ObjectMgr.h index 4442f56..d0fb9c5 100644 --- a/src/game/ObjectMgr.h +++ b/src/game/ObjectMgr.h @@ -301,6 +301,7 @@ enum ConditionType CONDITION_AURA = 1, // spell_id effindex CONDITION_ITEM = 2, // item_id count CONDITION_ITEM_EQUIPPED = 3, // item_id 0 + CONDITION_NOITEM = 16, // item_id 0 CONDITION_ZONEID = 4, // zone_id 0 CONDITION_REPUTATION_RANK = 5, // faction_id min_rank CONDITION_TEAM = 6, // player_team 0, (469 - Alliance 67 - Horde) @@ -315,7 +316,7 @@ enum ConditionType CONDITION_LEVEL = 15, // player_level 0, 1 or 2 (0: equal to, 1: equal or higher than, 2: equal or less than) }; -#define MAX_CONDITION 16 // maximum value in ConditionType enum +#define MAX_CONDITION 17 // maximum value in ConditionType enum struct PlayerCondition { Condition necessary for many gossips, which require the absence of the item in the inventory
×
×
  • 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