WiLDTuRTLE
Member
- Joined
- Feb 26, 2011
- Messages
- 478
- Reaction score
- 5
Im wondering how it works, i aint got my computer yet, so can't test it on my server, but how would it work, i only change the "exori vis" to my custom spell and the player will earn the spell, and do i have to change something in spell.xml?
Thanks for your answer slave or anybody else that tried that script :]
Thanks for your answer slave or anybody else that tried that script :]
Code:
-- Contact ; Slave <a href="mailto:[email protected]">[email protected]</a>
function onUse(cid, item, frompos, item2, topos)
local cfg = {
sorcerer = { 1, 5, 9, 13, 17 }, -- sorcerer vocations
druid = { 2, 6, 10, 14, 18 },-- druid vocations
paladin = { 3, 7, 11, 15, 19 },-- paladin vocations
knight = { 4, 8, 12, 16, 20 },-- knight vocations
storage = 12527, -- empty storage
sorcerer = "exori vis", -- spell for sorcerers dont remove ""
druid = "exori frigo", -- spell for druids dont remove ""
paladin = "exori con", -- spell for paladins dont remove ""
knight = "exori hur" --spell for knights dont remove ""
}
if getPlayerStorageValue(cid, cfg.storage) > 0 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "you have already learned this spell, check !spells")
doSendMagicEffect(getPlayerPosition(cid), 2)
return 1
end
if(isInArray(cfg.sorcerer, getPlayerVocation(cid)) == true) and getPlayerStorageValue(cid, cfg.storage) < 0 then
doPlayerLearnInstantSpell(cid, cfg.sorcerer)
doRemoveItem(item.uid, 1)
doSendMagicEffect(getPlayerPosition(cid), 27)
setPlayerStorageValue(cid, cfg.storage, 1)
return true
end
if(isInArray(cfg.druid, getPlayerVocation(cid)) == true) and getPlayerStorageValue(cid, cfg.storage) < 0 then
doPlayerLearnInstantSpell(cid, cfg.druid)
doRemoveItem(item.uid, 1)
doSendMagicEffect(getPlayerPosition(cid), 27)
setPlayerStorageValue(cid, cfg.storage, 1)
return true
end
if(isInArray(cfg.paladin, getPlayerVocation(cid)) == true) and getPlayerStorageValue(cid, cfg.storage) < 0 then
doPlayerLearnInstantSpell(cid, cfg.paladin)
doRemoveItem(item.uid, 1)
doSendMagicEffect(getPlayerPosition(cid), 27)
setPlayerStorageValue(cid, cfg.storage, 1)
return true
end
if(isInArray(cfg.knight, getPlayerVocation(cid)) == true) and getPlayerStorageValue(cid, cfg.storage) < 0 then
doPlayerLearnInstantSpell(cid, cfg.knight)
doRemoveItem(item.uid, 1)
doSendMagicEffect(getPlayerPosition(cid), 27)
setPlayerStorageValue(cid, cfg.storage, 1)
return true
end
end