Skrypty & Kody [XML 8.1] ManaRune

Status
Zamknięty.

emil1995

User
Zarejestrowany
Dołączył
Listopad 29, 2013
Posty
14
Liczba reakcji
0
Hej potrzebuj? by ta manaruna by?a dla vocation 5 i 6

[LUA]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 [/LUA]
Pozdrawiam
 
Odp: [XML 8.1] ManaRune

<rune name="MR" id="XXX" allowfaruse="1" charges="1" lvl="XXXX" maglv="XXX" exhaustion="2000" needtarget="1" blocktype="solid" event="script" value="XXXX">
<vocation id="1"/>
<vocation id="5" showInDescription="0"/>
</rune>
W spells.xml
 
Odp: [XML 8.1] ManaRune

A te "XXX" pozamienia?e??
 
Odp: [XML 8.1] ManaRune

tak pozmienia?em, manaruna dzia?a, ale wszyscy mog? jej u?ywa?. Problem jest taki ?e g??wny skrypt mie?ci si? w actions.xml i jakbym go usun?? to manaruna automatycznie przestaje dzia?a?, a tam nie ma mozliwo?ci dodania vocations. Nie potrafi? zmieni? w tym skrypcie, ale i tak dzi?ki
 
Odp: [XML 8.1] ManaRune

if getPlayerVocation(cid) = 1 then
A wiec dodaj taka linijke

---------- Tre?? dodana o 00:54 ----------

W actions w tej manarune
 
Odp: [XML 8.1] ManaRune

No tutaj nic nie da w spells.xml, bo skrypt jest w action...

[LUA]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)

if getPlayerVocation(cid) == 5 or getPlayerVocation(cid) == 6 then
-- 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)
end
else
doSendMagicEffect(frompos, CONST_ME_POFF)
doPlayerSendCancel(cid, "This rune you can only use on players.")
end
else
doPlayerSendCancel(cid, "You have to be Elder Druid or Master Sorcerer.")
end
end

return 1
end[/LUA]

Mo?e zadzia?a.
 
Odp: [XML 8.1] ManaRune

No tutaj nic nie da w spells.xml, bo skrypt jest w action...

[LUA]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)

if getPlayerVocation(cid) == 5 or getPlayerVocation(cid) == 6 then
-- 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)
end
else
doSendMagicEffect(frompos, CONST_ME_POFF)
doPlayerSendCancel(cid, "This rune you can only use on players.")
end
else
doPlayerSendCancel(cid, "You have to be Elder Druid or Master Sorcerer.")
end
end

return 1
end[/LUA]

Mo?e zadzia?a.

DZI?KUJ? ZA ODP. :
'end' expected <to close 'if' at line 41> near 'else'
 
Odp: [XML 8.1] ManaRune

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)

if getPlayerVocation(cid) == 5 or getPlayerVocation(cid) == 6 then
-- 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)
end
doSendMagicEffect(frompos, CONST_ME_POFF)
doPlayerSendCancel(cid, "This rune you can only use on players.")
end
doPlayerSendCancel(cid, "You have to be Elder Druid or Master Sorcerer.")
end
end

return 1
end
A to?
 
Odp: [XML 8.1] ManaRune


dzi?ki reput polecia?!
Tylko jeszcze mam pro?b?. wszystko dzia?a, ale jak knight albo palladyn pr?buje jej uzy? to wy?wietla si? : 13:29 Using the last mana rune... ale nie ma ?adnego efektu. Czy m?g?by? zrobi? tak by pojawia?y si? dymki i wy?wietla?a si? wiadomo?? " nie mo?esz tego u?y??
 
Odp: [XML 8.1] ManaRune

Ale to tam ju? chyba jest xD
 
Odp: [XML 8.1] ManaRune

[LUA]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)

if getPlayerVocation(cid) == 5 or getPlayerVocation(cid) == 6 then
-- 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.")
if(isPlayer(item2.uid) == 1) then
doSendMagicEffect(topos, CONST_ME_LOSEENERGY)
doPlayerAddMana(item2.uid, mana_add)
setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
end
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 have to be Elder Druid or Master Sorcerer.")
end
end
return 1
end[/LUA]

Mo?e end;a ?le wstawi?em jak wcze?niej ale obczaj.
 
Status
Zamknięty.
Back
Do góry