Tibia Mod
Forum zostało Przeniesione tutaj:
http://tibiamod.xaa.pl/

Zapraszam.

Join the forum, it's quick and easy

Tibia Mod
Forum zostało Przeniesione tutaj:
http://tibiamod.xaa.pl/

Zapraszam.
Tibia Mod
Czy chcesz zareagować na tę wiadomość? Zarejestruj się na forum za pomocą kilku kliknięć lub zaloguj się, aby kontynuować.

[creaturevents]Lista nowych czarów przy awansie [8.54]

Go down

[creaturevents]Lista nowych czarów przy awansie [8.54] Empty [creaturevents]Lista nowych czarów przy awansie [8.54]

Pisanie by darkes Sro Lis 14, 2012 12:20 pm

Autor: Mateusz

Skrypt wyświetla listę nowych czarów (dostępnych na poziom) przy awansie.

np.
Kod:
Spells for Level 45
adori vita vis - Sudden Death Rune : 999

Otwórz creaturescripts/scripts/login.lua i dodaj:
Kod:
registerCreatureEvent(cid, "spellsShowOnAdvance")
Następnie otwórz creaturescripts/creaturescripts.xml i dodaj
Kod:
<event type="advance" name="spellsShowOnAdvance" event="script" value="advanceSpells.lua"/>
Oraz stwórz plik creaturescripts/scripts/advanceSpells.lua i wklej:
Kod:
function onAdvance(cid, skill, oldLevel, newLevel)
 
if skill == SKILL__LEVEL and newLevel > oldLevel then
local playerLevel = getPlayerLevel(cid)
local c=0
local count = getPlayerInstantSpellCount(cid)
local text = ""
local t = {}
for i = 0, count - 1 do
local spell = getPlayerInstantSpellInfo(cid, i)
if spell.level == playerLevel then
if spell.manapercent > 0 then
spell.mana = spell.manapercent .. "%"
end
table.insert(t, spell)
c=c+1
end
end
 
if c>0 then
for i, spell in ipairs(t) do
local line = ""
 
if i ~= 1 then
line = "\n"
end
line = line .. "Spells for Level " .. spell.level .. "\n"
 
text = text .. line .. " " .. spell.words .. " - " .. spell.name .. " : " .. spell.mana .. "\n"
end
doShowTextDialog(cid, item.itemid, text)
end
 
end
 
return TRUE
end

darkes
Uploader

Liczba postów : 27
Join date : 13/11/2012

Powrót do góry Go down

Powrót do góry

- Similar topics

 
Permissions in this forum:
Nie możesz odpowiadać w tematach