[creaturevents]Lista nowych czarów przy awansie [8.54]
Strona 1 z 1
[creaturevents]Lista nowych czarów przy awansie [8.54]
Autor: Mateusz
Skrypt wyświetla listę nowych czarów (dostępnych na poziom) przy awansie.
np.
Otwórz creaturescripts/scripts/login.lua i dodaj:
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")
- Kod:
<event type="advance" name="spellsShowOnAdvance" event="script" value="advanceSpells.lua"/>
- 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
Strona 1 z 1
Permissions in this forum:
Nie możesz odpowiadać w tematach
|
|