gmstrikker
Well-Known Member
- Joined
- Jul 30, 2014
- Messages
- 458
- Solutions
- 1
- Reaction score
- 50
Is anyone know how to do, if it is possible OFC
To create a script that when players get magic level up, it show the new spells he can use
spells that are from his vocation and in that ml he just got
loading from the spells.xml ?
i put it to work with this script (by create a new list):
i want some more dynamic
everytime i create a new spell i have to change on spell seller npc, spells.xml and on this, is it possible guys?
but its pretty sucks to manage, add, remove, change any spell, maybe i forgot some spells, but if anyone want to use, that is what i'm using by now...
To create a script that when players get magic level up, it show the new spells he can use
spells that are from his vocation and in that ml he just got
loading from the spells.xml ?
i put it to work with this script (by create a new list):
Code:
local spells = {
[1] = { -- sorcerer
level = {
[1] = {
"Name: find person. Words: Exiva.",
"Name: magic rope. Words: exani tera.",
"Name: cure poison. Words: exana pox.",
"Name: food. Words: exevo pan.",
"Name: levitate. Words: exani hur."
},
[2] = {
"Name: death strike. Words: exori mort.",
"Name: light healing. Words: exura.",
"Name: magic shield. Words: utamo vita.",
"Name: poison field. Words: adevo grav pox.",
},
[3] = {
"Name: intense healing. Words: exura gran.",
"Name: heavy magic missile. Words: adori gran.",
"Name: energy strike. Words: exori vis.",
"Name: flame strike. Words: exori flam.",
"Name: great light. Words: utevo gran lux.",
"Name: fire field. Words: adevo grav flam."
},
[4] = {
"Name: haste. Words: utani hur.",
"Name: magic shield. Words: utamo vita."
},
[5] = {
"Name: ice strike. Words: exori frigo.",
"Name: energy field. Words: adevo grav vis."
},
[6] = {
"Name: poison strike. Words: exori pox.",
"Name: destroy field. Words: adito grav."
},
[7] = {
"Name: fire wave. Words: exevo flam hur."
},
[8] = {
"Name: ultimate healing. Words: exura vita.",
"Name: strong haste. Words: utani gran hur."
},
[9] = {
"Name: fire bomb. Words: adevo mas flam.",
"Name: great fireball. Words: adori gran flam."
},
[10] = {
"Name: creature illusion. Words: utevo res ina."
},
[12] = {
"Name: ultimate light. Words: utevo vis lux.",
"Name: explosion. Words: adevo mas hur."
},
[13] = {
"Name: soul fire. Words: adevo res flam."
},
[14] = {
"Name: magic wall. Words: adevo grav tera."
},
[15] = {
"Name: invisible. Words: utana vid."
},
[16] = {
"Name: summon creature. Words: utevo res."
},
[18] = {
"Name: energy bomb. Words: adevo mas vis.",
"Name: energy wall. Words: adevo mas grav vis.",
"Name: poison wall. Words: adevo mas grav pox."
},
[20] = {
"Name: mort wave. Words: exevo mort hur."
},
[22] = {
"Name: enchant staff. Words: exeta vis."
},
[25] = {
"Name: sudden death. Words: adori vita vis."
},
[33] = {
"Name: fire wall. Words: adevo mas grav flam."
},
[40] = {
"Name: ultimate explosion. Words: exevo gran mas vis."
}
}
},
[2] = { --druid
level = {
[1] = {
"Name: find person. Words: Exiva.",
"Name: magic rope. Words: exani tera.",
"Name: cure poison. Words: exana pox.",
"Name: food. Words: exevo pan.",
"Name: levitate. Words: exani hur."
},
[2] = {
"Name: Death Strike. Words: Exori Mort.",
"Name: light healing. Words: exura.",
"Name: magic shield. Words: utamo vita.",
"Name: poison field. Words: adevo grav pox."
},
[3] = {
"Name: intense healing. Words: exura gran.",
"Name: heavy magic missile. Words: adori gran.",
"Name: energy strike. Words: exori vis.",
"Name: flame strike. Words: exori flam.",
"Name: great light. Words: utevo gran lux.",
"Name: fire field. Words: adevo grav flam."
},
[4] = {
"Name: haste. Words: utani hur.",
"Name: magic shield. Words: utamo vita."
},
[5] = {
"Name: ice strike. Words: exori frigo.",
"Name: energy field. Words: adevo grav vis."
},
[6] = {
"Name: poison strike. Words: exori pox.",
"Name: destroy field. Words: adito grav."
},
[7] = {
"Name: heal friend. Words: exura sio."
},
[8] = {
"Name: ultimate healing. Words: exura vita.",
"Name: strong haste. Words: utani gran hur.",
"Name: ice wave. Words: exevo frigo hur."
},
[9] = {
"Name: fire bomb. Words: adevo mas flam.",
"Name: great fireball. Words: adori gran flam."
},
[10] = {
"Name: icicle. Words: adori frigo.",
"Name: creature illusion. Words: utevo res ina."
},
[11] = {
"Name: Ultimate Healing Rune. Words: Adura Vita."
},
[12] = {
"Name: ultimate light. Words: utevo vis lux."
},
[13] = {
"Name: soul fire. Words: adevo res flam."
},
[14] = {
"Name: wild growth. Words: adevo grav vita."
},
[15] = {
"Name: invisible. Words: utana vid.",
"Name: mass healing. Words: exura gran mas res."
},
[16] = {
"Name: summon creature. Words: utevo res."
},
[18] = {
"Name: energy bomb. Words: adevo mas vis.",
"Name: energy wall. Words: adevo mas grav vis.",
"Name: poison wall. Words: adevo mas grav pox."
},
[25] = {
"Name: avalanche. Words: adori gran frigo."
},
[28] = {
"Name: wrath of nature. Words: exevo gran mas pox."
},
[33] = {
"Name: fire wall. Words: adevo mas grav flam."
},
[35] = {
"Name: paralyze. Words: adana ani."
}
}
},
[3] = { --paladin
level = {
[1] = {
"Name: find person. Words: Exiva.",
"Name: magic rope. Words: exani tera.",
"Name: cure poison. Words: exana pox.",
"Name: food. Words: exevo pan.",
"Name: levitate. Words: exani hur.",
"Name: conjure arrow. Words: exevo con."
},
[2] = {
"Name: light healing. Words: exura.",
"Name: magic shield. Words: utamo vita."
},
[3] = {
"Name: intense healing. Words: exura gran.",
"Name: great light. Words: utevo gran lux.",
"Name: conjure poison arrow. Words: exevo con pox."
},
[4] = {
"Name: haste. Words: utani hur.",
"Name: magic shield. Words: utamo vita."
},
[6] = {
"Name: ultimate healing. Words: exura vita."
},
}
},
[4] = { --knight
level = {
[1] = {
"Name: find person. Words: Exiva.",
"Name: magic rope. Words: exani tera.",
"Name: cure poison. Words: exana pox.",
"Name: levitate. Words: exani hur.",
"Name: levitate. Words: exani hur."
},
[2] = {
"Name: light healing. Words: exura."
},
[3] = {
"Name: wound cleansing. Words: exana mort.",
"Name: great light. Words: utevo gran lux."
},
[4] = {
"Name: challenge. Words: exeta res.",
"Name: haste. Words: utani hur."
},
[5] = {
"Name: berserk. Words: exori."
}
}
}
}
local vocs = {
{1,5,9},
{2,6,10},
{3,7,11},
{4,8,12}
}
local vocationSpells = {}
function onAdvance(cid, skill, oldLevel, newLevel)
if skill == 7 then
for i, class in ipairs(vocs) do
if isInArray(class, getPlayerVocation(cid)) then
vocationSpells = spells[i]
end
end
if vocationSpells == nil then
return false
end
if oldLevel > newLevel then
return false
end
local lvl = getPlayerMagLevel(cid, false)
local playerSpells = vocationSpells.level[lvl]
if playerSpells == nil or #playerSpells == 0 then
return false
end
for x = 1, #playerSpells do
doPlayerSendTextMessage(cid, 20, "[NEW-SPELL] "..playerSpells[x]..".")
end
end
return true
end
i want some more dynamic
everytime i create a new spell i have to change on spell seller npc, spells.xml and on this, is it possible guys?
but its pretty sucks to manage, add, remove, change any spell, maybe i forgot some spells, but if anyone want to use, that is what i'm using by now...