i mean i want spells for rebirth 1 and spells for rebirth 2more details ?, to push anyone can help you.
ok i will try itu can make it quest and make door for this quest enter only player had rebirth 1
and in spells.xml add this in spell line "needlearn="1""
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
local v,p = getThingPos(cid),{x=1979,y=1989,z=6}
if isPlayer(cid) then
if getCreatureStorage(cid, 85987) >= 1 then
if getPlayerLevel(cid) >= 0 then
doTeleportThing(cid,p)
doSendMagicEffect(p,31)
doCreatureSay(cid,"SUPER SPAWN!",19)
else
doTeleportThing(cid,fromPosition)
doSendMagicEffect(p,10)
doPlayerSendTextMessage(cid,27,'Only players of 10st rebirth and higher are allowed to pass.')
end
else
doTeleportThing(cid,fromPosition)
doSendMagicEffect(p,10)
doCreatureSay(cid,"You Need 1 Rebirth To enter!",19)
doPlayerSendTextMessage(cid,27,'Only players of 10st rebirth higher are allowed to pass.')
end
end
return true
end
"if getCreatureStorage(cid, 85987) >= 1 then
did you read the thread's tittle perfectly ?and this will help u more
Code:function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor) local v,p = getThingPos(cid),{x=1979,y=1989,z=6} if isPlayer(cid) then if getCreatureStorage(cid, 85987) >= 1 then if getPlayerLevel(cid) >= 0 then doTeleportThing(cid,p) doSendMagicEffect(p,31) doCreatureSay(cid,"SUPER SPAWN!",19) else doTeleportThing(cid,fromPosition) doSendMagicEffect(p,10) doPlayerSendTextMessage(cid,27,'Only players of 10st rebirth and higher are allowed to pass.') end else doTeleportThing(cid,fromPosition) doSendMagicEffect(p,10) doCreatureSay(cid,"You Need 1 Rebirth To enter!",19) doPlayerSendTextMessage(cid,27,'Only players of 10st rebirth higher are allowed to pass.') end end return true end
change ....to ur rebirth storageCode:"if getCreatureStorage(cid, 85987) >= 1 then
local REQUIRED_REBIRTHS = 2 --Change this for the number of rebirths
if getCreatureStorage(cid, 133) < REQUIRED_REBIRTHS then
doPlayerSendCancel(cid, "You can only use this spell if you have " .. REQUIRED_REBIRTHS .. " reborns.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
return false
end
<movevent type="Equip" itemid="11111" slot="left-hand" event="script" value="weaponRebirth1.lua"
<movevent type="Equip" itemid="11111" slot="right-hand" event="script" value="weaponRebirth1.lua">
function onEquip(cid, item, slot)
local REQUIRED_REBIRTHS = 1 --Change this for the number of rebirths
if getCreatureStorage(cid, 133) < REQUIRED_REBIRTHS then
doPlayerSendCancel(cid, "You can only use this spell if you have " .. REQUIRED_REBIRTHS .. " reborns.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
return false
end
return true
end
function onCastSpell(cid, var)
local rebirthstorage = xxx
if getCreatureStorage(cid, rebirthstorage) >= 1 then
-- add spell code --
else
doSendMagicEffect(getCreaturePosition(cid), 2)
doPlayerSendCancel(cid, "Your rebirth level must be atleast (number) in order to use this spell"
return false
end
return true
end
did u read my idea??? i give him new ideadid you read the thread's tittle perfectly ?
i need something like when i write !spells i find it there and it should say rebirth 1 to use itdid u read my idea??? i give him new idea
<?xml version="1.0"?>
<npc name="Spell Seller" script="data/npc/scripts/spell_trade.lua" walkinterval="50000" floorchange="0">
<health now="100" max="100"/>
<look type="129" head="95" body="116" legs="121" feet="115" addons="3"/>
<parameters>
<parameter key="message_greet" value="Hello |PLAYERNAME|.I have many {spells} to sell for you! {trade}" />
</parameters>
</npc>
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local shopWindow = {}
local spells = {
{id=1950, buy = 150, name = "Exana Pox", spell = "Andidote", vocations = {1,2,3,4,5,6,7,8}, level = 10},
{id=1950, buy = 2500, name = "Exori", spell = "Berserk", vocations = {4,8}, level = 35},
{id=1950, buy = 80, name = "Exiva", spell = "Find Person", vocations = {1,2,3,4,5,6,7,8}, level = 8},
{id=2182, buy = 5000, name = "Exori Flam", spell = "Flame Strike", vocations = {1,2,5,6}, level = 12},
{id=1950, buy = 8000, name = "Utito Tempo", spell = "Blood Rage", vocations = {4,8}, level = 60},
{id=1950, buy = 2000, name = "Exeta Res", spell = "Challenge", vocations = {8}, level = 20},
{id=1950, buy = 5000, name = "Exori Gran", spell = "Fierce Berserk", vocations = {4,8}, level = 70},
{id=1950, buy = 500, name = "Utevo Gran Lux", spell = "Great Light", vocations = {1,2,3,4,5,6,7,8}, level = 13},
{id=1950, buy = 1500, name = "Exori Mas", spell = "Groundshaker", vocations = {4,8}, level = 33},
{id=1950, buy = 1500, name = "Exana Mort", spell = "Wound Cleansing", vocations = {4,8}, level = 30}
}
local onBuy = function(cid, item, subType, amount, ignoreCap, inBackpacks)
if not getPlayerLearnedInstantSpell(cid, shopWindow[item].Words) then
if getPlayerLevel(cid) >= shopWindow[item].Level then
if isInArray(shopWindow[item].Vocs, getPlayerVocation(cid)) then
doPlayerRemoveMoney(cid, shopWindow[item].Price)
doPlayerLearnInstantSpell(cid, shopWindow[item].Words)
npcHandler:say("You have learned " .. shopWindow[item].Words, cid)
else
npcHandler:say("This spell is not for your vocation.", cid)
end
else
npcHandler:say("You need to obtain a level of " .. shopWindow[item].Level .. " or higher to be able to learn this spell.", cid)
end
else
npcHandler:say("You already know this spell.", cid)
end
return true
end
if msgcontains(msg, 'trade') or msgcontains(msg, 'spells') then
for var, item in pairs(spells) do
shopWindow[item.id] = {Level = item.level, Vocs = item.vocations, Price = item.buy, subType = 0, Words = item.spell, SpellName = item.name}
end
openShopWindow(cid, spells, onBuy, onSell) end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
where do i put the first part and where i put the second part ?I can help you with different idea doesn/'t belong to me.
--------------------------------------------------------------
Well some time ago, I was searching for this, no anwer, you want to know what I did?, I added a NPC Spell Seller by trade, and that spell cost an item that you weren't able to get, and you can put it automatically that when you prestige this item will automatically appear in your Backpack or whatever, the NPC spell seller, is this script
Code:<?xml version="1.0"?> <npc name="Spell Seller" script="data/npc/scripts/spell_trade.lua" walkinterval="50000" floorchange="0"> <health now="100" max="100"/> <look type="129" head="95" body="116" legs="121" feet="115" addons="3"/> <parameters> <parameter key="message_greet" value="Hello |PLAYERNAME|.I have many {spells} to sell for you! {trade}" /> </parameters> </npc>
Code:local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local shopWindow = {} local spells = { {id=1950, buy = 150, name = "Exana Pox", spell = "Andidote", vocations = {1,2,3,4,5,6,7,8}, level = 10}, {id=1950, buy = 2500, name = "Exori", spell = "Berserk", vocations = {4,8}, level = 35}, {id=1950, buy = 80, name = "Exiva", spell = "Find Person", vocations = {1,2,3,4,5,6,7,8}, level = 8}, {id=2182, buy = 5000, name = "Exori Flam", spell = "Flame Strike", vocations = {1,2,5,6}, level = 12}, {id=1950, buy = 8000, name = "Utito Tempo", spell = "Blood Rage", vocations = {4,8}, level = 60}, {id=1950, buy = 2000, name = "Exeta Res", spell = "Challenge", vocations = {8}, level = 20}, {id=1950, buy = 5000, name = "Exori Gran", spell = "Fierce Berserk", vocations = {4,8}, level = 70}, {id=1950, buy = 500, name = "Utevo Gran Lux", spell = "Great Light", vocations = {1,2,3,4,5,6,7,8}, level = 13}, {id=1950, buy = 1500, name = "Exori Mas", spell = "Groundshaker", vocations = {4,8}, level = 33}, {id=1950, buy = 1500, name = "Exana Mort", spell = "Wound Cleansing", vocations = {4,8}, level = 30} } local onBuy = function(cid, item, subType, amount, ignoreCap, inBackpacks) if not getPlayerLearnedInstantSpell(cid, shopWindow[item].Words) then if getPlayerLevel(cid) >= shopWindow[item].Level then if isInArray(shopWindow[item].Vocs, getPlayerVocation(cid)) then doPlayerRemoveMoney(cid, shopWindow[item].Price) doPlayerLearnInstantSpell(cid, shopWindow[item].Words) npcHandler:say("You have learned " .. shopWindow[item].Words, cid) else npcHandler:say("This spell is not for your vocation.", cid) end else npcHandler:say("You need to obtain a level of " .. shopWindow[item].Level .. " or higher to be able to learn this spell.", cid) end else npcHandler:say("You already know this spell.", cid) end return true end if msgcontains(msg, 'trade') or msgcontains(msg, 'spells') then for var, item in pairs(spells) do shopWindow[item.id] = {Level = item.level, Vocs = item.vocations, Price = item.buy, subType = 0, Words = item.spell, SpellName = item.name} end openShopWindow(cid, spells, onBuy, onSell) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
![]()
hope this help you.
Please try to use google search it gonna help you.
ok thanks i did that but how can i put my custom spell in there ?First part, create xml file with npc name and put it into data/npc
Second part create lua file with
spell_trade.lua and put it into data/npc/scripts
{id=1950, buy = 2500, name = "Exori", spell = "Berserk", vocations = {4,8}, level = 35},
how do i know the id ?? i know the spell name scriptof spell and voc and lvl but how do i know the id ??Code:{id=1950, buy = 2500, name = "Exori", spell = "Berserk", vocations = {4,8}, level = 35},
Edit these lines with what you need.
buy =XXXX money
name = "SpellName"
spell = "ScriptOfSpell"
vocations = 1, 5 / 2, 6 / 3, 7 / 4, 8
Level = XXX level u want
how do i know the id ?how do i know the id ?? i know the spell name scriptof spell and voc and lvl but how do i know the id ??