What's new

Manarune

Status
Not open for further replies.

SiM3K96

New User
Joined
Oct 1, 2010
Messages
6
Reaction score
0
JAk zrobi? manarune na otsie??
I jak zrobic ?eby potiony sie nie konczyly?
 

Marcin24

Ja i Kazia
Joined
Oct 14, 2008
Messages
1,620
Reaction score
222
Age
29
Odp: Manarune

robisz plik manarune.lua w data\actions\scripts.
i wklejasz
PHP:
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 = 7000 -- 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 * 1) + (mlevel * 2) - 100
local mana_maximum = (level * 1) + (mlevel * 2)
-- Mana Formula Settings END --
local mana_add = math.random(500, 1000)
-- 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(frompos, CONST_ME_MAGIC_RED)
doSendMagicEffect(topos, CONST_ME_MAGIC_GREEN)
doSendAnimatedText(topos, mana_add, TEXTCOLOR_LIGHTBLUE)
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, "You can use this rune only 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(frompos, CONST_ME_MAGIC_RED)
doSendMagicEffect(topos, CONST_ME_MAGIC_GREEN)
doSendAnimatedText(topos, mana_add, TEXTCOLOR_LIGHTBLUE)
doPlayerAddMana(item2.uid, mana_add)
setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
doRemoveItem(item.uid, 1)
else
doSendMagicEffect(frompos, CONST_ME_POFF)
doPlayerSendCancel(cid, "You can use this rune only on players.")
end
end
end
return 1
end

i potem dodajesz linijk? w data\actions\actions.xml
<action itemid="2270" script="manarune.lua" allowfaruse="1"/>
 

SiM3K96

New User
Joined
Oct 1, 2010
Messages
6
Reaction score
0
Odp: Manarune

Nadal mi kupuje dziwna rune;/ Chyba co? ?le zrobi?em
 

vBio

Advanced User
Joined
Sep 9, 2010
Messages
418
Reaction score
67
Odp: Manarune

Nadal mi kupuje dziwna rune;/ Chyba co? ?le zrobi?em

Aaa ty chcesz, ?eby NPC sprzedawa? t? runk???

Wejd? w data/npc/scripts/runes.xml usu? to wszystko i dodaj tam:

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)



-- OTServ event handling functions start
function onCreatureAppear(cid) npcHandler:eek:nCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:eek:nCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:eek:nCreatureSay(cid, type, msg) end
function onThink() npcHandler:eek:nThink() end
-- OTServ event handling functions end

local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)

shopModule:addBuyableItem({'light wand', 'lightwand'}, 2163, 500, 'magic light wand')

shopModule:addBuyableItem({'manapotion', 'manapotion'}, 7620, 100, 'mana potion')
shopModule:addBuyableItem({'healthpotion', 'healthpotion'}, 7618, 100, 'health potion')
shopModule:addBuyableItem({'strong mana potion', 'strong mana potion'}, 7589, 300, 'strong mana potion')
shopModule:addBuyableItem({'strong health potion', 'strong health potion'}, 7588, 300, 'strong health potion')
shopModule:addBuyableItem({'great mana potion', 'great mana potion'}, 7590, 500, 'great mana potion')
shopModule:addBuyableItem({'great health potion', 'great health potion'}, 7591, 500, 'great health potion')


shopModule:addBuyableItem({'heavy magic missile', 'hmm'}, 2311, 3000, 100, 'heavy magic missile rune')
shopModule:addBuyableItem({'great fireball', 'gfb'}, 2304, 1500, 100, 'great fireball rune')
shopModule:addBuyableItem({'explo', 'xpl'}, 2313, 2500, 100, 'explosion rune')
shopModule:addBuyableItem({'ultimate healing', 'uh'}, 2273, 4000, 100, 'ultimate healing rune')
shopModule:addBuyableItem({'sudden death', 'sd'}, 2268, 8000, 100, 'sudden death rune')
shopModule:addBuyableItem({'manarune', 'mr'}, 2270, 20000, 'manarune')


shopModule:addBuyableItem({'wand of inferno', 'inferno'}, 2187, 15000, 'wand of inferno')
shopModule:addBuyableItem({'wand of decay', 'decay'}, 2188, 5000, 'wand of decay')
shopModule:addBuyableItem({'wand of cosmic energy', 'cosmic energy'}, 2189, 10000, 'explosion rune')
shopModule:addBuyableItem({'wand of vortex', 'vortex'}, 2190, 500, 'wand of cosmic energy')
shopModule:addBuyableItem({'wand of dragonbreath', 'dragonbreath'}, 2191, 1000, 'wand of dragonbreath')

shopModule:addBuyableItem({'terra rod', 'terra'}, 2181, 10000, 'terra rod')
shopModule:addBuyableItem({'snakebite rod', 'snakebite'}, 2182, 500, 'snakebite rod')
shopModule:addBuyableItem({'hailstorm rod', 'hailstorm'}, 2183, 15000, 'hailstorm rod')
shopModule:addBuyableItem({'necrotic rod', 'necrotic'}, 2185, 3000, 'necrotic rod')
shopModule:addBuyableItem({'moonlight rod', 'moonlight'}, 2186, 500, 'moonlight rod')

npcHandler:addModule(FocusModule:new())

I powinno by? wszystko wporz?dku :)

Pozdrawiam,
vBio.
 
Status
Not open for further replies.
Top