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

Revscriptsys

Evan

A splendid one to behold
Senator
Premium User
Joined
May 6, 2009
Messages
7,019
Solutions
1
Reaction score
1,029
Location
United States
I, myself, only ask one question to Talaturen or Elf.

Will you implement the Revscriptsys into The Forgotten Server when the OTserv Team releases it?

For those who don't know what Revscriptsys is, it is a simpler scripting system.
You can read more about it or find examples here: Revscriptsys WIKI
 
Yes, revscriptsys will be in The Forgotten Server version 0.4.
 
Awesome, I'm looking forward to learning them and starting some basic scripts.

For those who don't know what it looks like, here is an NPC example [The Sweaty Cyclops]:
Code:
local A_Sweaty_Cyclops = NPC:new("A Sweaty Cyclops")

A_Sweaty_Cyclops.outfit = {
    type = 22,
    head = 0,
    body = 0,
    legs = 0,
    feet = 0
}

A_Sweaty_Cyclops.greeting = "Hum Humm! Welcume lil' $name."
A_Sweaty_Cyclops.farewell = "Good bye lil' one."

--A Sweaty Cyclops.listen_radius = 4
--A Sweaty Cyclops.walk_radius = 3

A_Sweaty_Cyclops.dialog = {
    ["tibia"] = "One day I'll go and look.";
    ["ab'dendriel"] = "Me parents live here before town was. Me not care about lil' ones.";
    ["big|old"] = "Mountain in south. Lil' lil' ones living there.";
    ["elves"] = "Me not fight them, they not fight me.";
    ["humans"] = "Always asking me for stuff they can't afford.";
    ["orcs"] = "Silly ones. Not talk much. Always screaming and hitting.";
    ["minotaurs"] = "They were friend with me parents. Long before elves here, they often made visit. No longer come here.";
    ["dwarfs|lil"] = "Lil' lil' ones are so fun. We often chat.";
    ["god"] = "You shut up. Me not want to hear.";
    ["smith"] = "Working steel is my profession.";
    ["steel"] = "Manny kinds of. Like Mesh Kaha Rogh, Za'Kalortith, Uth'Byth, Uth'Morc, Uth'Amon, Uth'Maer, Uth'Doon, and Zatragil";
    ["Like Mesh Kaha Rogh"] = "Steel that is singing when forged. No one knows where find today.";
    ["Za'Kalortith"] = "It's evil. Demon iron is. No good cyclops goes where you can find and need evil flame to melt.";
    ["uth'Byth"] = "Not good to make stuff off. Bad steel it is. But eating magic, so useful is.";
    ["uth'Morc"] = "Lil' ones it thieves' steel call sometimes. It's dark and making not much noise.";
    ["uth'Amon"] = "Brigthsteel is. Much art made with it. Sorcerers to lazy and afraid to enchant much.";
    ["uth'Maer"] = "Heartiron from heart of big old mountain, found very deep. Lil' lil ones fiercely defend. Not wanting to have it used for stuff but holy stuff.";
    ["uth'Doon"] = "It's high steel called. Only lil' lil' ones know how make.";
    ["Zatragil"] = "Most ancients use dream silver for different stuff. Now ancients most gone. Most not know about.";
    ["Teshial|Deraisim|Cenath|Kuridai"] = "Is one of elven family or such thing. Me not understand lil' ones and their busisness.";
    ["cyclops"] = "Me people not live here much. Most are far away.";
    ["excalibug"] = "Me wish I could make weapon like it.";
    ["bast skirt"] = function(self)
        local storage = Player.getStorageValue(1119)
        if storage == 0 then
            self:say("Lil' one bring three bast skirts?")
                if Player.getItemTypeCount(itemid) >= 3 and containsAgreement(reply) then
                    self:say("Good good! Woman happy will be. Now me happy too and help you.")
                    Player.removeItem(itemid, 0, 3)
                    Player.setStorageValue(1119, 1)
                else
                    self:say("Me wait then.")
                end                
        end;
    ["uth'prta"] = function(self)   --- chunk of crude iron
        local storage = Player.getStorageValue(1119)
        if storage < 0 then
            self:say("Wait. Me work no cheap is. Do favour for me first, yes?")
                if containsAgreement(reply) then
                    self:say("Me need gift for woman. We dance, so me want to give her bast skirt. But she big is. So I need many to make big one. Bring three okay? Me wait.")
                    Player.setStorageValue(1119, 0)
                else
                    self:say("Humans always asking me for stuff they can't afford.")
                end            
        else
            if Player.getItemTypeCount(itemid) >= 1 then
                self:say("Did you bring me a Giant Sword?")
                if containsAgreement(reply) then
                    if Player.getItemTypeCount(itemid) >= 1 then
                        Player.removeItem(itemid, 0, 1)
                        Player.addItem(itemid, canDropOnMap = true)
                    else
                        self:say("You think me is a fool?")
                    end
                end
            else    
                self:say("I need a Giant Sword to give you the chunk of crude iron. Come back when you have it.")
            end
        end;  
    ["uth'lokr"] = function(self)   --- draconian steel
        local storage = Player.getStorageValue(1119)
        if storage < 0 then
            self:say("Wait. Me work no cheap is. Do favour for me first, yes?")
                if containsAgreement(reply) then
                    self:say("Me need gift for woman. We dance, so me want to give her bast skirt. But she big is. So I need many to make big one. Bring three okay? Me wait.")
                    Player.setStorageValue(1119, 0)
                else
                    self:say("Humans always asking me for stuff they can't afford.")
                end            
        else
            if Player.getItemTypeCount(itemid) >= 1 then
                self:say("Did you bring me a Dragon Shield?")
                if containsAgreement(reply) then
                    if Player.getItemTypeCount(itemid) >= 1 then
                        Player.removeItem(itemid, 0, 1)
                        Player.addItem(itemid, canDropOnMap = true)
                    else
                        self:say("You think me is a fool?")
                    end
                end
            else    
                self:say("I need a Dragon Shield to give you the draconian steel. Come back when you have it.")
            end
        end;
    ["uth'kean"] = function(self)   --- royal steel
        local storage = Player.getStorageValue(1119)
        if storage < 0 then
            self:say("Wait. Me work no cheap is. Do favour for me first, yes?")
                if containsAgreement(reply) then
                    self:say("Me need gift for woman. We dance, so me want to give her bast skirt. But she big is. So I need many to make big one. Bring three okay? Me wait.")
                    Player.setStorageValue(1119, 0)
                else
                    self:say("Humans always asking me for stuff they can't afford.")
                end            
        else
            if Player.getItemTypeCount(itemid) >= 1 then
                self:say("Very noble. Shiny. Me like. But breaks so fast. Me can make from shiny armour. Lil' one want to trade?")
                if containsAgreement(reply) then
                    if Player.getItemTypeCount(itemid) >= 1 then
                        self:say("Cling clang!")
                        Player.removeItem(itemid, 0, 1)
                        Player.addItem(itemid, canDropOnMap = true)
                    else
                        self:say("You think me is a fool?")
                    end
                end
            else    
                self:say("I need a Crown Armor to give you the royal steel. Come back when you have it.")
            end
        end;
    ["za'ralator"] = function(self) --- hell steel
        local storage = Player.getStorageValue(1119)
        if storage < 0 then
            self:say("Wait. Me work no cheap is. Do favour for me first, yes?")
                if containsAgreement(reply) then
                    self:say("Me need gift for woman. We dance, so me want to give her bast skirt. But she big is. So I need many to make big one. Bring three okay? Me wait.")
                    Player.setStorageValue(1119, 0)
                else
                    self:say("Humans always asking me for stuff they can't afford.")
                end            
        else
            if Player.getItemTypeCount(itemid) >= 1 then
                self:say("Did you bring me a Devil Helmet?")
                if containsAgreement(reply) then
                    if Player.getItemTypeCount(itemid) >= 1 then
                        Player.removeItem(itemid, 0, 1)
                        Player.addItem(itemid, canDropOnMap = true)
                    else
                        self:say("You think me is a fool?")
                    end
                end
            else    
                self:say("I need a Devil Helmet to give you the hell steel. Come back when you have it.")
            end
        end;
    ["infernal bolt"] = function(self)  --- infernal bolt
        local storage = Player.getStorageValue(1119)
        if storage < 0 then
            self:say("Wait. Me work no cheap is. Do favour for me first, yes?")
                if containsAgreement(reply) then
                    self:say("Me need gift for woman. We dance, so me want to give her bast skirt. But she big is. So I need many to make big one. Bring three okay? Me wait.")
                    Player.setStorageValue(1119, 0)
                else
                    self:say("Humans always asking me for stuff they can't afford.")
                end            
        else
            if Player.getItemTypeCount(itemid) >= 1 then
                self:say("Did you bring me a Soul Orb?")
                if containsAgreement(reply) then
                    if Player.getItemTypeCount(itemid) >= 1 then
                        Player.removeItem(itemid, 0, 1)
                        Player.addItem(itemid, canDropOnMap = true)
                    else
                        self:say("You think me is a fool?")
                    end
                end
            else    
                self:say("I need a Soul Orb to give you the infernal bolt. Come back when you have it.")
            end
        end;
    ["gear wheel"] = function(self) --- gear wheel
        local storage = Player.getStorageValue(1119)
        if storage < 0 then
            self:say("Wait. Me work no cheap is. Do favour for me first, yes?")
                if containsAgreement(reply) then
                    self:say("Me need gift for woman. We dance, so me want to give her bast skirt. But she big is. So I need many to make big one. Bring three okay? Me wait.")
                    Player.setStorageValue(1119, 0)
                else
                    self:say("Humans always asking me for stuff they can't afford.")
                end            
        else
            if Player.getItemTypeCount(itemid) >= 1 then
                self:say("Did you bring me the Iron Ore?")
                if containsAgreement(reply) then
                    if Player.getItemTypeCount(itemid) >= 1 then
                        Player.removeItem(itemid, 0, 1)
                        Player.addItem(itemid, canDropOnMap = true)
                    else
                        self:say("You think me is a fool?")
                    end
                end
            else    
                self:say("I need the Iron Ore to give you the gear wheel. Come back when you have it.")
            end
        end;
}
 
oooh... I like this new system, especially when it comes to NPCs. Looks much simpler than the current (rather messy) npc system.
 
Awesome, I'm looking forward to learning them and starting some basic scripts.

For those who don't know what it looks like, here is an NPC example [The Sweaty Cyclops]:
This version is bugged, I think it's better one but I'm still not sure.
By Remere:
Instead of Player.removeItem
you should use:
self.focus:removeitem

PHP:
local A_Sweaty_Cyclops = NPC:new("A Sweaty Cyclops")

A_Sweaty_Cyclops.outfit = {
    type = 22,
    head = 0,
    body = 0,
    legs = 0,
    feet = 0
}

A_Sweaty_Cyclops.greeting = "Hum Humm! Welcume lil' $name."
A_Sweaty_Cyclops.farewell = "Good bye lil' one."

--A Sweaty Cyclops.listen_radius = 4
--A Sweaty Cyclops.walk_radius = 3

A_Sweaty_Cyclops.dialog = {
    ["tibia"] = "One day I'll go and look.";
    ["ab'dendriel"] = "Me parents live here before town was. Me not care about lil' ones.";
    ["big|old"] = "Mountain in south. Lil' lil' ones living there.";
    ["elves"] = "Me not fight them, they not fight me.";
    ["humans"] = "Always asking me for stuff they can't afford.";
    ["orcs"] = "Silly ones. Not talk much. Always screaming and hitting.";
    ["minotaurs"] = "They were friend with me parents. Long before elves here, they often made visit. No longer come here.";
    ["dwarfs|lil"] = "Lil' lil' ones are so fun. We often chat.";
    ["god"] = "You shut up. Me not want to hear.";
    ["smith"] = "Working steel is my profession.";
    ["steel"] = "Manny kinds of. Like Mesh Kaha Rogh, Za'Kalortith, Uth'Byth, Uth'Morc, Uth'Amon, Uth'Maer, Uth'Doon, and Zatragil";
    ["Like Mesh Kaha Rogh"] = "Steel that is singing when forged. No one knows where find today.";
    ["Za'Kalortith"] = "It's evil. Demon iron is. No good cyclops goes where you can find and need evil flame to melt.";
    ["uth'Byth"] = "Not good to make stuff off. Bad steel it is. But eating magic, so useful is.";
    ["uth'Morc"] = "Lil' ones it thieves' steel call sometimes. It's dark and making not much noise.";
    ["uth'Amon"] = "Brigthsteel is. Much art made with it. Sorcerers to lazy and afraid to enchant much.";
    ["uth'Maer"] = "Heartiron from heart of big old mountain, found very deep. Lil' lil ones fiercely defend. Not wanting to have it used for stuff but holy stuff.";
    ["uth'Doon"] = "It's high steel called. Only lil' lil' ones know how make.";
    ["Zatragil"] = "Most ancients use dream silver for different stuff. Now ancients most gone. Most not know about.";
    ["Teshial|Deraisim|Cenath|Kuridai"] = "Is one of elven family or such thing. Me not understand lil' ones and their busisness.";
    ["cyclops"] = "Me people not live here much. Most are far away.";
    ["excalibug"] = "Me wish I could make weapon like it.";
	["bast skirt"] = function(self)
		local storage = Player.getStorageValue(1119)
		if storage == 0 then
			self:say("Lil' one bring three bast skirts?")
			local reply = self:listen()
				if Player.getItemTypeCount(itemid) >= 3 and containsAgreement(reply) then
					self:say("Good good! Woman happy will be. Now me happy too and help you.")
					self.focus:removeitem(itemid, 0, 3)
					Player.setStorageValue(1119, 1)
				else
					self:say("Me wait then.")
				end					
		end;
    ["uth'prta"] = function(self)	--- chunk of crude iron
		local storage = Player.getStorageValue(1119)
		if storage < 0 then
			self:say("Wait. Me work no cheap is. Do favour for me first, yes?")
			local reply = self:listen()
				if containsAgreement(reply) then
					self:say("Me need gift for woman. We dance, so me want to give her bast skirt. But she big is. So I need many to make big one. Bring three okay? Me wait.")
					Player.setStorageValue(1119, 0)
				else 
					self:say("Humans always asking me for stuff they can't afford.")
				end				
		else
			if Player.getItemTypeCount(itemid) >= 1 then
				self:say("Did you bring me a Giant Sword?")
				local reply = self:listen()
				if containsAgreement(reply) then
					if Player.getItemTypeCount(itemid) >= 1 then
						self.focus:removeitem(itemid, 0, 1)
						Player.addItem(itemid, canDropOnMap = true)
					else
						self:say("You think me is a fool?")
					end
				end
			else 	
				self:say("I need a Giant Sword to give you the chunk of crude iron. Come back when you have it.")
			end
		end;   
	["uth'lokr"] = function(self)	--- draconian steel
		local storage = Player.getStorageValue(1119)
		if storage < 0 then
			self:say("Wait. Me work no cheap is. Do favour for me first, yes?")
			local reply = self:listen()
				if containsAgreement(reply) then
					self:say("Me need gift for woman. We dance, so me want to give her bast skirt. But she big is. So I need many to make big one. Bring three okay? Me wait.")
					Player.setStorageValue(1119, 0)
				else 
					self:say("Humans always asking me for stuff they can't afford.")
				end				
		else
			if Player.getItemTypeCount(itemid) >= 1 then
				self:say("Did you bring me a Dragon Shield?")
				local reply = self:listen()
				if containsAgreement(reply) then
					if Player.getItemTypeCount(itemid) >= 1 then
						self.focus:removeitem(itemid, 0, 1)
						Player.addItem(itemid, canDropOnMap = true)
					else
						self:say("You think me is a fool?")
					end
				end
			else 	
				self:say("I need a Dragon Shield to give you the draconian steel. Come back when you have it.")
			end
		end;
	["uth'kean"] = function(self)	--- royal steel
		local storage = Player.getStorageValue(1119)
		if storage < 0 then
			self:say("Wait. Me work no cheap is. Do favour for me first, yes?")
			local reply = self:listen()
				if containsAgreement(reply) then
					self:say("Me need gift for woman. We dance, so me want to give her bast skirt. But she big is. So I need many to make big one. Bring three okay? Me wait.")
					Player.setStorageValue(1119, 0)
				else 
					self:say("Humans always asking me for stuff they can't afford.")
				end				
		else
			if Player.getItemTypeCount(itemid) >= 1 then
				self:say("Very noble. Shiny. Me like. But breaks so fast. Me can make from shiny armour. Lil' one want to trade?")
				local reply = self:listen()
				if containsAgreement(reply) then
					if Player.getItemTypeCount(itemid) >= 1 then
						self:say("Cling clang!")
						self.focus:removeitem(itemid, 0, 1)
						Player.addItem(itemid, canDropOnMap = true)
					else
						self:say("You think me is a fool?")
					end
				end
			else 	
				self:say("I need a Crown Armor to give you the royal steel. Come back when you have it.")
			end
		end;
	["za'ralator"] = function(self)	--- hell steel
		local storage = Player.getStorageValue(1119)
		if storage < 0 then
			self:say("Wait. Me work no cheap is. Do favour for me first, yes?")
			local reply = self:listen()
				if containsAgreement(reply) then
					self:say("Me need gift for woman. We dance, so me want to give her bast skirt. But she big is. So I need many to make big one. Bring three okay? Me wait.")
					Player.setStorageValue(1119, 0)
				else 
					self:say("Humans always asking me for stuff they can't afford.")
				end				
		else
			if Player.getItemTypeCount(itemid) >= 1 then
				self:say("Did you bring me a Devil Helmet?")
				local reply = self:listen()
				if containsAgreement(reply) then
					if Player.getItemTypeCount(itemid) >= 1 then
						self.focus:removeitem(itemid, 0, 1)
						Player.addItem(itemid, canDropOnMap = true)
					else
						self:say("You think me is a fool?")
					end
				end
			else 	
				self:say("I need a Devil Helmet to give you the hell steel. Come back when you have it.")
			end
		end;
	["infernal bolt"] = function(self)	--- infernal bolt
		local storage = Player.getStorageValue(1119)
		if storage < 0 then
			self:say("Wait. Me work no cheap is. Do favour for me first, yes?")
			local reply = self:listen()
				if containsAgreement(reply) then
					self:say("Me need gift for woman. We dance, so me want to give her bast skirt. But she big is. So I need many to make big one. Bring three okay? Me wait.")
					Player.setStorageValue(1119, 0)
				else 
					self:say("Humans always asking me for stuff they can't afford.")
				end				
		else
			if Player.getItemTypeCount(itemid) >= 1 then
				self:say("Did you bring me a Soul Orb?")
				local reply = self:listen()
				if containsAgreement(reply) then
					if Player.getItemTypeCount(itemid) >= 1 then
						self.focus:removeitem(itemid, 0, 1)
						Player.addItem(itemid, canDropOnMap = true)
					else
						self:say("You think me is a fool?")
					end
				end
			else 	
				self:say("I need a Soul Orb to give you the infernal bolt. Come back when you have it.")
			end
		end;
	["gear wheel"] = function(self)	--- gear wheel
		local storage = Player.getStorageValue(1119)
		if storage < 0 then
			self:say("Wait. Me work no cheap is. Do favour for me first, yes?")
			local reply = self:listen()
				if containsAgreement(reply) then
					self:say("Me need gift for woman. We dance, so me want to give her bast skirt. But she big is. So I need many to make big one. Bring three okay? Me wait.")
					Player.setStorageValue(1119, 0)
				else 
					self:say("Humans always asking me for stuff they can't afford.")
				end				
		else
			if Player.getItemTypeCount(itemid) >= 1 then
				self:say("Did you bring me the Iron Ore?")
				local reply = self:listen()
				if containsAgreement(reply) then
					if Player.getItemTypeCount(itemid) >= 1 then
						self.focus:removeitem(itemid, 0, 1)
						Player.addItem(itemid, canDropOnMap = true)
					else
						self:say("You think me is a fool?")
					end
				end
			else 	
				self:say("I need the Iron Ore to give you the gear wheel. Come back when you have it.")
			end
		end;
}

Revscripts are awesome, I'm waiting for TFS 0.4.
 
Last edited:
All though I can imagine the problems this will cause... since the current LUA system has a very light programming pattern that is easy to learn for the noobs. But this new one, which incorporates OOP (Object Oriented Programming), I can imagine there will be a lot of whining coming from noobs who are unable to understand it since they cannot grasp the whole OOP concept.
 
Last edited:
Up also keep in mind that there won't be any backward compatibily in fact of that ur old scripts won't work.:p
 
Another problem is that every script that is made right now, will probably not work, people would have to update it to the Revscriptsys. Not sure if Talaturen will implement such backward compatibility.

Lol, Pietia you posted faster than me, I was in the process in making the post before you actually posted yours, oh well, now we let people know two times more.
 
Lol. Imagine having to recode every single script in all of OT to work with revscriptsys... Poor Elf & Talaturen.
 
Lol. Imagine having to recode every single script in all of OT to work with revscriptsys... Poor Elf & Talaturen.

Rather than it poor Remere and all otserv Developers
Code:
Development stages for Major release 0.7 (revscriptsys)

    * Remove all Lua scripting capabilities from the sources, except for the config manager. [Done] 

    Assigned to: Remere 

    * Add a template for event listeners/callbacks. [Done] 

    Assigned to: Remere 

    * Add back in all script functions, and more! 

    * Rewrite all Lua scripts using the new model. 

    Assigned to: Everyone 

    * Merge Npc & Monster into a more general Actor class. [Done] 

    Assigned to: Remere
they are rewriting base scripts to revscriptsys so it means that u will have to just change to revscriptsys ur own scripts.
 
lool so every script I have won't work with 0.4? How many people do you think will update to it, like 5? :eek:
 
lool so every script I have won't work with 0.4? How many people do you think will update to it, like 5? :eek:

It's actually going to be really easy but time consuming, that's why we want people to actually start learning revscriptsys so we can get all the scripts done faster.

Here's conjure arrow:
Code:
local conjure_arrows = Spell:new("Conjure Arrows")
 
conjure_arrows.words       = "exevo con"
conjure_arrows.vocation    = "any"
conjure_arrows.level       = 8
conjure_arrows.mana        = 30
conjure_arrows.health      = 3
 
conjure_arrows.effect = CONST_ME_MAGIC_BLUE
 
conjure_arrows.product.id    = 2544
conjure_arrows.product.count = 15
 
conjure_arrows:register()

See? very simple.
 
lool so every script I have won't work with 0.4? How many people do you think will update to it, like 5? :eek:

I don't think that will be a problem. I'd easily update for the smexi new sprites :]
 
I like Lua =( Its used in WoW, one of the fastest most lightweight programming languages. I don't wanna update :( Even if it is easier.

EDIT: ohwell looked at all the functions, looks pretty nice.
 
Last edited:
I like Lua =( Its used in WoW, one of the fastest most lightweight programming languages. I don't wanna update :( Even if it is easier.

EDIT: ohwell looked at all the functions, looks pretty nice.

Yeah, its just going to suck hoping major developers / contributors update their big scripts and I use, and I'm able to learn this as well as I've been trying to learn lua

When can I expect this to change?
 
Eh..? Lol :p

They are not changing programming language, they are merely switching to object oriented scripting for OTServs .LUA ^^

So, instead of this:
Lua Code:
doPlayerAddHealth(cid, 500)

We use this:
Lua Code:
player.addHealth(500) --Here, 'player' is the object

(I clicked quote instead of edit <.<)
 
Last edited:
yeah realized that after looking through the wiki article, dont mind that. infact it looks fun. All the new events give me good ideas.
 
Back
Top