[{"data":1,"prerenderedAt":1311},["ShallowReactive",2],{"doc-global_essentials\u002Fitems\u002Fitems_overview":3},{"id":4,"title":5,"body":6,"description":1301,"extension":1302,"meta":1303,"navigation":1306,"path":1307,"seo":1308,"stem":1309,"__hash__":1310},"docs\u002Fdocs\u002Fglobal_essentials\u002Fitems\u002Fitems_overview.md","Overview",{"type":7,"value":8,"toc":1277},"minimark",[9,14,23,26,31,34,78,81,83,87,92,98,105,175,181,183,187,192,230,235,237,241,246,300,303,305,309,314,390,395,494,496,500,505,549,554,600,602,606,652,654,658,665,669,730,734,804,808,814,818,899,901,905,998,1003,1044,1046,1050,1142,1147,1177,1179,1183,1246,1248,1252],[10,11,13],"h1",{"id":12},"items-system","Items System",[15,16,17,18,22],"p",{},"Items in Dryad Engine follow the same layered philosophy as everything else. When equipped, an item applies a ",[19,20,21],"strong",{},"status"," to the character - adding stats, granting abilities, or changing appearance.",[24,25],"hr",{},[27,28,30],"h2",{"id":29},"items-are-status-containers","Items Are Status Containers",[15,32,33],{},"Like skills and buffs, equipped items add a status layer to the character:",[35,36,37,50],"table",{},[38,39,40],"thead",{},[41,42,43,47],"tr",{},[44,45,46],"th",{},"Action",[44,48,49],{},"Status Effect",[51,52,53,62,70],"tbody",{},[41,54,55,59],{},[56,57,58],"td",{},"Equip a sword",[56,60,61],{},"+10 Damage",[41,63,64,67],{},[56,65,66],{},"Wear armor",[56,68,69],{},"+50 Health, armor skin layer",[41,71,72,75],{},[56,73,74],{},"Hold a magic staff",[56,76,77],{},"Grants \"Fireball\" ability",[15,79,80],{},"Unequip the item, and its status is removed. The character loses those bonuses immediately.",[24,82],{},[27,84,86],{"id":85},"the-editor-forms","The Editor Forms",[88,89,91],"h3",{"id":90},"item-traits","Item Traits",[15,93,94,97],{},[19,95,96],{},"What they are:"," Custom data fields for items (like Character Traits, but for items).",[15,99,100,101,104],{},"Go to ",[19,102,103],{},"Items > Item Traits"," and define fields like:",[35,106,107,120],{},[38,108,109],{},[41,110,111,114,117],{},[44,112,113],{},"Field",[44,115,116],{},"Type",[44,118,119],{},"Example Value",[51,121,122,133,144,154,165],{},[41,123,124,127,130],{},[56,125,126],{},"name",[56,128,129],{},"string",[56,131,132],{},"\"Iron Sword\"",[41,134,135,138,141],{},[56,136,137],{},"description",[56,139,140],{},"rich-text",[56,142,143],{},"\"A sturdy blade...\"",[41,145,146,149,151],{},[56,147,148],{},"image",[56,150,148],{},[56,152,153],{},"(icon path)",[41,155,156,159,162],{},[56,157,158],{},"weight",[56,160,161],{},"number",[56,163,164],{},"5",[41,166,167,170,172],{},[56,168,169],{},"damage",[56,171,161],{},[56,173,174],{},"25",[15,176,177,180],{},[19,178,179],{},"When to use:"," Any data you want to store on items - display info, stats, custom properties.",[24,182],{},[88,184,186],{"id":185},"item-attributes","Item Attributes",[15,188,189,191],{},[19,190,96],{}," Categories with fixed options (like Character Attributes).",[35,193,194,204],{},[38,195,196],{},[41,197,198,201],{},[44,199,200],{},"Attribute",[44,202,203],{},"Options",[51,205,206,214,222],{},[41,207,208,211],{},[56,209,210],{},"rarity",[56,212,213],{},"common, uncommon, rare, legendary",[41,215,216,219],{},[56,217,218],{},"type",[56,220,221],{},"weapon, armor, accessory, consumable",[41,223,224,227],{},[56,225,226],{},"element",[56,228,229],{},"fire, ice, lightning, none",[15,231,232,234],{},[19,233,179],{}," Filtering items in UI, driving visual styles, game logic branches.",[24,236],{},[88,238,240],{"id":239},"item-slots","Item Slots",[15,242,243,245],{},[19,244,96],{}," Equipment positions on characters.",[35,247,248,258],{},[38,249,250],{},[41,251,252,255],{},[44,253,254],{},"Slot ID",[44,256,257],{},"Display Name",[51,259,260,268,276,284,292],{},[41,261,262,265],{},[56,263,264],{},"main_hand",[56,266,267],{},"Main Hand",[41,269,270,273],{},[56,271,272],{},"off_hand",[56,274,275],{},"Off Hand",[41,277,278,281],{},[56,279,280],{},"head",[56,282,283],{},"Head",[41,285,286,289],{},[56,287,288],{},"chest",[56,290,291],{},"Chest",[41,293,294,297],{},[56,295,296],{},"accessory_1",[56,298,299],{},"Accessory",[15,301,302],{},"Items define which slots they can go into. Characters define which slots they have (and where they appear in the equipment UI).",[24,304],{},[88,306,308],{"id":307},"item-templates","Item Templates",[15,310,311,313],{},[19,312,96],{}," The actual item definitions.",[35,315,316,325],{},[38,317,318],{},[41,319,320,322],{},[44,321,113],{},[44,323,324],{},"Description",[51,326,327,335,343,351,359,367,375,383],{},[41,328,329,332],{},[56,330,331],{},"traits",[56,333,334],{},"Item's custom data (name, damage, weight, etc.)",[41,336,337,340],{},[56,338,339],{},"attributes",[56,341,342],{},"Categories (rarity, type)",[41,344,345,348],{},[56,346,347],{},"slots",[56,349,350],{},"Which equipment slots this item fits",[41,352,353,356],{},[56,354,355],{},"tags",[56,357,358],{},"For filtering and game logic",[41,360,361,364],{},[56,362,363],{},"price",[56,365,366],{},"Trading value in various currencies",[41,368,369,372],{},[56,370,371],{},"max_stack",[56,373,374],{},"How many can stack (1 = no stacking)",[41,376,377,380],{},[56,378,379],{},"is_currency",[56,381,382],{},"Whether this item is money",[41,384,385,387],{},[56,386,21],{},[56,388,389],{},"What stats\u002Fabilities\u002Fskin layers to apply when equipped",[15,391,392],{},[19,393,394],{},"Example - Iron Sword:",[35,396,397,406],{},[38,398,399],{},[41,400,401,403],{},[44,402,113],{},[44,404,405],{},"Value",[51,407,408,418,427,436,445,455,465,474,484],{},[41,409,410,415],{},[56,411,412],{},[413,414,347],"code",{},[56,416,417],{},"main_hand, off_hand",[41,419,420,425],{},[56,421,422],{},[413,423,424],{},"traits.name",[56,426,132],{},[41,428,429,434],{},[56,430,431],{},[413,432,433],{},"traits.damage",[56,435,174],{},[41,437,438,443],{},[56,439,440],{},[413,441,442],{},"traits.weight",[56,444,164],{},[41,446,447,452],{},[56,448,449],{},[413,450,451],{},"attributes.rarity",[56,453,454],{},"common",[41,456,457,462],{},[56,458,459],{},[413,460,461],{},"attributes.type",[56,463,464],{},"weapon",[41,466,467,472],{},[56,468,469],{},[413,470,471],{},"status.stats.damage",[56,473,174],{},[41,475,476,481],{},[56,477,478],{},[413,479,480],{},"status.abilities",[56,482,483],{},"power_strike",[41,485,486,491],{},[56,487,488],{},[413,489,490],{},"status.skin_layers",[56,492,493],{},"weapon_sword",[24,495],{},[88,497,499],{"id":498},"inventories","Inventories",[15,501,502,504],{},[19,503,96],{}," Containers that hold items.",[35,506,507,515],{},[38,508,509],{},[41,510,511,513],{},[44,512,113],{},[44,514,324],{},[51,516,517,525,533,541],{},[41,518,519,522],{},[56,520,521],{},"maxSize",[56,523,524],{},"Maximum number of stacks (0 = unlimited)",[41,526,527,530],{},[56,528,529],{},"maxWeight",[56,531,532],{},"Maximum total weight (0 = unlimited)",[41,534,535,538],{},[56,536,537],{},"recipes",[56,539,540],{},"Which crafting recipes are available here",[41,542,543,546],{},[56,544,545],{},"items",[56,547,548],{},"Starting items in this inventory",[15,550,551],{},[19,552,553],{},"Special inventories:",[35,555,556,568],{},[38,557,558],{},[41,559,560,563,566],{},[44,561,562],{},"Inventory",[44,564,565],{},"ID Format",[44,567,324],{},[51,569,570,583],{},[41,571,572,575,580],{},[56,573,574],{},"Party",[56,576,577],{},[413,578,579],{},"_party_inventory",[56,581,582],{},"Shared inventory for all party members",[41,584,585,588,593],{},[56,586,587],{},"Character private",[56,589,590],{},[413,591,592],{},"_character_[characterId]",[56,594,595,596,599],{},"Personal storage per character (e.g., ",[413,597,598],{},"_character_mc",")",[24,601],{},[27,603,605],{"id":604},"equipment-flow","Equipment Flow",[35,607,608,618],{},[38,609,610],{},[41,611,612,615],{},[44,613,614],{},"Step",[44,616,617],{},"What happens",[51,619,620,628,636,644],{},[41,621,622,625],{},[56,623,624],{},"1",[56,626,627],{},"Character template defines equipment slots (main_hand, head, etc.)",[41,629,630,633],{},[56,631,632],{},"2",[56,634,635],{},"Item template defines compatible slots it can equip to",[41,637,638,641],{},[56,639,640],{},"3",[56,642,643],{},"On equip: item's status is applied (stats, abilities, skin layers)",[41,645,646,649],{},[56,647,648],{},"4",[56,650,651],{},"On unequip: item's status is removed",[24,653],{},[27,655,657],{"id":656},"consumable-items","Consumable Items",[15,659,660,661,664],{},"Items can be marked as consumable for one-time-use effects like potions, scrolls, and buff foods. Enable ",[413,662,663],{},"is_consumable"," in the item template to unlock the consume fields.",[88,666,668],{"id":667},"what-happens-on-consume","What Happens on Consume",[35,670,671,679],{},[38,672,673],{},[41,674,675,677],{},[44,676,614],{},[44,678,617],{},[51,680,681,691,698,705,712,719],{},[41,682,683,685],{},[56,684,624],{},[56,686,687,690],{},[413,688,689],{},"item_consume_before"," event fires (return false to cancel)",[41,692,693,695],{},[56,694,632],{},[56,696,697],{},"Item's status is applied to the character (visible, stackable)",[41,699,700,702],{},[56,701,640],{},[56,703,704],{},"Percentage-based resource changes are applied",[41,706,707,709],{},[56,708,648],{},[56,710,711],{},"Flat resource changes are applied",[41,713,714,716],{},[56,715,164],{},[56,717,718],{},"Item quantity is reduced by 1 (removed if last in stack)",[41,720,721,724],{},[56,722,723],{},"6",[56,725,726,729],{},[413,727,728],{},"item_consume_after"," event fires",[88,731,733],{"id":732},"template-fields","Template Fields",[35,735,736,744],{},[38,737,738],{},[41,739,740,742],{},[44,741,113],{},[44,743,324],{},[51,745,746,755,765,775,785,795],{},[41,747,748,752],{},[56,749,750],{},[413,751,663],{},[56,753,754],{},"Enable consume functionality",[41,756,757,762],{},[56,758,759],{},[413,760,761],{},"consume_duration",[56,763,764],{},"How many turns the applied status lasts. -1 or empty = permanent",[41,766,767,772],{},[56,768,769],{},[413,770,771],{},"consume_max_stacks",[56,773,774],{},"Max stacks when consuming the same item multiple times. -1 = unlimited",[41,776,777,782],{},[56,778,779],{},[413,780,781],{},"consume_percentage",[56,783,784],{},"Percentage of max resource to restore\u002Freduce (e.g., heal 25% of max health)",[41,786,787,792],{},[56,788,789],{},[413,790,791],{},"consume_absolute",[56,793,794],{},"Flat resource amount to restore\u002Freduce (e.g., restore 50 health)",[41,796,797,801],{},[56,798,799],{},[413,800,21],{},[56,802,803],{},"Status to apply on consume (same field used by equipment)",[88,805,807],{"id":806},"stacking-behavior","Stacking Behavior",[15,809,810,811,813],{},"Consuming the same item type multiple times produces the same status ID, so the engine's status stacking applies automatically. Use ",[413,812,771],{}," to cap how many stacks can accumulate.",[88,815,817],{"id":816},"consume-vs-equip","Consume vs Equip",[35,819,820,832],{},[38,821,822],{},[41,823,824,826,829],{},[44,825],{},[44,827,828],{},"Equip",[44,830,831],{},"Consume",[51,833,834,847,860,873,886],{},[41,835,836,841,844],{},[56,837,838],{},[19,839,840],{},"Duration",[56,842,843],{},"While equipped",[56,845,846],{},"Temporary or permanent",[41,848,849,854,857],{},[56,850,851],{},[19,852,853],{},"Status visibility",[56,855,856],{},"Hidden",[56,858,859],{},"Visible",[41,861,862,867,870],{},[56,863,864],{},[19,865,866],{},"Reversible",[56,868,869],{},"Unequip removes",[56,871,872],{},"Cannot undo",[41,874,875,880,883],{},[56,876,877],{},[19,878,879],{},"Stacking",[56,881,882],{},"One per slot",[56,884,885],{},"Stackable",[41,887,888,893,896],{},[56,889,890],{},[19,891,892],{},"Quantity",[56,894,895],{},"Unchanged",[56,897,898],{},"Reduced by 1",[24,900],{},[27,902,904],{"id":903},"accessing-items-in-code","Accessing Items in Code",[35,906,907,916],{},[38,908,909],{},[41,910,911,914],{},[44,912,913],{},"Method",[44,915,324],{},[51,917,918,928,938,948,958,968,978,988],{},[41,919,920,925],{},[56,921,922],{},[413,923,924],{},"game.createItem(id)",[56,926,927],{},"Create an item instance",[41,929,930,935],{},[56,931,932],{},[413,933,934],{},"game.getInventory(id)",[56,936,937],{},"Get an inventory by ID",[41,939,940,945],{},[56,941,942],{},[413,943,944],{},"inventory.addItem(item, quantity)",[56,946,947],{},"Add items to inventory",[41,949,950,955],{},[56,951,952],{},[413,953,954],{},"inventory.getItemsById(id)",[56,956,957],{},"Find items by template ID",[41,959,960,965],{},[56,961,962],{},[413,963,964],{},"inventory.getCurrencyAmount(id)",[56,966,967],{},"Get currency total",[41,969,970,975],{},[56,971,972],{},[413,973,974],{},"inventory.canAffordPrice(price)",[56,976,977],{},"Check if can afford",[41,979,980,985],{},[56,981,982],{},[413,983,984],{},"inventory.deductCurrency(price)",[56,986,987],{},"Pay with currency",[41,989,990,995],{},[56,991,992],{},[413,993,994],{},"character.getEquippedItems()",[56,996,997],{},"Items equipped on character",[15,999,1000],{},[19,1001,1002],{},"Common patterns:",[35,1004,1005,1015],{},[38,1006,1007],{},[41,1008,1009,1012],{},[44,1010,1011],{},"Task",[44,1013,1014],{},"Steps",[51,1016,1017,1031],{},[41,1018,1019,1022],{},[56,1020,1021],{},"Give player a sword",[56,1023,1024,1027,1028],{},[413,1025,1026],{},"game.createItem('iron_sword')"," → ",[413,1029,1030],{},"inventory.addItem(sword)",[41,1032,1033,1036],{},[56,1034,1035],{},"Check and deduct gold",[56,1037,1038,1027,1041],{},[413,1039,1040],{},"inventory.canAffordPrice({ gold: 100 })",[413,1042,1043],{},"inventory.deductCurrency({ gold: 100 })",[24,1045],{},[27,1047,1049],{"id":1048},"item-events","Item Events",[35,1051,1052,1062],{},[38,1053,1054],{},[41,1055,1056,1059],{},[44,1057,1058],{},"Event",[44,1060,1061],{},"When it fires",[51,1063,1064,1074,1084,1094,1104,1114,1123,1132],{},[41,1065,1066,1071],{},[56,1067,1068],{},[413,1069,1070],{},"item_create",[56,1072,1073],{},"Item instance is created",[41,1075,1076,1081],{},[56,1077,1078],{},[413,1079,1080],{},"item_equip_before",[56,1082,1083],{},"Before equipping (return false to cancel)",[41,1085,1086,1091],{},[56,1087,1088],{},[413,1089,1090],{},"item_equip_after",[56,1092,1093],{},"After equipping",[41,1095,1096,1101],{},[56,1097,1098],{},[413,1099,1100],{},"item_unequip_before",[56,1102,1103],{},"Before unequipping (return false to cancel)",[41,1105,1106,1111],{},[56,1107,1108],{},[413,1109,1110],{},"item_unequip_after",[56,1112,1113],{},"After unequipping",[41,1115,1116,1120],{},[56,1117,1118],{},[413,1119,689],{},[56,1121,1122],{},"Before consuming (return false to cancel)",[41,1124,1125,1129],{},[56,1126,1127],{},[413,1128,728],{},[56,1130,1131],{},"After consuming",[41,1133,1134,1139],{},[56,1135,1136],{},[413,1137,1138],{},"trade_init",[56,1140,1141],{},"When a trade opens (modify prices here)",[15,1143,1144],{},[19,1145,1146],{},"Example - Cursed items:",[35,1148,1149,1161],{},[38,1150,1151],{},[41,1152,1153,1155,1158],{},[44,1154,1058],{},[44,1156,1157],{},"Check",[44,1159,1160],{},"Result",[51,1162,1163],{},[41,1164,1165,1169,1174],{},[56,1166,1167],{},[413,1168,1100],{},[56,1170,1171],{},[413,1172,1173],{},"item.traits.is_cursed",[56,1175,1176],{},"return false, show notification",[24,1178],{},[27,1180,1182],{"id":1181},"quick-reference","Quick Reference",[35,1184,1185,1195],{},[38,1186,1187],{},[41,1188,1189,1192],{},[44,1190,1191],{},"I want to...",[44,1193,1194],{},"Do this",[51,1196,1197,1204,1212,1220,1228,1236],{},[41,1198,1199,1202],{},[56,1200,1201],{},"Define item data fields",[56,1203,103],{},[41,1205,1206,1209],{},[56,1207,1208],{},"Create item categories",[56,1210,1211],{},"Items > Item Attributes",[41,1213,1214,1217],{},[56,1215,1216],{},"Define equipment positions",[56,1218,1219],{},"Items > Item Slots",[41,1221,1222,1225],{},[56,1223,1224],{},"Create an item",[56,1226,1227],{},"Items > Item Templates",[41,1229,1230,1233],{},[56,1231,1232],{},"Create a container",[56,1234,1235],{},"Items > Inventories",[41,1237,1238,1241],{},[56,1239,1240],{},"Give player an item",[56,1242,1243],{},[413,1244,1245],{},"inventory.addItem(item)",[24,1247],{},[27,1249,1251],{"id":1250},"next-steps","Next Steps",[1253,1254,1255,1264,1271],"ul",{},[1256,1257,1258,1263],"li",{},[1259,1260,1262],"a",{"href":1261},"\u002Fdocs\u002Fglobal_essentials\u002Fitems\u002Fexchange","Exchange"," - Trading, shops, and currencies",[1256,1265,1266,1270],{},[1259,1267,1269],{"href":1268},"\u002Fdocs\u002Fglobal_essentials\u002Fitems\u002Fapply","Apply"," - Crafting and custom apply logic",[1256,1272,1273,1276],{},[1259,1274,5],{"href":1275},"\u002Fdocs\u002Fglobal_essentials\u002Fcharacters\u002Fcharacters_overview"," - How items connect to the status system",{"title":1278,"searchDepth":1279,"depth":1279,"links":1280},"",2,[1281,1282,1290,1291,1297,1298,1299,1300],{"id":29,"depth":1279,"text":30},{"id":85,"depth":1279,"text":86,"children":1283},[1284,1286,1287,1288,1289],{"id":90,"depth":1285,"text":91},3,{"id":185,"depth":1285,"text":186},{"id":239,"depth":1285,"text":240},{"id":307,"depth":1285,"text":308},{"id":498,"depth":1285,"text":499},{"id":604,"depth":1279,"text":605},{"id":656,"depth":1279,"text":657,"children":1292},[1293,1294,1295,1296],{"id":667,"depth":1285,"text":668},{"id":732,"depth":1285,"text":733},{"id":806,"depth":1285,"text":807},{"id":816,"depth":1285,"text":817},{"id":903,"depth":1279,"text":904},{"id":1048,"depth":1279,"text":1049},{"id":1181,"depth":1279,"text":1182},{"id":1250,"depth":1279,"text":1251},"Items in Dryad Engine follow the same layered philosophy as everything else. When equipped, an item applies a status to the character - adding stats, granting abilities, or changing appearance.","md",{"plugin":1304,"category":545,"page":1305},"global_essentials","items_overview",true,"\u002Fdocs\u002Fglobal_essentials\u002Fitems\u002Fitems_overview",{"title":5,"description":1301},"docs\u002Fglobal_essentials\u002Fitems\u002Fitems_overview","afhqOFIUKJFxMc3Lq5Bf9jV4AhdLVafZWdLvKmS4SSo",1779582261285]