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

Solved

Zarn

New Member
Joined
Oct 19, 2009
Messages
108
Reaction score
0
Finished, Thanks for all help, :thumbup:

Special thanks to djivar :wub:
 
Last edited:
do u have a chest quest whit 6 chest in one so i dont need to do like 10 of them ^_^

and maybe explain what i change in script to get it working.
 
nothing need to change just use a normal chest action ID: 2000
unique id: xxxx
put your six items in the black boxes and it should work :) nothing else (no scripts and nothing else)

if not work i dont know

xxxx = do what you want with 4 or 5 numbers;)
 
Lua:
-- 100% made by Colandus (Except exhaustion system).
-- If you edit on this script, be sure that you leave the credits to me, Colandus.
 
function onUse(cid, item, frompos, item2, topos)
 
	minMana = 30 -- How much mana minium will you get?
	maxMana = 70 -- How much mana max will you get?
	magToUse = 4 -- What magic level do you need to be to use the rune?
	useStats = true -- Shall given mana be affected by player level and magic level?
	runeID = 2270 -- Enter the item Id of the rune.
	loseCharges = true -- Write "true" if it shall lose charges. If not, then write something else such as "false".
	storeValue = 3567 -- Value where exhaust is saved.
	exhaustTime = 2 -- 1 = 1 second of exhaustion.
	animationColor = 41 -- The color of the "animation".
	mLvlLowMsg = "Your magic level is too low." -- Appears when player got too low magic level.
	missPlayerMsg = "You can only use this rune on players."-- Appears when you don't shoot on a player.
	exhaustMsg = "You are exhausted." -- Appears when you are exhausted.
 
	if item.itemid == runeID then
		if getThingfromPos({x=topos.x, y=topos.y, z=topos.z, stackpos=253}).itemid > 0 then
			if getPlayerMagLevel(cid) >= magToUse then
				if (exhaust(cid, storeValue, 1) > 0) then
					if loseCharges == true or loseCharges == True then
						if item.type > 1 then
							doChangeTypeItem(item.uid, item.type-1)
						else
							doRemoveItem(item.uid, 1)
						end
					end
					newMana = math.random(minMana, maxMana)
					if useStats then
						newMana = newMana + getPlayerLevel(cid) + getPlayerMagLevel(cid)
					end
					manaNow = getPlayerMana(item2.uid)
					doPlayerAddMana(item2.uid, 999999)
					manaMax = getPlayerMana(item2.uid)
					doPlayerAddMana(item2.uid, - manaMax + manaNow)
					nMana = manaMax - manaNow
					if newMana > nMana then
						newMana = nMana
					end
					if getPlayerMana(item2.uid) == manaMax then
						if getPlayerPosition(cid).x == getPlayerPosition(item2.uid).x and getPlayerPosition(cid).y == getPlayerPosition(item2.uid).y then
							doPlayerSendCancel(item2.uid, "Your mana is already full.")
							doChangeTypeItem(item.uid, item.type)
						else
							doPlayerSendCancel(cid, "" .. getPlayerName(item2.uid) .. " mana is already full.")
							doChangeTypeItem(item.uid, item.type)
						end
					else
						if getPlayerPosition(cid).x == getPlayerPosition(item2.uid).x and getPlayerPosition(cid).y == getPlayerPosition(item2.uid).y then
							doSendMagicEffect(getPlayerPosition(cid), 12)
							doPlayerSendTextMessage(cid, 23, "You received " .. newMana .. " mana.")
						else
							doSendMagicEffect(getPlayerPosition(cid), 14)
							doSendMagicEffect(getPlayerPosition(item2.uid), 12)
							doPlayerSendTextMessage(item2.uid, 23, "You received " .. newMana .. " mana.")
							doPlayerSendTextMessage(cid, 23, "You gave " .. getPlayerName(item2.uid) .. " " .. newMana .. " mana.")
						end
						doPlayerAddMana(item2.uid, newMana)
						doSendAnimatedText(getPlayerPosition(item2.uid), newMana, animationColor)
					end
				else
					doPlayerSendCancel(cid, exhaustMsg)
				end
			else
				doSendMagicEffect(getPlayerPosition(cid), 2)
				doPlayerSendCancel(cid, mLvlLowMsg)
			end
		else
			doSendMagicEffect(getPlayerPosition(cid), 2)
			doPlayerSendCancel(cid, missPlayerMsg)
		end
		return 1
	end
end
 
 
-- Exhaustion system (Made by Alreth, bugfix by me)
-- DO NOT EDIT!
function exhaust(cid, storeValue, exhaustTime)
 
    newExhaust = os.time()
    oldExhaust = getPlayerStorageValue(cid, storeValue)
    if (oldExhaust == nil or oldExhaust < 0) then
        oldExhaust = 0
    end
    if (exhaustTime == nil or exhaustTime < 0) then
        exhaustTime = 1
    end
    diffTime = os.difftime(newExhaust, oldExhaust)
    if (diffTime >= exhaustTime) then
        setPlayerStorageValue(cid, storeValue, newExhaust) 
        return 1
    else
        return 0
    end
end

Code:
function comparePos(pos1,pos2)
    return pos1.x == pos2.x and pos1.y == pos2.y and pos1.z == pos2.z
end

put in global.lua or lib/functions.lua.

<action itemid="2270" script="manarune.lua" allowfaruse="1" blockwalls="0" />

rep++ ?

Credit, Colandus.
 
Lua:
-- 100% made by Colandus (Except exhaustion system).
-- If you edit on this script, be sure that you leave the credits to me, Colandus.
 
function onUse(cid, item, frompos, item2, topos)
 
	minMana = 30 -- How much mana minium will you get?
	maxMana = 70 -- How much mana max will you get?
	magToUse = 4 -- What magic level do you need to be to use the rune?
	useStats = true -- Shall given mana be affected by player level and magic level?
	runeID = 2270 -- Enter the item Id of the rune.
	loseCharges = true -- Write "true" if it shall lose charges. If not, then write something else such as "false".
	storeValue = 3567 -- Value where exhaust is saved.
	exhaustTime = 2 -- 1 = 1 second of exhaustion.
	animationColor = 41 -- The color of the "animation".
	mLvlLowMsg = "Your magic level is too low." -- Appears when player got too low magic level.
	missPlayerMsg = "You can only use this rune on players."-- Appears when you don't shoot on a player.
	exhaustMsg = "You are exhausted." -- Appears when you are exhausted.
 
	if item.itemid == runeID then
		if getThingfromPos({x=topos.x, y=topos.y, z=topos.z, stackpos=253}).itemid > 0 then
			if getPlayerMagLevel(cid) >= magToUse then
				if (exhaust(cid, storeValue, 1) > 0) then
					if loseCharges == true or loseCharges == True then
						if item.type > 1 then
							doChangeTypeItem(item.uid, item.type-1)
						else
							doRemoveItem(item.uid, 1)
						end
					end
					newMana = math.random(minMana, maxMana)
					if useStats then
						newMana = newMana + getPlayerLevel(cid) + getPlayerMagLevel(cid)
					end
					manaNow = getPlayerMana(item2.uid)
					doPlayerAddMana(item2.uid, 999999)
					manaMax = getPlayerMana(item2.uid)
					doPlayerAddMana(item2.uid, - manaMax + manaNow)
					nMana = manaMax - manaNow
					if newMana > nMana then
						newMana = nMana
					end
					if getPlayerMana(item2.uid) == manaMax then
						if getPlayerPosition(cid).x == getPlayerPosition(item2.uid).x and getPlayerPosition(cid).y == getPlayerPosition(item2.uid).y then
							doPlayerSendCancel(item2.uid, "Your mana is already full.")
							doChangeTypeItem(item.uid, item.type)
						else
							doPlayerSendCancel(cid, "" .. getPlayerName(item2.uid) .. " mana is already full.")
							doChangeTypeItem(item.uid, item.type)
						end
					else
						if getPlayerPosition(cid).x == getPlayerPosition(item2.uid).x and getPlayerPosition(cid).y == getPlayerPosition(item2.uid).y then
							doSendMagicEffect(getPlayerPosition(cid), 12)
							doPlayerSendTextMessage(cid, 23, "You received " .. newMana .. " mana.")
						else
							doSendMagicEffect(getPlayerPosition(cid), 14)
							doSendMagicEffect(getPlayerPosition(item2.uid), 12)
							doPlayerSendTextMessage(item2.uid, 23, "You received " .. newMana .. " mana.")
							doPlayerSendTextMessage(cid, 23, "You gave " .. getPlayerName(item2.uid) .. " " .. newMana .. " mana.")
						end
						doPlayerAddMana(item2.uid, newMana)
						doSendAnimatedText(getPlayerPosition(item2.uid), newMana, animationColor)
					end
				else
					doPlayerSendCancel(cid, exhaustMsg)
				end
			else
				doSendMagicEffect(getPlayerPosition(cid), 2)
				doPlayerSendCancel(cid, mLvlLowMsg)
			end
		else
			doSendMagicEffect(getPlayerPosition(cid), 2)
			doPlayerSendCancel(cid, missPlayerMsg)
		end
		return 1
	end
end
 
 
-- Exhaustion system (Made by Alreth, bugfix by me)
-- DO NOT EDIT!
function exhaust(cid, storeValue, exhaustTime)
 
    newExhaust = os.time()
    oldExhaust = getPlayerStorageValue(cid, storeValue)
    if (oldExhaust == nil or oldExhaust < 0) then
        oldExhaust = 0
    end
    if (exhaustTime == nil or exhaustTime < 0) then
        exhaustTime = 1
    end
    diffTime = os.difftime(newExhaust, oldExhaust)
    if (diffTime >= exhaustTime) then
        setPlayerStorageValue(cid, storeValue, newExhaust) 
        return 1
    else
        return 0
    end
end

Code:
function comparePos(pos1,pos2)
    return pos1.x == pos2.x and pos1.y == pos2.y and pos1.z == pos2.z
end

put in global.lua or lib/functions.lua.

<action itemid="2270" script="manarune.lua" allowfaruse="1" blockwalls="0" />

rep++ ?

Credit, Colandus.

Need to reade the comments maby? i have allready done one for him
 
Need to reade the comments maby? i have allready done one for him

Youres suxxs.. No offence.

Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

function onCastSpell(cid, var)
        doPlayerAddMana(cid, math.random(600, 750))
        return doCombat(cid, combat, var)
end
== noob mana rune.

#up is more "cooler" math.random and stuffs


Lua:
function onUse(cid, item, frompos, item2, topos)
 
        minMana = 30 -- How much mana minium will you get?
        maxMana = 70 -- How much mana max will you get?
        magToUse = 4 -- What magic level do you need to be to use the rune?
        useStats = true -- Shall given mana be affected by player level and magic level?
        runeID = 2270 -- Enter the item Id of the rune.
        loseCharges = true -- Write "true" if it shall lose charges. If not, then write something else such as "false".
        storeValue = 3567 -- Value where exhaust is saved.
        exhaustTime = 2 -- 1 = 1 second of exhaustion.
        animationColor = 41 -- The color of the "animation".
        mLvlLowMsg = "Your magic level is too low." -- Appears when player got too low magic level.
        missPlayerMsg = "You can only use this rune on players."-- Appears when you don't shoot on a player.
        exhaustMsg = "You are exhausted." -- Appears when you are exhausted.

Nice?..
 
2 new questions, ^_^

Nr 1, how do i change cap for new players when they start they drop som start item and some player take thos item before they can pick it up.

Nr 2, How do i change onlien time its normaly on 15 minits i wanna change that to 60 miniuts
 
Lua:
-- 100% made by Colandus (Except exhaustion system).
-- If you edit on this script, be sure that you leave the credits to me, Colandus.
 
function onUse(cid, item, frompos, item2, topos)
 
	minMana = 30 -- How much mana minium will you get?
	maxMana = 70 -- How much mana max will you get?
	magToUse = 4 -- What magic level do you need to be to use the rune?
	useStats = true -- Shall given mana be affected by player level and magic level?
	runeID = 2270 -- Enter the item Id of the rune.
	loseCharges = true -- Write "true" if it shall lose charges. If not, then write something else such as "false".
	storeValue = 3567 -- Value where exhaust is saved.
	exhaustTime = 2 -- 1 = 1 second of exhaustion.
	animationColor = 41 -- The color of the "animation".
	mLvlLowMsg = "Your magic level is too low." -- Appears when player got too low magic level.
	missPlayerMsg = "You can only use this rune on players."-- Appears when you don't shoot on a player.
	exhaustMsg = "You are exhausted." -- Appears when you are exhausted.
 
	if item.itemid == runeID then
		if getThingfromPos({x=topos.x, y=topos.y, z=topos.z, stackpos=253}).itemid > 0 then
			if getPlayerMagLevel(cid) >= magToUse then
				if (exhaust(cid, storeValue, 1) > 0) then
					if loseCharges == true or loseCharges == True then
						if item.type > 1 then
							doChangeTypeItem(item.uid, item.type-1)
						else
							doRemoveItem(item.uid, 1)
						end
					end
					newMana = math.random(minMana, maxMana)
					if useStats then
						newMana = newMana + getPlayerLevel(cid) + getPlayerMagLevel(cid)
					end
					manaNow = getPlayerMana(item2.uid)
					doPlayerAddMana(item2.uid, 999999)
					manaMax = getPlayerMana(item2.uid)
					doPlayerAddMana(item2.uid, - manaMax + manaNow)
					nMana = manaMax - manaNow
					if newMana > nMana then
						newMana = nMana
					end
					if getPlayerMana(item2.uid) == manaMax then
						if getPlayerPosition(cid).x == getPlayerPosition(item2.uid).x and getPlayerPosition(cid).y == getPlayerPosition(item2.uid).y then
							doPlayerSendCancel(item2.uid, "Your mana is already full.")
							doChangeTypeItem(item.uid, item.type)
						else
							doPlayerSendCancel(cid, "" .. getPlayerName(item2.uid) .. " mana is already full.")
							doChangeTypeItem(item.uid, item.type)
						end
					else
						if getPlayerPosition(cid).x == getPlayerPosition(item2.uid).x and getPlayerPosition(cid).y == getPlayerPosition(item2.uid).y then
							doSendMagicEffect(getPlayerPosition(cid), 12)
							doPlayerSendTextMessage(cid, 23, "You received " .. newMana .. " mana.")
						else
							doSendMagicEffect(getPlayerPosition(cid), 14)
							doSendMagicEffect(getPlayerPosition(item2.uid), 12)
							doPlayerSendTextMessage(item2.uid, 23, "You received " .. newMana .. " mana.")
							doPlayerSendTextMessage(cid, 23, "You gave " .. getPlayerName(item2.uid) .. " " .. newMana .. " mana.")
						end
						doPlayerAddMana(item2.uid, newMana)
						doSendAnimatedText(getPlayerPosition(item2.uid), newMana, animationColor)
					end
				else
					doPlayerSendCancel(cid, exhaustMsg)
				end
			else
				doSendMagicEffect(getPlayerPosition(cid), 2)
				doPlayerSendCancel(cid, mLvlLowMsg)
			end
		else
			doSendMagicEffect(getPlayerPosition(cid), 2)
			doPlayerSendCancel(cid, missPlayerMsg)
		end
		return 1
	end
end
 
 
-- Exhaustion system (Made by Alreth, bugfix by me)
-- DO NOT EDIT!
function exhaust(cid, storeValue, exhaustTime)
 
    newExhaust = os.time()
    oldExhaust = getPlayerStorageValue(cid, storeValue)
    if (oldExhaust == nil or oldExhaust < 0) then
        oldExhaust = 0
    end
    if (exhaustTime == nil or exhaustTime < 0) then
        exhaustTime = 1
    end
    diffTime = os.difftime(newExhaust, oldExhaust)
    if (diffTime >= exhaustTime) then
        setPlayerStorageValue(cid, storeValue, newExhaust) 
        return 1
    else
        return 0
    end
end

Code:
function comparePos(pos1,pos2)
    return pos1.x == pos2.x and pos1.y == pos2.y and pos1.z == pos2.z
end

put in global.lua or lib/functions.lua.

<action itemid="2270" script="manarune.lua" allowfaruse="1" blockwalls="0" />

rep++ ?

Credit, Colandus.

Its look like a good script and i will try it and see whats i think is the best but i like to know where i poste what right now i am pritti cunfused :blink:
 
okok i will try both and se whitch i like moste ^_^

i did try this 2000 in action id and random in unigue
and after i downlode a new server its worked but now i wont the player to chose one item do i just set same unigue then?

And do u know where i poste hims?

I just try and se what i like moste ^^
 
Can somone upload manarune 1200 per use and the runes doesn't disaper when you use it once and one with 400 mana per use?
just the LUA file
 
Back
Top