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

Nostalrius 7.7

can i use lua script functions in .npc or create array and doing for there? Im reading behaviors but i need time to learn all.

#edit
im doing tasks with npc and i resolve it like this

Code:
#TASKS

#REWARD
"task",QuestValue(6522002)>0 -> Amount=QuestValue(6522000),"I have something for you, would you like to get a reward? %A", Topic=10
Topic=10,"yes",QuestValue(6522000)=1 -> Amount=10, Create(3043), SetQuestValue(6522000,0), SetQuestValue(6522002,0), SetQuestValue(6522003,1), "Here you go!"
Topic=10,"yes",QuestValue(6522000)=2 -> Amount=50, Create(3043), SetQuestValue(6522000,0), SetQuestValue(6522002,0), SetQuestValue(6522003,2), "Here you go!"
Topic=10,"yes",QuestValue(6522000)=3 -> Amount=100, Create(3043), SetQuestValue(6522000,0), SetQuestValue(6522002,0), SetQuestValue(6522003,3), "Here you go!"
Topic=10 -> "Ok, your loss.", Idle

#TASK ALREADY
"task",QuestValue(6522000)>0 -> "You already have a task, would you like to know name of this task?",Topic=20
Topic=20,"yes",QuestValue(6522000)=1 -> "You already on a Rotworms task."
Topic=20,"yes",QuestValue(6522000)=2 -> "You already on a Dragons task."
Topic=20,"yes",QuestValue(6522000)=3 -> "You already on a Demons task."
Topic=20 -> "Good bye. Dont walk in the dark alone, the evil is just around the corner!", Idle

#ALL DONE
"task",QuestValue(6522003)=3 -> "You have completed all the tasks!"

#SET NEW
"task",QuestValue(6522003)<1 -> SetQuestValue(6522000,1),SetQuestValue(6522001,50),"Started Rotworms task."
"task",QuestValue(6522003)=1 -> SetQuestValue(6522000,2),SetQuestValue(6522001,100),"Started Dragons task."
"task",QuestValue(6522003)=2 -> SetQuestValue(6522000,3),SetQuestValue(6522001,666),"Started Demons task."

but i want to get storage value from my lua object. Its possible? Thanks for answer
 
Last edited:
data/globalevents/globalevents.xml
XML:
<globalevent name="Player Save" interval="1800000" script="playersave.lua" />


data/globalevents/scripts/playersave.lua
Lua:
local function serverSave()
    Game.saveGameState()
    broadcastMessage("Server saved, next save in 30 minutes.", MESSAGE_STATUS_WARNING)
    return true
end

function onThink(interval, lastExecution, thinkInterval)
    broadcastMessage("Automatic Serversave in 10 seconds!", MESSAGE_STATUS_WARNING)
    addEvent(serverSave, 10000)
end


data/talkactions/scripts/saveserver.lua
Lua:
function onSay(player, words, param)
    if not player:getGroup():getAccess() then
        return true
    end

    if player:getAccountType() < ACCOUNT_TYPE_GOD then
        return false
    end

    Game.saveGameState()
    player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Server is now saved.")
end


data/talkactions/talkactions.xml
XML:
<talkaction words="/saveserver" script="saveserver.lua" />


src/luascript.cpp add on line 1635 ~

C++:
registerMethod("Game", "saveGameState", LuaScriptInterface::luaGameSaveGameState);
and add on line 3939 (after luaGameSetGameState)
C++:
int LuaScriptInterface::luaGameSaveGameState(lua_State* L)
{
    // Game.saveGameState()
    g_game.saveGameState();
    pushBoolean(L, true);
    return 1;
}

src/luascript.h add on line 538 ~
C++:
static int luaGameSaveGameState(lua_State* L);


enjoy


Ty brow, love you! :D
 
Hi,

I'm having some issues with changing the spawn rate of the server.
Whenever I change rateSpawn from 0, it leads to monsters instantly respawning (as soon as the player leaves the screen).

Does anybody know how I could fix this?
 
Hi,

I'm having some issues with changing the spawn rate of the server.
Whenever I change rateSpawn from 0, it leads to monsters instantly respawning (as soon as the player leaves the screen).

Does anybody know how I could fix this?

I changed the time in world/spawn.xml
 
Hello guys!

Is it possible bank system like: Balance, deposit, transfer and withdraw ?
 
This error when compiling. Does anyone knows what am I doing wrong? :p

unknown.png
 
Thank you for sharing this!
I'm brand new here at OTLand, but I played Tibia mainly between 2001-2006. My goal is to just have a private server to re-experience this game the way it was before it, in my opinion, went to shit :) So far I'm having a lot of fun with it, but I am also having a little trouble with the game freezing completely after playing for around 1 hour. When this happens the only solution I've found is to restart the server application, but this sometimes causes all the progress I made in that hour to be lost. Any ideas what could be wrong?
 
I'm also trying to learn how to compile this myself, since I would like to eventually be able to change things to be more like the previous versions of Tibia, before the magic system got updated etc. But I'm running into a lot of trouble compiling in Visual Studio and have spent the past few days troubleshooting, but now I'm completely stuck. I have a little coding experience, but have never worked with Visual Studio. I tried to follow the tutorial here otland/forgottenserver (https://github.com/otland/forgottenserver/wiki/Compiling-on-Windows) but I keep getting errors. I've overcome some of them, but now I'm really stuck.

The errors I'm getting now all seem to be related to Lua. Getting about 100 errors similar to this one:
Error LNK2001 unresolved external symbol _luaL_loadfile

Could someone please help me out? I'd really appreciate it!
 
Does anyone compiled it after the monster.cpp fix? Would you upload it please? o_O
 
Is there an easy way to convert/open other maps to import segments of map?

Because all the item ids are different in this RME, all other maps open up all mis-matched.
 
Did the 5 blessings not always protect against item drop as well?

I was a noob back then, I never bought them.
 
Hello, community.

I'm releasing here my clone of RealOTS 7.7, it's based on TFS 1.2 and comes with everything needed to setup a true 7.7 clone, including formulas and monsters behavior, this server has been running a few times, and since I don't have purpose with it anymore, and my friends agreed with me on releasing it, well, here it is.

Please, make sure to report any issue I might have done during the upload.

TwistedScorpio/Nostalrius (https://github.com/TwistedScorpio/Nostalrius)

In a few moments I will be uploading the map editor required.
This distro had the artificial AI f cipsoft 7.7?
 
Back
Top