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

Xikini's Free Scripting Service. [0.3.7 & (0.3.6/0.4)]

Status
Not open for further replies.

Xikini

I whore myself out for likes
Senator
Premium User
Joined
Nov 17, 2010
Messages
6,756
Solutions
578
Reaction score
5,305
Doing quick (30 min or less) scripts for [0.3.7 & (0.3.6/0.4)]
I am not here to fix your broken scripts, although I will give advice if requested.
I am here for script requests of scripts not already available on the forum.
If you require support for your scripting issues please make a thread in the support section.

For clarity's sake,
I will script actionscripts, creaturescripts, globalevents, talkactions, movements, npcs for you.
I will not script spells, weapons, raids or monster scripts.
Additionally, source editing, websites and database queries are a no go as well.

Code:
How to make shorter links to posts.
https://otland.net/threads/234306/page-14#post-2330703
 
Last edited:
wow 28 pages, impressive.
How about you make a full cooking system for all baked goods in tibia :D gogo
 
My requests are:
1-I need free points as a reward at specific level like 10 points for level 500 PER ACCOUNT not character so if the player tried to do other char in same account, he won't get points because his ACCOUNT NUMBER already got the reward.



2-I need a creatureevent ONKILL for a specific points i mean something like points for players by killing bosses and i already have got the npc that will work with these points something like this system but with specific storage with command to check how many points do i have something like this system
https://otland.net/threads/6-1-cybers-repsystem-w-opinion-points-for-0-4-maac.54500/
Code:
<event type="kill" name="repMonster" event="script"><![CDATA[
domodlib('repSystem')
local monster = { --add monsters names only in lowercase
['demon'] = 3,
['behemoth'] = 4,
['hellfire fighter'] = 5,
['orshabaal'] = 10,
}
function onKill(cid, target, lastHit)
if isPlayer(cid) and isMonster(target) and monster[getCreatureName(target):lower()] then
rep.add(cid, monster[getCreatureName(target):lower()])
end
return true
end]]>
</event>

Thanks for your work.
TFS: 0.4 (3884)
 
Last edited:
My requests are:
1-I need free points as a reward at specific level like 10 points for level 500 PER ACCOUNT not character so if the player tried to do other char in same account, he won't get points because his ACCOUNT NUMBER already got the reward.



2-I need a creatureevent ONKILL for a specific points i mean something like points for players by killing bosses and i already have got the npc that will work with these points something like this system but with specific storage with command to check how many points do i have something like this system
https://otland.net/threads/6-1-cybers-repsystem-w-opinion-points-for-0-4-maac.54500/
Code:
<event type="kill" name="repMonster" event="script"><![CDATA[
domodlib('repSystem')
local monster = { --add monsters names only in lowercase
['demon'] = 3,
['behemoth'] = 4,
['hellfire fighter'] = 5,
['orshabaal'] = 10,
}
function onKill(cid, target, lastHit)
if isPlayer(cid) and isMonster(target) and monster[getCreatureName(target):lower()] then
rep.add(cid, monster[getCreatureName(target):lower()])
end
return true
end]]>
</event>

Thanks for your work.
TFS: 0.4 (3884)
1. This is what your looking for.
https://otland.net/threads/account-storage-value.20407/

2. I don't exactly understand what your wanting.

For both the requests,
What points am I giving? Is it just a storage value increase when you kill a monster or when you level up?
Random addon doll pls, tfs 0.4 8.6
https://otland.net/threads/85729/#post-879187
 
For both the requests,
What points am I giving? Is it just a storage value increase when you kill a monster or when you level up?
First one is premium points when i get level 500 and 700,
second one is storage value when i kill monster, Like when i get demon i get BOSS points etc with others.
 
Hello Dear. Xikini , how are you?

I would ask a simple script : Every day of the week, there will be a war on the castle. But, this ( castle war ) has time and the appointed day, the tile to it should be open only x hours of the day and will close x + 1 hour of the day . That is, the guild will have only an hour for dueling and possibly take over the castle. The last guild to use the lever , will be in possession of the castle, and of course, have access to a unique port . If possible , add in a BOOK a guild that won the last battle :D ..

thank you.
 
Hello Dear. Xikini , how are you?

I would ask a simple script : Every day of the week, there will be a war on the castle. But, this ( castle war ) has time and the appointed day, the tile to it should be open only x hours of the day and will close x + 1 hour of the day . That is, the guild will have only an hour for dueling and possibly take over the castle. The last guild to use the lever , will be in possession of the castle, and of course, have access to a unique port . If possible , add in a BOOK a guild that won the last battle :D ..

thank you.
nice idea :D.
 
Definitely. I'll post an updated script when I get home in an hour.

-- Update

Code:
local config = {
     [1] = {min_roll = 1, max_roll = 3, item_id = 2160, item_amount = 5}, -- 3%
     [2] = {min_roll = 4, max_roll = 30, item_id = 2160, item_amount = 3}, -- 27%
     [3] = {min_roll = 31, max_roll = 100, item_id = 2160, item_amount = 1} -- 70%
}

function onKill(cid, target, damage, flags)

     if not isPlayer(cid) or not isPlayer(target) then
         return true
     end

     if getTileInfo(getThingPos(target)).pvp then
         return true
     end

     if getPlayerLevel(target) >= 200 and getPlayerLevel(target) < 1000 then
         local rand = math.random(100)
         for i = 1, #config do
             if rand >= config[i].min_roll and rand <= config[i].max_roll then
                 doPlayerAddItem(cid, config[i].item_id, config[i].item_amount)
                 break
             end
         end
     end
 
     return true
end
why do you use minRoll and maxRoll?
why just not a parameter called "chance"?
Right now with no reason you made it more complicated xD
 
why do you use minRoll and maxRoll?
why just not a parameter called "chance"?
Right now with no reason you made it more complicated xD
Because I honestly don't know another way to do it. :p
If you have the time I'd love to see an example.
 
Because it is more accurate.
@Ninja gave me a pretty good solution / explanation why to use min/max, don't have the snippet still but maybe he wants to share again :)
more accurate??
Not rly that hard to make chance more accurate..

chance = 1436 -- 100 = 1%
math.random(10000) <= chance
 
more accurate??
Not rly that hard to make chance more accurate..

chance = 1436 -- 100 = 1%
math.random(10000) <= chance
Still can get it more accurate, to bad I don't have the snippet left from Ninja so you can see what I am talking about.
Will see if I can find it

more accurate??
Not rly that hard to make chance more accurate..

chance = 1436 -- 100 = 1%
math.random(10000) <= chance
This is the snippet! kai0yjwogkahioakg · GitHub
{4.23, 10.55}, means a chance of 6.32%

Edit: Sorry for double post, damn it.
 
Last edited by a moderator:
Still can get it more accurate, to bad I don't have the snippet left from Ninja so you can see what I am talking about.
Will see if I can find it
Doesn't prove anything. Its not more accurate and requires more knowledge to create chance%
 
Doesn't prove anything. Its not more accurate and requires more knowledge to create chance%
Go ahead and try them you, I did it the way you did first and the way Ninja learnt me is more accurate.
And yes, I tried it myself.

Edit: I can try them both later for you, and post the result here.. It is a harder way to specify the chance, but doing like that result in a more accurate result.
 
Go ahead and try them you, I did it the way you did first and the way Ninja learnt me is more accurate.
And yes, I tried it myself.

Edit: I can try them both later for you, and post the result here.
try what?
How freaking accurate you want it to be? Just add zeros as much as you want or recalculuate the decimal points in script if you want it to be easy to read also.

The snippet only calculates the chance between 2 pointers. But what I'm doing is using the chance itself, because I don't see the use for 2pointer chance in anywhere.
 
try what?
How freaking accurate you want it to be? Just add zeros as much as you want or recalculuate the decimal points in script if you want it to be easy to read also.
I want it to be accurate as much it can.

How isn't this easy to read AND accurate? Isn't it easy to read just because of the key? I think it is a very good & clean solution.

So, if you can do this without min & max and still have same accurate, why do every script i pretty much see using it?
 
I want it to be accurate as much it can.

How isn't this easy to read AND accurate? Isn't it easy to read just because of the key? I think it is a very good & clean solution.

So, if you can do this without min & max and still have same accurate, why do every script i pretty much see using it?
This is the difference.

Using min/max it's impossible to screw up your table.
Code:
local config = {
     [1] = {min_roll = 1, max_roll = 3, item_id = 2160, item_amount = 5}, -- 3% -- accurate
     [2] = {min_roll = 4, max_roll = 30, item_id = 2160, item_amount = 3}, -- 27%
     [3] = {min_roll = 31, max_roll = 100, item_id = 2160, item_amount = 1} -- 70%
}

local config = {
     [1] = {min_roll = 31, max_roll = 100, item_id = 2160, item_amount = 1} -- 70% -- accurate
     [2] = {min_roll = 4, max_roll = 30, item_id = 2160, item_amount = 3}, -- 27%
     [3] = {min_roll = 1, max_roll = 3, item_id = 2160, item_amount = 5}, -- 3%
}

local config = {
     [1] = {min_roll = 4, max_roll = 30, item_id = 2160, item_amount = 3}, -- 27% -- accurate
     [2] = {min_roll = 1, max_roll = 3, item_id = 2160, item_amount = 5}, -- 3%
     [3] = {min_roll = 31, max_roll = 100, item_id = 2160, item_amount = 1} -- 70%
}
Using only 1 number, it will iterate through the table faster, however if scripted incorrectly, or the table is set-up incorrectly, will become inaccurate.
Code:
local config = {
     [1] = {chance = 3, item_id = 2160, item_amount = 5}, -- 3% -- accurate
     [2] = {chance = 30, item_id = 2160, item_amount = 3}, -- 27%
     [3] = {chance = 100, item_id = 2160, item_amount = 1} -- 70%
}

local config = {
     [1] = {chance = 100, item_id = 2160, item_amount = 1} -- 70% -- accurate (if you use reverse logic)
     [2] = {chance = 30, item_id = 2160, item_amount = 3}, -- 27%
     [3] = {chance = 3, item_id = 2160, item_amount = 5}, -- 3%
}

local config = {
     [1] = {chance = 30, item_id = 2160, item_amount = 3}, -- 27% -- inaccurate
     [2] = {chance = 3, item_id = 2160, item_amount = 5}, -- 3% -- this item will never be received.
     [3] = {chance = 100, item_id = 2160, item_amount = 1} -- 70%
}
 
Status
Not open for further replies.

Similar threads

Back
Top