Dantez
Moim sekretem jest ciasto
- Joined
- May 22, 2008
- Messages
- 1,206
- Reaction score
- 202
Author: Dantez
Tested on: 0.3.6pl
Wersja z czarem dla wszystkich profesji:
data/actions/scripts/spellquest.lua
[LUA]local spells = {
[4444] = {spell="Light Healing", effect=14},
[3333] = {spell="Intense Healing", effect=11},
-- [UID Skrzynki] = {spell="Nazwa Spella", effect=efekt}
}
function onUse(cid, item, frompos, item2, topos)
if (spells[item.uid]) then
if not (getPlayerLearnedInstantSpell(cid, spells[item.uid].spell)) then
doPlayerLearnInstantSpell(cid, spells[item.uid].spell)
doPlayerSendTextMessage(cid, 25, "You've learned new spell! ["..spells[items.uid].spell.."]")
doSendMagicEffect(getCreaturePosition(cid), spells[item.uid].effect)
else
doPlayerSendTextMessage(cid, 25, "You already know that spell.")
end
end
return true
end[/LUA]
Wersja z r??nymi spellami dla profesji:
data/actions/scripts/spellquest.lua
[LUA]local spells = {
[4444] = {spell={"Ultimate Healing", "Energy Strike", "Death Strike", "Flame Strike"}, effect=14},
[3333] = {spell={"Ultimate Healing", "Energy Strike", "Death Strike", "Flame Strike"}, effect=11},
-- [UID Skrzynki] = {spell={"Nazwa Spella1", "Nazwa Spella2", "Nazwa Spella3", "Nazwa Spella4"}, effect=efekt}
}
function onUse(cid, item, frompos, item2, topos)
local spell = spells[item.uid] ~= nil and (spells[item.uid].spell[getPlayerVocation()] or spells[item.uid].spell[getPlayerVocation()-4]) or nil
if (spell) then
if not (getPlayerLearnedInstantSpell(spell)) then
doPlayerLearnInstantSpell(cid, spell)
doPlayerSendTextMessage(cid, 25, "You've learned new spell! ["..spell.."]")
doSendMagicEffect(getCreaturePosition(cid), spells[item.uid].effect)
else
doPlayerSendTextMessage(cid, 25, "You already know that spell.")
end
end
return true
end[/LUA]
Do actions.xml dodajemy:
Skrzynce/statuetce/?cianie czy czemukolwiek nadajemy actionid 9687 oraz uniqueid - kt?re b?dzie wskazywa?o jaki spell ma nas nauczy?.
Tested on: 0.3.6pl
Wersja z czarem dla wszystkich profesji:
data/actions/scripts/spellquest.lua
[LUA]local spells = {
[4444] = {spell="Light Healing", effect=14},
[3333] = {spell="Intense Healing", effect=11},
-- [UID Skrzynki] = {spell="Nazwa Spella", effect=efekt}
}
function onUse(cid, item, frompos, item2, topos)
if (spells[item.uid]) then
if not (getPlayerLearnedInstantSpell(cid, spells[item.uid].spell)) then
doPlayerLearnInstantSpell(cid, spells[item.uid].spell)
doPlayerSendTextMessage(cid, 25, "You've learned new spell! ["..spells[items.uid].spell.."]")
doSendMagicEffect(getCreaturePosition(cid), spells[item.uid].effect)
else
doPlayerSendTextMessage(cid, 25, "You already know that spell.")
end
end
return true
end[/LUA]
Wersja z r??nymi spellami dla profesji:
data/actions/scripts/spellquest.lua
[LUA]local spells = {
[4444] = {spell={"Ultimate Healing", "Energy Strike", "Death Strike", "Flame Strike"}, effect=14},
[3333] = {spell={"Ultimate Healing", "Energy Strike", "Death Strike", "Flame Strike"}, effect=11},
-- [UID Skrzynki] = {spell={"Nazwa Spella1", "Nazwa Spella2", "Nazwa Spella3", "Nazwa Spella4"}, effect=efekt}
}
function onUse(cid, item, frompos, item2, topos)
local spell = spells[item.uid] ~= nil and (spells[item.uid].spell[getPlayerVocation()] or spells[item.uid].spell[getPlayerVocation()-4]) or nil
if (spell) then
if not (getPlayerLearnedInstantSpell(spell)) then
doPlayerLearnInstantSpell(cid, spell)
doPlayerSendTextMessage(cid, 25, "You've learned new spell! ["..spell.."]")
doSendMagicEffect(getCreaturePosition(cid), spells[item.uid].effect)
else
doPlayerSendTextMessage(cid, 25, "You already know that spell.")
end
end
return true
end[/LUA]
Do actions.xml dodajemy:
PHP:
<action actionid="9687" event="script" value="spellquest.lua"/>
Skrzynce/statuetce/?cianie czy czemukolwiek nadajemy actionid 9687 oraz uniqueid - kt?re b?dzie wskazywa?o jaki spell ma nas nauczy?.