Ir para conteúdo

[REMAKE] Scripts antigos refeitos [PACK]


LuckOake

Posts Recomendados

Olá galera :)

 

Já viram aqueles scripts antigos, lá de 2006, 2007 ~~ 2011, que são totalmente bagunçados e é um saco pra configurar e/ou adicionar coisas novas? Pois é, eu tive a ideia de refazê-los para melhorar sua formatação e aprimorar suas funcionalidades.

 

O que é: É um pacote que conta atualmente com 13 scripts (actions e talks) de scripts antigos que foram refeitos por mim. Download está no fim da mensagem, no anexo. Ou se quiserem, podem pegar algum script sozinho aqui no tópico, que jájá vou editar e colocar isso.

 

Actions:

- Absorb Rune
- Bread System
- Future Orb
- Trash Lever
- Multifunctional Rune
- Present Box
- Steal Rune
- Teleport Rune
- Vocation Chest
- Vocation Door

 

Talks:

- AFK
- Change Status
- Terror
- Vote System

 

Scripts:

Actions:

Absorb Rune:

 

absorbrune.lua:

 

http://pastebin.com/bFKfPbdn

 

 

Bread System:

 

 

 

Future Orb:

 

 

 

Trash Lever:

 

 

 

Multifunctional Rune:

 

multifunctionalrune.lua:

http://pastebin.com/HqpwiWqV

 

 

Present Box:

 

 

 

Steal Rune:

 

 

 

Teleport Rune:

 

teleportrune.lua:

http://pastebin.com/tDaKy9qL

 

 

Vocation Chest:

 

vocationchest.lua:

 

http://pastebin.com/rswKrDEM

 

 

Vocation Door:

 

vocationdoor.lua:

http://pastebin.com/v57sq2gc

 

 

actions.xml:

 

<?xml version="1.0" encoding="UTF-8"?>
<actions>
   <!-- Lembre-se de alterar o xxxx por um action id que desejar! -->
   <action actionid="xxxx" script="absorbrune.lua"/>
   <action actionid="2694;2692;2693" script="bread.lua"/>
   <action actionid="xxxx" script="futureorb.lua"/>
   <action actionid="xxxx" script="levertrash.lua"/>
   <action actionid="xxxx" script="multifunctionalrune.lua" />
   <action actionid="xxxx" script="presentbox.lua"/>
   <action actionid="xxxx" script="stealrune.lua"/>
   <action actionid="xxxx" script="teleportrune.lua"/>
   <action actionid="xxxx" script="vocationchest.lua"/>
   <action actionid="xxxx" script="vocationdoor.lua"/>
</actions>

 

 

 

Talkactions:

AFK:

 

afk.lua:

local time = 0.2
local afkstor = 14850

function turnAfk(cid, text)
   if not isCreature(cid) then return true
   elseif getPlayerStorageValue(cid, afkstor) == -1 then return true
   end

       doSendAnimatedText(getCreaturePosition(cid), text, math.random(1, 255))
       addEvent(turnAfk, time*1000, cid, text)
return true
end

function onSay(cid, words)
   if getPlayerStorageValue(cid, afkstor) == -1 then
       setPlayerStorageValue(cid, afkstor, 1)
       turnAfk(cid, "Ocupado!")
       doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Agora você está AFK.")
   else
       setPlayerStorageValue(cid, afkstor, -1)
       doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você não está mais AFK.")
   end
return true
end

 

 

Change Stats:

 

changestats.lua:

function onSay(cid, words, param)
   local exhastor = 3179 -- Storage da exhaustion
   local wait = 1 -- Segundos de exhaustion
   local change = 30 -- Quantidade de mana/health que será trocada
   local vocs = {"Sorcerer", "Druid"} -- Vocations que podem usar essa talk

   if not isInArray(vocs, getPlayerVocationName(cid)) then
       doSendMagicEffect(getCreaturePosition(cid), 2)
       doPlayerSendCancel(cid, "Your vocation cannot use this move.") return true
   elseif exhaustion.check(cid, exhastor) then
       doSendMagicEffect(getCreaturePosition(cid), 2)
       doPlayerSendCancel(cid, "You are exhausted.") return true
   elseif param == "mana" then
       if getPlayerHealth(cid) < change then
           doPlayerSendCancel(cid, "Not enough health to change to mana.") return true
       end

           doPlayerAddMana(cid, change)
           doCreatureAddHealth(cid, -change)
           doSendMagicEffect(getCreaturePosition(cid), 12)
           exhaustion.set(cid, exhastor, wait)
   elseif param == "health" then
       if getPlayerMana(cid) < change then
           doPlayerSendCancel(cid, "Not enough mana to change to health.") return true
       end

           doPlayerAddMana(cid, -change)
           doCreatureAddHealth(cid, change)
           doSendMagicEffect(getCreaturePosition(cid), 13)
           exhaustion.set(cid, exhastor, wait)
   else
       doPlayerSendCancel(cid, "Choose if you want to change mana to 'health' or health to 'mana'") return true
   end
return true
end

 

 

Terror:

 

 

 

Vote System:

 

votesystem.lua:

local votestorage = 32940
local yes = 32941
local no = 32942
local playervote = 32943
local players = {}

function hasVotationOpen()
   return getGlobalStorageValue(votestorage) == 1 and true or false
end

function openVotation()
   return setGlobalStorageValue(votestorage, 1)
end

function closeVotation()
   setGlobalStorageValue(votestorage, -1)
   setGlobalStorageValue(yes, -1)
   setGlobalStorageValue(no, -1)
   players = {}
return true
end

function vote(cid, choose)
   table.insert(players, cid)
   return choose == "yes" and setGlobalStorageValue(yes, getGlobalStorageValue(yes) == -1 and 1 or getGlobalStorageValue(yes)+1) or setGlobalStorageValue(no, getGlobalStorageValue(no) == -1 and 1 or getGlobalStorageValue(no)+1)
end

function hasVoted(cid)
   return table.find(players, cid) and true or false
end

function onSay(cid, words, param)
   if words == "/openvote" then
       if hasVotationOpen() then
           doPlayerSendCancel(cid, "Já há uma votação aberta.") return true
       end

       broadcastMessage("Votação aberta com a seguinte pergunta:\n"..param.."\nUse !vote sim para votar sim\nUse !vote nao para votar não")
       openVotation()
   elseif words == "/closevote" then
       if not hasVotationOpen() then
           doPlayerSendCancel(cid, "Não há nenhuma votação aberta.") return true
       end

       broadcastMessage("Votação fechada. Resultado:\nSIM: "..(getGlobalStorageValue(yes) == -1 and 0 or getGlobalStorageValue(yes)).." votos\nNÃO: "..(getGlobalStorageValue(no) == -1 and 0 or getGlobalStorageValue(no)).." votos")
       closeVotation()
   elseif words == "!vote" then
       if not hasVotationOpen() then
           doPlayerSendCancel(cid, "Não há nenhuma votação aberta.") return true
       elseif hasVoted(cid) then
           doPlayerSendCancel(cid, "Você já votou.") return true
       elseif param ~= "sim" and param ~= "nao" then
           doPlayerSendCancel(cid, 'Voto incorreto. Escreva apenas "sim" ou "nao".') return true
       elseif param == "sim" then
           vote(cid, "yes")
       elseif param == "nao" then
           vote(cid, "no")
       end
           doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Obrigado por votar.")
   end
return true
end

 

 

talkactions.xml:

 

<?xml version="1.0" encoding="UTF-8"?>
<talkactions>
   <!-- VIP System -->
   <talkaction words="!changestats" script="changestats.lua"/>
   <talkaction words="!afk" script="afk.lua"/>
   <talkaction access="5" words="/terror" script="terror.lua"/>
   <talkaction words="!vote" script="votesystem.lua" />
   <talkaction log="yes" access="5" words="/openvote;/closevote" script="votesystem.lua" />
</talkactions>

 

 

 

 

OBS: Caso encontre algum bug, avise aqui no tópico.

OBS²: Caso tenha algum outro script antigo que você gostaria que eu refizesse, poste aqui no tópico.

OBS³: Sim, eu sei que tem poucos scripts ainda, mas é por isso que eu quero que vocês peçam mais scripts antigos, como no OBS².

Remakes.rar

Editado por LuckOake
Link para o comentário
Compartilhar em outros sites

  • 3 months later...

Gostei da iniciativa de fazer remake, desculpa se estou "floodando"...

 

Gostaria que fizesse remake dessa action se fosse possível :)

Queria por ela no Friday WAR (8.60)

 

  
local messagetype = MESSAGE_EVENT_ORANGE
local fetishs = {
   [7801] = {chance = 100, amount = 1, set = setItemDefense, get = getItemDefense, name = "defense"},
   [7802] = {chance = 80, amount = 2, set = setItemDefense, get = getItemDefense, name = "defense"},
   [7803] = {chance = 60, amount = 3, set = setItemDefense, get = getItemDefense, name = "defense"},
   [7804] = {chance = 40, amount = 4, set = setItemDefense, get = getItemDefense, name = "defense", destroy = TRUE},
   [7805] = {chance = 20, amount = 5, set = setItemDefense, get = getItemDefense, name = "defense", destroy = TRUE},
   [7850] = {chance = 100, amount = 5, set = setItemDefense, get = getItemDefense, name = "defense"}, -- only given when access >= 5
}
local minmax = {
   min1 = 7801, -- minimum of the random fetishs for access < 5
   max1 = 7805, -- maximum of the random fetishs for access < 5
   min2 = 7850, -- minimum of the random fetishs for access >= 5
   max2 = 7850, -- maximum of the random fetishs for access >= 5
}
-- WARNING: look further down and your eyes will burn. --
function onUse(cid, item, fromPosition, itemEx, toPosition)
   if item.actionid == 0 then
    local new = getPlayerAccess(cid) >= 5 and math.random(minmax.min2, minmax.max2) or math.random(minmax.min1, minmax.max1)
    local text = "You remove the dust and revealed that it is a "..fetishs[new].chance.."% fetish for "..fetishs[new].name.." +"..fetishs[new].amount.."."..(fetishs[new].destroy ~= nil and " It has a slight chance of breaking your item." or "")
    doPlayerSendTextMessage(cid, messagetype, text)
    doSetItemActionId(item.uid, new)
    doSetItemSpecialDescription(item.uid, text)
    setItemName(item.uid, fetishs[new].chance.."% fetish for "..fetishs[new].name.." +"..fetishs[new].amount)
   elseif fetishs[item.actionid] ~= nil then
    if fetishs[item.actionid].get(itemEx.uid) > 0 then
	    if itemEx.actionid < 105 then
		    local amount = math.max(0, itemEx.actionid - 100)
		    local chance = math.random(0, 100)
		    local text = fetishs[item.actionid].name.." enchant on "..getItemNameById(itemEx.itemid).." failed."
		    if chance <= fetishs[item.actionid].chance then
			    fetishs[item.actionid].set(itemEx.uid, (fetishs[item.actionid].get(itemEx.uid)+fetishs[item.actionid].amount))
			    text = getItemNameById(itemEx.itemid).." "..fetishs[item.actionid].name.." +"..fetishs[item.actionid].amount.."."
		    elseif fetishs[item.actionid].destroy ~= nil or fetishs[item.actionid].destroy == TRUE then
			    if math.random(0, 1) == 1 then
				    doRemoveItem(itemEx.uid)
				    text = getItemNameById(itemEx.itemid).." has been destroyed."
			    end
		    end
		    doPlayerSendTextMessage(cid, messagetype, text)
		    doSetItemActionId(itemEx.uid, 100+(amount+1))
		    setItemName(itemEx.uid, getItemNameById(itemEx.itemid).." (Level "..(amount+1)..")")
		    doSendMagicEffect(toPosition, (chance <= fetishs[item.actionid].chance and 13 or 2))
						    doSendAnimatedText(toPosition, (chance <= fetishs[item.actionid].chance and "Success!" or "Failed!"),(chance <= fetishs[item.actionid].chance and TEXTCOLOR_WHITE or TEXTCOLOR_RED))
		    doRemoveItem(item.uid)
	    else
		    doPlayerSendCancel(cid, "This weapon has already been enchanted 5 times.")
	    end
    else
	    doPlayerSendCancel(cid, "This item may not be enchanted.")
    end
   else
    doPlayerSendCancel(cid, "Sorry, not possible.")
   end
    return TRUE
end

Link para o comentário
Compartilhar em outros sites

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