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

komenda !bless !aol

Status
Not open for further replies.

arczieku

New Member
Joined
Feb 17, 2010
Messages
57
Reaction score
0
Witam. Mam TFS 0.3.6 :) chciałem wprowadzić do siebie na server 2 komendy !aol i !bless żeby nie latać do npc :)

talkaction
Code:
	<talkaction words="!bless" scripts="bless.lua"/>
    <talkaction words="!aol" scripts="aol.lua"/>

aol.lua
Code:
local cost = 10000
local item = 2173
local quantity = 1
function onSay(cid, words, param)
if doPlayerRemoveMoney(cid, cost) == TRUE then
doPlayerAddItem(cid, item, quantity)
else
doPlayerSendCancel(cid, "You haven\'t enough gold.")
end
return TRUE
end

bless.lua

Code:
local bless = {1, 2, 3, 4, 5}
local cost = 50000
function onSay(cid, words, param)
    for i = 1, table.maxn(bless) do
        if(getPlayerBlessing(cid, bless[i])) then
            doPlayerSendCancel(cid, "You have already all blessings.")
            return TRUE
        end
    end
   
    if(doPlayerRemoveMoney(cid, cost) == TRUE) then
        for i = 1, table.maxn(bless) do
            doPlayerAddBlessing(cid, bless[i])
        end
        doCreatureSay(cid, "You are now blessed!" ,19)
        doSendMagicEffect(getPlayerPosition(cid), 49)
    else
        doPlayerSendCancel(cid, "You don\'t have enough money.")
    end
    return TRUE
end

Może ktoś mi pomoc z tym ?? wpisuje !aol i bless i nie działa w grze...:confused::confused:
 
-- !buyaol script by Achlyzyko edited by Budziol z otsy.pl(translate to poland) --

function onSay(cid, words, param)

if doPlayerRemoveMoney(cid, 20000) == TRUE then
doPlayerAddItem(cid, 2173, 1)
doPlayerSendTextMessage(cid, 19,"Kupiles amulet of loss.")
doSendMagicEffect(getPlayerPosition(cid), 19)
else
doPlayerSendCancel(cid, "AOL kosztuje 20k")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end

end


function onSay(cid, words, param)
if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5) then
doPlayerSendCancel(cid,'You have already got one or more blessings!')
else
if doPlayerRemoveMoney(cid, 50000) == TRUE then
doPlayerAddBlessing(cid, 1)
doPlayerAddBlessing(cid, 2)
doPlayerAddBlessing(cid, 3)
doPlayerAddBlessing(cid, 4)
doPlayerAddBlessing(cid, 5)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have been blessed by the gods!')
else
doPlayerSendCancel(cid, "You need 50k to get blessed!")
end
end
return 1
end
 
bless.lua


local bless = {1, 2, 3, 4, 5}
local cost = 20000 -- Cost in gp.

function onSay(cid, words, param)
for i = 1, table.maxn(bless) do
if(getPlayerBlessing(cid, bless)) then
doPlayerSendCancel(cid, "You already have all blessings.")
return TRUE
end
end

if(doPlayerRemoveMoney(cid, cost) == TRUE) then
for i = 1, table.maxn(bless) do
doPlayerAddBlessing(cid, bless)
end
doPlayerSendTextMessage(cid,24, "You have bought all blessings.")
doSendMagicEffect(getPlayerPosition(cid), 28)
else
doPlayerSendCancel(cid, "You don't have enough money.")
end
return TRUE
end


buy.lua (backpack,shovel etc)


local items = {
["backpack"] = {id = 1988, count = 1, cost = 10},
["shovel"] = {id = 2554, count = 1, cost = 50},
["rope"] = {id = 2120, count = 1, cost = 50},
["assassin star"] = {id = 7368, count = 100, cost = 10000},
["aol"] = {id= 2173, count = 1, cost= 20000},
}

function onSay(cid, words, param, channel)
local buyItem = items[param]
if buyItem ~= nil then
if doPlayerRemoveMoney(cid, buyItem.cost) == TRUE then
doPlayerAddItem(cid,buyItem.id,buyItem.count)
doPlayerSendTextMessage(cid,18,"Buy Manager: You bought "..buyItem.count.." "..getItemNameById(buyItem.id).." for "..buyItem.cost.." gold.")
else
doPlayerSendTextMessage(cid,18,"Buy Manager: You need "..buyItem.cost.." gold for "..buyItem.count.." "..getItemNameById(buyItem.id)..".")
end
else
doPlayerSendTextMessage(cid,18,"Buy Manager: Invaild item name.")
end
buyItem = nil
return TRUE
end
 
Aol.lua

Code:
function onSay(cid, words, param)
    if doPlayerRemoveMoney(cid, 50000) == true then
        doPlayerAddItem(cid, 2173, 1)
		doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FIREAREA)
		doPlayerSendCancel(cid, 'You have bought an Amulet of loss.')
    else
        doPlayerSendCancel(cid, 'You don\'t have enough money.')
        doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
    end
end


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


Regards.
 
Status
Not open for further replies.
Back
Top