iTibia

Wszystko o Tibi i OTS, i nie tylko!

  • Nie jesteś zalogowany.
  • Polecamy: Moda

Ogłoszenie


#1 2010-08-13 21:23:02

 Sherman

http://i34.tinypic.com/28ko5qb.gif

2660937
Skąd: Szamocin
Zarejestrowany: 2008-07-25
Posty: 24
Punktów :   

Manaruna

Dzisiaj opiszę wam jak zrobić ManaRune ; )

1. Wejdz w TwójOTS\data\actions\scripts i utwórz plik "manarune.lua" wklej do niego:

Kod:

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 = 1555 -- 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 * 3) + (mlevel * 5) - 50
local mana_maximum = (level * 3) + (mlevel * 5)
-- 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,28)
doSendMagicEffect(topos, CONST_ME_MAGIC_GREEN)
doSendAnimatedText(topos, mana_add, TEXTCOLOR_LIGHTBLUE)
doPlayerSay(cid,"Mana UUPP!!!",1)
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(topos,28)
doSendMagicEffect(topos, CONST_ME_MAGIC_GREEN)
doSendAnimatedText(topos, mana_add, TEXTCOLOR_LIGHTBLUE)
doPlayerSay(cid,"Mana UUPP!!!",1)
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

2. Wejdz w Twójots\data\actions i zedytuj plik "actions.xml"
Wklej tam:

Kod:

<action itemid="2270" script="manarune.lua"  />

No i to by było na tyle. Jeżeli macie jakieś pytania piszcie.


It is no use saying "We are doing our best."
You have got to succeed in doing what is necessary.

Offline

 

Stopka forum

RSS
Powered by PunBB 1.2.23
© Copyright 2002–2008 PunBB
Polityka cookies - Wersja Lo-Fi


Darmowe Forum | Ciekawe Fora | Darmowe Fora
www.wszystkonatelefon.pun.pl www.watra.pun.pl www.mobileinfantry.pun.pl www.starastarego.pun.pl www.gry-all.pun.pl