[8.x+]2 Przydatne Skrypty(BR)

Status
Zamknięty.

Rewizzu

Active User
Zarejestrowany
Dołączył
Luty 1, 2010
Posty
92
Liczba reakcji
14
Double Exp Potion:
Autor: Eu
v.8.x

Typ:Action
>data/actions/scripts>"nazwa.lua"
Kod:
function onUse(cid, item, frompos, item2, topos)
  local pausa = 30*60*1000 -- (1000 = 1 segundos) Tempo que o script durar?
  local texto = "You received ' .. exp .. 'x the experience to kill a monster for ' .. pausa/60/1000 .. ' minutes." -- Texto que ir? receber ao usar a potion.
  textofinal = "It is just minutes." -- Texto que ir? receber quando o efeito da potion acabar.
  local exp = 2 -- O quanto que você quer que dobre sua experiencia, por exemplo 2 ? 2x as rates do seu server.
  expfinal = 1 --Não mude, isso ? para a experiencia voltar ao normal.
    if item.itemid == 7443 then
      doRemoveItem(item.uid,1)
      doPlayerSetExperienceRate(cid,exp)
      doSendMagicEffect(frompos,13)
      doPlayerSendTextMessage(cid,22,texto)
      addEvent(potion,pausa,cid)
    end
end
function potion(pos, cid)
  doPlayerSetExperienceRate(pos,expfinal)
  doPlayerSendTextMessage(pos,22,textofinal)
end
>data/action/actions.xml
Kod:
<action itemid="7443" script="nazwa.lua" />
__________
:Mining system
Autor:Lwkass
v.8.4+

Typ:Action
>data/actions/scripts>"nazwa.lua"
--Version: 1.1.5
Kod:
--Configs--
local configs = {
 sign = {{level = {0,9}, quant = {1,2}, percent = 40},
         {level = {10,19}, quant = {2,4}, percent = 45},
         {level = {20,29}, quant = {3,6}, percent = 50},
         {level = {30,39}, quant = {4,8}, percent = 55},
         {level = {40,49}, quant = {5,10}, percent = 60},
         {level = {50,59}, quant = {6,12}, percent = 65},
         {level = {60,69}, quant = {7,14}, percent = 70},
         {level = {70,79}, quant = {8,16}, percent = 75},
         {level = {80,89}, quant = {9,18}, percent = 80},
         {level = {90,99}, quant = {10,20}, percent = 85},
         {level = {100}, quant = {11,22}, percent = 90}},
 stones = {1285, 1356},
 gold = {{2157, 'all'}},
 stone_delay = 15,
 MaxLevel = 100
}
--END Configs--
function onUse(cid, item, fromPosition, itemEx, toPosition)
local STORAGE_SKILL_LEVEL = 20000
local STORAGE_SKILL_TRY = 20001  
local skillLevel = getPlayerStorageValue(cid,STORAGE_SKILL_LEVEL)
local skillTry = getPlayerStorageValue(cid,STORAGE_SKILL_TRY)
local objeto2 = getThingFromPos(toPosition)
local player = getCreaturePosition(cid)
  if skillLevel == -1 then 
   setPlayerStorageValue(cid,STORAGE_SKILL_LEVEL,1)
  end
  for Q = 1, #configs.sign do
    if configs.sign[Q].level[2] == nil then
    configs.sign[Q].level[2] = configs.sign[Q].level[1]
    end
     if skillLevel >= configs.sign[Q].level[1] and skillLevel <= configs.sign[Q].level[2] then
     quant = math.random(configs.sign[Q].quant[1],configs.sign[Q].quant[2])
     percent = configs.sign[Q].percent
      break
     end
  end
 for i = 1, #configs.stones do
  if objeto2.itemid == configs.stones[i] then
    if math.random(1,100) <= percent then
    possible_gold = {{},{}}
        for h = 1, #configs.gold do
          if configs.gold[h][2] == objeto2.itemid then
           possible_gold[1][#possible_gold[1]+1] = configs.gold[h][1] 
          else
            if configs.gold[h][2] == 'all' then
             possible_gold[2][#possible_gold[2]+1] = configs.gold[h][1]
            end
          end
        end
      if possible_gold[1][1] == nil and possible_gold[2][1] == nil then    
       doPlayerSendTextMessage(cid,22,"This stone can not be mined.")
      elseif possible_gold[1][1] ~= nil then    
        doPlayerAddItem(cid,possible_gold[1][math.random(1,#possible_gold[1])],quant)
      elseif possible_gold[1][1] == nil and possible_gold[2][1] ~= nil then    
        doPlayerAddItem(cid,possible_gold[2][math.random(1,#possible_gold[2])],quant)    
      end
     if possible_gold[1][1] ~= nil or possible_gold[2][1] ~= nil then
      if skillTry >= 0 then
        setPlayerStorageValue(cid,STORAGE_SKILL_TRY,skillT  ry + 1) 
      else 
       setPlayerStorageValue(cid,STORAGE_SKILL_TRY,1)
      end
      doSendMagicEffect(getCreaturePosition(cid), 12)
      doPlayerSendTextMessage(cid,22,"You got "..quant.." gold "..getItemNameById(objeto2.itemid)..".")
      doSendAnimatedText(getCreaturePosition(cid), ''..quant..'', 192, cid) 
      setItemName(objeto2.uid, 'A remains of '..getItemNameById(objeto2.itemid))
      doSendMagicEffect(toPosition, 3)
      addEvent(dostoneReturn,configs.stone_delay * 1000,toPosition,objeto2.itemid)
      doTransformItem(objeto2.uid, 3610)
      break
     end
    else
     doPlayerSendCancel(cid,"You got nothing") 
     doSendMagicEffect(toPosition, 3)
     setItemName(objeto2.uid, 'A remains of '..getItemNameById(objeto2.itemid))
     doSendAnimatedText(getCreaturePosition(cid), 'Fail!', 180, cid)
     addEvent(dostoneReturn,configs.stone_delay * 1000,toPosition,objeto2.itemid)
     doTransformItem(objeto2.uid, 3610)
     break
    end
  else
   doPlayerSendCancel(cid,"You can only mine stones")
  end
 end
  if skillTry >= ((skillLevel+1)*3)  then
    if skillLevel == configs.MaxLevel then
     doPlayerSendTextMessage(cid, 22, "Max level reached in mining.")
     setPlayerStorageValue(cid,STORAGE_SKILL_TRY,0)
    else
     setPlayerStorageValue(cid,STORAGE_SKILL_LEVEL,skil  lLevel + 1)
     setPlayerStorageValue(cid,STORAGE_SKILL_TRY,0)
     doPlayerSendTextMessage(cid, 22, "You advanced from level ".. skillLevel .." to level ".. skillLevel + 1 .." in Mining.")
     doSendMagicEffect(getCreaturePosition(cid),14)
     doSendAnimatedText(getCreaturePosition(cid), 'Advance!', 18, cid)
    end
  end
end
 function dostoneReturn(itemposition,oldid)
 local pos = getThingfromPos(itemposition)
  doTransformItem(pos.uid,oldid)
  setItemName(pos.uid, getItemNameById(oldid))
  doSendMagicEffect(itemposition,math.random(28,30))
 end
--Lumberjack by: Lwkass
<action itemid="2553" event="script" value="nazwa.lua"/>
 
Odp: [8.x+]2 Przydatne Skrypty(BR)

A powiesz mi jaki jest skrypt do tego ?e jak si? powie "!mininglevel" to wyskakuje
na bia?o napis "Masz level gornictwa.".

A i chcia?bym si? dowiedzie? gdzie mo?na zmieni? by by?a inna "zdobycz".

PS. Zadzia?a to na 8.1?
 
Ostatnia edycja:
Odp: [8.x+]2 Przydatne Skrypty(BR)

Zajebi?cie, tylko po portugalsku config... Mining system na forum ju? by? i to co najmniej dwa razy i mo?na zrobi? go o wiele szybciej i wydajniej. Og??em 5/10 za ch?ci.
 
Status
Zamknięty.
Back
Do góry