• 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
Joined
Nov 17, 2010
Messages
6,812
Solutions
582
Reaction score
5,372
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:
Im quite surprised to see that not many people seem to be using this service. Anyway keep it up!
It's probably cause people are PMing me instead xD I was thinking about requesting a system myself but it's ridiculously advanced and honestly I don't even know where to start it myself, so I wouldn't request such a system for free xD Hell, I don't even know how to explain the system
 
It's probably cause people are PMing me instead xD I was thinking about requesting a system myself but it's ridiculously advanced and honestly I don't even know where to start it myself, so I wouldn't request such a system for free xD Hell, I don't even know how to explain the system
Well but isnt that a challenge every scripter would be looking forward to? Sou dont know unless you try :)
 
The following scripts are intended for boss monsters, but can easily be used for normal creatures as well.
The script will give players additional storage values to be used elsewhere.

In this particular example the points are used for a teleport script.

Scripts to get storage when killing creatures.

creaturescripts/creaturescripts.xml

Code:
<event type="kill" name="AAAAAAAA" event="script" value="script.lua"/>
creaturescripts/scripts/login.lua (somewhere near the bottom with the other registered events)
Code:
registerCreatureEvent(cid, "AAAAAAAA")
creaturescripts/scripts/script.lua
Code:
local storage = 45001 -- storageID to use.
local maxPoints = 10 -- maximum amount of saved points a player can have
local givePoints = 1 -- amount of points to give player
local creatureName = 'cave rat' -- creaturename (must be lowercase letters)

function onKill(cid, target, damage, flags)

   if isPlayer(target) then
     return true
   end

   local name = getCreatureName(target):lower()
   if name ~= creatureName then
     return true
   end

   if getPlayerStorageValue(cid, storage) < 0 then
     doPlayerSetStorageValue(cid, storage, 0)
   end

   if getPlayerStorageValue(cid, storage) < maxPoints then
     doPlayerSetStorageValue(cid, storage, getPlayerStorageValue(cid, storage) + givePoints)
   end

   doCreatureSay(cid, 'You have defeated ' .. name .. '.', TALKTYPE_ORANGE_1)

   return true
end
--------------------------------
Scripts to use storage when entering teleport.

movements/movements.xml

Code:
<movevent type="StepIn" actionid="45001" event="script" value="script.lua"/>
movements/scripts/script.lua
Code:
local storage = 45001 -- storage used in creaturescript
local location = {x = 1000, y = 1000, z = 7} -- place you will teleport
local pointsRequired = 1 -- how many creature points required to teleport

function onStepIn(cid, item, position, fromPosition)
   if isPlayer(cid) ~= TRUE then
     return false
   end
   if getPlayerStorageValue(cid, storage) < 0 then
     doPlayerSetStorageValue(cid, storage, 0)
   end

   if getPlayerStorageValue(cid, storage) >= pointsRequired then
     doPlayerSetStorageValue(cid, storage, getPlayerStorageValue(cid, storage) - pointsRequired)
     doTeleportThing(cid, location)
   else
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You require ".. pointsRequired .." points to use this teleport. You currently have ".. getPlayerStorageValue(cid, storage) .." points.")
   end

   return true
end

89h bump.

191h bump.

169h bump.

48h bump.

75h bump.
 
Last edited by a moderator:
Code:
local storage = "45001"

Won't work because of the "".

You should delete them.

Anyways looks promising.

Good luck.
 
TFS 0.3.7
@Xikini
i want that premium players receive 50% more exp.

But i want that this work with stages..

(LETS IMAGINE A STAGE)
So in level 100~199 he receive 2k exp of monster X + 50% exp for being premium;
So in level 200+ he receive 1k exp of monster X + 50% exp for being premium.

How can i do that? THANKS!
 
Hello can you make a script for me. I need a item to pass way and when i pass that item disapear. Using TFS v8.2
The current latest version of TFS is 1.2.xx.
I would suggest reading the first line in your console for the correct version of your server.
But here's a simple movement script for 0.3.7

data/movements/movements.xml

Code:
<movevent type="StepIn" actionid="45001" event="script" value="item_required_to_pass.lua"/>
data/movements/scripts/item_required_to_pass.lua
Code:
local config = {
   how_many_required = 1, -- how many of the item_required, required, to pass.
   item_required = 1111111, -- itemID of the item required.
   remove_item = 1 -- remove item = 1 | 0 = do not remove item.
}
function onStepIn(cid, item, position, fromPosition)
   if getPlayerItemCount(cid, config.item_required) >= config.how_many_required then
     if config.remove_item == 1 then
       doPlayerRemoveItem(cid, config.item_required, config.how_many_required)
       doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "".. config.how_many_required .." ".. getItemNameById(config.item_required) .."(s) removed from inventory. Journey onwards ".. getCreatureName(cid) ..".")
     else
       doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have the correct item(s) to pass. Journey onwards ".. getCreatureName(cid) ..".")
     end
   else  
     doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You require ".. config.how_many_required .." ".. getItemNameById(config.item_required) .."(s) to pass through here!")
     doTeleportThing(cid, fromPosition)
   end
   return TRUE
end
 
Last edited:
TFS 0.3.7
@Xikini
i want that premium players receive 50% more exp.

But i want that this work with stages..

(LETS IMAGINE A STAGE)
So in level 100~199 he receive 2k exp of monster X + 50% exp for being premium;
So in level 200+ he receive 1k exp of monster X + 50% exp for being premium.

How can i do that? THANKS!
Set up stages something like below..
data/xml/stages.xml

Code:
<?xml version="1.0" encoding="UTF-8"?>
<stages>
   <world id="0" multiplier="1">
     <stage minlevel="1" maxlevel="99" multiplier="3"/>
     <stage minlevel="100" maxlevel="199" multiplier="2"/>
     <stage minlevel="200" multiplier="1"/>
   </world>
</stages>
--------------
For extra experience try this. (Completely untested)
data/creaturescripts/creaturescripts.xml

Code:
<event type="login" name="PremiumExperienceRate" event="script" value="premium_experience_rate.lua"/>
data/creaturescripts/scripts/login.lua [somewhere near the bottom with the other registered events]
Code:
registerCreatureEvent(cid, "PremiumExperienceRate")
data/creaturescripts/scripts/premium_experience_rate.lua
Code:
local config = {
   rate = 1.5 -- normal experience rate = 1.0 | 1.5 Should be 150% experience
}
function onLogin(cid)
   if isPremium(cid) then
     doPlayerSetRate(cid, SKILL__LEVEL, config.rate)
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are premium. You get extra experience. Yay!")
   else
     doPlayerSetRate(cid, SKILL__LEVEL, 1)
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You are not premium. You get normal experience. Woo.")
   end
   return TRUE
end
 
Set up stages something like below..
data/xml/stages.xml

Code:
<?xml version="1.0" encoding="UTF-8"?>
<stages>
   <world id="0" multiplier="1">
     <stage minlevel="1" maxlevel="99" multiplier="3"/>
     <stage minlevel="100" maxlevel="199" multiplier="2"/>
     <stage minlevel="200" multiplier="1"/>
   </world>
</stages>
--------------
For extra experience try this. (Completely untested)
data/creaturescripts/creaturescripts.xml

Code:
<event type="login" name="PremiumExperienceRate" event="script" value="premium_experience_rate.lua"/>
data/creaturescripts/scripts/login.lua [somewhere near the bottom with the other registered events]
Code:
registerCreatureEvent(cid, "PremiumExperienceRate")
data/creaturescripts/scripts/premium_experience_rate.lua
Code:
local config = {
   rate = 1.5 -- normal experience rate = 1.0 | 1.5 Should be 150% experience
}
function onLogin(cid)
   if isPremium(cid) then
     doPlayerSetRate(cid, SKILL__LEVEL, config.rate)
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are premium. You get extra experience. Yay!")
   else
     doPlayerSetRate(cid, SKILL__LEVEL, 1)
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You are not premium. You get normal experience. Woo.")
   end
   return TRUE
end

Thanks! But if player are level 99 (rate 3) and get level 100 (rate 2), the experience will not bug and the 150% will be added following the stages, right? :O

EDIT: what about the function: doPlayerSetExperienceRate ? Work in the same way?
 
Thanks! But if player are level 99 (rate 3) and get level 100 (rate 2), the experience will not bug and the 150% will be added following the stages, right? :O
I think the stages will stay the same until the next time the player relogs.
So if they go from level 99-102 in 1 day (some serious power grinding) they'll get the 1.5*3 for that duration.
When they login next, their experience would be 1.5*2.
To stop this you can add an onAdvance script.

data/creaturescripts/creaturescripts.xml

Code:
<event type="advance" name="PremiumExperienceRateOnAdvance" script="premium_experience_rate_on_advance.lua"/>
data/creaturescripts/scripts/premium_experience_rate_on_advance.lua
Code:
local config = {
   rate = 1.5 -- normal experience rate = 1.0 | 1.5 Should be 150% experience
}

function onAdvance(cid, skill, oldlevel, newlevel)
   if isPremium(cid) then
     doPlayerSetRate(cid, SKILL__LEVEL, config.rate)
   else
     doPlayerSetRate(cid, SKILL__LEVEL, 1)
   end
   return true
end
 
I think the stages will stay the same until the next time the player relogs.
So if they go from level 99-102 in 1 day (some serious power grinding) they'll get the 1.5*3 for that duration.
When they login next, their experience would be 1.5*2.
To stop this you can add an onAdvance script.

data/creaturescripts/creaturescripts.xml

Code:
<event type="advance" name="PremiumExperienceRateOnAdvance" script="premium_experience_rate_on_advance.lua"/>
data/creaturescripts/scripts/premium_experience_rate_on_advance.lua
Code:
local config = {
   rate = 1.5 -- normal experience rate = 1.0 | 1.5 Should be 150% experience
}

function onAdvance(cid, skill, oldlevel, newlevel)
   if isPremium(cid) then
     doPlayerSetRate(cid, SKILL__LEVEL, config.rate)
   else
     doPlayerSetRate(cid, SKILL__LEVEL, 1)
   end
   return true
end

NICE IDEA, thanks!

The function doPlayerSetExperienceRate works in the same way of the function doPlayerSetRate ?
 
NICE IDEA, thanks!

The function doPlayerSetExperienceRate works in the same way of the function doPlayerSetRate ?
I'm not too sure to be honest.
The rate I'm setting is the one in config.lua
The default is 1.0
 
I'm not too sure to be honest.
The rate I'm setting is the one in config.lua
The default is 1.0

But if the function doPlayerSetRate made the experience of cong.lua higher, i assume that if the server follow stages, player will not have the extra exp working, since the extra exp are being added to the conf.lua experience rate.

Am i right? If yes, exist a function that chance the stages rate? (in xml/stages.xml)
 
But if the function doPlayerSetRate made the experience of cong.lua higher, i assume that if the server follow stages, player will not have the extra exp working, since the extra exp are being added to the conf.lua experience rate.

Am i right? If yes, exist a function that chance the stages rate? (in xml/stages.xml)
config.lua
Code:
  -- Rates
   experienceStages = true
   rateExperience = 1.0
If stages = true, then experience is.. 1.0*stages.xml
My script changes the 1.0 to 1.5. (if they are premium)
 
config.lua
Code:
  -- Rates
   experienceStages = true
   rateExperience = 1.0
If stages = true, then experience is.. 1.0*stages.xml
My script changes the 1.0 to 1.5. (if they are premium)

I really do not have too much natural knowledge (since i am not a programmer of sometthing like that), but this that u posted means that rateExperience = 1 make the experience in stages.xml be * 1 ? And if i put doPlayerSetRate(cid, SKILL__LEVEL, 2) will make the experience in stages.xml be * 2 ?
 
If your using stages.xml.. you should set the experience to 1.0 in config.lua..
Anything other then 1.0 and your going to screw up your stages.xml

So all in all set-up your stages.xml perfectly..
so level 1-99 get's 3x experience
level 100-199 get's 2x experience
level 200+ get's 1x experience -- this is all normal experience rates.

IF you downloaded a server, and want all experience from monsters to be 2x normal rates.. then change to 2.0
OR
change stages.xml to
6x
4x
2x

and yes change script to reflect your config.lua
So if config.lua = 1.0
then SKILL__LEVEL, 1)

if config.lua = 2.0
then SKILL__LEVEL, 2)
and rate = 3
(this is some math here.. if 1.0 then 1.5.. if 2.0 then 3.. if 15.0 then 22.5)
 
If your using stages.xml.. you should set the experience to 1.0 in config.lua..
Anything other then 1.0 and your going to screw up your stages.xml

So all in all set-up your stages.xml perfectly..
so level 1-99 get's 3x experience
level 100-199 get's 2x experience
level 200+ get's 1x experience -- this is all normal experience rates.

IF you downloaded a server, and want all experience from monsters to be 2x normal rates.. then change to 2.0
OR
change stages.xml to
6x
4x
2x

and yes change script to reflect your config.lua
So if config.lua = 1.0
then SKILL__LEVEL, 1)

if config.lua = 2.0
then SKILL__LEVEL, 2)
and rate = 3
(this is some math here.. if 1.0 then 1.5.. if 2.0 then 3.. if 15.0 then 22.5)

Now i understand, THANKS!

I dont know if u check my old post ( https://otland.net/threads/how-can-i-add-50-to-this-script.235290/#post-2272435 ), but i am having a problem.
Now i understand (since u teached me lol) how to add 50% exp when premium player log in + keep 50% exp when player advance level. Thats nice.

But if you check the post (go down on post to find what i am saying), i have a exp ring script. This script add 10% more exp for player wearing it. (sorry for english, im brazilian). The problem is: player are premium (+50% exp) and use the ring (+ 10% exp).

If u check the post i tried to make storages to check if player are using the ring.
So i putted this way on CREATURESCRIPT (ring script):

If Player equip the exp ring + are free account -> get 10% more exp.
If player equip the exp ring + are premium account -> get 60% more exp (50% for being premium + 10% from exp ring) + player get storage X

If player dequip exp ring + are free account -> exp back to normal
If player dequip exp ring + are premium account -> set experience 50% (for being premium account) + remove storage X

Adding the storage are used to know if player were using the exp ring when log out.

If he were using the exp ring when he log out (then he have X storage), the FUNCTION ONLOGIN will:
If player have storage X and are premium then: Add 60% experience (50% experience for benig premium + 10% experience for using the ring);
If player have storage X and are not premium then: Add 10% experience for using exp ring.
If player do not have storage X and are premium then: Add 50% exp experience for being premium account
If player do not have storage X and are not premium account then: do not add any experience.

What u think about this logic? Ideas for the code? (u can check the codes that do not work with me in other post).
I am really breaking my head in this script xD
 
Hello bro i wanted script for loosing item when i pass way. I have tfs 0.3.6 v8.2 when i import your script i got this error
[Error - MoveEvents Interface]
[17/08/2015 00:49:13] data/movements/scripts/boss2.lua:eek:nStepIn
[17/08/2015 00:49:13] Description:
[17/08/2015 00:49:13] data/movements/scripts/boss2.lua:7: attempt to compare nil with number
[17/08/2015 00:49:13] stack traceback:
[17/08/2015 00:49:13] data/movements/scripts/boss2.lua:7: in function <data/movements/scripts/boss2.lua:6>
 
Status
Not open for further replies.
Back
Top