• 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:
I think bows and crossbows can receive hit chance and attack, and throwables should be able to receive attack as well, but once they stack, they probably will have issues. wands and rods definitely don't work unless you can set the range of them.
This.
 
I only wanted it to be for X id and X monster so I can configure that on my own. It's going to be MELEE WEAPONS ONLY though.
 
I only wanted it to be for X id and X monster so I can configure that on my own. It's going to be MELEE WEAPONS ONLY though.
Calm yourself. That is what I intend.
7Lo6SYq.png
 
Yo, I seen a post about this forever ago but it was bugged completely. Can you do a weapon system for me? (I believe 1 script is fine then I can edit the rest with ID's)

Basically it's : If you kill X monster with X weapon equipped, add X attack/defence

Example : Kill 100 wyverns wearing wyvern fang, gain +10 attack - can only do it once, not repeatable.

Like I said, once its scripted I can most likely edit it and add/take away lines to get it to work with different ID (wepaons)
Attribute 'Range/shootRange' doesn't work, so only attack was included in this script.
Completely tested and created by me.
The only 'bug' I encountered was while I was on my God character. It doesn't show the 'weight' because it's too far down in the description.
Normal characters do not encounter this 'bug'.


What the script does: Will upgrade your weapon to a new attack and flavour text, upon successfully killing a set amount of monsters.

Safeguards:
If quest has not been started, do nothing.
If player is using in-correct weapon, does nothing.
If player is using already modified weapon, does nothing.
If script is set to use something other then melee or distance weapons, tells player to notify admin.
If script is set to use stackable weapons, tells player to notify admin.
When quest completed stops showing text.

100% working for 0.3.7
creaturescripts.xml

Code:
<event type="kill" name="RatQuest" event="script" value="script.lua"/>
creaturescripts/login.lua [somewhere near the bottom with the other registered creature events]
Code:
registerCreatureEvent(cid, "RatQuest")
creaturescripts/script.lua
Code:
-- https://otland.net/members/xikini.102396/
-- https://otland.net/threads/xikinis-free-scripting-service.234306/page-2#post-2262314
local t = {
   [{"rat", "cave rat"}] = {   -- Monster names = Monsters you can kill in the quest. You can use as little or as many as you want.
     started = 45001,     -- started = Storage value Required to start the quest. (given by an npc for example)
     storage = 45002,     -- storage = Storage used for counting how many kills have been achieved.
     kills = 30,       -- kills = how many monsters must be killed to gain reward
     raceName = "rats",   -- raceName = Whatever you want it to show for the monsters race. "You have defeated 34 out of 50 rodents."
                 ------------- It is recommended to keep raceName all lowercase letters for best effect.
     weaponID = 6528,     -- weaponID = The itemID of the weapon you wish the player to use for this quest.
     newAttack = 100}     -- newAttack = What the attack of the weapon will be after finished quest. old: Atk +67 | new: Atk +100
                 -------------- Only works for Melee and Distance weapons
}
function onKill(cid, target, damage, flags)
   for v, k in pairs(t) do
     local master = getCreatureMaster(target)
     if(master and master ~= target) then return true end
     if(bit.band(flags, 1) == 1 and isMonster(target) and isInArray(v, getCreatureName(target))) then
       if(getCreatureStorage(cid, k.started) == 1) then
         if(getCreatureStorage(cid, k.storage) < 0) then
           doCreatureSetStorage(cid, k.storage, 0)
         end
         if getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid == k.weaponID then
           if getPlayerSlotItem(cid, CONST_SLOT_LEFT).actionid < 1 then
             local type = getItemWeaponType(getPlayerSlotItem(cid, CONST_SLOT_LEFT).uid)
             if type == 1 or type == 2 or type == 3 or type == 4 then
               if isItemStackable(k.weaponID) ~= true then
                 if(getCreatureStorage(cid, k.storage) < k.kills - 1) then
                   doCreatureSetStorage(cid, k.storage, getCreatureStorage(cid, k.storage) + 1)
                   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have defeated " .. getCreatureStorage(cid, k.storage) .. " out of " .. k.kills .. " " .. k.raceName .. "!")
                 elseif getCreatureStorage(cid, k.storage) == k.kills - 1 then
                   doSetItemActionId(getPlayerSlotItem(cid, CONST_SLOT_LEFT).uid, getPlayerSlotItem(cid, CONST_SLOT_LEFT).uid)
                   doItemSetAttribute(getPlayerSlotItem(cid, CONST_SLOT_LEFT).uid, "attack", k.newAttack)
                   doItemSetAttribute(getPlayerSlotItem(cid, CONST_SLOT_LEFT).uid, "description", "This item has imbued with special properties for killing " .. k.kills .. " " .. k.raceName .. ". It")
                   doCreatureSetStorage(cid, k.storage, getCreatureStorage(cid, k.storage) + 1)
                   doCreatureSetStorage(cid, k.started, getCreatureStorage(cid, k.started) + 1)
                   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have defeated enough " .. k.raceName .. "!  Your weapon has been imbued with special properties. Well done.")
                 end
               else
               doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Error: Item being used in script is stackable. Contact Administration.")
               end
             else
               doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Error: Incorrect item type being used in script. Contact Administration.")
             end
           else
             doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This item has already been upgraded. Only non-upgraded " .. getItemNameById(k.weaponID) .. "'s can be used.")
           end
         end
       end
     end
   end
   return true
end
 
Last edited:
The scripts posted below are meant for a Boss Monster in a server.
It allows the boss to summon monsters when they reach a certain hp threshold.
For instance, if the bosses max hp is 1000, and you set the hp as 500, then the boss will summon minions (only once), when it's hp drops below that mark.

I originally intended this script to use onStats change, however tfs 0.3.7 has a bug when summoning or creating monsters through this function. I created a workaround that was acceptable for Boss monsters, as they usually have their own chamber to fight in.

I will quickly explain how the entire script works, and further, why each script is necessary to be installed.

Generally the script will check when the boss monster moves, if it's hp is lower then the threshold. If yes, then summon monsters and set a global storage, so the summons will only happen once. When the boss is killed the storage is reset, so when the boss respawns later, it can summon it's minions again.


globalevent script is required because if the boss summoned the minions, however was never killed, when server restarts next the global storage will be reset.
creature script is required so when the boss dies, the storage is reset.
login.lua is to register the boss death, aka: make creature script work properly
movements is so the summons will spawn.
movements.xml .. ACTIONID .. needs to be placed on every tile in boss chamber. So when the boss moves, and the hp is below threshold, will summon monsters.

Anyways, on to the scripts!


globalevents.xml
Code:
<globalevent name="Cave Rat Boss" type="start" event="script" value="cave_rat_boss.lua"/>
globalevents/scripts/cave_rat_boss.lua
Code:
function onStartup()
   local config = {
     storage = 45001
   }
   if getGlobalStorageValue(config.storage) == 1 then
     setGlobalStorageValue(config.storage, -1)
   else
     return false
   end
return true
end
---------------------
creaturescripts.xml
Code:
<event type="kill" name="Cave Rat Boss Death" event="script" value="cave_rat_boss_death.lua"/>
creaturescripts/scripts/login.lua (somewhere at bottom)
Code:
registerCreatureEvent(cid, "Cave Rat Boss Death")
creaturescripts/scripts/cave_rat_boss_death.lua
Code:
local config = {
   killstorage = 45001,
   name = 'cave rat' -- Must Be All... lowercase letters
}
function onKill(cid, target, damage, flags)
   local name = getCreatureName(target):lower()
   if isPlayer(target) then return true end
   if name == config.name then
     doCreatureSay(cid, 'You have defeated ' .. name .. '.', TALKTYPE_ORANGE_1)
     setGlobalStorageValue(config.killstorage, -1)
   end
   return true
end
---------------------
movements.xml
Code:
<movevent type="StepIn" actionid="45001" event="script" value="cave_rat_boss.lua"/>
movements/scripts/cave_rat_boss.lua
Code:
-- https://otland.net/members/xikini.102396/
-- https://otland.net/threads/xikinis-free-scripting-service.234306/page-2#post-2262318
local config = {
   boss_name = "Cave Rat",
   summon_name = "Rat",
   summon_amount = 4,
   storage = 45001,
   health = 500 -- Creatures MAX HEALTH (-) health. // 1000(-)500= 500 or less hp, do summon // 10000(-)500= 9500 or less hp, do summon
}
function onStepIn(cid, item, position, fromPosition)
   if isPlayer(cid) then
     return false
   end
   if (getCreatureName(cid) == config.boss_name) and (getGlobalStorageValue(config.storage) < 1) and (getCreatureHealth(cid) <= getCreatureMaxHealth(cid)-config.health) then
     for a = 1,config.summon_amount do
       doSummonMonster(cid, config.summon_name)
     end
     setGlobalStorageValue(config.storage, 1)
   else
     return false
   end
   return true
end
 
Last edited:
Attribute 'Range/shootRange' doesn't work, so only attack was included in this script.
Completely tested and created by me.
The only 'bug' I encountered was while I was on my God character. It doesn't show the 'weight' because it's too far down in the description.
Normal characters do not encounter this 'bug'.


What the script does: Will upgrade your weapon to a new attack and flavour text, upon successfully killing a set amount of monsters.

Safeguards:
If quest has not been started, do nothing.
If player is using in-correct weapon, does nothing.
If player is using already modified weapon, does nothing.
If script is set to use something other then melee or distance weapons, tells player to notify admin.
If player is using stackable weapons, tells player to notify admin.
When quest completed stops showing text.

100% working for 0.3.7
creaturescripts.xml

Code:
<event type="kill" name="RatQuest" event="script" value="CarlsQuests/script.lua"/>
creaturescripts/login.lua [somewhere near the bottom with the other registered creature events]
Code:
registerCreatureEvent(cid, "RatQuest")
creaturescripts/script.lua
Code:
-- https://otland.net/members/xikini.102396/
-- https://otland.net/threads/xikinis-free-scripting-service.234306/page-2#post-2262314
local t = {
   [{"rat", "cave rat"}] = {   -- Monster names = Monsters you can kill in the quest. You can use as little or as many as you want.
     started = 45001,     -- started = Storage value Required to start the quest. (given by an npc for example)
     storage = 45002,     -- storage = Storage used for counting how many kills have been achieved.
     kills = 30,       -- kills = how many monsters must be killed to gain reward
     raceName = "rats",   -- raceName = Whatever you want it to show for the monsters race. "You have defeated 34 out of 50 rodents."
                 ------------- It is recommended to keep raceName all lowercase letters for best effect.
     weaponID = 6528,     -- weaponID = The itemID of the weapon you wish the player to use for this quest.
     newAttack = 100}     -- newAttack = What the attack of the weapon will be after finished quest. old: Atk +67 | new: Atk +100
                 -------------- Only works for Melee and Distance weapons
}
function onKill(cid, target, damage, flags)
   for v, k in pairs(t) do
     local master = getCreatureMaster(target)
     if(master and master ~= target) then return true end
     if(bit.band(flags, 1) == 1 and isMonster(target) and isInArray(v, getCreatureName(target))) then
       if(getCreatureStorage(cid, k.started) == 1) then
         if(getCreatureStorage(cid, k.storage) < 0) then
           doCreatureSetStorage(cid, k.storage, 0)
         end
         if getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid == k.weaponID then
           if getPlayerSlotItem(cid, CONST_SLOT_LEFT).actionid < 1 then
             local type = getItemWeaponType(getPlayerSlotItem(cid, CONST_SLOT_LEFT).uid)
             if type == 1 or type == 2 or type == 3 or type == 4 then
               if isItemStackable(k.weaponID) ~= true then
                 if(getCreatureStorage(cid, k.storage) < k.kills - 1) then
                   doCreatureSetStorage(cid, k.storage, getCreatureStorage(cid, k.storage) + 1)
                   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have defeated " .. getCreatureStorage(cid, k.storage) .. " out of " .. k.kills .. " " .. k.raceName .. "!")
                 elseif getCreatureStorage(cid, k.storage) == k.kills - 1 then
                   doSetItemActionId(getPlayerSlotItem(cid, CONST_SLOT_LEFT).uid, getPlayerSlotItem(cid, CONST_SLOT_LEFT).uid)
                   doItemSetAttribute(getPlayerSlotItem(cid, CONST_SLOT_LEFT).uid, "attack", k.newAttack)
                   doItemSetAttribute(getPlayerSlotItem(cid, CONST_SLOT_LEFT).uid, "description", "This item has imbued with special properties for killing " .. k.kills .. " " .. k.raceName .. ". It")
                   doCreatureSetStorage(cid, k.storage, getCreatureStorage(cid, k.storage) + 1)
                   doCreatureSetStorage(cid, k.started, getCreatureStorage(cid, k.started) + 1)
                   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have defeated enough " .. k.raceName .. "!  Your weapon has been imbued with special properties. Well done.")
                 end
               else
               doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Error: Item being used in script is stackable. Contact Administration.")
               end
             else
               doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Error: Incorrect item type being used in script. Contact Administration.")
             end
           else
             doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This item has already been upgraded. Only non-upgraded " .. getItemNameById(k.weaponID) .. "'s can be used.")
           end
         end
       end
     end
   end
   return true
end
Didnt test it, but that's awesome work brother. Good shit
 
There is no onThink on those distros? I mean, maybe easier than check onStepIn
Mediocre scripter here. :rolleyes:
I never thought of using a global event with onThink until you mentioned it. :p :oops:
Scan area for boss, checking spawn pos first ofc (to reduce stress), then checking hp.
Should work. :D
 
Mediocre scripter here. :rolleyes:
I never thought of using a global event with onThink until you mentioned it. :p :oops:
Scan area for boss, checking spawn pos first ofc (to reduce stress), then checking hp.
Should work. :D
You should script the most requested stuff for 0.4 :D, Like Zombie event and so on.

Great work. :d
 
Will be gone for a couple days, but you guys can still keep inboxing me. I'll read the requests when I can/come back.
For the record, no request is too easy. Had a couple people ask that. I'll throw it on the main post as well.


107h bump.

24h bump.
 
Last edited by a moderator:
Im quite surprised to see that not many people seem to be using this service. Anyway keep it up!
 
Status
Not open for further replies.
Back
Top