Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <<<<<<< HEAD
- case CONDITION_SOURCE_TYPE_ITEM_REQUIRED_TARGET:
- {
- if (cond->ConditionType != CONDITION_ITEM_TARGET)
- {
- sLog->outErrorDb("SourceEntry %u in `condition` table, has ConditionType %u. Only CONDITION_ITEM_TARGET(24) is valid for CONDITION_SOURCE_TYPE_ITEM_REQUIRED_TARGET(18), ignoring.", cond->SourceEntry, uint32(cond->ConditionType));
- return false;
- }
- ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
- if (!pItemProto)
- {
- sLog->outErrorDb("SourceEntry %u in `condition` table, does not exist in `item_tamplate`, ignoring.", cond->SourceEntry);
- return false;
- }
- bool bIsItemSpellValid = false;
- for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i)
- {
- if (SpellInfo const* pSpellInfo = sSpellMgr->GetSpellInfo(pItemProto->Spells[i].SpellId))
- {
- if (pItemProto->Spells[i].SpellTrigger == ITEM_SPELLTRIGGER_ON_USE ||
- pItemProto->Spells[i].SpellTrigger == ITEM_SPELLTRIGGER_ON_STORE)
- {
- ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET, pSpellInfo->Id);//script loading is done before item target loading
- if (!conditions.empty())
- break;
- if (pSpellInfo->NeedsExplicitUnitTarget())
- {
- bIsItemSpellValid = true;
- break;
- }
- }
- }
- }
- if (!bIsItemSpellValid)
- {
- sLog->outErrorDb("Conditions: CONDITION_SOURCE_TYPE_ITEM_REQUIRED_TARGET for item %u, which either doesn't have item spelltrigger or its spells don't allow caster to select a unit target"
- ", or the spells are already listed in CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET conditions.", cond->SourceEntry);
- break;
- }
- break;
- }
- =======
- >>>>>>> ba4d1c36f1b947f17ffc394afac11e9fb42d0b9b
Add Comment
Please, Sign In to add comment