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

Sirion_Mido Free Scripting Service (Actions/Movements/Talkactions/Creaturescripts)

Sirion_Mido

Experienced Member
Joined
Jul 22, 2012
Messages
579
Reaction score
43
Location
E-G-Y-P-T
Hello,

I decide to make scripts depending on players request like cyko , just i do that because cyko closed his theard , so i can continue if anyone want.

Follow these rules and we are good to go!

Rule number 1: No Spamming!
Rule number 2: Be Patient!
Rule number 3: There is no rule number 3!
Rule number 4: Follow all these rules!

As far you can see i accept only Actions/Movements/Talkactions/Creaturescripts.

Rep++ If It Helpful For You..
 
Last edited:
Can you do task for potions? Like at otsmateria.pl
Example we must use 1000 any potion (small, strong, great, - health, mana), and we get reward.
 

really it's not a easy script , so i can reply here the simple scripts , im not cykotitan or ninja to make that scripts , just i can make that simple scripts
sorry.

- - - Updated - - -

Can you do task for potions? Like at otsmateria.pl
Example we must use 1000 any potion (small, strong, great, - health, mana), and we get reward.

i working in your script , but im not very good at creaturescripts , so it might take time ... , if anyone wany help in actions or takactions gogo i can do it at the moment :p
 
i working in your script , but im not very good at creaturescripts , so it might take time ... , if anyone wany help in actions or takactions gogo i can do it at the moment :p

You could use something like this in potions.lua though. :)

Lua:
if getPlayerStorageValue(cid, 12345) == 1000 then
doPlayerSendTextMessage(cid, 22, "Congratulations, you have been rewarded with 10 crystal coins.")
doPlayerAddItem(cid, 2160, 10)
end

setPlayerStorageValue(cid, 12345, getCreatureStorage(cid, 12345) + 1)
 
Ninja@
well , i already done that script , but problme in , if do play use x item do set storage :p
i did something like , if doPlayerRemoveItem(cid,)~~ do setstoragevalue
but something went wrong :p
 
You could use something like this in potions.lua though. :)

Lua:
if getPlayerStorageValue(cid, 12345) == 1000 then
doPlayerSendTextMessage(cid, 22, "Congratulations, you have been rewarded with 10 crystal coins.")
doPlayerAddItem(cid, 2160, 10)
end

setPlayerStorageValue(cid, 12345, getCreatureStorage(cid, 12345) + 1)

I wouldn't use this, code leaks :p
 
Can you do task for potions? Like at otsmateria.pl
Example we must use 1000 any potion (small, strong, great, - health, mana), and we get reward.

here you go...
use this potions.lua
Lua:
local sirion_mido = {
	storage = 123456, --put here a unused storage!
	use_times = 10, --how many times should they use pots until reward
	use_stop = 11, --this should be always 1 number over the use_times!
	--//////Reward////--
	reward = 2160, --itemid of the reward!
	reward_count, = 10 --how much Ex coins!
        reward_msg = "Congratulations, you have been rewarded with 10 crystal coins."
}

local config = {
	removeOnUse = "yes",
	usableOnTarget = "yes", -- can be used on target? (fe. healing friend)
	splashable = "no",
	realAnimation = "no", -- make text effect visible only for players in range 1x1
	healthMultiplier = 1.0,
	manaMultiplier = 1.0
}

config.removeOnUse = getBooleanFromString(config.removeOnUse)
config.usableOnTarget = getBooleanFromString(config.usableOnTarget)
config.splashable = getBooleanFromString(config.splashable)
config.realAnimation = getBooleanFromString(config.realAnimation)

local POTIONS = {
	[8704] = {empty = 7636, splash = 2, health = {50, 100}}, -- small health potion
	[7618] = {empty = 7636, splash = 2, health = {100, 200}}, -- health potion
	[7588] = {empty = 7634, splash = 2, health = {1800, 1900}, level = 340, vocations = {3, 4, 7, 8}, vocStr = "knights and paladins"}, -- strong health potion
	[7591] = {empty = 7635, splash = 2, health = {2400, 2500}, level = 390, vocations = {4, 8}, vocStr = "knights"}, -- great health potion
	[8473] = {empty = 7635, splash = 2, health = {3000, 3200}, level = 450, vocations = {4, 8}, vocStr = "knights"}, -- ultimate health potion

	[7620] = {empty = 7636, splash = 7, mana = {70, 130}}, -- mana potion
	[7589] = {empty = 7634, splash = 7, mana = {1000, 1400}, level = 340, vocations = {1, 2, 3, 5, 6, 7}, vocStr = "sorcerers, druids and paladins"}, -- strong mana potion
	[7590] = {empty = 7635, splash = 7, mana = {1400, 1700}, level = 410, vocations = {1, 2, 5, 6}, vocStr = "sorcerers and druids"}, -- great mana potion

	[8472] = {empty = 7635, splash = 3, health = {1550, 1666}, mana = {1300, 1400}, level = 420, vocations = {3, 7}, vocStr = "paladins"} -- great spirit potion
}

local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local potion = POTIONS[item.itemid]
	if(not potion) then
		return false
	end

	if(not isPlayer(itemEx.uid) or (not config.usableOnTarget and cid ~= itemEx.uid)) then
		if(not config.splashable) then
			return false
		end

		if(toPosition.x == CONTAINER_POSITION) then
			toPosition = getThingPos(item.uid)
		end

		doDecayItem(doCreateItem(2016, potion.splash, toPosition))
		doTransformItem(item.uid, potion.empty)
		return true
	end

	if(hasCondition(cid, CONDITION_EXHAUST_HEAL)) then
		doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
		return true
	end

	if(((potion.level and getPlayerLevel(cid) < potion.level) or (potion.vocations and not isInArray(potion.vocations, getPlayerVocation(cid)))) and
		not getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES))
	then
		doCreatureSay(itemEx.uid, "Only " .. potion.vocStr .. (potion.level and (" of level " .. potion.level) or "") .. " or above may drink this fluid.", TALKTYPE_ORANGE_1)
		return true
	end

	local health = potion.health
	if(health and not doCreatureAddHealth(itemEx.uid, math.ceil(math.random(health[1], health[2]) * config.healthMultiplier))) then
		return false
	end

	local mana = potion.mana
	if(mana and not doPlayerAddMana(itemEx.uid, math.ceil(math.random(mana[1], mana[2]) * config.manaMultiplier))) then
		return false
	end

	doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
	if(not realAnimation) then
		doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
	else
		for i, tid in ipairs(getSpectators(getCreaturePosition(cid), 1, 1)) do
			if(isPlayer(tid)) then
				doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1, false, tid)
			end
		end
	end
	

    if getPlayerStorageValue(cid, sirion_mido.storage) == sirion_mido.use_times then
              doPlayerSendTextMessage(cid, 22, sirion_mido.reward_msg)
       doPlayerAddItem(cid, sirion_mido.reward, sirion_mido.reward_count)
       setPlayerStorageValue(cid, sirion_mido.storage, sirion_mido.use_times)
    end
     if getPlayerStorageValue(cid, sirion_mido.storage) < sirion_mido.use_stop then
        setPlayerStorageValue(cid, sirion_mido.storage, getCreatureStorage(cid, sirion_mido.storage) + 1)
    end

	doAddCondition(cid, exhaust)
	if(not potion.empty or config.removeOnUse) then
		doRemoveItem(item.uid, 1)
		return true
	end

	doTransformItem(item.uid, potion.empty)
	return true
end
but don't forget to edit how many potion you need to heal min--max , etc , because it diffrent potions.lua
 
Last edited:
ey..
this script credits to Kimokimo,
thank you kimo..
here we go..
use this in movements , this script which you use to go to that different area which get level 8 there
Lua:
    function onStepIn(cid, item, position, fromPosition)
    local level = getPlayerLevel(cid)
    local health = getCreatureMaxHealth(cid)
    local mana = getCreatureMaxMana(cid)
    local experience = getPlayerExperience(cid)
    local hss = 5051 --"The storage that will save the player health"
    local mss = 5052 --"The storage that will save the player mana"
    local ess = 5053 --"The storage that will save the player experience"
    local newpos = {x = 0 y = 0, z = 0} --"The new player position"
    if isPlayer(cid) then
       setPlayerStorageValue(cid, hss, "..health..")
       setPlayerStorageValue(cid, mss, "..mana..")
       setPlayerStorageValue(cid, ess, "..experience..")
       doPlayerAddExperience(cid, -getPlayerExperience(cid)+4200)
       setCreatureMaxHealth(cid, 185)
       setCreatureMaxMana(cid, 35)
       doCreatureAddMana(cid, -getCreatureMana(cid)+35)
       doCreatureAddHealth(cid, -getCreatureHealth(cid)+185)
       doTeleportThing(cid, newpos)
       doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You have been downgraded to level 8.")
       end
    return true
    end

then this one...
that script which when you stepin the floor you get back your orignal level
Lua:
    function onStepIn(cid, item, position, fromPosition)
    local hss = 5051 --"The storage that will save the player health"
    local mss = 5052 --"The storage that will save the player mana"
    local ess = 5053 --"The storage that will save the player experience"
    local newpos = {x = 0 y = 0, z = 0} --"The new player position"
    if isPlayer(cid) then
       doPlayerAddExperience(cid, +getPlayerStorageValue(cid, ess)-4200)
       setCreatureMaxHealth(cid, getPlayerStorageValue(cid, hss))
       setCreatureMaxMana(cid, getPlayerStorageValue(cid, mss))
       doCreatureAddMana(cid, +getCreatureMana(cid)-35)
       doCreatureAddHealth(cid, +getCreatureHealth(cid)-185)
       setPlayerStorageValue(cid, lss, 0)
       setPlayerStorageValue(cid, hss, 0)
       setPlayerStorageValue(cid, mss, 0)
       setPlayerStorageValue(cid, ess, 0)
       doTeleportThing(cid, newpos)
       doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You have been upgraded to level "..getPlayerLevel(cid).." again.")
       end
    return true
    end
 
Lua:
Lua Script Error: [Npc interface]
data/npc/scripts/killinginthenameof.lua:onCreatureSay
data/npc/scripts/killinginthenameof.lua:80: attempt to call global 'getCreatureS
torage' (a nil value)
stack traceback:
        [C]: in function 'getCreatureStorage'
        data/npc/scripts/killinginthenameof.lua:80: in function 'callback'
        data/npc/lib/npcsystem/npchandler.lua:390: in function 'onCreatureSay'
        data/npc/scripts/killinginthenameof.lua:75: in function <data/npc/script
s/killinginthenameof.lua:75>
what is the reason for this? ill post line 80 here
Lua:
	local s = getCreatureStorage(cid, storage)
 
ey..
this script credits to Kimokimo,
thank you kimo..
here we go..
use this in movements , this script which you use to go to that different area which get level 8 there
Lua:
    function onStepIn(cid, item, position, fromPosition)
    local level = getPlayerLevel(cid)
    local health = getCreatureMaxHealth(cid)
    local mana = getCreatureMaxMana(cid)
    local experience = getPlayerExperience(cid)
    local hss = 5051 --"The storage that will save the player health"
    local mss = 5052 --"The storage that will save the player mana"
    local ess = 5053 --"The storage that will save the player experience"
    local newpos = {x = 0 y = 0, z = 0} --"The new player position"
    if isPlayer(cid) then
       setPlayerStorageValue(cid, hss, "..health..")
       setPlayerStorageValue(cid, mss, "..mana..")
       setPlayerStorageValue(cid, ess, "..experience..")
       doPlayerAddExperience(cid, -getPlayerExperience(cid)+4200)
       setCreatureMaxHealth(cid, 185)
       setCreatureMaxMana(cid, 35)
       doCreatureAddMana(cid, -getCreatureMana(cid)+35)
       doCreatureAddHealth(cid, -getCreatureHealth(cid)+185)
       doTeleportThing(cid, newpos)
       doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You have been downgraded to level 8.")
       end
    return true
    end

then this one...
that script which when you stepin the floor you get back your orignal level
Lua:
    function onStepIn(cid, item, position, fromPosition)
    local hss = 5051 --"The storage that will save the player health"
    local mss = 5052 --"The storage that will save the player mana"
    local ess = 5053 --"The storage that will save the player experience"
    local newpos = {x = 0 y = 0, z = 0} --"The new player position"
    if isPlayer(cid) then
       doPlayerAddExperience(cid, +getPlayerStorageValue(cid, ess)-4200)
       setCreatureMaxHealth(cid, getPlayerStorageValue(cid, hss))
       setCreatureMaxMana(cid, getPlayerStorageValue(cid, mss))
       doCreatureAddMana(cid, +getCreatureMana(cid)-35)
       doCreatureAddHealth(cid, +getCreatureHealth(cid)-185)
       setPlayerStorageValue(cid, lss, 0)
       setPlayerStorageValue(cid, hss, 0)
       setPlayerStorageValue(cid, mss, 0)
       setPlayerStorageValue(cid, ess, 0)
       doTeleportThing(cid, newpos)
       doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You have been upgraded to level "..getPlayerLevel(cid).." again.")
       end
    return true
    end


[Error - LuaScriptInterface::loadFile] data/movements/scripts/tp2.lua:7: unexpected symbol near '+'
[31/12/2012 02:33:04] [Warning - Event::loadScript] Cannot load script (data/movements/scripts/tp2.lua)
[31/12/2012 02:33:04] data/movements/scripts/tp2.lua:7: unexpected symbol near '+'
 
[Error - LuaScriptInterface::loadFile] data/movements/scripts/tp2.lua:7: unexpected symbol near '+'
[31/12/2012 02:33:04] [Warning - Event::loadScript] Cannot load script (data/movements/scripts/tp2.lua)
[31/12/2012 02:33:04] data/movements/scripts/tp2.lua:7: unexpected symbol near '+'

Retry:
Lua:
 function onStepIn(cid, item, position, fromPosition)
    local hss = 5051 --"The storage that will save the player health"
    local mss = 5052 --"The storage that will save the player mana"
    local ess = 5053 --"The storage that will save the player experience"
    local newpos = {x = 0, y = 0, z = 0} --"The new player position"
    if isPlayer(cid) then
       doPlayerAddExperience(cid, getPlayerStorageValue(cid, ess)-4200)
       setCreatureMaxHealth(cid, getPlayerStorageValue(cid, hss))
       setCreatureMaxMana(cid, getPlayerStorageValue(cid, mss))
       doCreatureAddMana(cid, getCreatureMana(cid)-35)
       doCreatureAddHealth(cid, getCreatureHealth(cid)-185)
       setPlayerStorageValue(cid, lss, 0)
       setPlayerStorageValue(cid, hss, 0)
       setPlayerStorageValue(cid, mss, 0)
       setPlayerStorageValue(cid, ess, 0)
       doTeleportThing(cid, newpos)
       doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You have been upgraded to level "..getPlayerLevel(cid).." again.")
       end
    return true
    end
 
[31/12/2012 11:18:21] [Error - MoveEvents Interface]
[31/12/2012 11:18:21] data/movements/scripts/tp2.lua:eek:nStepIn
[31/12/2012 11:18:21] Description:
[31/12/2012 11:18:21] data/movements/scripts/tp2.lua:7: attempt to perform arithmetic on a string value
[31/12/2012 11:18:21] stack traceback:
[31/12/2012 11:18:21] data/movements/scripts/tp2.lua:7: in function <data/movements/scripts/tp2.lua:1>
 
Lua:
Lua Script Error: [Npc interface]
data/npc/scripts/killinginthenameof.lua:onCreatureSay
data/npc/scripts/killinginthenameof.lua:80: attempt to call global 'getCreatureS
torage' (a nil value)
stack traceback:
        [C]: in function 'getCreatureStorage'
        data/npc/scripts/killinginthenameof.lua:80: in function 'callback'
        data/npc/lib/npcsystem/npchandler.lua:390: in function 'onCreatureSay'
        data/npc/scripts/killinginthenameof.lua:75: in function <data/npc/script
s/killinginthenameof.lua:75>
what is the reason for this? ill post line 80 here
Lua:
	local s = getCreatureStorage(cid, storage)

post whole code.
 
Lua:
Lua Script Error: [Npc interface]
data/npc/scripts/killinginthenameof.lua:onCreatureSay
data/npc/scripts/killinginthenameof.lua:80: attempt to call global 'getCreatureS
torage' (a nil value)
stack traceback:
        [C]: in function 'getCreatureStorage'
        data/npc/scripts/killinginthenameof.lua:80: in function 'callback'
        data/npc/lib/npcsystem/npchandler.lua:390: in function 'onCreatureSay'
        data/npc/scripts/killinginthenameof.lua:75: in function <data/npc/script
s/killinginthenameof.lua:75>
what is the reason for this? ill post line 80 here
Lua:
	local s = getCreatureStorage(cid, storage)

Bro.. it's requests theard so i hope you post request for script , and i will make it for you no post errors and i fix...just i can fix in 1 time , if iam the maker of that script..
thx......
 
try this sebbe
Lua:
 function onStepIn(cid, item, position, fromPosition)
    local hss = 5051 --"The storage that will save the player health"
    local mss = 5052 --"The storage that will save the player mana"
    local ess = 5053 --"The storage that will save the player experience"
    local newpos = {x = 0, y = 0, z = 0} --"The new player position"
    if isPlayer(cid) then
       doPlayerAddExperience(cid, getPlayerStorageValue(cid, ess))
       doPlayerAddExperience(cid, -4200)
       setCreatureMaxHealth(cid, getPlayerStorageValue(cid, hss))
       setCreatureMaxMana(cid, getPlayerStorageValue(cid, mss))
       doCreatureAddMana(cid, getCreatureMana(cid)-35)
       doCreatureAddHealth(cid, getCreatureHealth(cid)-185)
       setPlayerStorageValue(cid, lss, 0)
       setPlayerStorageValue(cid, hss, 0)
       setPlayerStorageValue(cid, mss, 0)
       setPlayerStorageValue(cid, ess, 0)
       doTeleportThing(cid, newpos)
       doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You have been upgraded to level "..getPlayerLevel(cid).." again.")
       end
    return true
    end
 
[31/12/2012 16:34:59] [Error - LuaScriptInterface::loadFile] data/movements/scripts/tp2.lua:20: 'end' expected (to close 'function' at line 1) near '<eof>'
[31/12/2012 16:34:59] [Warning - Event::loadScript] Cannot load script (data/movements/scripts/tp2.lua)
[31/12/2012 16:34:59] data/movements/scripts/tp2.lua:20: 'end' expected (to close 'function' at line 1) near '<eof>'

Fixed, but now:

16:36 Your last visit was on Fri Dec 28 10:45:49 2012.
16:36 You have been downgraded to level 8. <-- tp 1
16:36 You have been upgraded to level 1 again. <-- tp 2 ( and i was lvl 30 )
 
Back
Top