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

[7.4] Avesta

Is there a way to run it on XML? I just want a server for me and couple of friends, i dont want to mess with all that SQL..
 
Is there a easiest way to setup server on SQL? I mean i dont want loading all my server files to some server, i want to have all the server files on my computer like on XML. As i said before it's just for me and a couple of my friends.
 
I have problems with the capacity.
I change the capacity of a player on the database (players/cap) to 1000 but when i login it changes always to 0.
How can i repair that?
 
En español:
Le cambio los valores del capacity a cualquier player y este vuelve a 0 repentinamente cuando se logea el character.
En el group tiene access 0 y flag 0, pero igual se salta las capacidades, es decir, puede tomar cualquier item independientemente si tiene capacidad o no. COmo podré arreglar esto? es la rev 94, avesta 7.7
 
En español:
Le cambio los valores del capacity a cualquier player y este vuelve a 0 repentinamente cuando se logea el character.
En el group tiene access 0 y flag 0, pero igual se salta las capacidades, es decir, puede tomar cualquier item independientemente si tiene capacidad o no. COmo podré arreglar esto? es la rev 94, avesta 7.7

I dont have problems with this i use the same rev and all work very well, remember if you edit some value in the table players you need be offline in-game to re-load the player info.
 
Has anyone correct source for Linux 7.6 avesta? if so please contact me or a link. Regards
 
the avesta 0.6.3 have auto save? because i cant use Avesta 0.6.5e when i try to open this one i get one error in console -dbghelp.dll could not been found- and i want to know if 0.6.3 crashes, if it autosave
 
avesta 0.6.5 has auto save but needs to be added in global events.

Code:
function onThink(interval, lastExecution, thinkInterval)
    local PlayersOnline = getPlayersOnline()
        for o = 1, table.maxn(PlayersOnline) do
          doSavePlayer(PlayersOnline[o])
        end
        print(":: Server save [done]")
  return 1
end

Code:
<globalevent name="Save" interval="300000" script="save.lua"/>
<< 5 minutes.
 
avesta 0.6.5 has auto save but needs to be added in global events.

Code:
function onThink(interval, lastExecution, thinkInterval)
    local PlayersOnline = getPlayersOnline()
        for o = 1, table.maxn(PlayersOnline) do
          doSavePlayer(PlayersOnline[o])
        end
        print(":: Server save [done]")
  return 1
end

Code:
<globalevent name="Save" interval="300000" script="save.lua"/>
<< 5 minutes.

Maybe someone has a better script for this but this is what i wrote.
 
someone know about the problem of "could not generate dbghelp.dll, please report it", the server crash when is loading the map of 7.6, im trying with rev 94, im use msvc 2010 express for compile and i use
__USE_OTPCH__
__USE_MYSQL__
__PROTOCOL_77__

but i try with all
__USE_OTPCH__
__USE_MYSQL__
__PROTOCOL_76__
__PROTOCOL_77__

someone can help me?, thanks in advance
 
Masterwhat? xD

My qquestion is refered with this problem posted by Peonso

Im using the rev94 why the server only load the same script to the rest of the npc?

Don't know if it still relevant, but the problem is with the tables at the start of npcs scripts, replace the line destinations = {} with local destinations = {}. Same with seller npcs, replace items = {} with local items = {}, and everything will work as intended.

See mine as sample
Code:
_state = 0
_count = 0
_index = 0
_delay = 800

local items = {}
items[0] = {name = 'amulet', id = 2173, subtype = -1, sell = 50000, buy = 50000, stackable = 0}
items[1] = {name = 'sudden death', id = 2268, subtype = -1, sell = 175, buy = -1, stackable = 1}
items[2] = {name = 'explosion', id = 2313, subtype = -1, sell = 50, buy = -1, stackable = 1}
items[3] = {name = 'magic missile', id = 2311, subtype = -1, sell = 8, buy = -1, stackable = 1}
items[4] = {name = 'ultimate healing', id = 2273, subtype = -1, sell = 80, buy = -1, stackable = 1}
items[5] = {name = 'great fireball', id = 2304, subtype = -1, sell = 45, buy = -1, stackable = 1}
items[6] = {name = 'intense healing', id = 2265, subtype = -1, sell = 12, buy = -1, stackable = 1}

local function onActionItem(action)
    if (action == 'buy' and items[_index].sell == -1) then
        selfSay('I\'m not selling it.', _delay * 2)
        _state = 0
        return
    elseif (action == 'sell' and items[_index].buy == -1) then
        selfSay('I\'m not interested.', _delay * 2)
        _state = 0
        return
    end

    DESCRIPTION = getItemDescriptions(items[_index].id)
    amount = ''
    NAME_TO_SAY = DESCRIPTION.name
    if items[_index].subtype == 7 then
        NAME_TO_SAY = 'mana fluid'
    end
    plural = DESCRIPTION.article

    if (_count > 1) then
        amount = '' .. tostring(_count)
        NAME_TO_SAY = DESCRIPTION.plural
        if items[_index].subtype == 7 then
        NAME_TO_SAY = 'mana fluids'
        end
        plural = ''
    end

    cost = items[_index].buy
    if (_count > 1) then
        cost = items[_index].buy * amount
    end

    if (action == 'buy') then
        cost = items[_index].sell
        if (_count > 1) then
            cost = items[_index].sell * amount
        end
    end

    selfSay('Do you want to ' .. action .. ' ' .. plural .. amount .. ' ' .. NAME_TO_SAY .. ' for ' .. cost .. ' gold?')
end

function getNext()
    nextPlayer = getQueuedPlayer()
    if (nextPlayer ~= nil) then
        if (getDistanceToCreature(nextPlayer) <= 4) then
            updateNpcIdle()
            setNpcFocus(nextPlayer)
            _state = 0
            selfSay('Hi there ' .. getCreatureName(nextPlayer) .. '.', _delay * 3)
            return
        else
            getNext()
        end
    end

    setNpcFocus(0)
    resetNpcIdle()
end

function _selfSay(message)
    selfSay(message, _delay)
    updateNpcIdle()
end

--
function onCreatureAppear(cid)

end

function onCreatureDisappear(cid)
    if (getNpcFocus() == cid) then
        selfSay('See you.', _delay)
    _state = 0
        getNext()
    else
        unqueuePlayer(cid)
    end
end

function onCreatureMove(cid, oldPos, newPos)
    if (getNpcFocus() == cid) then
        faceCreature(cid)

        if (oldPos.z ~= newPos.z or getDistanceToCreature(cid) > 4) then
            selfSay('See you.', _delay)
      _state = 0
            getNext()
        end
    else
        if (oldPos.z ~= newPos.z or getDistanceToCreature(cid) > 4) then
            unqueuePlayer(cid)
        end
    end
end

function onCreatureSay(cid, type, msg)

    if (getNpcFocus() == 0) then
        if ((msgcontains(msg, 'hi') or msgcontains(msg, 'hello')) and getDistanceToCreature(cid) <= 4) then
            updateNpcIdle()
            setNpcFocus(cid)
            getCreatureName(cid)
            selfSay('Welcome to my little room, adventurer ' .. getCreatureName(cid) .. '!', _delay)
        end
  
    elseif (getNpcFocus() ~= cid) then
        if ((msgcontains(msg, 'hi') or msgcontains(msg, 'hello')) and getDistanceToCreature(cid) <= 4) then
            selfSay('Please wait a minute, ' .. getCreatureName(cid) .. '.', _delay)
            queuePlayer(cid)
        end

    else
        if (msgcontains(msg, 'bye')or msgcontains(msg, 'farewell')) then
            selfSay('Farewell.', _delay)
            _state = 0
            getNext()

        elseif (msgcontains(msg, 'hi') or msgcontains(msg, 'hello')) then
            _selfSay('I\'m already talking to you.')
            _state = 0

        elseif (msgcontains(msg, 'name')) then
            _selfSay('I am Remere. I am selling everything the adventurer needs.')
            _state = 0
          
        elseif (msgcontains(msg, 'guilcera')) then
            _selfSay('A great world full of magic and wonder.')
            _state = 0

        elseif (msgcontains(msg, 'food')) then
            _selfSay('Sorry, I don\'t sell food.')
            _state = 0

        elseif (msgcontains(msg, 'time')) then
            _selfSay('It\'s ' .. getTibiaTime() .. ' right now.')
            _state = 0

        elseif (msgcontains(msg, 'offer')) or (msgcontains(msg, 'goods')) or (msgcontains(msg, 'job')) or (msgcontains(msg, 'runes')) then
            selfSay('I sell runes. Sudden death runes, ultimate healing runes, great fireball runes, heavy magic missile runes...', _delay)
            selfSay('... explosion runes and intense healing runes. ...', _delay*5)
            selfSay('... Almost forgot, I can sell you an amulet of loss also.', _delay*10)
            updateNpcIdle()
            _state = 0

        elseif (_state == 1) then
            if (msgcontains(msg, 'yes')) then
                if (doPlayerRemoveMoney(cid, items[_index].sell * _count) == 1) then

                    if items[_index].stackable == TRUE then
                        local _stacks = math.floor(_count/100)
                        _count = _count - _stacks*100
                        if _stacks > 0 then
                            for i = 1, _stacks do
                                doPlayerAddItem(cid, items[_index].id, 100)
                                  end
                            end
                            if _count > 0 then
                            doPlayerAddItem(cid, items[_index].id, _count)
                            end

                    else
                        for i = 1, _count do
                            doPlayerAddItem(cid, items[_index].id, items[_index].subtype)
                        end
                    end

                    selfSay('Thank you. Use it wisely.', _delay)
                else
                    selfSay('Oh. You do not have enough money.', _delay)
                end

                updateNpcIdle()
            else
                selfSay('Maybe another time.', _delay)
            end

            _state = 0

        elseif (_state == 2) then
            if (msgcontains(msg, 'yes')) then
                if (doPlayerRemoveItem(cid, items[_index].id, _count, items[_index].subtype) == 1) then
                    doPlayerAddMoney(cid, items[_index].buy * _count)
                    selfSay('Ok. Here is your money.')
                else
                    if (_count > 1) then
                        selfSay('Sorry, you do not have so many.', _delay)
                    else
                        selfSay('Sorry, you do not have one.', _delay)
                    end
                end

                updateNpcIdle()
            else
                selfSay('Maybe another time.', _delay)
            end

            _state = 0

        else
            for n = 0, table.getn(items) do
                if (msgcontains(msg, items[n].name) or msgcontains(msg, items[n].name .. "s")) then
                    _count = getCount(msg)
                    _index = n

                    if (msgcontains(msg, 'sell')) then
                        _state = 2
                        onActionItem('sell')
                      
                    else  
                        _state = 1
                        onActionItem('buy')
                      
                    end

                    updateNpcIdle()
                    break
                end
            end
        end
    end
end

function onThink()
    if (getNpcFocus() ~= 0) then
        if (isNpcIdle()) then
            selfSay('See you.', _delay)
            _state = 0
            getNext()
        end
    end
end
 
Back
Top