Guest User

Untitled

a guest
Jun 24th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.29 KB | None | 0 0
  1.  
  2. <<<<<<< HEAD
  3.         case CONDITION_SOURCE_TYPE_ITEM_REQUIRED_TARGET:
  4.         {
  5.             if (cond->ConditionType != CONDITION_ITEM_TARGET)
  6.             {
  7.                 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));
  8.                 return false;
  9.             }
  10.  
  11.             ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
  12.             if (!pItemProto)
  13.             {
  14.                 sLog->outErrorDb("SourceEntry %u in `condition` table, does not exist in `item_tamplate`, ignoring.", cond->SourceEntry);
  15.                 return false;
  16.             }
  17.  
  18.             bool bIsItemSpellValid = false;
  19.             for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i)
  20.             {
  21.                 if (SpellInfo const* pSpellInfo = sSpellMgr->GetSpellInfo(pItemProto->Spells[i].SpellId))
  22.                 {
  23.                     if (pItemProto->Spells[i].SpellTrigger == ITEM_SPELLTRIGGER_ON_USE ||
  24.                         pItemProto->Spells[i].SpellTrigger == ITEM_SPELLTRIGGER_ON_STORE)
  25.                     {
  26.                         ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET, pSpellInfo->Id);//script loading is done before item target loading
  27.                         if (!conditions.empty())
  28.                             break;
  29.  
  30.                         if (pSpellInfo->NeedsExplicitUnitTarget())
  31.                         {
  32.                             bIsItemSpellValid = true;
  33.                             break;
  34.                         }
  35.                     }
  36.                 }
  37.             }
  38.  
  39.             if (!bIsItemSpellValid)
  40.             {
  41.                 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"
  42.                                 ", or the spells are already listed in CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET conditions.", cond->SourceEntry);
  43.                 break;
  44.             }
  45.             break;
  46.         }
  47. =======
  48. >>>>>>> ba4d1c36f1b947f17ffc394afac11e9fb42d0b9b
Add Comment
Please, Sign In to add comment