Informacion para las spells custom en comando
!spells
Nota: Cada vocation le saldra la informacion de sus spells custom.
Ver archivo adjunto Tibia - Deixis 2023-12-13 21-35-43.mp4
!spells
Nota: Cada vocation le saldra la informacion de sus spells custom.
Ver archivo adjunto Tibia - Deixis 2023-12-13 21-35-43.mp4
Código Lua:
local newspellsinfo = TalkAction("!spells")
-- Define the information for spells (name, cooldown, level required, mana cost, vocation)
local spellInfo = {
Knight = {
["exori attraction"] = {
cooldown = 5,
levelRequired = 300,
manaCost = 300
},
["exori follow ico"] = {
cooldown = 5,
levelRequired = 250,
manaCost = 300
},
["exori blaze"] = {
cooldown = 5,
levelRequired = 300,
manaCost = 300
}
},
Sorcerer = {
["ethereal velocity"] = {
cooldown = 5,
levelRequired = 200,
manaCost = 650
},
["exori follow death"] = {
cooldown = 5,
levelRequired = 250,
manaCost = 700
},
["exevo Necroshock"] = {
cooldown = 5,
levelRequired = 300,
manaCost = 700
}
},
Druid = {
["ethereal velocity"] = {
cooldown = 5,
levelRequired = 200,
manaCost = 650
},
["exevo Frostquake"] = {
cooldown = 5,
levelRequired = 300,
manaCost = 700
},
["Radiant Strike"] = {
cooldown = 5,
levelRequired = 150,
manaCost = 800
},
["exori follow ice"] = {
cooldown = 5,
levelRequired = 250,
manaCost = 700
},
["exevo tame"] = {
cooldown = 5,
levelRequired = 300,
manaCost = 800
}
},
Paladin = {
["exevo divine burst"] = {
cooldown = 5,
levelRequired = 300,
manaCost = 400
},
["exevo follow holy"] = {
cooldown = 5,
levelRequired = 250,
manaCost = 400
},
["exevo gran san"] = {
cooldown = 5,
levelRequired = 300,
manaCost = 400
}
}
-- Add more spells as needed
}
-- Define promotions and their respective base vocations
local promotions = {
["Elite Knight"] = "Knight",
["Master Sorcerer"] = "Sorcerer",
["Elder Druid"] = "Druid",
["Royal Paladin"] = "Paladin"
}
-- Function to show the information of spells for a specific vocation or promotion
function showSpellInfo(player, vocation)
local message = "Information about " .. vocation .. " spells:\n\n"
for spellName, spellData in pairs(spellInfo[vocation]) do
message = message .. "Spell: " .. spellName ..
"\nCooldown: " .. spellData.cooldown .. " seconds" ..
"\nRequired Level: " .. spellData.levelRequired ..
"\nMana Cost: " .. spellData.manaCost .. "\n\n"
end
player:showTextDialog(43927, message)
end
-- Function to handle the onSay command
function newspellsinfo.onSay(player, words, param)
local vocation = player:getVocation():getName()
-- Check if the player's vocation is in promotions
local baseVocation = promotions[vocation] or vocation
if spellInfo[baseVocation] then
showSpellInfo(player, baseVocation)
else
player:sendTextMessage(MESSAGE_INFO_DESCR, "No spells found for your vocation.")
end
return false
end
newspellsinfo:register()