• 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,799
Solutions
581
Reaction score
5,362
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:
I use that

Code:
function onKill(cid, target)
    local toPos = getCreatureLookPosition(cid)

    if getTileInfo(toPos).pvp then
        return true
    end
    if(isPlayer(target) and isPlayer(cid)) then
        if(getPlayerLevel(target) >= 200 and getPlayerLevel(target) < 1000) then
            doPlayerAddItem(cid, 2160, 1)
        end   
end
    return true
end

but often there is a lot of errors with monsters, I do not know why
 
I use that

Code:
function onKill(cid, target)
    local toPos = getCreatureLookPosition(cid)

    if getTileInfo(toPos).pvp then
        return true
    end
    if(isPlayer(target) and isPlayer(cid)) then
        if(getPlayerLevel(target) >= 200 and getPlayerLevel(target) < 1000) then
            doPlayerAddItem(cid, 2160, 1)
        end 
end
    return true
end

but often there is a lot of errors with monsters, I do not know why
Try this.
Code:
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
        doPlayerAddItem(cid, 2160, 1)
    end

    return true
end
 
Try this.
Code:
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
        doPlayerAddItem(cid, 2160, 1)
    end

    return true
end
And can you do by chance % i mean 10% change to get x item 15% chance get xx etc.
 
And can you do by chance % i mean 10% change to get x item 15% chance get xx etc.
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
 
Last edited:
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

its possible add broadcast in that script when u recive x item server do broadcast for example Congratulations! bloddy looted a [spell rune] when kill abaaz.

and where is chances configuration because if i wanna edit etc
 
Last edited:
its possible add broadcast in that script when u recive x item server do broadcast for example Bloody recived x item for kill Demon Player
Add this on the line above break
Code:
doPlayerBroadcastMessage(cid, "" .. getCreatureName(cid) .. " has received " .. config[i].item_amount .. " " .. config[i].item_amount > 1 and getItemPluralNameById(config[i].item_id) or getItemNameById(config[i].item_id) .. " for killing " .. getCreatureName(target) .. "!")
 
Add this on the line above break
Code:
doPlayerBroadcastMessage(cid, "" .. getCreatureName(cid) .. " has received " .. config[i].item_amount .. " " .. config[i].item_amount > 1 and getItemPluralNameById(config[i].item_id) or getItemNameById(config[i].item_id) .. " for killing " .. getCreatureName(target) .. "!")

error
[07/07/2016 15:09:24] data/creaturescripts/scripts/item.lua:22: attempt to compare number with string
[07/07/2016 15:09:24] stack traceback:
[07/07/2016 15:09:24] data/creaturescripts/scripts/item.lua:22: in function <data/creaturescripts/scripts/item.lua:7>
 
error
[07/07/2016 15:09:24] data/creaturescripts/scripts/item.lua:22: attempt to compare number with string
[07/07/2016 15:09:24] stack traceback:
[07/07/2016 15:09:24] data/creaturescripts/scripts/item.lua:22: in function <data/creaturescripts/scripts/item.lua:7>
forgot (brackets) :p

-- Player Broadcast
Code:
doPlayerBroadcastMessage(cid, "" .. getCreatureName(cid) .. " has received " .. config[i].item_amount .. " " .. (config[i].item_amount > 1 and getItemPluralNameById(config[i].item_id) or getItemNameById(config[i].item_id)) .. " for killing " .. getCreatureName(target) .. "!")
-- Server Broadcast
Code:
doBroadcastMessage("" .. getCreatureName(cid) .. " has received " .. config[i].item_amount .. " " .. (config[i].item_amount > 1 and getItemPluralNameById(config[i].item_id) or getItemNameById(config[i].item_id)) .. " for killing " .. getCreatureName(target) .. "!", MESSAGE_STATUS_CONSOLE_ORANGE)
 
Last edited:
Hiho is it possible to make a anti push script also if a player stands on a special ground he cant get pushed ? :p If yea can you fix me that script? Please xD need it hehe ( tfs 0.4 ) :p
 
Hiho is it possible to make a anti push script also if a player stands on a special ground he cant get pushed ? :p If yea can you fix me that script? Please xD need it hehe ( tfs 0.4 ) :p
Can you be more clear for the 'special ground'?
Do you mean in X area cannot push player, or, if player on tile_id 1111 cannot push player?
Last thing, what do you mean by anti-push? I'm not familiar with the issue.
 
Oh sorry also easy peasy if I put on any special ground an action id explain ( 5000 ) then peoples cant push the guy who stands on that sqm like a push block you know what I mean?
 
Hiho is it possible to make a anti push script also if a player stands on a special ground he cant get pushed ? :p If yea can you fix me that script? Please xD need it hehe ( tfs 0.4 ) :p
Can you be more clear for the 'special ground'?
Do you mean in X area cannot push player, or, if player on tile_id 1111 cannot push player?
Last thing, what do you mean by anti-push? I'm not familiar with the issue.
Do you have an onMove event in 0.4?
 
Do you have an onMove event in 0.4?
I only found onPush in 0.3.7
Code:
onPush(cid, target, ground, position)
Untested, since it won't help Fantasy Mage with his issue.
Code:
function onPush(cid, target, ground, position)
     if ground.aid ~= 45001 then
         return true
     end
     if cid ~= target and isPlayer(target) and not isMonster(cid) then
         doPlayerSendCancel(cid, "Sorry not possible.")
         return false
     end
     return true
end
------------------------------------------------------------------------------
However 0.4 has a different onStepOut (You can thank @Amiroslo for his 0.4 source code backups that I was able to download and view.)
Code:
onStepOut(cid, item, position, lastPosition, fromPosition, toPosition, actor)
This is probably a small stretch.. but I think 'actor' is whoever was doing the action.. same as onPush's target, just backwards..
Untested, cuz I don't have these functions.
Code:
<movevent type="StepOut" actionid="45001" event="script" value="test37.lua"/>
Code:
function onStepOut(cid, item, position, lastPosition, fromPosition, toPosition, actor)
     if actor ~= cid and isPlayer(cid) and not isMonster(actor) then
         doPlayerSendCancel(cid, "Sorry not possible.")
         return false
     end
     return true
end
 
Xikini, can you help me add a function into a quest action that i have, that does not allow the player to do the quest if he has any buffs what so ever, for example, if he has a armor that gives Axe, if he has a Bag that gives Magic Level, if he uses Utito Tempo, any of this stuff. I ask this because i have a quest that gives skills, if the player uses utito tempo let's say, and goes to skill 300 and then right clicks the chest, his skill will be the one when he used Utito plus the skills the quest gives.

If you need i have something familiar with this to prevent someone from buying skills with buffs, and also, i can post the quest script if you need.
 
Hi
Can you create a script that gives physical damage for players depending on the sword fighting?

Example: 15 sword fightning = +150 damage
 
Hi, I need NPC to look at the players, every time they pass close to a ranging of 7 .
And another to do the same but with the difference that this stepping on a tile lift a door.

Please and thank you!.
Sorry my bad English.
 
I need automatic reborn system:
- 1 reborn give 20% atack and 20% hp i mana
- max reborn 2000 -to configure
- lvl not restart to 8
- reborn this same in bydgoski ots or rebhight i need tfs 0.4
 
Sorry for the long delay in replies.
I've seen the requests, however haven't had the time to address each request individually.
I need automatic reborn system:
- 1 reborn give 20% atack and 20% hp i mana
- max reborn 2000 -to configure
- lvl not restart to 8
- reborn this same in bydgoski ots or rebhight i need tfs 0.4
Simply put, there is many many reborn systems on the forum.
Please search around for one that fits your needs.
Hi, I need NPC to look at the players, every time they pass close to a ranging of 7 .
And another to do the same but with the difference that this stepping on a tile lift a door.

Please and thank you!.
Sorry my bad English.
I have made a npc similar to this before, here.
For some reason the npc always faces south, even if you force move/or set direction to another.
Due to this, I don't think I can make this npc.
As for the movement tile, that's relatively easy.
If you still require the movement tile to open a wall just post again.
Hi
Can you create a script that gives physical damage for players depending on the sword fighting?

Example: 15 sword fightning = +150 damage
You would have to create a custom weapon script, for each weapon you want this function to be in.
Unfortunately I don't work in that area so I will need to decline this request.
Xikini, can you help me add a function into a quest action that i have, that does not allow the player to do the quest if he has any buffs what so ever, for example, if he has a armor that gives Axe, if he has a Bag that gives Magic Level, if he uses Utito Tempo, any of this stuff. I ask this because i have a quest that gives skills, if the player uses utito tempo let's say, and goes to skill 300 and then right clicks the chest, his skill will be the one when he used Utito plus the skills the quest gives.

If you need i have something familiar with this to prevent someone from buying skills with buffs, and also, i can post the quest script if you need.
Typically the only hindrance to adding skills to a player is through buffs as you've noticed.
I don't believe armor counts as a buff, and is ignored by typical checks of player skills, however I may be wrong.. I haven't worked with skill adding scripts in awhile.
I searched around but couldn't find how to check for buffs.. although somewhere in my files I've checked for them before..
You can pm me your scripts like you suggested, I'm sure I can find the "buff checker" easily enough, then either edit your script or explain how/where you'd want to add it in.

Been about a week, might as well bump. :p
The thread guys.
Bumping the thread.
God!
 
Last edited by a moderator:
Status
Not open for further replies.
Back
Top