• 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 Small MR~Changes~ (Rune)

killing

Member
Joined
Feb 23, 2012
Messages
815
Reaction score
11
Location
BIH
Hello
I want to Change a little bit my Small Mr rune..
this is Script
Lua:
function onUse(cid, item, frompos, item2, topos)
	doSendMagicEffect(topos,1)
	doCreatureSay(cid,"AhA!", TALKTYPE_ORANGE_1)
	doPlayerAddMana(cid, 1000)
	return true
end

I want it to still be same but
If Knight is Using This MR,i want to it add mana only 150
If Paladin is Using it I want to it add mana only 150
----
If Sorcerer is Using It,i want to it Add mana 1000 mana.
If Druid is using it,i want to it add 1000 mana.

Rep++

- - - Updated - - -

I do not want to add more Items IDS.
i want to all that be on the same one ID.

- - - Updated - - -

Bump
 
Last edited:
Code:
function onUse(cid, item, frompos, item2, topos)
local manapa = 150 -- Mana for paladins
local manakn = 150 -- Mana for knights
local manama = 1000 -- Mana for mages
	if(isSorcerer(cid) or isDruid(cid)then
		doSendMagicEffect(topos,1)
		doCreatureSay(cid,"AhA!", TALKTYPE_ORANGE_1)
		doPlayerAddMana(cid, manama)
		return true
	elseif isPaladin(cid) then
		doSendMagicEffect(topos,1)
		doCreatureSay(cid,"AhA!", TALKTYPE_ORANGE_1)
		doPlayerAddMana(cid, manapa)
		return true
	else
		doSendMagicEffect(topos,1)
		doCreatureSay(cid,"AhA!", TALKTYPE_ORANGE_1)
		doPlayerAddMana(cid, manakn)
		return true
	
	
end
 
I suck at lua..

But maybe something like this?

Lua:
local mana1 = 150
local mana2 = 1000
local voc1 = {
				1,
				2,
				5,
				6}
local voc2 = {
				3,
				4,
				7,
				8}

function onUse(cid, item, frompos, item2, topos)

	if getPlayerVocation(cid) == voc1 then
		doSendMagicEffect(topos,1)
		doCreatureSay(cid,"AhA!", TALKTYPE_ORANGE_1)
		doPlayerAddMana(cid, mana1)
		return true
	end
	if getPlayerVocation(cid) == voc2 then
		doSendMagicEffect(topos,1)
		doCreatureSay(cid,"AhA!", TALKTYPE_ORANGE_1)
		doPlayerAddMana(cid, mana2)
		return true
	end
end


BTW,
@Up
Your code wont work :p you are missing atleast one "end"
 
I well test it.
if it works Repp++

- - - Updated - - -

Not Working Sry
No rep.
:p

- - - Updated - - -

I suck at lua..

But maybe something like this?

Lua:
local mana1 = 150
local mana2 = 1000
local voc1 = {
				1,
				2,
				5,
				6}
local voc2 = {
				3,
				4,
				7,
				8}

function onUse(cid, item, frompos, item2, topos)

	if getPlayerVocation(cid) == voc1 then
		doSendMagicEffect(topos,1)
		doCreatureSay(cid,"AhA!", TALKTYPE_ORANGE_1)
		doPlayerAddMana(cid, mana1)
		return true
	end
	if getPlayerVocation(cid) == voc2 then
		doSendMagicEffect(topos,1)
		doCreatureSay(cid,"AhA!", TALKTYPE_ORANGE_1)
		doPlayerAddMana(cid, mana2)
		return true
	end
end


BTW,
@Up
Your code wont work :p you are missing atleast one "end"


your is not working..

- - - Updated - - -

it just say your Cant Use that object..
i do not get any problems
 
what did you add in actions.xml?

- - - Updated - - -

Try this one:

Lua:
local mana1 = 150
local mana2 = 1000
local voc1 = {
				1,
				2,
				5,
				6}
local voc2 = {
				3,
				4,
				7,
				8}

function onUse(cid, item, frompos, item2, topos)

	if isInArray(voc1, getPlayerVocation(cid)) then
		doSendMagicEffect(topos,1)
		doCreatureSay(cid,"AhA!", TALKTYPE_ORANGE_1)
		doPlayerAddMana(cid, mana1)
		return true
	end
	if isInArray(voc2, getPlayerVocation(cid)) then
		doSendMagicEffect(topos,1)
		doCreatureSay(cid,"AhA!", TALKTYPE_ORANGE_1)
		doPlayerAddMana(cid, mana2)
		return true
	end
end
 
yeah it works now but
I want to paladin Add mana 150..and to royal paladin too

- - - Updated - - -

You have repp++
 
Lua:
local mana1 = 150
local mana2 = 1000
local voc1 = {
		3,
		7,
		4,
		8
}

local voc2 = {
		1,
		5,
		2,
		6
}
 
function onUse(cid, item, frompos, item2, topos)
 
	if isInArray(voc1, getPlayerVocation(cid)) then
		doSendMagicEffect(topos,1)
		doCreatureSay(cid,"AhA!", TALKTYPE_ORANGE_1)
		doPlayerAddMana(cid, mana1)
		return true
	end
	if isInArray(voc2, getPlayerVocation(cid)) then
		doSendMagicEffect(topos,1)
		doCreatureSay(cid,"AhA!", TALKTYPE_ORANGE_1)
		doPlayerAddMana(cid, mana2)
		return true
	end
end

Maybe? xd
 
Lua:
local mana1 = 150
local mana2 = 1000
local voc1 = {
				3,
				7,
				4,
				8
}

local voc2 = {
				1,
				5,
				2,
				6
}
 
function onUse(cid, item, frompos, item2, topos)
 
	if isInArray(voc1, getPlayerVocation(cid)) then
		doSendMagicEffect(topos,1)
		doCreatureSay(cid,"AhA!", TALKTYPE_ORANGE_1)
		doPlayerAddMana(cid, mana1)
		return true
	end
	if isInArray(voc2, getPlayerVocation(cid)) then
		doSendMagicEffect(topos,1)
		doCreatureSay(cid,"AhA!", TALKTYPE_ORANGE_1)
		doPlayerAddMana(cid, mana2)
		return true
	end
end

Maybe? xd

Gah you need to make them learn something :p
 
Gah you need to make them learn something :p

Haha :)

You can also do like this:

Lua:
local mana1 = 150
local mana2 = 1000

local voc1 = {
		3,
		7,
		4,
		8
}
 

function onUse(cid, item, frompos, item2, topos)
 
	if isInArray(voc1, getPlayerVocation(cid)) then
		doSendMagicEffect(topos,1)
		doCreatureSay(cid,"AhA!", TALKTYPE_ORANGE_1)
		doPlayerAddMana(cid, mana1)
		else
		doSendMagicEffect(topos,1)
		doCreatureSay(cid,"AhA!", TALKTYPE_ORANGE_1)
		doPlayerAddMana(cid, mana2)
		return true
			end
end
 
Back
Top