introduce premium account system as a real premmium account for donators while regular features like travling and spells are free

This commit is contained in:
ErikasKontenis
2021-04-17 17:33:22 +03:00
parent 37aedf0555
commit 6fda4d4663
15 changed files with 78 additions and 95 deletions

View File

@@ -16,40 +16,13 @@ function onLogin(player)
nextUseStaminaTime[player.uid] = 0
-- Promotion
if player:isPremium() then
if player:getVocation():getId() ~= 0 and player:getVocation():getId() < 5 and player:getStorageValue(30018) == 1 then
player:setVocation(player:getVocation():getId() + 4)
end
else
if player:getVocation():getId() ~= 0 and player:getVocation():getId() > 4 then
player:setVocation(player:getVocation():getId() - 4)
end
end
-- Outfits
if not player:isPremium() then
if player:getSex() == PLAYERSEX_FEMALE then
local outfit = player:getOutfit()
if outfit.lookType > 139 then
player:setOutfit({lookType = 136, lookHead = 78, lookBody = 106, lookLegs = 58, lookFeet = 95})
end
else
local outfit = player:getOutfit()
if outfit.lookType > 131 then
player:setOutfit({lookType = 128, lookHead = 78, lookBody = 106, lookLegs = 58, lookFeet = 95})
end
end
if player:getVocation():getId() ~= 0 and player:getVocation():getId() < 5 and player:getStorageValue(30018) == 1 then
player:setVocation(player:getVocation():getId() + 4)
end
-- Premium system
if player:isPremium() then
player:setStorageValue(43434, 1)
elseif player:getStorageValue(43434) == 1 then
player:setStorageValue(43434, 0)
if player:getVocation():getId() > 0 then
player:teleportTo({x = 32369, y = 32241, z = 7})
player:setTown(Town("Thais"))
end
end
-- Events