• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Releasing Riptide Scripts - Request what you want.

Should i give out more scripts like this?

  • Yes - Post more they are useful!

    Votes: 9 75.0%
  • No - No need of scripts like this!

    Votes: 2 16.7%
  • They suck - don't post anything else!

    Votes: 1 8.3%

  • Total voters
    12

RosOT

Who am i?
Joined
Feb 12, 2013
Messages
714
Reaction score
137
Location
Canada
CLICK HERE TO CHECK OUT MY KITTEN PHOTO GALLERY!!! NO IM NOT GAY LOL CATS ARE JUST AWESOME :)
Click spoiler - Don't be scared?
super-cute-kitten.jpg

This is just a simple little system i threw together to spice up the rebirth/prestige system. Ill try to explain it as much as i can but bare with me.


Click to view - Ingame prestige shop scripts.
Ok first add this to Data/Lib/050-function.lua anywhere at the bottom should be fine.
Code:
-- Prestige Points --
function getPlayerPrestigeP(cid)
    local Info = db.getResult("SELECT `Prestige Points` FROM `players` WHERE `id` = " .. getPlayerGUID(cid) .. " LIMIT 1")
        if Info:getID() ~= LUA_ERROR then
        local presp= Info:getDataInt("Prestige Points")
        Info:free()
        return presp
    end
     return LUA_ERROR
end

function doAddPrestigeP(cid, presp)
    db.executeQuery("UPDATE `players` SET `Prestige Points` = `Prestige Points` + " .. presp .. " WHERE `id` = " .. getPlayerGUID(cid) .. ";")
end

function doRemovePrestigep(cid, presp)
    db.executeQuery("UPDATE `players` SET `Prestige Points` = `Prestige Points` - " .. presp .. " WHERE `id` = " .. getPlayerGUID(cid) .. ";")
end
2. Now your going to want to add the mysql query so you have the points stored in mysql.
Code:
ALTER TABLE `players` ADD `Prestige Points` INT NOT NULL DEFAULT 0;
3. Now you can add this script to Data/Actions/TestLever.lua "Name it what ever you want idc".
(This is just a simple one that takes 1 Prestige Point and add's 1 premium day to the player.)

Code:
local pp = 1
local cancelmsg = "You need "..pp.." prestige points."
local buymsg = "Congratulations! You have recieved 1 day of premium for "..pp.." Prestige point."
local Message = "You need "..pp.." coins to buy this item."


function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerPrestigeP(cid) < pp then
doPlayerSendTextMessage(cid,19,cancelmsg)
elseif getPlayerPrestigeP (cid) >= pp then
doCreatureSay(cid, buymsg, TALKTYPE_ORANGE_1)
doRemovePrestigep(cid, pp)
doPlayerAddPremiumDays(cid, 1)
else
doPlayerSendTextMessage(cid,19,Message)
end
return true
end
(You dont need this but i use it to give players 1 prestige point. add this to action scripts aswell)
Code:
    function onUse(cid, item, fromPosition, itemEx, toPosition)
        if getPlayerFreeCap(cid) >= 65 then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You added +1 prestige point to your player.")
            doAddPrestigeP(cid, 1)
            doRemoveItem(item.uid, 1)
        else
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You just cant use this.")
        end
        return true
    end

If you want to make quests to give prestige points or a prestige npc just add this into the npc or script you wanna put it into.
Code:
doAddPrestigeP(cid, #amount of points)
 
Last edited:
CLICK HERE TO CHECK OUT MY KITTEN PHOTO GALLERY!!! NO IM NOT GAY LOL CATS ARE JUST AWESOME :)
Click spoiler - Don't be scared?
super-cute-kitten.jpg


Actions - Item upgrade (The Little Box to upgrade items)

Make a new Lua file in Data/Actions/Upgrade.lua and put this code in the file.
Code:
local item_config = {
--Tier:1--
{{{2457,0}}, {{2482,0}, {8303,1}}}, --Helmet
{{{2463,0}}, {{2484,0}, {8303,1}}}, --Armor
{{{2647,0}}, {{2468,0}, {8303,1}}}, --legs
{{{2521,0}}, {{2526,0}, {8303,1}}}, --Shield
{{{2306,1}}, {{2305,1}, {8303,1}}}, --hprune
{{{2274,1}}, {{2273,1}, {8303,1}}}, --mprune
{{{2383,0}}, {{2395,0}, {8303,5}}}, --Sword
{{{2404,0}}, {{2403,0}, {8303,5}}}, --Dagger
{{{7378,1}}, {{2389,1}, {8303,5}}}, --Distance
{{{7387,0}}, {{2423,0}, {8303,5}}}, --Wand

--Tier:2--
{{{2490,0}}, {{2457,0}, {12449,1}}}, --Helmet
{{{2476,0}}, {{2463,0}, {12449,1}}}, --Armor
{{{2477,0}}, {{2647,0}, {12449,1}}}, --legs
{{{2529,0}}, {{2521,0}, {12449,1}}}, --Shield
{{{2307,1}}, {{2306,1}, {12449,1}}}, --hprune
{{{2275,1}}, {{2274,1}, {12449,1}}}, --mprune

{{{2384,0}}, {{2383,0}, {12449,5}}}, --Sword
{{{2379,0}}, {{2404,0}, {12449,5}}}, --Dagger
{{{3965,1}}, {{7378,1}, {12449,5}}}, --Distance
{{{2437,0}}, {{7387,0}, {12449,5}}}, --Wand
--Tier:3--
{{{2491,0}}, {{2490,0}, {12403,1}}}, --Helmet
{{{2487,0}}, {{2476,0}, {12403,1}}}, --Armor
{{{2488,0}}, {{2477,0}, {12403,1}}}, --legs
{{{2519,0}}, {{2529,0}, {12403,1}}}, --Shield
{{{2308,1}}, {{2307,1}, {12403,1}}}, --hprune
{{{2276,1}}, {{2275,1}, {12403,1}}}, --mprune

{{{2392,0}}, {{2384,0}, {12403,5}}}, --Sword
{{{2350,0}}, {{2379,0}, {12403,5}}}, --Dagger
{{{7367,1}}, {{3965,1}, {12403,5}}}, --Distance
{{{7437,0}}, {{2437,0}, {12403,5}}}, --Wand
--Tier:4--
{{{7939,0}}, {{2491,0}, {12406,1}}}, --Helmet
{{{7899,0}}, {{2487,0}, {12406,1}}}, --Armor
{{{7894,0}}, {{2488,0}, {12406,1}}}, --legs
{{{8906,0}}, {{2519,0}, {12406,1}}}, --Shield
{{{2302,1}}, {{2308,1}, {12406,1}}}, --hprune
{{{2270,1}}, {{2276,1}, {12406,1}}}, --mprune

{{{7419,0}}, {{2392,0}, {12406,5}}}, --Sword
{{{2402,0}}, {{2350,0}, {12406,5}}}, --Dagger
{{{7840,1}}, {{7367,1}, {12406,5}}}, --Distance
{{{7379,0}}, {{7437,0}, {12406,5}}} --Wand
}

local pos_1 = {x = 1143, y = 1085, z = 6}
local pos_2 = {x = 1145, y = 1085, z = 6}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local create_item_pos = pos_2
    local container = getTileItemByType(pos_1, ITEM_TYPE_CONTAINER)
    if(container.uid == 0 or not(isContainer(container.uid))) then
        create_item_pos = pos_1
        container = getTileItemByType(pos_2, ITEM_TYPE_CONTAINER)
    end
    if(container.uid == 0 or not(isContainer(container.uid))) then
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "Put the material and current tier item into the box.")
        return FALSE
    end
    items_in_container = {}
    item_slot = 0
    while(true) do
        item_in = getContainerItem(container.uid, item_slot)
        if item_in.itemid > 0 then
            table.insert(items_in_container, item_in)
        else
            break
        end
        item_slot = item_slot+1
    end
    local fusion_id = 0
    for i = 1, table.getn(item_config) do
        fusion_items = item_config[i]
        items_create = fusion_items[1]
        items_required = fusion_items[2]
        local tmp_items_required = {}
        for s = 1, table.getn(items_required) do
            table.insert(tmp_items_required, items_required[s])
        end
        if(table.getn(items_in_container) == table.getn(tmp_items_required)) then
            for c = 1, table.getn(items_in_container) do
                local item_in_container = items_in_container[c]
                for r = 1, table.getn(tmp_items_required) do
                    local item_required = tmp_items_required[r]
                    if(item_in_container.itemid == item_required[1] and item_in_container.type == item_required[2] and (item_required["actionid"] == nil or item_required["actionid"] == item_in_container.actionid)) or (item_required["recipe"] ~= nil and item_required["recipe"] == item_in_container.actionid and getItemDescriptions(item_in_container.uid).text ~= '') then
                        table.remove(tmp_items_required, r)
                        break
                    end
                end
            end
            if(table.getn(tmp_items_required) == 0) then
                fusion_id = i
                break
            end
        end
    end
    if(fusion_id > 0) then
        while(true) do
            item_in = getContainerItem(container.uid, 0)
            if item_in.uid > 0 then
                doRemoveItem(item_in.uid)
            else
                break
            end
        end
        for u = 1, table.getn(items_create) do
            local item_to_create = items_create[u]
            local new_item_uid = doCreateItemEx(item_to_create[1], item_to_create[2])
            doTileAddItemEx(create_item_pos, new_item_uid)
            if(item_to_create["actionid"] ~= nil) then
                doSetItemActionId(new_item_uid, item_to_create["actionid"])
            end
            if(item_to_create["name"] ~= nil) then
                setItemName(new_item_uid, item_to_create["name"])
            end
            if(item_to_create["description"] ~= nil) then
                doSetItemSpecialDescription(new_item_uid, item_to_create["description"])
            end
            if(item_to_create["attack"] ~= nil) then
                setItemAttack(new_item_uid, getItemAttack(new_item_uid)+item_to_create["attack"])
            end
            if(item_to_create["extraAttack"] ~= nil) then
                setItemExtraAttack(new_item_uid, getItemExtraAttack(new_item_uid)+item_to_create["extraAttack"])
            end
            if(item_to_create["defense"] ~= nil) then
                setItemDefense(new_item_uid, getItemDefense(new_item_uid)+item_to_create["defense"])
            end
            if(item_to_create["extraDefense"] ~= nil) then
                setItemExtraDefense(new_item_uid, getItemExtraDefense(new_item_uid)+item_to_create["extraDefense"])
            end
            if(item_to_create["armor"] ~= nil) then
                setItemArmor(new_item_uid, getItemArmor(new_item_uid)+item_to_create["armor"])
            end
            --if(item_to_create["attackSpeed"] ~= nil) then
            --    setItemAttackSpeed(new_item_uid, getItemAttackSpeed(new_item_uid)+item_to_create["attackSpeed"])
            --end
            if(item_to_create["hitChance"] ~= nil) then
                setItemHitChance(new_item_uid, getItemHitChance(new_item_uid)+item_to_create["hitChance"])
            end
            if(item_to_create["shootRange"] ~= nil) then
                setItemShootRange(new_item_uid, getItemShootRange(new_item_uid)+item_to_create["shootRange"])
            end
        end
        doSendMagicEffect(pos_1,CONST_ME_FIREATTACK)
        doSendMagicEffect(pos_2,CONST_ME_TUTORIALSQUARE)
        doSendMagicEffect(getPlayerPosition(cid),CONST_ME_GROUNDSHAKER)
    else
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "You need 1 material and the tier item to go with it to upgrade. (Example: Tier 1 helmet + Elder Terragon Soul = Tier 2 Helmet.")
        doSendMagicEffect(pos_1,CONST_ME_TUTORIALARROW)
    end
    if(item.itemid == 1945) then
        doTransformItem(item.uid,item.itemid+1)
    elseif(item.itemid == 1946) then
        doTransformItem(item.uid,item.itemid-1)
    end
    return TRUE
end
Then add this code to actions.xml anywhere according to how you did it.
Code:
<action actionid="8000" event="script" value="new/upgrade.lua"/>
 
Last edited:
CLICK HERE TO CHECK OUT MY KITTEN PHOTO GALLERY!!! NO IM NOT GAY LOL CATS ARE JUST AWESOME :)
Click spoiler - Don't be scared?
super-cute-kitten.jpg


Legendary prestige npc

Put this badboy in Data/Npcs/NPC NAME.XML
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Legend Master" script="Legend.lua" walkinterval="0" floorchange="0">
    <health now="100" max="100"/>
    <look type="300" head="114" body="0" legs="11" feet="0" addons="3" corpse="2212"/>
    <parameters>
        <parameter key="message_greet" value="Hello |PLAYERNAME|. Would you like to become a {Legend}?!"/>
        <parameter key="message_farewell" value="Cya later!"/>
    </parameters>
</npc>
Then goto scripts folder and add/make this Legend.LUA
Code:
local config = {
    price = 0, -- Price of first Prestige
    priceIncrease = 10000, -- Works as 'price' + current Prestiges * priceIncrease.
    LegendLevel = 500, -- Level for first Prestige.
    LegendIncrease = 0, -- Works as 'PrestigeLevel' + current Prestiges * PrestigeIncrease.
    maxLegend = 500, -- Number of times a player can Prestige.
    level = 8, -- The level the player is set to apon Prestige.
    Legend = 1, -- The prestige the player is set to apon Prestige.
    healthPercent = 1.00, -- 1.00 = 100%.
    health = 100, -- Only used if 'healthPercent' = 0.
    manaPercent = 1.00, -- 1.00 = 100%.
    mana = 100, -- Only used if 'manaPercent' = 0.
    keepSkills = true, -- Wether players keep skills and level apon Prestige.
    skillLevel = 10, -- Only used if 'keepSkills' = false.
    magicLevel = 0, -- Only used if 'keepSkills' = false.
    capacity = 10000, -- The capacity players are set to apon Prestige.
    templePos = {x = 0, y = 0, z = 0}, -- The place where players reset to should there town id return 0.
    Legend = 1 -- how many Legend player will get.
}

local focuses = {}
local function isFocused(cid)
    for i, v in pairs(focuses) do
        if(v == cid) then
            return true
        end
    end
    return false
end

local function addFocus(cid)
    if(not isFocused(cid)) then
        table.insert(focuses, cid)
    end
end
local function removeFocus(cid)
    for i, v in pairs(focuses) do
        if(v == cid) then
            table.remove(focuses, i)
            break
        end
    end
end
local function lookAtFocus()
    for i, v in pairs(focuses) do
        if(isPlayer(v)) then
            doNpcSetCreatureFocus(v)
            return
        end
    end
    doNpcSetCreatureFocus(0)
end

function onCreatureDisappear(cid)
    if(isFocused(cid)) then
        selfSay("Goodbye.")
        removeFocus(cid)
    end
end


function onCreatureSay(cid, type, msg)
    if((msg == "hi") and not (isFocused(cid))) then
        selfSay("Welcome, ".. getCreatureName(cid) ..".", cid, true)
        selfSay("Im in charge of the {legend} system. If you want to become a {legend} just say {leg}.", cid)
        addFocus(cid)
        status = 1
    elseif((isFocused(cid)) and (msg == "legend")  or (msg == "Legend") or (msg == "leg")  and (status == 1)) then
              if(isInArray({1,2,3,4,5, 6, 7, 8,9,10,11,12}, getPlayerVocation(cid))) then
        if (getPlayerLPrestiges(cid, config.Legend) < config.maxLegend) then
            Legend = getPlayerLPrestiges(cid, config.Legend)
            LegendLevel = config.Legend + (config.LegendIncrease * Legend)
            if (getPlayerPrestige(cid) >= LegendLevel) then
                money = config.price + (config.priceIncrease * Legend)
                if (getPlayerMoney(cid) >= money) then
                    selfSay("Once you become a legend you will need to get prestige 500 again?", cid)
                    status = 2
                else
                    selfSay("You need at least " .. money .. " gold before you can become a legend.", cid)
                    status = 1
                end
                else
                    selfSay("You need to be at least Prestige 500 before you can become a legend.", cid)
                status = 1
                end
            else
            selfSay("It seems like you cannot get anymore Legend Prestiges because you reached the limit.", cid)
            status = 1
            end
        else
            selfSay("Please get promotion first.", cid)
            status = 1
        end
    elseif((isFocused(cid)) and (msg == "yes") and (status == 2)) then
        selfSay("Ok then i will give you 1 legend.", cid)
        selfSay("You will now be logged out.", cid)
        doPlayerRemoveMoney(cid, money)
        addEvent(doLegendPlayer, 0, {cid=cid})
        removeFocus(cid)
    elseif((isFocused(cid)) and (msg == "no") and (status == 2)) then
        selfSay("Maybe one day you will wise up and change your mind!", cid)
        status = 1
    elseif((isFocused(cid)) and (msg == "bye" or msg == "goodbye" or msg == "cya")) then
        selfSay("Goodbye!", cid, true)
        removeFocus(cid)
    end
end

function onPlayerCloseChannel(cid)
    if(isFocused(cid)) then
        selfSay("Goodbye.")
        removeFocus(cid)
    end
end

function onThink()
    for i, focus in pairs(focuses) do
        if(not isCreature(focus)) then
            removeFocus(focus)
        else
            local distance = getDistanceTo(focus) or -1
            if((distance > 4) or (distance == -1)) then
                selfSay("Goodbye.")
                removeFocus(focus)
            end
        end
    end
    lookAtFocus()
end

function doLegendPlayer(cid)
    cid = cid.cid
    if (cid == nil) then
        return true
    end

    local guid = getPlayerGUID(cid)

    if (config.healthPercent > 0) then
        health = getCreatureMaxHealth(cid) * config.healthPercent
    else
        health = config.health
    end
    if (config.manaPercent > 0) then
        mana = getCreatureMaxMana(cid) * config.manaPercent
    else
        mana = config.mana
    end
    if (getPlayerTown(cid) > 0) then
        pos = getTownTemplePosition(getPlayerTown(cid))
    else
        pos = config.templePos
end

    doAddLPrestiges(cid, config.Legend, getPlayerLPrestiges(cid, config.Legend) + 1)
    doRemovePrestige(cid, 500)
    doRemoveCreature(cid, true)
    db.executeQuery("UPDATE `players` SET level = " .. config.level .. ", health = " .. health .. ", healthmax = " .. health .. ", mana = " .. mana .. ", manamax = " .. mana .. ", posx = " .. pos.x .. ", posy = " .. pos.y .. ", posz = " .. pos.z .. ", cap = " .. config.capacity .. " WHERE id = " .. guid)

    if (not config.keepSkills) then
        db.executeQuery("UPDATE `players` SET maglevel = " .. config.magicLevel .. " WHERE id = " .. guid .. ";")
        db.executeQuery("UPDATE `player_skills` SET value = " .. config.skillLevel .. " WHERE id = " .. guid .. ";")
    end
    return true
end
 
Last edited:
CLICK HERE TO CHECK OUT MY KITTEN PHOTO GALLERY!!! NO IM NOT GAY LOL CATS ARE JUST AWESOME :)
Click spoiler - Don't be scared?
super-cute-kitten.jpg


prestige Master npc

Put this badboy in Data/Npcs/NPC NAME.XML
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Prestige Master" script="prestige.lua" walkinterval="0" floorchange="0">
    <health now="100" max="100"/>
    <look type="300" head="114" body="0" legs="11" feet="0" addons="3" corpse="2212"/>
    <parameters>
        <parameter key="message_greet" value="Hello |PLAYERNAME|. Do you want to {Prestige}?!"/>
        <parameter key="message_farewell" value="Cya later!"/>
    </parameters>
</npc>
</npc>
Then goto scripts folder and add/make this Prestige.LUA
Code:
local config = {
    price = 0, -- Price of first Prestige
    priceIncrease = 10000, -- Works as 'price' + current Prestiges * priceIncrease.
    PrestigeLevel = 500, -- Level for first Prestige.
    PrestigeIncrease = 0, -- Works as 'PrestigeLevel' + current Prestiges * PrestigeIncrease.
    maxPrestiges = 5000, -- Number of times a player can Prestige.
    level = 8, -- The level the player is set to apon Prestige.
    healthPercent = 1.00, -- 1.00 = 100%.
    health = 100, -- Only used if 'healthPercent' = 0.
    manaPercent = 1.00, -- 1.00 = 100%.
    mana = 100, -- Only used if 'manaPercent' = 0.
    keepSkills = true, -- Wether players keep skills and level apon Prestige.
    skillLevel = 10, -- Only used if 'keepSkills' = false.
    magicLevel = 0, -- Only used if 'keepSkills' = false.
    capacity = 10000, -- The capacity players are set to apon Prestige.
    templePos = {x = 0, y = 0, z = 0}, -- The place where players reset to should there town id return 0.
    Prestige = 1 -- how many Prestige player will get.
}

local focuses = {}
local function isFocused(cid)
    for i, v in pairs(focuses) do
        if(v == cid) then
            return true
        end
    end
    return false
end

local function addFocus(cid)
    if(not isFocused(cid)) then
        table.insert(focuses, cid)
    end
end
local function removeFocus(cid)
    for i, v in pairs(focuses) do
        if(v == cid) then
            table.remove(focuses, i)
            break
        end
    end
end
local function lookAtFocus()
    for i, v in pairs(focuses) do
        if(isPlayer(v)) then
            doNpcSetCreatureFocus(v)
            return
        end
    end
    doNpcSetCreatureFocus(0)
end

function onCreatureDisappear(cid)
    if(isFocused(cid)) then
        selfSay("Goodbye.")
        removeFocus(cid)
    end
end

 
function onCreatureSay(cid, type, msg)
    if((msg == "hi") and not (isFocused(cid))) then
        selfSay("Welcome, ".. getCreatureName(cid) ..".", cid, true)
        selfSay("Im in charge of the {Prestige} system. If you want to {Prestige} just say {Pres}.", cid)
        addFocus(cid)
        status = 1
    elseif((isFocused(cid)) and (msg == "prestige")  or (msg == "prestige") or (msg == "pres")  and (status == 1)) then
              if(isInArray({1,2,3,4,5, 6, 7, 8,9,10,11,12}, getPlayerVocation(cid))) then
        if (getPlayerPrestige(cid, config.Prestige) < config.maxPrestiges) then
            Prestige = getPlayerPrestige(cid, config.Prestige)
            PrestigeLevel = config.PrestigeLevel + (config.PrestigeIncrease * Prestige)
            if (getPlayerLevel(cid) >= PrestigeLevel) then
                money = config.price + (config.priceIncrease * Prestige)
                if (getPlayerMoney(cid) >= money) then
                    selfSay("Once you Prestige you will have to level up again from the beginning! Are you sure you still want to Prestige?", cid)
                    status = 2
                else
                    selfSay("You need at least " .. money .. " gold before you can Prestige.", cid)
                    status = 1
                end
                else
                    selfSay("You need to be at least level " .. PrestigeLevel .. " before you can Prestige.", cid)
                status = 1
                end
            else
            selfSay("It seems you can not Prestige anymore you are max Prestige .", cid)
            status = 1
            end
        else
            selfSay("Please get promotion first.", cid)
            status = 1
        end
    elseif((isFocused(cid)) and (msg == "yes") and (status == 2)) then
        selfSay("Ok then i will Prestige you.", cid)
        selfSay("You will now be logged out.", cid)
        doPlayerRemoveMoney(cid, money)
        addEvent(doPrestigePlayer, 0, {cid=cid})
        removeFocus(cid)
    elseif((isFocused(cid)) and (msg == "no") and (status == 2)) then
        selfSay("Maybe one day you will wise up and change your mind!", cid)
        status = 1
    elseif((isFocused(cid)) and (msg == "bye" or msg == "goodbye" or msg == "cya")) then
        selfSay("Goodbye!", cid, true)
        removeFocus(cid)
    end
end

function onPlayerCloseChannel(cid)
    if(isFocused(cid)) then
        selfSay("Goodbye.")
        removeFocus(cid)
    end
end

function onThink()
    for i, focus in pairs(focuses) do
        if(not isCreature(focus)) then
            removeFocus(focus)
        else
            local distance = getDistanceTo(focus) or -1
            if((distance > 4) or (distance == -1)) then
                selfSay("Goodbye.")
                removeFocus(focus)
            end
        end
    end
    lookAtFocus()
end

function doPrestigePlayer(cid)
    cid = cid.cid
    if (cid == nil) then
        return true
    end

    local guid = getPlayerGUID(cid)

    if (config.healthPercent > 0) then
        health = getCreatureMaxHealth(cid) * config.healthPercent
    else
        health = config.health
    end
    if (config.manaPercent > 0) then
        mana = getCreatureMaxMana(cid) * config.manaPercent
    else
        mana = config.mana
    end
    if (getPlayerTown(cid) > 0) then
        pos = getTownTemplePosition(getPlayerTown(cid))
    else
        pos = config.templePos
end

    doAddPrestige(cid, config.Prestige, getPlayerPrestige(cid, config.Prestige) + 1)
    doAddPrestigeP(cid, 1)
    doRemoveCreature(cid, true)
    db.executeQuery("UPDATE `players` SET level = " .. config.level .. ", health = " .. health .. ", healthmax = " .. health .. ", mana = " .. mana .. ", manamax = " .. mana .. ", posx = " .. pos.x .. ", posy = " .. pos.y .. ", posz = " .. pos.z .. ", cap = " .. config.capacity .. " WHERE id = " .. guid)
 
    if (not config.keepSkills) then
        db.executeQuery("UPDATE `players` SET maglevel = " .. config.magicLevel .. " WHERE id = " .. guid .. ";")
        db.executeQuery("UPDATE `player_skills` SET value = " .. config.skillLevel .. " WHERE id = " .. guid .. ";")
    end
    return true
end
 
Last edited:
CLICK HERE TO CHECK OUT MY KITTEN PHOTO GALLERY!!! NO IM NOT GAY LOL CATS ARE JUST AWESOME :)
Click spoiler - Don't be scared?
super-cute-kitten.jpg


Automatic bless onlogin (Prestige 50 and under)
Creaturescripts/bless.lua
Code:
local config = {
        Prestige = 50,
        text = "You will get free bless until you reach prestige 50!"
}
       
function onLogin(cid)
if(getPlayerPrestige(cid) <= config.Prestige and not getPlayerBlessing(cid,1)) then
for b=1, 5 do
doPlayerAddBlessing(cid, b)
end
doCreatureSay(cid, 'BLESS', TALKTYPE_ORANGE_1)
doSendMagicEffect(getThingPosition(cid), CONST_ME_HOLYDAMAGE)
doPlayerSendTextMessage(cid, 19, config.text)
end
return true
end
add this to onlogin.lua
Code:
registerCreatureEvent(cid, "Bless")
add this to creaturescripts.xml
Code:
<event type="login" name="bless" event="script" value="bless.lua"/>
 
Last edited:
Would not click that link! :p
Whys that :)
HWayMVv.png

Im not gay bro just like to troll :)
So much fun if you make an awesome exit from a gaming community trolls for life.
Btw your now on the kitty photo gallery for life lmfao~
 
Last edited:
Nice work!
Thank you, I'm quite sure a lot of people will learn more about scripting for an ot just because people like yourself are contributing their work to the community! :)
 
Back
Top