• 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!

Scripts and Help!

Raston

Evil Fabulist
Joined
Jun 5, 2010
Messages
27
Reaction score
0
Location
Poland
Hello dear users! I need a few scripts and I hope you will help me find them.

1. Correct the script !aol and !bless, because on my server you buy aol, but i takes cash and does not object.

2. Addon Doll - by clicking on a doll gives us all the addons.

3. When you use the mp / smp / gmp disappears bottle (vial).

4. On my server there aren't new outfits (DemonHunter, Asassin and those others.) - How do I do?

5. Scripts for lotteries, the statistics of war, sales figures on Acc Maker.​

Sorry for my english, this is translate text.
 
Last edited:
1. Correct the script !aol and !bless, because on my server you buy aol, but i takes cash and does not object.

talkactions.xml:
Code:
	<talkaction words="!aol" event="script" value="aol.lua"/>
	<talkaction words="!bless" event="script" value="bless.lua"/>
aol.lua
Lua:
function onSay(cid, words, param, channel)
if (getPlayerItemCount(cid, 2160) * 10000 + getPlayerItemCount(cid, 2152) * 100 + getPlayerItemCount(cid, 2148)) >= 10000 then
doPlayerSendTextMessage(cid,25,"Amulet of loss added to your inventory.")
doPlayerRemoveMoney(cid, 10000)
doPlayerAddItem(cid, 2173, 1)
else
doPlayerSendTextMessage(cid,24,"You don't have enough money.")
end
end

bless.lua
Lua:
  function onSay(cid, words, param, channel)
        if getPlayerBlessing(cid, 5) == FALSE then
                if getPlayerMoney(cid) >= 300000 then
                        for i = 1,5 do
                                doPlayerAddBlessing(cid, i)
                        end
                        doSendMagicEffect(getCreaturePosition(cid), 39)
                        doPlayerRemoveMoney(cid, 300000)
                        doPlayerSendTextMessage(cid, 22, "You have been blessed by the gods!")
                else
                        doPlayerSendCancel(cid, "You don't have enough money.")
                        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
                end
        else
                doPlayerSendCancel(cid, "You have already been blessed.")
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
        end
return true
end
 
1.

Lua:
function onSay (cid, words, param, channel)
local cost = 50000
if doPlayerRemoveMoney (cid, cost) then
doPlayerAddItem (cid, 2173)
doPlayerSendTextMessage (cid, 25, "You have bought an Amulet of Loss.")
else
doPlayerSendCancel (cid, "You need to have "..cost.." gold to buy Amulet of Loss!")
end
return true
end
Bless
Lua:
-- !blessing by artofwork
local bless = {1, 2, 3, 4, 5}
local cost = 1000000
local maxlevel = 1000000000

function onSay(cid, words, param)
local lvl = getPlayerLevel(cid)
local new_cost = (lvl * cost) / 500
local target = getPlayerGUID(cid)


	for i = 1, table.maxn(bless) do
		if(getPlayerBlessing(cid, bless[i])) then
			doPlayerSendCancel(cid, "You have already have been blessed.")
			return TRUE
		end
	end
	
	if (getPlayerLevel(cid) >= maxlevel)  then
		if(doPlayerRemoveMoney(cid, new_cost) == TRUE) then
			for i = 1, table.maxn(bless) do
			doPlayerAddBlessing(cid, bless[i])
			doPlayerSendTextMessage(cid,22,"You have been successfully blessed.!")
		end
		else
		doPlayerPopupFYI(cid, "You need "..new_cost.." to buy blessings.")
		end
	
	elseif(getPlayerLevel(cid) < maxlevel) then
		if(doPlayerRemoveMoney(cid, cost) == TRUE) then
			for i = 1, table.maxn(bless) do
			doPlayerAddBlessing(cid, bless[i])
			end
			doPlayerPopupFYI(cid, "You have successfully been blessed.")
		else
			doPlayerPopupFYI(cid, "You need to have "..cost.."gp to buy blessings.")
		end
	end
	return FALSE
end

3.

Lua:
local config = {
    removeOnUse = "yes",
    usableOnTarget = "yes", -- can be used on target? (fe. healing friend)
    splashable = "no",
    realAnimation = "no", -- make text effect visible only for players in range 1x1
    healthMultiplier = 1.0,
    manaMultiplier = 1.0
}

config.removeOnUse = getBooleanFromString(config.removeOnUse)
config.usableOnTarget = getBooleanFromString(config.usableOnTarget)
config.splashable = getBooleanFromString(config.splashable)
config.realAnimation = getBooleanFromString(config.realAnimation)

local POTIONS = {
    [8704] = {empty = 7636, splash = 2, health = {50, 100}}, -- small health potion
    [7618] = {empty = 7636, splash = 2, health = {100, 200}}, -- health potion
    [7588] = {empty = 7634, splash = 2, health = {200, 400}, level = 50, vocations = {3, 4, 7, 8}, vocStr = "knights and paladins"}, -- strong health potion
    [7591] = {empty = 7635, splash = 2, health = {500, 700}, level = 80, vocations = {4, 8}, vocStr = "knights"}, -- great health potion
    [8473] = {empty = 7635, splash = 2, health = {800, 1000}, level = 130, vocations = {4, 8}, vocStr = "knights"}, -- ultimate health potion

    [7620] = {empty = 7636, splash = 7, mana = {70, 130}}, -- mana potion
    [7589] = {empty = 7634, splash = 7, mana = {110, 190}, level = 50, vocations = {1, 2, 3, 5, 6, 7}, vocStr = "sorcerers, druids and paladins"}, -- strong mana potion
    [7590] = {empty = 7635, splash = 7, mana = {200, 300}, level = 80, vocations = {1, 2, 5, 6}, vocStr = "sorcerers and druids"}, -- great mana potion

    [8472] = {empty = 7635, splash = 3, health = {200, 400}, mana = {110, 190}, level = 80, vocations = {3, 7}, vocStr = "paladins"} -- great spirit potion
}

local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local potion = POTIONS[item.itemid]
    if(not potion) then
        return false
    end

    if(not isPlayer(itemEx.uid) or (not config.usableOnTarget and cid ~= itemEx.uid)) then
        if(not config.splashable) then
            return false
        end

        if(toPosition.x == CONTAINER_POSITION) then
            toPosition = getThingPos(item.uid)
        end

        doDecayItem(doCreateItem(2016, potion.splash, toPosition))
        doTransformItem(item.uid, potion.empty)
        return true
    end

    if(hasCondition(cid, CONDITION_EXHAUST)) then
        doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
        return true
    end

    if(((potion.level and getPlayerLevel(cid) < potion.level) or (potion.vocations and not isInArray(potion.vocations, getPlayerVocation(cid)))) and
        not getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES))
    then
        doCreatureSay(itemEx.uid, "Only " .. potion.vocStr .. (potion.level and (" of level " .. potion.level) or "") .. " or above may drink this fluid.", TALKTYPE_ORANGE_1)
        return true
    end

    local health = potion.health
    if(health and not doCreatureAddHealth(itemEx.uid, math.ceil(math.random(health[1], health[2]) * config.healthMultiplier))) then
        return false
    end

    local mana = potion.mana
    if(mana and not doPlayerAddMana(itemEx.uid, math.ceil(math.random(mana[1], mana[2]) * config.manaMultiplier))) then
        return false
    end

    doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
    if(not realAnimation) then
        doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
    else
        for i, tid in ipairs(getSpectators(getCreaturePosition(cid), 1, 1)) do
            if(isPlayer(tid)) then
                doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1, false, tid)
            end
        end
    end

    doAddCondition(cid, exhaust)
    if(not potion.empty or config.removeOnUse) then
        doRemoveItem(item.uid)
        return true
    end

    doTransformItem(item.uid, potion.empty)
    return true
end
actions.xml
Code:
	<action itemid="7588-7591;8472-8473;8704" event="script" value="liquids/potions.lua"/>
 
2. Addon Doll - by clicking on a doll gives us all the addons.
actions.xml
Code:
<action itemid="[COLOR="Red"]itemID[/COLOR]" event="script" value="other/addonitem.lua/>

other/addonitem.lua
Lua:
function onUse(cid, item, fromPosition)
	doPlayerAddAddons(cid,1)	
	doPlayerAddAddons(cid,2)
	doSendMagicEffect(fromPosition, CONST_ME_GIFT_WRAPS)
   return true
end
itemID - change to ID which item need to be used to add addons



--------------------
4. On my server there aren't new outfits (DemonHunter, Asassin and those others.) - How do I do?
If you have TFS!
Go to a SVN site of TFS (http://svn.otland.net/public/forgottenserver/tags/0.3.6pl1/data/XML/outfits.xml), direct download the outfis.xml and replace the file. (make a backup of your old file first).
 
Last edited:
if you wanna a good aol, bless scripts use this from Djivar.. But hes to fast in being dumb to understand that its good for the server to use one script insted of two.

Lua:
  function onSay(cid, words, param, channel)
	for param="!bless" then
        if getPlayerBlessing(cid, 5) == FALSE then
                if getPlayerMoney(cid) >= 300000 then
                        for i = 1,5 do
                                doPlayerAddBlessing(cid, i)
                        end
                        doSendMagicEffect(getCreaturePosition(cid), 39)
                        doPlayerRemoveMoney(cid, 300000)
                        doPlayerSendTextMessage(cid, 22, "You have been blessed by the gods!")
                else
                        doPlayerSendCancel(cid, "You don't have enough money.")
                        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
                end
        else
                doPlayerSendCancel(cid, "You have already been blessed.")
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
        end
else
	for param="!aol" then
if (getPlayerItemCount(cid, 2160) * 10000 + getPlayerItemCount(cid, 2152) * 100 + getPlayerItemCount(cid, 2148)) >= 10000 then
doPlayerSendTextMessage(cid,25,"Amulet of loss added to your inventory.")
doPlayerRemoveMoney(cid, 10000)
doPlayerAddItem(cid, 2173, 1)
else
doPlayerSendTextMessage(cid,24,"You don't have enough money.")
end
end
return true
end
 
Back
Top