• 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!

Lua [0.4] bless

foulla

Member
Joined
Jun 26, 2016
Messages
78
Solutions
1
Reaction score
6
TFS 0.4
Hello otland ...
I have a problem when I get the blessing and after death it becomes my level 1 At whatever level I am I have no mistakes in the console

bless.lua

Lua:
local cost = 2000
function onSay(cid, words, param)
    if (exhaustion.get (cid, 99901)) then
        doPlayerSendCancel (cid, "You must wait "..exhaustion.get (cid, 99901).. " to use this command again!")
        return true
        end
    for i = 1, 5 do
        if(getPlayerBlessing(cid, i)) then
            doPlayerSendCancel(cid, "You have already all blessings.")
        elseif getPlayerLevel(cid) < 50 then
            doPlayerSendCancel(cid, "You are not level 50.")
        elseif doPlayerRemoveMoney(cid, cost) then
            doPlayerAddBlessing(cid, 1)
            doPlayerAddBlessing(cid, 2)
            doPlayerAddBlessing(cid, 3)
            doPlayerAddBlessing(cid, 4)
            doPlayerAddBlessing(cid, 5)
            doCreatureSay(cid, "You are now blessed, Dont forget to buy aol!" ,19)
            exhaustion.set(cid, 99901, 1)
            doSendMagicEffect(getPlayerPosition(cid), 49)
        else
            doPlayerSendCancel(cid, "You don\'t have enough money.")
        end
    end
    return true
end
 
Solution
Change this
Lua:
    blessings = true
    blessingOnlyPremium = true
    blessingReductionBase = 300000
    blessingReductionDecrement = 20000
    eachBlessReduction = 40000
to this and then retry
Lua:
    blessings = true
    blessingOnlyPremium = true
    blessingReductionBase = 30
    blessingReductionDecrement = 5
    eachBlessReduction = 8
Post your config.lua and login.lua
config.lua

Lua:
    -- accountManager
    accountManager = false
    namelockManager = false
    newPlayerChooseVoc = true
    newPlayerSpawnPosX = 1004
    newPlayerSpawnPosY = 1001
    newPlayerSpawnPosZ = 6
    newPlayerTownId = 1
    newPlayerLevel = 20
    newPlayerMagicLevel = 1
    generateAccountNumber = false
    enableCast = true
    
    redSkullLength = 30 * 24 * 60 * 60
    blackSkullLength = 45 * 24 * 60 * 60
    dailyFragsToRedSkull = 40000000
    weeklyFragsToRedSkull = 100000000
    monthlyFragsToRedSkull = 150000000
    dailyFragsToBlackSkull = dailyFragsToRedSkull
    weeklyFragsToBlackSkull = weeklyFragsToRedSkull
    monthlyFragsToBlackSkull = monthlyFragsToRedSkull
    dailyFragsToBanishment = dailyFragsToRedSkull
    weeklyFragsToBanishment = weeklyFragsToRedSkull
    monthlyFragsToBanishment = monthlyFragsToRedSkull
    blackSkulledDeathHealth = 40
    blackSkulledDeathMana = 0
    useBlackSkull = false
    useFragHandler = true
    advancedFragList = false


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


    worldType = "open"
    protectionLevel = 50000
    pvpTileIgnoreLevelAndVocationProtection = true
    pzLocked = 6 * 1000
    huntingDuration = 60 * 1000
    criticalHitChance = 7
    criticalHitMultiplier = 1
    displayCriticalHitNotify = true
    removeWeaponAmmunition = false
    removeWeaponCharges = false
    removeRuneCharges = false
    whiteSkullTime = 0.2 * 60 * 1000
    noDamageToSameLookfeet = false
    showHealingDamage = true
    showHealingDamageForMonsters = true
    fieldOwnershipDuration = 5 * 1000
    stopAttackingAtExit = false
    loginProtectionPeriod = 1 * 1000
    deathLostPercent = 5
    stairhopDelay = 1
    pushCreatureDelay = 0.1 * 1000
    allowedMaxSizedPackets = 3
    deathContainerId = 1987
    gainExperienceColor = 215
    addManaSpentInPvPZone = true
    squareColor = 0
    allowFightback = true
    fistBaseAttack = 7


    worldId = 0
    ip = "127.0.0.1"
    bindOnlyGlobalAddress = true
    loginPort = 7171
    gamePort = 7172
    loginTries = 0
    retryTimeout = 5 * 1000
    loginTimeout = 60 * 1000
    maxPlayers = 500
    motd = "Welcome to Evoland"
    displayOnOrOffAtCharlist = false
    onePlayerOnlinePerAccount = false
    allowClones = false
    serverName = "Evoland"
    loginMessage = "Welcome to Evoland"
    statusTimeout = 0
    replaceKickOnLogin = true
    forceSlowConnectionsToDisconnect = false
    loginOnlyWithLoginServer = false
    premiumPlayerSkipWaitList = false


    sqlType = "mysql"
    sqlHost = "localhost"
    sqlUser = "root"
    sqlPass = ""
    sqlDatabase = "evoland"
    sqlPort = 3306
    encryptionType = "sha1"
    
    --sqlFile = "theforgottenserver.s3db"
    --sqlKeepAlive = 0
    --mysqlReadTimeout = 10
    --mysqlWriteTimeout = 10

    

    deathListEnabled = true
    deathListRequiredTime = 1 * 60 * 1000
    deathAssistCount = 4
    maxDeathRecords = 10


    ingameGuildManagement = false
    levelToFormGuild = 8
    premiumDaysToFormGuild = 0
    guildNameMinLength = 4
    guildNameMaxLength = 20


    highscoreDisplayPlayers = 15
    updateHighscoresAfterMinutes = 60


    buyableAndSellableHouses = true
    houseNeedPremium = true
    bedsRequirePremium = true
    levelToBuyHouse = 100000
    housesPerAccount = 1
    houseRentAsPrice = false
    housePriceAsRent = false
    housePriceEachSquare = 4
    houseRentPeriod = "never"
    houseCleanOld = 0
    guildHalls = true


    timeBetweenActions = 200
    timeBetweenExActions = 1000
    hotkeyAimbotEnabled = true


    mapName = "Evoland.otbm"
    mapAuthor = ""
    randomizeTiles = true
    storeTrash = true
    cleanProtectedZones = true
    mailboxDisabledTowns = ""


    niceLevel = 0
    coresUsed = "-1"


    startupDatabaseOptimization = false
    updatePremiumStateAtStartup = true
    confirmOutdatedVersion = false


    formulaLevel = 5.0
    formulaMagic = 1.0
    bufferMutedOnSpellFailure = false
    spellNameInsteadOfWords = false
    emoteSpells = true


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


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


    separateVipListPerCharacter = false
    vipListDefaultLimit = 20
    vipListDefaultPremiumLimit = 100


    saveGlobalStorage = true
    useHouseDataStorage = false
    storePlayerDirection = false


    checkCorpseOwner = true
    monsterLootMessage = 3
    monsterLootMessageType = 25


    ghostModeInvisibleEffect = true
    ghostModeSpellEffects = true


    idleWarningTime = 15 * 3600 * 1000
    idleKickTime = 16 * 3600 * 1000
    reportsExpirationAfterReads = 1
    playerQueryDeepness = 2
    tileLimit = 9
    protectionTileLimit = 9
    houseTileLimit = 9


    freePremium = true
    premiumForPromotion = true


    blessings = true
    blessingOnlyPremium = true
    blessingReductionBase = 300000
    blessingReductionDecrement = 20000
    eachBlessReduction = 40000


    experienceStages = true
    pvpStages = false
    rateExperience = 20
    rateExperienceFromPlayers = 0.2
    rateSkill = 35
    rateMagic = 20
    rateLoot = 4
    rateSpawn = 3

    rateMonsterHealth = 1.0
    rateMonsterMana = 1.0
    rateMonsterAttack = 0.94
    rateMonsterDefense = 1.0


    minLevelThresholdForKilledPlayer = 0
    maxLevelThresholdForKilledPlayer = 0


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


    experienceShareRadiusX = 0
    experienceShareRadiusY = 0
    experienceShareRadiusZ = 0
    extraPartyExperienceLimit = 0
    extraPartyExperiencePercent = 0
    experienceShareActivity = 2 * 60 * 1000


    globalSaveEnabled = false
    globalSaveHour = 0
    globalSaveMinute = 0
    shutdownAtGlobalSave = false
    cleanMapAtGlobalSave = false


    deSpawnRange = 2
    deSpawnRadius = 50


    maxPlayerSummons = 1
    teleportAllSummons = true
    teleportPlayerSummons = true


    statusPort = 7171
    ownerName = "Owner"
    ownerEmail = ""
    url = "evoland.org"
    location = "Sweden"
    displayGamemastersWithOnlineCommand = false


    displayPlayersLogging = true
    prefixChannelLogs = ""
    runFile = ""
    outputLog = "screen.log"
    truncateLogsOnStartup = false


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


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

login.lua

Lua:
local config = {
        loginMessage = getConfigValue('loginMessage'),
        useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}


local BUFF = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(BUFF, CONDITION_PARAM_TICKS, -1)
setConditionParam(BUFF, CONDITION_PARAM_SUBID, 10)
setConditionParam(BUFF, CONDITION_PARAM_BUFF, 1)
setConditionParam(BUFF, CONDITION_PARAM_STAT_MAXHEALTHPERCENT, 104)
setConditionParam(BUFF, CONDITION_PARAM_STAT_MAXMANAPERCENT, 104)

local function removeWeedBuff(cid)
    if not isPlayer(cid) then return true end

    doRemoveCondition(cid, CONDITION_ATTRIBUTES, 10)
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You are no longer high.')
end

function onLogin(cid)
    registerCreatureEvent(cid, "RS_BS_Bless")

    if getPlayerStorageValue(cid, 1) == 1 then
        -- reset damage increase by 10 as defined in the kill script
        setPlayerStorageValue(cid, 4523, getPlayerStorageValue(cid, 4523) - 10)
        setPlayerStorageValue(cid, 1, -1)
    end

    if getPlayerPromotionLevel(cid) < 1 then
        doPlayerSetPromotionLevel(cid, 1)
    end
    setPlayerStorageValue(cid, 22372, -1)
    setPlayerStorageValue(cid, 22375, -1)

    registerCreatureEvent(cid, "lmsKill")
    registerCreatureEvent(cid, "Buffs_dead")
    registerCreatureEvent(cid, "Buffs_logout")
    registerCreatureEvent(cid, "Buffs_dmg")
    registerCreatureEvent(cid, "outfitboss")

    registerCreatureEvent(cid, "Buffs_login")
    registerCreatureEvent(cid, "statschange")
    registerCreatureEvent(cid, "PtToken")
    registerCreatureEvent(cid, "killexp")
    registerCreatureEvent(cid, "FireDeath")
    registerCreatureEvent(cid, "VipCheck")
    registerCreatureEvent(cid, "Crown_Stats")
    registerCreatureEvent(cid, "AntiCheatSystem")
    registerCreatureEvent(cid, "AntiCheatSystem_2")
    registerCreatureEvent(cid, "Pushing")
    registerCreatureEvent(cid, "firstitems")
    registerCreatureEvent(cid, "TalentPoints")
    registerCreatureEvent(cid, "lastmanDead")
    registerCreatureEvent(cid, "lastmanCorpse")
    registerCreatureEvent(cid, "CTFOutfit")
    registerCreatureEvent(cid, "CTFCombat")
    registerCreatureEvent(cid, "CTFAttck")
    registerCreatureEvent(cid, "CTFCorpse")
    registerCreatureEvent(cid, "CTFDead")
    registerCreatureEvent(cid, "AntiTrash")
    registerCreatureEvent(cid, "testkill")
    registerCreatureEvent(cid,'KillKills')
    registerCreatureEvent(cid,'KillStreak')
    registerCreatureEvent(cid,'KillStreakDeath')

    registerCreatureEvent(cid, "KingCombat")
    registerCreatureEvent(cid, "KingAttack")
    registerCreatureEvent(cid, "KingDamage")
    registerCreatureEvent(cid, "KingCorpse")
    registerCreatureEvent(cid, "KingDead")
    registerCreatureEvent(cid, "KingOutfit")
    registerCreatureEvent(cid, "CreateTeleport")
    registerCreatureEvent(cid, "CreateTeleport1")
    registerCreatureEvent(cid, "CreateTeleport2")
    registerCreatureEvent(cid, "CreateTeleport3")

    registerCreatureEvent(cid, "Bless_Aol")
    registerCreatureEvent(cid, "buffs_combat")
    registerCreatureEvent(cid, "buffs_attack")
    registerCreatureEvent(cid, "HornedDeath")
    registerCreatureEvent(cid, "WeedLogin")
    registerCreatureEvent(cid, "Survival")
    registerCreatureEvent(cid, "AdvanceLevel")
    registerCreatureEvent(cid, "TURRETCombat")
    registerCreatureEvent(cid, "TURRETAttack")
    registerCreatureEvent(cid, "TURRETCorpse")
    registerCreatureEvent(cid, "TURRETDead")
    registerCreatureEvent(cid, "TURRETOutfit")
    registerCreatureEvent(cid, "CombatPlant")
    registerCreatureEvent(cid, "DeathPlant")
    registerCreatureEvent(cid, "DeathPlantSmall")
        setPlayerStorageValue(cid, 43331, -1)
        setPlayerStorageValue(cid, 43332, -1)
        setPlayerStorageValue(cid, 43333, -1)
        setPlayerStorageValue(cid, 43334, -1)
        setPlayerStorageValue(cid, 43330, -1)
        doChangeSpeed(cid, getCreatureBaseSpeed(cid))
        doCreatureSetNoMove(cid, false)

        if getPlayerStorageValue(cid, 8859) > 0 then
                local yourRates = getPlayerRates(cid)[SKILL__LEVEL]
                local bonusExpRate = 2
                local lastTime = exhaustion.check(cid, 3010)
                doPlayerSetRate(cid, SKILL__LEVEL, bonusExpRate)
                addEvent(bonusExp, lastTime * 1000, cid)
        end



registerCreatureEvent(cid, "AdvanceWeed")
    if isHigh(cid) then
        local duration = getHighDuration(cid)
        local pos = getThingPos(cid)
        doSendMagicEffect(pos, CONST_ME_STUN)
        doSendMagicEffect({x = pos.x + 1, y = pos.y - 1, z = pos.z}, CONST_ME_SMOKE)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You are still high.')
        doAddCondition(cid, BUFF)
        addEvent(removeWeedBuff, duration * 1000, cid)
    end

        if (getCreatureHealth(cid) > getCreatureMaxHealth(cid)  ) then
                local chuj = -((getCreatureMaxHealth(cid)) - (getCreatureHealth(cid)))
                local chuje = -((getCreatureMaxMana(cid)) - (getCreatureMana(cid)))
                doCreatureAddHealth(cid, chuj)
                doCreatureAddMana(cid, chuje)
        end

        if (getCreatureStorage(cid, 88953) > 0) then
                setCreatureMaxHealth(cid, 185)
                setCreatureMaxMana(cid, 35)
                doCreatureAddMana(cid, 35)
                doCreatureAddHealth(cid, 185)
                setPlayerStorageValue(cid, 88953, 0)
        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
                        doPlayerSendOutfitWindow(cid)
                        doTeleportThing(cid, {x=851, y=895, z=4})
                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, "ZombieEvent")
        registerCreatureEvent(cid, "TalentLook")
        registerCreatureEvent(cid, "KillingInTheNameOf")
        registerCreatureEvent(cid, "PetAccept")
        registerCreatureEvent(cid, "KillGiver")
        registerCreatureEvent(cid, "DemoteDeath")
        registerCreatureEvent(cid, "koh_target")
        registerCreatureEvent(cid, "RushOutfit")
        registerCreatureEvent(cid, "GetToken")
        registerCreatureEvent(cid, "MAIL")
        registerCreatureEvent(cid, "RebirthDescription")
        registerCreatureEvent(cid, "SlotLogin")
        registerCreatureEvent(cid, "GuildMotd")
        registerCreatureEvent(cid, "demonOakLogout")
        registerCreatureEvent(cid, "demonOakDeath")
        registerCreatureEvent(cid, "Monsterlvl")
        registerCreatureEvent(cid, "Monsterearn")
        registerCreatureEvent(cid, "Sonsterlvl")
        registerCreatureEvent(cid, "spellodmg")
        registerCreatureEvent(cid, "Idle")
        registerCreatureEvent(cid, "teleportpaper")
        if(config.useFragHandler) then
                registerCreatureEvent(cid, "SkullCheck")
        end


        registerCreatureEvent(cid, "addDesc")
        registerCreatureEvent(cid, "death2")
        registerCreatureEvent(cid, "death")



        registerCreatureEvent(cid, "KOHEventS")
        registerCreatureEvent(cid, "Deadly")
        registerCreatureEvent(cid, "FireDeath")
        registerCreatureEvent(cid, "VampiroDeath")
        registerCreatureEvent(cid, "WarriorDeath")
        registerCreatureEvent(cid, "HerodoDeath")
        registerCreatureEvent(cid, "GoluromDeath")
        registerCreatureEvent(cid, "BeholderDeath")
        registerCreatureEvent(cid, "SkeletoniroDeath")
        registerCreatureEvent(cid, "PriestessDeath")
        registerCreatureEvent(cid, "KakoDeath")
        registerCreatureEvent(cid, "FighterDeath")
        registerCreatureEvent(cid, "KermitDeath")
        registerCreatureEvent(cid, "CavemanDeath")
        registerCreatureEvent(cid, "DragonyDeath")
        registerCreatureEvent(cid, "SeptunDeath")
        registerCreatureEvent(cid, "KargasDeath")
        registerCreatureEvent(cid, "MayoDeath")
        registerCreatureEvent(cid, "DrakonDeath")
        registerCreatureEvent(cid, "YellowDeath")
        registerCreatureEvent(cid, "BaterinoDeath")
        registerCreatureEvent(cid, "TarantuloDeath")
        registerCreatureEvent(cid, "AshDeath")
        registerCreatureEvent(cid, "ZombieAttack")
        registerCreatureEvent(cid, "AdvanceSave")
        registerCreatureEvent(cid, "Bounty")
        registerCreatureEvent(cid, "GuildMotd")
        registerCreatureEvent(cid, "TBEventC")
        registerCreatureEvent(cid, "TBEventS")
        registerCreatureEvent(cid, "TBEventO")
        registerCreatureEvent(cid, "zombie")
        registerCreatureEvent(cid, "ArenaKill")
        registerCreatureEvent(cid, "Arabic Pharao")
        registerCreatureEvent(cid, "ZLMSEvent")

    -- if he did not make full arena 1 he must START from zero
    if getPlayerStorageValue(cid, 42309) < 1 then
        for i = 42300, 42309 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    -- if he did not make full arena 2 he must START from zero
    if getPlayerStorageValue(cid, 42319) < 1 then
        for i = 42310, 42319 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    -- if he did not make full arena 3 he must start from zero
    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) -- did not arena level
    end
    if getPlayerStorageValue(cid, 85989) < 0 or getPlayerStorageValue(cid, 85989) == nil then
         setPlayerStorageValue(cid, 85989, 0)
    end
    setPlayerStorageValue(cid, 42350, 0) -- time to kick 0
    setPlayerStorageValue(cid, 42352, 0) -- is not in arena

    doCreatureSay(cid, "Welcome!", 20)

        return true
end
 
Change this
Lua:
    blessings = true
    blessingOnlyPremium = true
    blessingReductionBase = 300000
    blessingReductionDecrement = 20000
    eachBlessReduction = 40000
to this and then retry
Lua:
    blessings = true
    blessingOnlyPremium = true
    blessingReductionBase = 30
    blessingReductionDecrement = 5
    eachBlessReduction = 8
 
Solution
Change this
Lua:
    blessings = true
    blessingOnlyPremium = true
    blessingReductionBase = 300000
    blessingReductionDecrement = 20000
    eachBlessReduction = 40000
to this and then retry
Lua:
    blessings = true
    blessingOnlyPremium = true
    blessingReductionBase = 30
    blessingReductionDecrement = 5
    eachBlessReduction = 8
Done..
How to control how much lost level??
 
Code:
blessingReductionBase = the minimum reduction you get
eachBlessReduction = how much reduction each 1 blessing gives to you
And don't change this one
Lua:
blessingReductionDecrement
 
Code:
blessingReductionBase = the minimum reduction you get
eachBlessReduction = how much reduction each 1 blessing gives to you
And don't change this one
Lua:
blessingReductionDecrement
How to make it a no-lose level when buying a bless
 
Try changing this
Lua:
eachBlessReduction = 14
but its somehow connected to
Lua:
deathLostPercent = 5
 
Back
Top