Angelika1993
New Member
- Joined
- Oct 6, 2014
- Messages
- 46
- Reaction score
- 2
Hello i have two scripts, and both working but i need this both in one. I try but not works..
I need vocation manarune :
Here is mine :
[/LIST]
Here is second with vocation.... :
[/LIST]
Can you help me?
I need vocation manarune :
Here is mine :
PHP:
[LIST=1]
[*]function onUse(cid, item, frompos, item2, topos)
[*]
[*]local level = getPlayerLevel(cid)
[*]local mlevel = getPlayerMagLevel(cid)
[*]
[*]-- Exhausted Settings --
[*]local exhausted_seconds = 1 -- How many seconds manarune will be unavailible to use. --
[*]local exhausted_storagevalue = 1000 -- Storage Value to store exhaust. It MUST be unused! --
[*]-- Exhausted Settings END --
[*]
[*]-- Mana Formula Settings --
[*]-- You can use "level" and "mlevel" --
[*]local mana_minimum = (level * 7) + (mlevel * 8)
[*]local mana_maximum = (level * 7) + (mlevel * 8)
[*]-- Mana Formula Settings END --
[*]
[*]local mana_add = math.random(mana_minimum, mana_maximum)
[*]
[*]-- We check the charges. --
[*]if(item.type > 1) then
[*]-- Exhausted check. --
[*]if(os.time() > getPlayerStorageValue(cid, exhausted_storagevalue)) then
[*]-- Entity is player? --
[*]if(isPlayer(item2.uid) == 1) then
[*]
[*]doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
[*]
[*]doPlayerAddMana(item2.uid, mana_add)
[*]setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
[*]doChangeTypeItem(item.uid, item.type - 1)
[*]else
[*]doSendMagicEffect(frompos, CONST_ME_POFF)
[*]doPlayerSendCancel(cid, "This rune you can only use on players.")
[*]end
[*]else
[*]doSendMagicEffect(frompos, CONST_ME_POFF)
[*]doPlayerSendCancel(cid, "You are exhausted.")
[*]end
[*]else
[*]if(os.time() < getPlayerStorageValue(cid, exhausted_storagevalue)) then
[*]doSendMagicEffect(frompos, CONST_ME_POFF)
[*]doPlayerSendCancel(cid, "You are exhausted.")
[*]else
[*]if(isPlayer(item2.uid) == 1) then
[*]
[*]doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
[*]
[*]doPlayerAddMana(item2.uid, mana_add)
[*]setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
[*]
[*]else
[*]doSendMagicEffect(frompos, CONST_ME_POFF)
[*]doPlayerSendCancel(cid, "This rune you can only use on players.")
[*]end
[*]end
[*]end
[*]
[*]return 1
[*]end
Here is second with vocation.... :
PHP:
[LIST=1]
[*]function onUse(cid, item, frompos, item2, topos)
[*]
[*]local playerpos = getPlayerPosition(cid)
[*]local vocation = getPlayerVocation(cid)
[*]local manaadd = math.random(100,250)
[*]
[*]
[*]if (vocation == 4) or (vocation == 8) then
[*]doPlayerAddMana(cid, manaadd)
[*]doPlayerSay(cid,"Mniam...",1)
[*]doRemoveItem(item.uid, 1)
[*]doSendMagicEffect(playerpos, 12)
[*]else
[*]doPlayerSendTextMessage(cid,19,"You are not knight or elite knight.")
[*]end
[*]end
Can you help me?