Ir para conteúdo
  • 0

Pedido Task System Diferente


KennyConrad

Pergunta

Galera Queria Um Sistema De Task Exatamente Do Geito Que Postarei Abaixo.

 

.Npc Desse Geito.

 

Dalila: Olá Din Grey. Você quer me ajudar acabar com poderosas gosmas chamadas multi?

 

Dalila: Ótimo! Você precisa matar pelo menos 600 multis em um prazo de 1 semana para te dar recompensa. Aceita?

 

Dalila: Você já pode começar a matar os multis, mas cuidado! É uma criatura muito forte. Volte aqui quando matar 600 multis para ser recompensado. O prazo é até 25/08/2012 16:57:40.

 

Dalila: Você ainda não matou os 600 multis, atualmente você matou 0, resta 600. Seu prazo é de até 25/08/2012 16:57:40.

 

Dalila: Obrigado! você matou os 600 multis em menos de 1 semana.Aqui esta sua recompensa! Lembre-se que você pode fazer esta task quantas vezes quiser,desde que tenha concluído 1 semana contado a partir do dia de inicio.

 

Dalila: Parabéns! Você já concluiu esta task 4 vezes

.

 

Aparecer na tela pro player que está fazendo a task as mensagems em cor branca assim

 

[Multi Task] (1/600).

 

[Multi Task Finalizada] (600/600).

 

O Premio È Em Exp.

 

 

Ajudem Ae Vlw REP + Pra Quem AJudar.

Link para o comentário
Compartilhar em outros sites

  • Respostas 38
  • Created
  • Última resposta

Top Posters For This Question

Posts Recomendados

  • 0

@ lummos vo postar aki do geito que ta no meu servidor ai voce tenta.

 

em creaturescripts

 

       
<event type="death" name="TaskMulti" event="script" value="TaskMulti.lua"/>

 


function onDeath(cid, corpse, deathList)

local qntdade = 600
local stoTime = 96586
local stoKill = 96587

if getCreatureName(cid) == "multi" then
for a = 1, #deathList do
local pk = deathList[a]
local left = math.ceil((getPlayerStorageValue(pk, stoTime) - os.time())/(24 * 60 * 60))
if left > 0 and getPlayerStorageValue(pk, stoKill) > 0 then
setPlayerStorageValue(pk, stoKill, getPlayerStorageValue(pk, stoKill) - 1)
local sto = getPlayerStorageValue(pk, stoKill)
local jaMatou = math.abs(getPlayerStorageValue(pk, stoKill)-qntdade)

if sto == 0 then
doPlayerSendTextMessage(pk, 18, "[Multi Task Finalizada] ("..qntdade.."/"..qntdade..")")
else
doPlayerSendTextMessage(pk, 18, "[Multi Task] ("..jaMatou.."/"..qntdade..")")
end
end
end
end
return true
end

 

em login adiciona essa tag

 

       registerCreatureEvent(cid, "TaskMulti")

 

o meu Multi

 

 

 

 

<?xml version="1.0" encoding="UTF-8"?>

<monster name="multi" nameDescription="a multi" race="venom" experience="30600" speed="260" manacost="0">

<health now="6650" max="6650"/>

<look type="238" corpse="6532"/>

<targetchange interval="4000" chance="10"/>

<strategy attack="100" defense="0"/>

<flags>

<flag summonable="0"/>

<flag attackable="1"/>

<flag hostile="1"/>

<flag illusionable="1"/>

<flag convinceable="0"/>

<flag pushable="0"/>

<flag canpushitems="1"/>

<flag canpushcreatures="1"/>

<flag targetdistance="1"/>

<flag staticattack="90"/>

<flag runonhealth="2000"/>

</flags>

<attacks>

<attack name="melee" interval="2000" min="-300" max="-1000"/>

<attack name="poison" interval="2500" range="8" min="-200" max="-400">

</attack>

</attacks>

<defenses armor="15" defense="15">

<defense name="healing" interval="2500" chance="50" min="1000" max="2000">

</defense>

</defenses>

 

<immunities>

<immunity fire="1"/>

<immunity poison="1"/>

<immunity lifedrain="1"/>

<immunity paralyze="1"/>

<immunity outfit="1"/>

<immunity drunk="1"/>

<immunity invisible="1"/>

</immunities>

<summons maxSummons="25">

<summon name="Multi" interval="2500" chance="10000"/>

</summons>

<voices interval="3000" chance="10">

<voice sentence="Aquele e o verdadeiro."/>

</voices>

<loot>

<item id="2148" countmax="100" chance1="100000" chancemax="0"/> --Gold Coins

<item id="2152" countmax="20" chance1="100000" chancemax="0"/> --Platinum Coin

<item id="2152" countmax="10" chance1="100000" chancemax="0"/> --Platinum Coin

<item id="6500" countmax="1" chance1="2857" chancemax="0"/> --Demonic Essence

<item id="5944" chance="2500"/> --Soul Orb

 

</loot>

<script>

<event name="TaskMulti"/>

</script>

</monster>

 

 

 

NPC

 


<?xml version="1.0" encoding="ISO-8859-1"?>
<npc name="Dalila" script="data/npc/scripts/NpcMulti.lua" floorchange="0" walkinterval="0">
<health now="100" max="100"/>
<look type="148" head="24" body="25" legs="100" feet="118" addons="0"/>
<parameters>
<parameter key="message_greet" value="Olá |PLAYERNAME|, você gostaria de fazer uma {missao}?" />
</parameters>
</npc>

 

 

 

 

local keywordHandler = KeywordHandler:new()

local npcHandler = NpcHandler:new(keywordHandler)

NpcSystem.parseParameters(npcHandler)

local talkState = {}

function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end

function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end

function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end

function onThink() npcHandler:onThink() end

function creatureSayCallback(cid, type, msg)

if(not npcHandler:isFocused(cid)) then

return false

end

 

local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid

local qntdade = 600

local stoTime = 96586

local stoKill = 96587

local premio = 622720300 --em exp!

local msg = string.lower(msg)

local left = math.ceil((getPlayerStorageValue(cid, stoTime) - os.time())/(24 * 60 * 60)) --nao mexe!

 

 

if (msgcontains(msg, 'tarefa') or msgcontains(msg, 'missao')) then

if getPlayerStorageValue(cid, stoTime) ~= -1 and left > 0 and getPlayerStorageValue(cid, stoKill) > 0 then

local faltaMatar = getPlayerStorageValue(cid, stoKill)

local jaMatou = math.abs(getPlayerStorageValue(cid, stoKill)-qntdade)

local prazo = os.date("%d/%m/%y %X", getPlayerStorageValue(cid, stoTime))

selfSay("Você ainda não matou os "..qntdade.." multis, atualmente você matou ".. (jaMatou)..", resta "..faltaMatar..". Seu prazo é de até "..prazo..".", cid)

talkState[talkUser] = 0

return true

elseif getPlayerStorageValue(cid, stoTime) ~= -1 and left <= 0 and getPlayerStorageValue(cid, stoKill) ~= -1 then

selfSay("Infelismente você não matou as "..qntdade.." multis a tempo. Se você quiser, você pode tentar fazer denovo a missao.", cid)

setPlayerStorageValue(cid, stoTime, -1)

setPlayerStorageValue(cid, stoKill, -1)

talkState[talkUser] = 0

return true

elseif getPlayerStorageValue(cid, stoTime) ~= -1 and left > 0 and getPlayerStorageValue(cid, stoKill) == -1 then

local prazo = os.date("%d/%m/%y %X", getPlayerStorageValue(cid, stoTime))

selfSay("Você tem que esperar pelo menos 1 semana para poder pegar essa tarefa denovo. O prazo de acaba dia ".. prazo..".", cid)

talkState[talkUser] = 0

return true

elseif getPlayerStorageValue(cid, stoTime) ~= -1 and left > 0 and getPlayerStorageValue(cid, stoKill) == 0 then

selfSay("Obrigado! você matou os "..qntdade.." multis em menos de 1 semana. Aqui esta sua recompensa! Lembre-se que você pode fazer esta task quantas vezes quiser,desde que tenha concluído 1 semana contado a partir do dia de inicio.", cid)

doPlayerAddExp(cid, premio) --premio

setPlayerStorageValue(cid, stoKill, -1)

talkState[talkUser] = 0

return true

else

if getPlayerStorageValue(cid, stoTime) ~= -1 and getPlayerStorageValue(cid, stoKill) == -1 then

setPlayerStorageValue(cid, stoTime, -1) --soh pra evitar problemas...

end

selfSay("Você quer me ajudar a acabar com poderosas gosmas chamadas Multi?", cid)

talkState[talkUser] = 1

end

 

elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and talkState[talkUser] == 1 then

selfSay("Ótimo! Você precisa matar pelo menos "..qntdade.." Multis em um prazo de 1 semana para eu te dar a recompensa. Aceita?", cid)

talkState[talkUser] = 2

 

elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and talkState[talkUser] == 2 then

local semana = 7 * 24 * 60 * 60

setPlayerStorageValue(cid, stoTime, os.time()+semana)

setPlayerStorageValue(cid, stoKill, qntdade)

local sto = getPlayerStorageValue(cid, stoTime)

selfSay("Você já pode começar a matar os multis, mas cuidado! É uma criatura muito forte. Volte aqui quando matar "..qntdade.." multis para ser recompensado. O prazo é até ".. os.date("%d/%m/%y %X", sto) ..".", cid)

 

end

 

return true

end

 

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())

 

 

 

testa ae ve se funciona agora.

Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.

×
×
  • Criar Novo...