From b28506638caa582fbbd72149222d5918fb7efc44 Mon Sep 17 00:00:00 2001 From: ErikasKontenis Date: Tue, 7 Jan 2020 20:18:39 +0200 Subject: [PATCH] set sync outfits with znote aac --- data/creaturescripts/creaturescripts.xml | 1 + data/creaturescripts/scripts/login.lua | 4 +++ data/creaturescripts/scripts/syncoutfit.lua | 39 +++++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 data/creaturescripts/scripts/syncoutfit.lua diff --git a/data/creaturescripts/creaturescripts.xml b/data/creaturescripts/creaturescripts.xml index acd4814..512315c 100644 --- a/data/creaturescripts/creaturescripts.xml +++ b/data/creaturescripts/creaturescripts.xml @@ -1,6 +1,7 @@ + diff --git a/data/creaturescripts/scripts/login.lua b/data/creaturescripts/scripts/login.lua index bcfb245..480455d 100644 --- a/data/creaturescripts/scripts/login.lua +++ b/data/creaturescripts/scripts/login.lua @@ -55,5 +55,9 @@ function onLogin(player) -- Events player:registerEvent("PlayerDeath") player:registerEvent("kills") + player:registerEvent("PlayerLogout") + player:registerEvent("FirstItems") + player:registerEvent("RegenerateStamina") + return true end diff --git a/data/creaturescripts/scripts/syncoutfit.lua b/data/creaturescripts/scripts/syncoutfit.lua new file mode 100644 index 0000000..ada481d --- /dev/null +++ b/data/creaturescripts/scripts/syncoutfit.lua @@ -0,0 +1,39 @@ +-- Sync outfits that player own with Znote AAC +-- So its possible to see which full sets player +-- has in characterprofile.php + +znote_outfit_list = { + { -- Female (girl) outfits + 136,137,138,139,140,141,142,147,148, + 149,150,155,156,157,158,252,269,270, + 279,288,324,329,336,366,431,433,464, + 466,471,513,514,542,575,578,618,620, + 632,635,636,664,666,683,694,696,698, + 724,732,745,749,759,845,852,874,885, + 900 + }, + { -- Male (boy) outfits + 128,129,130,131,132,133,134,143,144, + 145,146,151,152,153,154,251,268,273, + 278,289,325,328,335,367,430,432,463, + 465,472,512,516,541,574,577,610,619, + 633,634,637,665,667,684,695,697,699, + 725,733,746,750,760,846,853,873,884, + 899 + } +} + +function onLogin(player) + -- storage_value + 1000 storages (highest outfit id) must not be used in other script. + -- Must be identical to Znote AAC config.php: $config['EQ_shower'] -> storage_value + local storage_value = 10000 + -- Loop through outfits + for _, outfit in pairs(znote_outfit_list[player:getSex()+1]) do + if player:hasOutfit(outfit,3) then + if player:getStorageValue(storage_value + outfit) ~= 3 then + player:setStorageValue(storage_value + outfit, 3) + end + end + end + return true +end