mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-10-15 23:04:54 +02:00
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:
@@ -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
|
||||
|
Reference in New Issue
Block a user