ED

Auto Loot

Por eduardo190696, 07 de ago. de 2011 em Actions e Talkactions

script
32
12.9k
GateuG
31 de agosto de 2011 às 08:40

USO OT 8.60 TESTEI COM VARIOS EQUIPES, POR EXEMPLO O DEMON SHIELD E NAO PEGOU, TESTEI COM WORM E HAM E PEGOU.

 

sO DA LOOT EM COISAS USAVEIS? EQUIPES NAO PEGA? TEM COMO COLOCAR PRA PEGAR? E PRA POR PRA GOLD TBM? PRA TODOS OS ITENS? A E OUTRA COISA COM OS WORMS POR EXEMPLO ELE SO JUNTA 100 E DEPOIS NAO PEGA MAIS. DA PRA POR PRA IR JUNTANDO DE 100 EM 100 E SO NAO PEGAR QUANDO A BAG TIVER CHEIA?

É PRA EQUIPES NAO PEGA =/

Editado Setembro 2 por gateu

pedroianP
31 de agosto de 2011 às 09:53

Eu consegui equipar: Golden Armor, Golden Legs, Demon Helmet, Steel Boots... Tem como configurar equipe sim.

 

No meu ot, eu coloquei o maximo de 5 items, mais quando atinge 5 itens e eu quero remover 1 não tem como, fala que está cheio. '-'

GateuG
31 de agosto de 2011 às 12:40

Eu consegui equipar: Golden Armor, Golden Legs, Demon Helmet, Steel Boots... Tem como configurar equipe sim.

 

No meu ot, eu coloquei o maximo de 5 items, mais quando atinge 5 itens e eu quero remover 1 não tem como, fala que está cheio. '-'

 

pode me dizer como configura para pegar equip, pq aki eu coloquei /aloot add:demon shield, aparece na lista do loot mas msm assim nao pega o item.

angeldoidoA
31 de agosto de 2011 às 18:21

Eu consegui equipar: Golden Armor, Golden Legs, Demon Helmet, Steel Boots... Tem como configurar equipe sim.

 

No meu ot, eu coloquei o maximo de 5 items, mais quando atinge 5 itens e eu quero remover 1 não tem como, fala que está cheio. '-'

 

Cara vamo se dizer q esse script é DEMO, em outras palavras ele ainda tem varios bug q nem nosso amigo disse junta 100 e n pega ++

mais na verdade pega sim ele so tenta junta o q pega com os 100 que ja tem =D

 

um script bem compativel é do autouse do edu vc junta 100 moeda e transforma em 1 de platium, dai é meio dificil de da bug, so se vc tiver 99 moeda

drpa 25 do monster ele vai pega so 1 e da use vc vai perde as outras+ mais fica bem melhor 1 script assim xD

GateuG
31 de agosto de 2011 às 21:25

Alguem pode modificar esse script pra pegar equipes, e que nao fique com tantos bugs? Seria de grande ajuda pra muita gente. obs: aki ele nao conseguiu pegar gold =/

walefxavierW
04 de setembro de 2011 às 09:48

Este sistema funciona em The Forgotten Server 0.4 ?

angeldoidoA
04 de setembro de 2011 às 14:28

Este sistema funciona em The Forgotten Server 0.4 ?

 

 

INfelizmente naum =/

mais tenta vai q da '-

4 meses depois...
gaazinG
03 de janeiro de 2012 às 19:44

Esse Sitema de Vocês ai ! Só funciona pra determinados tipos de corpse, por exemplo aqueles preto de gahz nao funciona ! alguns demons também não e agora ?

2 meses depois...
kriller12K
01 de março de 2012 às 02:17

eu n posso dar rep+ hj ,más eu prometo q irei te dar amanha!!! gostei muito vlw!!

2 semanas depois...
BrunooMaciellB
11 de março de 2012 às 19:38

rep++++++

12 de março de 2012 às 18:42

CRIADOR : JANO

Retirado: Outro forum

Script: Auto Loot *-*

 

creaturescripts.xml

<event type="login" name="aloot_reg" event="script" value="aloot.lua"/>
<event type="kill" name="aloot_kill" event="script" value="aloot.lua"/>  

creaturescripts/scritps

aloot.lua

function onLogin(cid)
registerCreatureEvent(cid, "aloot_kill")
return true
end

local stor = 7575

function autoloot(cid, target, pos)
local function doStack(cid, itemid, new)
	local count = getPlayerItemCount(cid, itemid)
	if (count > 100) then
		count = count - math.floor(count / 100) * 100
	end
	local newCount = count + new
	if (count ~= 0) then
		local find = getPlayerItemById(cid, true, itemid, count).uid
		if (find > 0) then
			doRemoveItem(find)
		else
			newCount = new
		end
	end
	local item = doCreateItemEx(itemid, newCount)
	doPlayerAddItemEx(cid, item, true)
end

local function scanContainer(cid, uid, list)
	for k = (getContainerSize(uid) - 1), 0, -1 do
		local tmp = getContainerItem(uid, k)
		if (isInArray(list, tmp.itemid)) then
			if isItemStackable(tmp.itemid) and (getPlayerItemCount(cid, tmp.itemid) > 0) then
				doStack(cid, tmp.itemid, tmp.type)
			else
				local item = doCreateItemEx(tmp.itemid, tmp.type)
				doPlayerAddItemEx(cid, item, true)
			end
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Looted ' .. tmp.type .. ' ' .. getItemNameById(tmp.itemid) .. '.')
			doRemoveItem(tmp.uid)
		elseif isContainer(tmp.uid) then
			scanContainer(cid, tmp.uid, list)
		end
	end
end

local items = {}
for i = getTileInfo(pos).items, 1, -1 do
	pos.stackpos = i
	table.insert(items, getThingFromPos(pos))
end

if (#items == 0) then
	return
end

local corpse = -1
for _, item in ipairs(items) do
	local name = getItemName(item.uid):lower()
	if name:find(target:lower()) then
		corpse = item.uid
		break
	end
end

if (corpse ~= -1) and isContainer(corpse) then
	scanContainer(cid, corpse, tostring(getPlayerStorageValue(cid, stor)):gsub('_', ''):explode(','))
end
end

function onKill(cid, target, lastHit)
if not isPlayer(target) then
	local infos = getPlayerStorageValue(cid, stor)
	if (infos == -1) then
		return true
	end
	local list = tostring(infos):explode(',')
	if (#list == 0) then
		return true
	end
	addEvent(autoloot, 150, cid, getCreatureName(target), getCreaturePosition(target))
end
return true
end

talkactios.xml

<talkaction words="/aloot" hide="yes" event="script" value="aloot.lua"/>  

 

Talkaction/scrips

local stor, limit = 7575, 5 --storage, limit to add.

local allow_container = false --empty! not looted with items, atleast for now.

function onSay(cid, words, param)
local expl = param:explode(':')
local action, rst = expl[1], expl[2]
if (action:lower() == 'check') then
	local infos, list = getPlayerStorageValue(cid, stor), {}
	if (infos ~= -1) then
		list = tostring(infos):explode(',')
	end
	local txt = 'Autoloot List:\n'
	if (#list > 0) then
		for k, id in ipairs(list) do
			id = id:gsub('_', '')
			if tonumber(id) then
				txt = txt .. getItemNameById(tonumber(id)) .. ((k < #list) and '\n' or '')
			end
		end
	else
		txt = 'Empty'
	end
	doPlayerPopupFYI(cid, txt)
elseif (action:lower() == 'add') then
	local infos, list = getPlayerStorageValue(cid, stor), {}
	if (infos ~= -1) then
		list = tostring(infos):gsub('_', ''):explode(',')
	end
	if (#list >= limit) then
		return doPlayerSendCancel(cid, 'You already have ' .. limit .. ' autolooting items.')
	end
	local item = tonumber(rst)
	if not item then
		item = getItemIdByName(rst, false)
		if not item then
			return doPlayerSendCancel(cid, 'not valid item.')
		end
	end
	if not allow_container and isItemContainer(item) then
		return doPlayerSendCancel(cid, 'this item can not be autolooted.')
	end
	local attrs = getItemInfo(item)
	if not attrs then
		return doPlayerSendCancel(cid, 'not valid item.')
	elseif not attrs.movable or not attrs.pickupable then
		return doPlayerSendCancel(cid, 'this item can not be autolooted.')
	end
	if isInArray(list, item) then
		return doPlayerSendCancel(cid, 'already added.')
	end
	table.insert(list, tostring(item))
	local new = ''
	for v, id in ipairs(list) do
		new = new .. '_' .. id:gsub('_' ,'') .. ((v < #list) and ',' or '')
	end
	doPlayerSetStorageValue(cid, stor, tostring(new))
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Item >>' .. getItemNameById(item) .. '<< has been added to the autoloot list.')
elseif (action:lower() == 'remove') then
	local infos, list = getPlayerStorageValue(cid, stor), {}
	if (infos ~= -1) then
		list = tostring(infos):gsub('_', ''):explode(',')
	end
	if (#list == 0) then
		return doPlayerSendCancel(cid, 'You dont have any item added.')
	end
	if (#list >= limit) then
		return doPlayerSendCancel(cid, 'You already have ' .. limit .. ' autolooting items.')
	end
	local item = tonumber(rst)
	if not item then
		item = getItemIdByName(rst, false)
		if not item then
			return doPlayerSendCancel(cid, 'not valid item.')
		end
	end
	if not isInArray(list, item) then
		return doPlayerSendCancel(cid, 'This item is not in the list.')
	end
	local new = ''
	for v, id in ipairs(list) do
		if (tonumber(id) ~= item) then
			new = new .. '_' .. id:gsub('_' ,'') .. ((v < #list) and ',' or '')
		end
	end
	doPlayerSetStorageValue(cid, stor, tostring(new))
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Item >>' .. getItemNameById(item) .. '<< removed from the autoloot list.')
end		
return true
end

 

Usando

 

/aloot check

Cheka a Lista dos Loots

 

/aloot add:itemid ou nome do item

 

Exemplo

/aloot add:worm

/aloot add:2170

 

16:42 Item >>worm<< has been added to the autoloot list.

 

Para remover

/aloot remove:worm

/aloot remove:2170

 

Exemplo Testado:

16:41 Looted 2 gold coin.

16:41 Looted 1 cheese.

 

é isso pessoal gosto da + Rep

esse script ja foi postado ake no fórum pelo Jack Bolin

SubheS
15 de março de 2012 às 13:08

Mano muito bom mesmo, aqui funcionou certinho

vlw ae, amanhã te dou REP++, pq hj nao posso dar + ;/

1 mês depois...
coyotestarkC
03 de abril de 2012 às 14:13

:( parece que nao pegou em meu ot.

um styller

pareceque meu servidor nao aceita

getinteminfo.

BrunooMaciellB
09 de abril de 2012 às 17:22

Mt Bom tutorial bem explicado e ele ta pegando =D

2 semanas depois...
SofftS
17 de abril de 2012 às 21:19

E como o amigo @gaazin ali disse, esse sistema só funciona para monstros que seu corpese tem o mesmo nome do monstro, ex:

Orc = Dead Orc, logo funciona perfeitamente,

 

porem se,

 

Necromancer = Dead Humam , o script não funciona.

 

Tentem arrumar ai por favor, eu já viz de tudo não funciona!