Ir para conteúdo

Remove All Itens


tibiaa4e

Posts Recomendados

um code q remove todos os viais

igual no rl qdo se fala hi,flask,yes :D

 

 

na lib npc.lua add

function flask(cid, itemid, profit)

-- Made by Ispiro

-- If you want to just have this remove the item and return

-- how many flasks has been taken, just comment the lines

-- that says 'selfSay("")'

local flask = 0

local crystalcoins = 0

local platinumcoins = 0

local goldcoins = 0

---- Removing Item while counting

while doPlayerRemoveItem(cid, itemid, 1) == 1 do --Counts number of items player has

flask = flask + 1 -- if player has item then set 'flask' higher to be able to count profit.

end

---- //Removing Item while counting

local gpsrewarded = profit*flask -- sets how many gps left to be rewarded.

if flask > 0 then -- check if player had any of the specified item.

  selfSay("Here you go... ".. flask*profit .. " gold coins.") -- Comment This line if you want to have it set in the npc file.

  addMoney(cid, gpsrewarded) -- reward player with money 

else

  selfSay("Sorry, you don\'t have any.") -- Comment This line if you want to have it set in the npc file.

end

return flask -- Returns number of items has been removed, 0 if player doesn't have the item.

end

 

function addMoney(cid, money)

-- Made by Ispiro

local gpsrewarded = money

local crystalcoins = 0

local platinumcoins = 0

local goldcoins = 0

 

  while gpsrewarded >= 10000 do -- Count how many crystal coins should be rewarded

  crystalcoins = crystalcoins + 1 -- Set the number of crystal coins to be rewarded

  gpsrewarded = gpsrewarded - 10000 -- lower the number of gps left to be rewarded.

  end

  while gpsrewarded >= 100 do -- Count how many platinum coins should be rewarded

  platinumcoins = platinumcoins + 1 -- Set the number of platinum coins to be rewarded

  gpsrewarded = gpsrewarded - 100 -- lower the number of gps left to be rewarded.

  end

  while gpsrewarded >= 1 do -- Count how many gold coins should be rewarded

  goldcoins = goldcoins + 1 -- Set the number of gold coins to be rewarded

  gpsrewarded = gpsrewarded - 1 -- lower the number of gps left to be rewarded.

  end

 

  doPlayerAddItem(cid, 2148, goldcoins) -- give the player the gold coins

  doPlayerAddItem(cid, 2152, platinumcoins) -- give the player the platinum coins

  doPlayerAddItem(cid, 2160, crystalcoins) -- give the player the crystal coins

end

 

exemplo de script

 

flask(cid, 2006, 5)

 

2006 o id

5 os gp recebido

 

flws :hi:

Link para o comentário
Compartilhar em outros sites

  • 3 months later...
×
×
  • Criar Novo...