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

All Commands!!!

Amiroslo

Excellent OT User
Joined
Jul 28, 2009
Messages
6,801
Solutions
6
Reaction score
809
i thought if some one can give me a full fixed commands.xml with all commands like
!spells
!bless
!afk
!buy
!hunt
!tp
!buyhouse
!sellhouse
house commands
and all the commands
then put the lua file for each command
Thanks
 
Bless.lua
LUA:
local bless = {1, 2, 3, 4, 5}
local cost = 50000 -- Cost in gp.
local maxlevel = 1000

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 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,19,"You have successfully all blessing , now do not need aol.")
end
else
doPlayerSendTextMessage(cid,19,"You need to have "..new_cost.."gp 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
doPlayerSendTextMessage(cid,19,"You have successfully been blessed.")
else
doPlayerSendTextMessage(cid,19,"You need to have "..cost.."gp to buy blessings.")
end
end
return FALSE
end

LUA:
<talkaction words="!bless" event="script" value="bless.lua" />

!buyhouse
LUA:
local config = {
	teleportAccess = 3
}

function onSay(cid, words, param, channel)
	if(param == '') then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
		return true
	end

	local teleport = false
	local t = string.explode(param, ",")
	if(t[2]) then
		teleport = getBooleanFromString(t[2])
		param = t[1]
	end

	local house = getHouseByPlayerGUID(getPlayerGUIDByName(param))
	if(not house) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " does not own house or doesn't exists.")
		return true
	end

	local houseInfo = getHouseInfo(house)
	if(teleport and getPlayerAccess(cid) >= config.teleportAccess) then
		doTeleportThing(cid, houseInfo.entry)
	end

	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, param .. " owns house: " .. houseInfo.name .. ".")
	return true
end

LUA:
<talkaction words="!buyhouse" filter="word-spaced" event="function" value="houseBuy"/>

!sellhouse

LUA:
function onSay(cid, words, param, channel)
	local house = getHouseFromPos(getCreaturePosition(cid))
	if(not house) then
		doPlayerSendCancel(cid, "You are not inside a house.")
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
		return false
	end

	local owner = getHouseInfo(house).owner
	if(owner ~= getPlayerGUID(cid) and (owner ~= getPlayerGuildId(cid) or getPlayerGuildLevel(cid) ~= GUILDLEVEL_LEADER)) then
		doPlayerSendCancel(cid, "You are not the owner of this house.")
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
		return false
	end

	setHouseOwner(house, 0)
	doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_BLUE)
	return false
end

LUA:
<talkaction words="!sellhouse" filter="word-spaced" event="function" value="houseSell"/>

!afk

LUA:
local time = 3 -- Seconds
local say_events = {}
local function SayText(cid)
    if isPlayer(cid) == TRUE then
         if say_events[getPlayerGUID(cid)] ~= nil then
             if isPlayer(cid) == TRUE then
                 doSendAnimatedText(getPlayerPosition(cid),"AFK", math.random(01,255))
             end
             say_events[getPlayerGUID(cid)] = addEvent(SayText, time * 1000 / 2, cid)       
         end                                                       
    end
    return TRUE
end

local storage = 38417
function onSay(cid, words, param, channel)
local afkCheck = getPlayerStorageValue(cid, storage)
    if(param == "") then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
    return TRUE
    end
     if (param == "on") then
        if (afkCheck == -1) then
            if (isPlayer(cid) == TRUE) then
                doSendAnimatedText(getPlayerPosition(cid),"AFK", math.random(01,255))
            end
            say_events[getPlayerGUID(cid)] = addEvent(SayText, time * 1000, cid)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You are now AFK.")
            doCreatureSetNoMove(cid, true)
            setPlayerStorageValue(cid, storage, 1)
        else
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are already AFK.")
        end
     elseif (param == "off") then
        stopEvent(say_events[getPlayerGUID(cid)])
        say_events[getPlayerGUID(cid)] = nil
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Welcome Back!")
        doCreatureSetNoMove(cid, false)
        setPlayerStorageValue(cid, storage, -1)
    end
    return TRUE
end

LUA:
<talkaction words="!afk" event="script" value="afk.lua"/>

Remember commands:
1-!afk on (For Start the Script)
2-!afk off (For Stop the Script)

!tp nuub
LUA:
local config = {
        exhaustionInSeconds = 420,
        storage = 36531
}
function onSay(cid, words, param)
local player = getPlayerByName(param)
if(isPlayer(player) == TRUE) then
if(exhaustion.check(cid, config.storage) == TRUE) then
                doPlayerSendCancel(cid, "You can teleport players only 1 time per " .. config.exhaustionInSeconds .. " seconds.")
                return TRUE
        end
 if (getPlayerLevel(cid) > 50) then
  if (getPlayerLevel(player) <= 50) then
   if(doPlayerAddSoul(cid, -100) == TRUE) then
    exhaustion.set(cid, config.storage, config.exhaustionInSeconds)
    doTeleportThing(player, getTownTemplePosition(getPlayerTown(player)))
   else
    doPlayerSendCancel(cid,"You dont have 100 soul points.")
   end
  else
   doPlayerSendCancel(cid,"This player have lvl higher than 50.")
  end
 else
  doPlayerSendCancel(cid,"Your level is too low.")
 end
else
 doPlayerSendCancel(cid,"this players doesn exist, or is offline.")
end
return TRUE
end

LUA:
<talkaction log="no" words="!tpnuub" access="0" event="script" value="tpnuub.lua"/>

!hunt
test this:
http://otland.net/f81/bounty-hunters-system-player-hunt-system-27721/

!buy
use Auction system by Vdk
search in OTland
Auction system
 
So, why don't you have these commands ?

Code:
	<!-- Houses -->
	<talkaction words="!buyhouse" event="function" value="houseBuy"/>
	<talkaction words="!sellhouse" event="function" value="houseSell"/>
	<talkaction words="alana sio" filter="word-spaced" event="function" value="houseKick"/>
	<talkaction words="aleta grav" filter="word-spaced" event="function" value="houseDoorList"/>
	<talkaction words="aleta sio" filter="word-spaced" event="function" value="houseGuestList"/>
	<talkaction words="aleta som" filter="word-spaced" event="function" value="houseSubOwnerList"/>
	<talkaction words="!leavehouse" event="script" value="leavehouse.lua"/>
 
It was a question^^

Ok, I need script only to
Code:
	<talkaction words="!leavehouse" event="script" value="leavehouse.lua"/>

LUA:
function onSay(cid, words, param, channel)
	local house = getHouseFromPos(getCreaturePosition(cid))
	if(not house) then
		doPlayerSendCancel(cid, "You are not inside a house.")
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
		return false
	end

	local owner = getHouseInfo(house).owner
	if(owner ~= getPlayerGUID(cid) and (owner ~= getPlayerGuildId(cid) or getPlayerGuildLevel(cid) ~= GUILDLEVEL_LEADER)) then
		doPlayerSendCancel(cid, "You are not the owner of this house.")
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
		return false
	end

	setHouseOwner(house, 0)
	doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_BLUE)
	return false
end

The rest have functions, so try it without scripts
 
Code:
function onSay(cid, words, param, channel)
	local t, k = {}, getPlayerLevel(cid)
	for i = 0, getPlayerInstantSpellCount(cid) - 1 do
		local spell = getPlayerInstantSpellInfo(cid, i)
		if(spell.level ~= 0 and k >= spell.level) then
			if(spell.manapercent > 0) then
				spell.mana = spell.manapercent .. "%"
			end

			table.insert(t, spell)
		end
	end

	table.sort(t, function(a, b) return a.level < b.level end)
	local text, prevLevel = "", -1
	for i, spell in ipairs(t) do
		local line = ""
		if(prevLevel ~= spell.level) then
			if(i ~= 1) then
				line = "\n"
			end

			line = line .. "Spells for Level " .. spell.level .. "\n"
			prevLevel = spell.level
		end

		text = text .. line .. "  " .. spell.words .. " - " .. spell.name .. " : " .. spell.mana .. "\n"
	end

	doShowTextDialog(cid, 2175, text)
	return true
end
 
Back
Top