1-- Sync the full outfits (all 3 addons) a character owns into Znote AAC storage,
2-- so characterprofile.php can show them. Canary / otservbr-global.
3--
4-- looktype lists below are the complete Female / Male outfit sets from
5-- opentibiabr/canary data/XML/outfits.xml. Regenerate them from that file if
6-- you add custom outfits.
7
8znote_outfit_list = {
9 { -- Female outfits (127)
10 136, 137, 138, 139, 140, 141, 142, 147, 148, 149,
11 150, 155, 156, 157, 158, 252, 269, 270, 279, 288,
12 324, 329, 336, 366, 431, 433, 464, 466, 471, 513,
13 514, 542, 575, 578, 618, 620, 632, 635, 636, 664,
14 666, 683, 694, 696, 698, 724, 732, 745, 749, 759,
15 845, 852, 874, 885, 900, 909, 929, 956, 958, 963,
16 965, 967, 969, 971, 973, 975, 1020, 1024, 1043, 1050,
17 1057, 1070, 1095, 1103, 1128, 1147, 1162, 1174, 1187, 1203,
18 1205, 1207, 1211, 1244, 1246, 1252, 1271, 1280, 1283, 1289,
19 1293, 1323, 1332, 1339, 1372, 1383, 1385, 1387, 1416, 1437,
20 1445, 1450, 1456, 1461, 1490, 1501, 1569, 1576, 1582, 1598,
21 1613, 1619, 1663, 1676, 1681, 1714, 1723, 1726, 1746, 1775,
22 1777, 1808, 1825, 1832, 1838, 1860, 1861
23 },
24 { -- Male outfits (125)
25 128, 129, 130, 131, 132, 133, 134, 143, 144, 145,
26 146, 151, 152, 153, 154, 251, 268, 273, 278, 289,
27 325, 328, 335, 367, 430, 432, 463, 465, 472, 512,
28 516, 541, 574, 577, 610, 619, 633, 634, 637, 665,
29 667, 684, 695, 697, 699, 725, 733, 746, 750, 760,
30 846, 853, 873, 884, 899, 908, 931, 955, 957, 962,
31 964, 966, 968, 970, 972, 974, 1021, 1023, 1042, 1051,
32 1056, 1069, 1094, 1102, 1127, 1146, 1161, 1173, 1186, 1202,
33 1204, 1206, 1210, 1243, 1245, 1251, 1270, 1279, 1282, 1288,
34 1292, 1322, 1331, 1338, 1371, 1382, 1384, 1386, 1415, 1436,
35 1444, 1449, 1457, 1460, 1489, 1500, 1568, 1575, 1581, 1597,
36 1612, 1618, 1662, 1675, 1680, 1713, 1722, 1725, 1745, 1774,
37 1776, 1809, 1824, 1831, 1837
38 }
39}
40
41local syncOutfit = CreatureEvent("ZnoteSyncOutfit")
42
43function syncOutfit.onLogin(player)
44 -- storage_value .. storage_value + highest look type must be free.
45 -- Must match $config['EQ_shower'] in the Znote AAC config.php.
46 local storage_value = 10000
47 for _, lookType in ipairs(znote_outfit_list[player:getSex() + 1]) do
48 if player:hasOutfit(lookType, 3) then
49 if player:getStorageValue(storage_value + lookType) ~= 3 then
50 player:setStorageValue(storage_value + lookType, 3)
51 end
52 end
53 end
54 return true
55end
56
57syncOutfit:register()
58