• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Solved Skulls reset on logout and Red Skull not being assigned

Giorox

Member
Joined
Jun 5, 2009
Messages
19
Reaction score
7
What's hapenning is, only white skulls are working in my OTS, and even then you can just logout and log back in to reset that, any idea on how to make the skulls work just like Global? My OTS is 8.6
 
Skulls and PZ lock

Login.lua
Code:
local config = {
    loginMessage = getConfigValue('loginMessage'),
    useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}

function onLogin(cid)
accountManager = "Account Manager"                    
managerCounter = 0

   for i, player in ipairs(getOnlinePlayers()) do
      if accountManager:lower() == player:lower() then          
      managerCounter = managerCounter + 1
      end
   end

   if managerCounter >= 3 then
      return false
   end
    local loss = getConfigValue('deathLostPercent')
    if(loss ~= nil) then
        doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
    end

    local accountManager = getPlayerAccountManager(cid)
    if(accountManager == MANAGER_NONE) then
        local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
        if(lastLogin > 0) then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
            str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
        else
            str = str .. " Please choose your outfit."
            doPlayerSendOutfitWindow(cid)
        end

        doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
    elseif(accountManager == MANAGER_NAMELOCK) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
    elseif(accountManager == MANAGER_ACCOUNT) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
    end

    if(not isPlayerGhost(cid)) then
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
    end

    registerCreatureEvent(cid, "Mail")
    registerCreatureEvent(cid, "GuildMotd")

    registerCreatureEvent(cid, "Idle")
    if(config.useFragHandler) then
        registerCreatureEvent(cid, "SkullCheck")
    end

registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "AdvanceSave")
registerCreatureEvent(cid, "attackguild") 
registerCreatureEvent(cid, "advance")
registerCreatureEvent(cid, "FimVip")
registerCreatureEvent(cid, "SkullCheck")
registerCreatureEvent(cid, "demonOakLogout")
registerCreatureEvent(cid, "demonOakDeath")
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, VipReceive)
registerCreatureEvent(cid, "PlayerKill")
registerCreatureEvent(cid, "KillingInTheNameOf")

    if (InitArenaScript ~= 0) then
    InitArenaScript = 1

        for i = 42300, 42309 do
            setGlobalStorageValue(i, 0)
            setGlobalStorageValue(i+100, 0)
        end
    end

    if getPlayerStorageValue(cid, 42309) < 1 then
        for i = 42300, 42309 do
            setPlayerStorageValue(cid, i, 0)
        end
    end

    if getPlayerStorageValue(cid, 42319) < 1 then
        for i = 42310, 42319 do
            setPlayerStorageValue(cid, i, 0)
        end
    end

    if getPlayerStorageValue(cid, 42329) < 1 then
        for i = 42320, 42329 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    if getPlayerStorageValue(cid, 42355) == -1 then
        setPlayerStorageValue(cid, 42355, 0)
    end
    setPlayerStorageValue(cid, 42350, 0)
    setPlayerStorageValue(cid, 42352, 0)
return true
end

Skullcheck.lua
Code:
function onThink(cid, interval)
 
if(not isCreature(cid)) then
     
return
 
end

 
local skull, skullEnd = getCreatureSkull(cid), getPlayerSkullEnd(cid)
 
if(skullEnd > 0 and skull > SKULL_WHITE and os.time() > skullEnd and not getCreatureCondition(cid, CONDITION_INFIGHT)) then
     
doPlayerSetSkullEnd(cid, 0, skull)
 
end

end

EDIT: Should have mentioned I use TFS 0.3.6
 
Last edited by a moderator:
Does your account has group_id higher than 1? If it has, set it to 1.
What is the exact problem with the other skulls, do people not receive them or do they go away in a short amount of time?
 
Yes, my account has a group_id of 5 because of the GOD that had to be in my account.

In general what happens is, 2 unmarked players, one of them starts attacking the other, the attacking one gets a white skull and PZ lock for the correct time, except it doesn't matter how many people the attacking player kills, he'll keep the white skull and if said player logs out and back in the skull and PZ lock just dissappear
 
Change group_id in accounts to 1. Having group id in accounts means it will have certain god/gm features for all characters of that account, so normal players on that account will be able to logout any time.
Only group_id in players for the god character is needed.
In config.lua you can change the amount of frags for a red/black skull, dailyFragsToRedSkull, weeklyFragsToRedSkull, etc.
 
All others accounts are group_id 1, I'm testing it in group_id 1 accounts. Server is set to PvP and the daily, weekly and monthly frags are set to 3, 10 and 40 respectively, but the only problem that persists right now is that it's not attributing red skulls to players.
 
Datapack?
Just noticed something, this server has a frag handler, and with this character I'm testing I have at least 20 kills already in the past 20 minutes, but the frag handler hasn't recorded any

Config.lua
Code:
-- Global Server Config

-- Account manager
accountManager = true
namelockManager = true
newPlayerChooseVoc = true
newPlayerSpawnPosX = 32230
newPlayerSpawnPosY = 32206
newPlayerSpawnPosZ = 7
newPlayerTownId = 2
newPlayerLevel = 8
newPlayerMagicLevel = 8
generateAccountNumber = false

-- Unjustified kills
useFragHandler = true
redSkullLength = 30 * 24 * 60 * 60
blackSkullLength = 45 * 24 * 60 * 60
dailyFragsToRedSkull = 3
weeklyFragsToRedSkull = 10
monthlyFragsToRedSkull = 40
dailyFragsToBlackSkull = 10
weeklyFragsToBlackSkull = 20
monthlyFragsToBlackSkull = 90
dailyFragsToBanishment = 100
weeklyFragsToBanishment = 300
monthlyFragsToBanishment = 1200
blackSkulledDeathHealth = 40
blackSkulledDeathMana = 0
useBlackSkull = true
advancedFragList = true

-- Banishments
notationsToBan = 3
warningsToFinalBan = 4
warningsToDeletion = 5
banLength = 7 * 24 * 60 * 60
killsBanLength = 7 * 24 * 60 * 60
finalBanLength = 30 * 24 * 60 * 60
ipBanishmentLength = 1 * 24 * 60 * 60
broadcastBanishments = true
maxViolationCommentSize = 200
violationNameReportActionType = 2
autoBanishUnknownBytes = false

-- Battle
worldType = "pvp"
protectionLevel = 20
pvpTileIgnoreLevelAndVocationProtection = true
pzLocked = 60 * 1000
huntingDuration = 60 * 1000
criticalHitChance = 7
criticalHitMultiplier = 1
displayCriticalHitNotify = false
removeWeaponAmmunition = true
removeWeaponCharges = true
removeRuneCharges = true
whiteSkullTime = 15 * 60 * 1000
noDamageToSameLookfeet = false
showHealingDamage = false
showHealingDamageForMonsters = false
fieldOwnershipDuration = 5 * 1000
stopAttackingAtExit = false
loginProtectionPeriod = 10 * 1000
deathLostPercent = 10
stairhopDelay = 2 * 1000
pushCreatureDelay = 2 * 1000
deathContainerId = 1987
gainExperienceColor = 215
addManaSpentInPvPZone = true
squareColor = 0
allowFightback = true
fistBaseAttack = 7

-- Connection config
worldId = 0
ip = "angelions.noip.me"
loginPort = 7171
gamePort = 7172
loginTries = 10
retryTimeout = 5 * 1000
loginTimeout = 60 * 1000
maxPlayers = 1000
motd = "Raids Novas!"
displayOnOrOffAtCharlist = true
onePlayerOnlinePerAccount = false
allowClones = false
serverName = "Angelion"
loginMessage = "Welcome! ^-^"
statusTimeout = 5 * 60 * 1000
replaceKickOnLogin = true
forceSlowConnectionsToDisconnect = false
loginOnlyWithLoginServer = false
premiumPlayerSkipWaitList = false

-- Database
sqlType = "sqlite"
sqlHost = "localhost"
sqlPort = 3306
sqlUser = "root"
sqlPass = "150198"
sqlDatabase = "realserver"
sqlFile = "realserver.s3db"
sqlKeepAlive = 0
mysqlReadTimeout = 10
mysqlWriteTimeout = 10
encryptionType = "plain"

-- Deathlist
deathListEnabled = false
deathListRequiredTime = 1 * 60 * 1000
deathAssistCount = 19
maxDeathRecords = 5

-- Guilds
ingameGuildManagement = true
levelToFormGuild = 40
premiumDaysToFormGuild = 0
guildNameMinLength = 4
guildNameMaxLength = 40

-- Highscores
highscoreDisplayPlayers = 15
updateHighscoresAfterMinutes = 60

-- Houses
buyableAndSellableHouses = true
houseNeedPremium = true
bedsRequirePremium = true
levelToBuyHouse = 20
housesPerAccount = 0
houseRentAsPrice = false
housePriceAsRent = false
housePriceEachSquare = 1000
houseRentPeriod = "never"
houseCleanOld = 0
guildHalls = true

-- Item usage
timeBetweenActions = 1 * 0001
timeBetweenExActions = 1 * 0001
hotkeyAimbotEnabled = true

-- Map
mapName = "World"
mapAuthor = "Giorox"
randomizeTiles = true
storeTrash = true
cleanProtectedZones = true
mailboxDisabledTowns = ""

-- Process
defaultPriority = "high"
niceLevel = 5
coresUsed = "-1"

-- Startup
startupDatabaseOptimization = true
updatePremiumStateAtStartup = true
confirmOutdatedVersion = false

-- Spells
formulaLevel = 5.0
formulaMagic = 1.0
bufferMutedOnSpellFailure = false
spellNameInsteadOfWords = false
emoteSpells = false

-- Outfits
allowChangeOutfit = true
allowChangeColors = true
allowChangeAddons = true
disableOutfitsForPrivilegedPlayers = false
addonsOnlyPremium = true

-- Miscellaneous
dataDirectory = "data/"
logsDirectory = "data/logs/"
bankSystem = true
displaySkillLevelOnAdvance = false
promptExceptionTracerErrorBox = true
maximumDoorLevel = 500
maxMessageBuffer = 4

-- VIP list
separateVipListPerCharacter = false
vipListDefaultLimit = 20
vipListDefaultPremiumLimit = 100

-- Saving-related
saveGlobalStorage = true
useHouseDataStorage = true
storePlayerDirection = false

-- Loot
checkCorpseOwner = true
monsterLootMessage = 3
monsterLootMessageType = 25

-- Ghost mode
ghostModeInvisibleEffect = false
ghostModeSpellEffects = true

-- Limits
idleWarningTime = 59 * 60 * 1000
idleKickTime = 60 * 60 * 1000
reportsExpirationAfterReads = 1
playerQueryDeepness = 2
tileLimit = 0
protectionTileLimit = 0
houseTileLimit = 0

-- Premium-related
freePremium = true
premiumForPromotion = true

-- Blessings
blessings = true
blessingOnlyPremium = true
blessingReductionBase = 30
blessingReductionDecrement = 5
eachBlessReduction = 8

-- Rates
experienceStages = false
rateExperience = 50
rateExperienceFromPlayers = 0
rateSkill = 50
rateMagic = 100
rateLoot = 3
rateSpawn = 1

-- Monster rates
rateMonsterHealth = 1.0
rateMonsterMana = 1.0
rateMonsterAttack = 1.0
rateMonsterDefense = 1.0

-- Experience from players
minLevelThresholdForKilledPlayer = 0.9
maxLevelThresholdForKilledPlayer = 1.1

-- Stamina
rateStaminaLoss = 1
rateStaminaGain = 3
rateStaminaThresholdGain = 12
staminaRatingLimitTop = 40 * 60
staminaRatingLimitBottom = 14 * 60
staminaLootLimit = 14 * 60
rateStaminaAboveNormal = 1.5
rateStaminaUnderNormal = 0.5
staminaThresholdOnlyPremium = true

-- Party
experienceShareRadiusX = 100
experienceShareRadiusY = 100
experienceShareRadiusZ = 2
experienceShareLevelDifference = 2 / 3
extraPartyExperienceLimit = 20
extraPartyExperiencePercent = 5
experienceShareActivity = 2 * 60 * 1000

-- Global save
globalSaveEnabled = false
globalSaveHour = 8
globalSaveMinute = 0
shutdownAtGlobalSave = true
cleanMapAtGlobalSave = false

-- Spawns
deSpawnRange = 2
deSpawnRadius = 50

-- Summons
maxPlayerSummons = 2
teleportAllSummons = false
teleportPlayerSummons = false

-- Status
statusPort = 7171
ownerName = "Giorox"
ownerEmail = "[email protected]"
url = ""
location = "Brasil"
displayGamemastersWithOnlineCommand = false

-- Logs
displayPlayersLogging = true
prefixChannelLogs = ""
runFile = ""
outputLog = ""
truncateLogsOnStartup = false

-- Manager
managerPort = 7171
managerLogs = true
managerPassword = ""
managerLocalhostOnly = true
managerConnectionsLimit = 1

-- Admin
adminPort = 7171
adminLogs = true
adminPassword = ""
adminLocalhostOnly = true
adminConnectionsLimit = 1
adminRequireLogin = true
adminEncryption = ""
adminEncryptionData = ""

Groups.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<groups>
    <group id="1" name="Player"/>
    <group id="2" name="Tutor" flags="16809984" customFlags="2" access="1" violationReasons="4" nameViolationFlags="2"/>
    <group id="3" name="Senior Tutor" flags="68736352256" customFlags="14" access="2" violationReasons="10" nameViolationFlags="2" statementViolationFlags="63" maxVips="200"/>
    <group id="4" name="Gamemaster" flags="3808558964575" customFlags="257215" access="3" violationReasons="19" nameViolationFlags="10" statementViolationFlags="69" depotLimit="3000" maxVips="300" outfit="75"/>
    <group id="5" name="Community Manager" flags="3845069447162" customFlags="2097151" access="4" violationReasons="23" nameViolationFlags="42" statementViolationFlags="213" depotLimit="0" maxVips="0" outfit="266"/>
    <group id="6" name="God" flags="3845069447162" customFlags="2097151" access="5" violationReasons="23" nameViolationFlags="426" statementViolationFlags="469" depotLimit="5000" maxVips="500" outfit="266"/>
</groups>
 
This is the default data folder. I got from Xtibia (an OTS forum that has closed now) from the official TFS post there

EDIT: To recap, it was the group_id that was resetting the skulls, now the only problem I have is it not assigning red skulls at all, even to accounts with group_id 1

EDIT2: So, I've figured out that the frag handler is not counting the kills for some unknown reason and maybe that's why the server isn't giving the players red skulls.

Could it be something related to the database? Since the fraghandler goes to the db to look for player_killers and player_deaths to determine frags..

EDIT3:Found the problem, firstly the !frags command only works if you enable fraghandling and advancedfraglist on the config, secondly, for those 2 commands to work you need to enable the deathlist inside of the config aswell, from then on it should be smooth sailing

Could a mod set this as solved for me?
 
Last edited:
Back
Top