• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Help! Rebirth Spells

Zinux

New Member
Joined
Nov 4, 2012
Messages
27
Reaction score
0
Hi!

I want a spell to be for XX rebirths but i don't know how to do. Please someone help me!
 
Last edited:
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())




Credits to Critico for the script.
 
xml:

<instant name="Spell Rebirth" words="Exevo Gran Rebirth" lvl="8" maglv="100" mana="1000000" exhaustion="500" prem="1" needlearn="0" blockwalls="0" aggressive="1" event="script" value="Spell Rebirth.lua">
<vocation id="1"/>
<vocation id="2"/>
<vocation id="3"/>
<vocation id="4"/>
<vocation id="5"/>
<vocation id="6"/>
<vocation id="7"/>
<vocation id="8"/>
</instant>

And
Script:
local combat0_Brush = createCombatObject()
setCombatParam(combat0_Brush, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
setCombatParam(combat0_Brush, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
setCombatArea(combat0_Brush,createCombatArea({{0, 0, 0, 0, 1, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 0, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 0, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 0},
{1, 1, 1, 1, 2, 1, 1, 1, 1},
{0, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 0, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 1, 0, 1, 0, 0}}))
setCombatFormula(combat0_Brush, COMBAT_FORMULA_LEVELMAGIC, -12.500, 20, 900, -40000)

local con___combat0_Brush = createConditionObject(1+CONDITION_ENERGY)
addDamageCondition(con___combat0_Brush, -12, 1000, -60000)
setCombatCondition(combat0_Brush, con___combat0_Brush)

local con_LifeDrain__combat0_Brush = createConditionObject(1+CONDITION_ENERGY)
setConditionParam(con_LifeDrain__combat0_Brush, CONDITION_PARAM_HEALTHTICKS, 300)
setCombatCondition(combat0_Brush, con_LifeDrain__combat0_Brush)

local function RunPart(c,cid,var,dirList,dirEmitPos) -- Part
if (isCreature(cid)) then
doCombat(cid, c, var)
if (dirList ~= nil) then -- Emit distance effects
local i = 2;
while (i < #dirList) do
doSendDistanceShoot(dirEmitPos,{x=dirEmitPos.x-dirList,y=dirEmitPos.y-dirList[i+1],z=dirEmitPos.z},dirList[1])
i = i + 2
end
end
end
end

function onCastSpell(cid, var)
local startPos = getCreaturePosition(cid)
RunPart(combat0_Brush,cid,var)
return true
end


I use this kind of spells for rebirths ..
On my server the rebirth is at lv 20000 xp: 2000.0
Reborn at level 100 with skills +100, ml, etc. .. the amount of mana that uses a reborm is much more than a 20000 level without rebirth.
20000's why a player reborn, passed level 100, with twice the mana ..
So you're the only magic could use a reborn being level 100, will have magic levels higher than 20000. Just look at the maximum amount of mana that has a player before rebirth, and put 10000 more mana to use. and will use only the reborm players .. I can not think of anything .. luck!:rolleyes:
 
Back
Top