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

!aol and !bless +repp

data/talkaction/script. Make a file called aol, and past this there:
Code:
function onSay(cid, words, param)
local cost = 10000
local item = 2173
local quantity = 1
if doPlayerRemoveMoney(cid, cost) == TRUE then
doPlayerAddItem(cid, item, quantity)
else
doPlayerSendCancel(cid, "You have not enough gold.")
end
return TRUE
end
Talkaction.xml and past this there:
Code:
<talkaction words="!aol" script="buy.lua"/>

Thats for !aol
 
In /data/talkactions/talkaction.xml add
Code:
<talkaction words="!aol" event="script"value="aol.lua" />

in talkactions/script add aol.lua
Code:
function onSay(cid, words, param)
if doPlayerRemoveMoney(cid, 10000) == 1 then
doPlayerAddItem(cid, 2173, 1)
else
			doPlayerSendCancel(cid, 'You don\'t have enough money.')
			doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
		end
		end

EDITED! in talkaction.xml add
Code:
<talkaction words="!bless" event="script" value="bless.lua"/>

in talkactions/script create bless.lua
Code:
function onSay(cid, words, param)
local fail = 0

	if getPlayerLevel(cid) < 31 then
		cost = 2000
	else
		cost = ((getPlayerLevel(cid) - 30) * 200) + 2000
	end
	
	if cost > 20000 then
		cost = 20000
	end

	for i = 1, 5 do
		if getPlayerBlessing(cid, i) then
			fail = fail + 1
		else
			if doPlayerRemoveMoney(cid, cost) == TRUE then
				doPlayerAddBlessing(cid, i)
				if i == 5 and not(fail == 5) then
					doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
				end
			else
				doPlayerSendCancel(cid, "You do not have enough money to buy all the blessings!")
				break
			end
		end
	end
	if fail == 5 then
		doPlayerSendCancel(cid, "You already have all the blessings!")
	end
return TRUE
end
 
aol

Lua:
function onSay (cid, words, param)
if doPlayerRemoveMoney (cid, 10000) == TRUE then
doPlayerAddItem(cid,2173,1)
doSendMagicEffect(getPlayerPosition(cid),12)
doPlayerSendTextMessage(cid,22,"You've bought an Amulet of Loss!")
else
doPlayerSendCancel(cid,"You don't have enough money.")
doSendMagicEffect(getPlayerPosition(cid),2)
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
 
Why does the aol not work? :S

ok, fixed. I guess this one will work.
Code:
function onSay(cid, words, param)
local cost = 10000
local item = 2173
local quantity = 1
if doPlayerRemoveMoney(cid, cost) == TRUE then
doPlayerAddItem(cid, item, quantity)
else
doPlayerSendCancel(cid, "You have not enough gold.")
end
return TRUE
end
 
Code:
local t = {
	itemid = 2173,
	count = 1,
	cost = 10000
}
function onSay(cid, words, param, channel)
	if doPlayerRemoveMoney(cid, t.cost) then
		doPlayerAddItem(cid, t.itemid, t.cost)
		doCreatureSay(cid, "You have bought " .. t.count .. "x " .. getItemNameById(t.itemid) .. " for " .. t.cost .. " gold", TALKTYPE_ORANGE_1, false, cid, getThingPos(cid))
		doSendMagicEffect(getThingPos(cid), CONST_ME_GIFT_WRAPS)
	else
		doPlayerSendCancel(cid, "You need " .. t.cost .. " gold.")
		doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
	end
	return true
end
Code:
<talkaction words="!aol" [B][COLOR="Red"]event="script" value[/COLOR][/B]="aol.lua"/>
 
Back
Top