883 files, from working commit b1a079a. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
142 lines
6.0 KiB
JSON
142 lines
6.0 KiB
JSON
{
|
|
"kind": "frozen-public-Source-T2-postcheck-item-use-excerpts",
|
|
"accepted_server_sha256": "1ed8851998eb486675dbd4957dd865556340f2796b45baf20e649d9528bcd429",
|
|
"files": {
|
|
"src/scripts/miscellaneous/random_scripts_1.cpp": "bool ItemUseSpell_octotoken_cache(Player* pPlayer, Item* pItem, const SpellCastTargets&)\n{\n if (!pPlayer || !pItem)\n return false;\n\n constexpr uint32 OCTOTOKEN_CACHE_AMOUNT = 200;\n const uint32 accountId = pPlayer->GetSession()->GetAccountId();\n\n // shop_coins.id is the primary key; an account that never opened the shop has no row yet.\n LoginDatabase.PExecute(\"INSERT INTO `shop_coins` (`id`, `coins`) VALUES (%u, %u) \"\n \"ON DUPLICATE KEY UPDATE `coins` = `coins` + %u\",\n accountId, OCTOTOKEN_CACHE_AMOUNT, OCTOTOKEN_CACHE_AMOUNT);\n\n uint32 count = 1;\n pPlayer->DestroyItemCount(pItem, count, true);\n pPlayer->SaveInventoryAndGoldToDB();\n return true;\n}\n\n newscript = new Script;\n newscript->Name = \"item_octotoken_cache\";\n newscript->pItemUseSpell = &ItemUseSpell_octotoken_cache;\n newscript->RegisterSelf();\n",
|
|
"src/game/Objects/Player.cpp": "void Player::CastItemUseSpell(Item *item, SpellCastTargets const& targets)\n{\n ItemPrototype const* proto = item->GetProto();\n\n // use triggered flag only for items with many spell casts and for not first cast\n int count = 0;\n\n bool SpellUsed = false;\n // item spells casted at use\n for (const auto& spellData : proto->Spells)\n {\n // no spell\n if (!spellData.SpellId)\n continue;\n\n // wrong triggering type\n if (spellData.SpellTrigger != ITEM_SPELLTRIGGER_ON_USE && spellData.SpellTrigger != ITEM_SPELLTRIGGER_ON_NO_DELAY_USE)\n continue;\n\n SpellEntry const *spellInfo = sSpellMgr.GetSpellEntry(spellData.SpellId);\n if (!spellInfo)\n {\n sLog.outError(\"Player::CastItemUseSpell: Item (Entry: %u) in have wrong spell id %u, ignoring\", proto->ItemId, spellData.SpellId);\n continue;\n }\n\n Spell *spell = new Spell(this, spellInfo, (count > 0));\n spell->SetCastItem(item);\n spell->prepare(targets);\n\n SpellCastResult result = spell->CheckCast(true);\n if (result == SPELL_CAST_OK)\n SpellUsed = true;\n\n ++count;\n }\n\n if (SpellUsed)\n sScriptMgr.OnItemUseSpell(this, item, targets);\n}",
|
|
"src/game/ScriptMgr.cpp": "bool ScriptMgr::OnItemUseSpell(Player* pPlayer, Item* pItem, SpellCastTargets const& targets)\n{\n Script* pTempScript = m_NPC_scripts[pItem->GetProto()->ScriptId];\n\n if (pTempScript && pTempScript->pItemUseSpell && pTempScript->pItemUseSpell(pPlayer, pItem, targets))\n return true;\n\n if (ItemScript* script = ScriptRegistry<ItemScript>::GetScriptById(pItem->GetProto()->ScriptId))\n return script->OnUseSpell(pPlayer, pItem, targets);\n\n return false;\n}"
|
|
},
|
|
"source_item": {
|
|
"entry": 92500,
|
|
"class": 0,
|
|
"subclass": 0,
|
|
"name": "Cache of OctoTokens",
|
|
"description": "This mysterious coin seams to almost ungulate with an unidentifiable magic",
|
|
"display_id": 32284,
|
|
"quality": 4,
|
|
"flags": 0,
|
|
"buy_count": 1,
|
|
"buy_price": 0,
|
|
"sell_price": 0,
|
|
"inventory_type": 0,
|
|
"allowable_class": -1,
|
|
"allowable_race": -1,
|
|
"item_level": 60,
|
|
"required_level": 0,
|
|
"required_skill": 0,
|
|
"required_skill_rank": 0,
|
|
"required_spell": 0,
|
|
"required_honor_rank": 0,
|
|
"required_city_rank": 0,
|
|
"required_reputation_faction": 0,
|
|
"required_reputation_rank": 0,
|
|
"max_count": 0,
|
|
"stackable": 1,
|
|
"container_slots": 0,
|
|
"stat_type1": 0,
|
|
"stat_value1": 0,
|
|
"stat_type2": 0,
|
|
"stat_value2": 0,
|
|
"stat_type3": 0,
|
|
"stat_value3": 0,
|
|
"stat_type4": 0,
|
|
"stat_value4": 0,
|
|
"stat_type5": 0,
|
|
"stat_value5": 0,
|
|
"stat_type6": 0,
|
|
"stat_value6": 0,
|
|
"stat_type7": 0,
|
|
"stat_value7": 0,
|
|
"stat_type8": 0,
|
|
"stat_value8": 0,
|
|
"stat_type9": 0,
|
|
"stat_value9": 0,
|
|
"stat_type10": 0,
|
|
"stat_value10": 0,
|
|
"delay": 0,
|
|
"range_mod": 0,
|
|
"ammo_type": 0,
|
|
"dmg_min1": 0,
|
|
"dmg_max1": 0,
|
|
"dmg_type1": 0,
|
|
"dmg_min2": 0,
|
|
"dmg_max2": 0,
|
|
"dmg_type2": 0,
|
|
"dmg_min3": 0,
|
|
"dmg_max3": 0,
|
|
"dmg_type3": 0,
|
|
"dmg_min4": 0,
|
|
"dmg_max4": 0,
|
|
"dmg_type4": 0,
|
|
"dmg_min5": 0,
|
|
"dmg_max5": 0,
|
|
"dmg_type5": 0,
|
|
"block": 0,
|
|
"armor": 0,
|
|
"holy_res": 0,
|
|
"fire_res": 0,
|
|
"nature_res": 0,
|
|
"frost_res": 0,
|
|
"shadow_res": 0,
|
|
"arcane_res": 0,
|
|
"spellid_1": 65250,
|
|
"spelltrigger_1": 0,
|
|
"spellcharges_1": 0,
|
|
"spellppmrate_1": 0,
|
|
"spellcooldown_1": -1,
|
|
"spellcategory_1": 0,
|
|
"spellcategorycooldown_1": -1,
|
|
"spellid_2": 0,
|
|
"spelltrigger_2": 0,
|
|
"spellcharges_2": 0,
|
|
"spellppmrate_2": 0,
|
|
"spellcooldown_2": -1,
|
|
"spellcategory_2": 0,
|
|
"spellcategorycooldown_2": -1,
|
|
"spellid_3": 0,
|
|
"spelltrigger_3": 0,
|
|
"spellcharges_3": 0,
|
|
"spellppmrate_3": 0,
|
|
"spellcooldown_3": -1,
|
|
"spellcategory_3": 0,
|
|
"spellcategorycooldown_3": -1,
|
|
"spellid_4": 0,
|
|
"spelltrigger_4": 0,
|
|
"spellcharges_4": 0,
|
|
"spellppmrate_4": 0,
|
|
"spellcooldown_4": -1,
|
|
"spellcategory_4": 0,
|
|
"spellcategorycooldown_4": -1,
|
|
"spellid_5": 0,
|
|
"spelltrigger_5": 0,
|
|
"spellcharges_5": 0,
|
|
"spellppmrate_5": 0,
|
|
"spellcooldown_5": -1,
|
|
"spellcategory_5": 0,
|
|
"spellcategorycooldown_5": -1,
|
|
"bonding": 1,
|
|
"page_text": 0,
|
|
"page_language": 0,
|
|
"page_material": 0,
|
|
"start_quest": 0,
|
|
"lock_id": 0,
|
|
"material": 0,
|
|
"sheath": 0,
|
|
"random_property": 0,
|
|
"set_id": 0,
|
|
"max_durability": 0,
|
|
"area_bound": 0,
|
|
"map_bound": 0,
|
|
"duration": 0,
|
|
"bag_family": 0,
|
|
"disenchant_id": 0,
|
|
"food_type": 0,
|
|
"min_money_loot": 0,
|
|
"max_money_loot": 0,
|
|
"wrapped_gift": 0,
|
|
"extra_flags": 0,
|
|
"other_team_entry": 1,
|
|
"script_name": "item_octotoken_cache"
|
|
}
|
|
}
|