BlackTibia

No estás conectado. Conéctate o registrate

 » Open Tibia » Pedido de Scripts » 

demon oak tfs 1.0

demon oak tfs 1.0

#1 demon oak tfs 1.0 el Miér Oct 28, 2015 8:13 pm

yaicko


Novato
Hola, busco el scribcompleto de la demon oak en tfs 1.0 algien me dice como hacerle u.u gracias por su tiempo de pasar por aqui

#2 Re: demon oak tfs 1.0 el Jue Oct 29, 2015 5:15 pm

ricker


Moderador Global
en tu Ot data/actions/scripts/quests haces una carpeta nueva llamada demon oak y dentro colocas lo siguiente:

demonOak.lua
Código:
local config = {
 demonOakIds = {8288, 8289, 8290, 8291},
 sounds = {
 'MY ROOTS ARE SHARP AS A SCYTHE! FEEL IT?!?',
 'CURSE YOU!',
 'RISE, MINIONS, RISE FROM THE DEAD!!!!',
 'AHHHH! YOUR BLOOD MAKES ME STRONG!',
 'GET THE BONES, HELLHOUND! GET THEM!!',
 'GET THERE WHERE I CAN REACH YOU!!!',
 'ETERNAL PAIN AWAITS YOU! NICE REWARD, HUH?!?!',
 'YOU ARE GOING TO PAY FOR EACH HIT WITH DECADES OF TORTURE!!',
 'ARGG! TORTURE IT!! KILL IT SLOWLY MY MINION!!'
 },
 bonebeastChance = 90,
 bonebeastCount = 4,
 waves = 10,
 questArea = {
 fromPosition = {x = 32706, y = 32345, z = 7},
 toPosition = {x = 32725, y = 32357, z = 7}
 },
 summonPositions = {
 {x = 32714, y = 32348, z = 7},
 {x = 32712, y = 32349, z = 7},
 {x = 32711, y = 32351, z = 7},
 {x = 32713, y = 32354, z = 7},
 {x = 32716, y = 32354, z = 7},
 {x = 32719, y = 32354, z = 7},
 {x = 32721, y = 32351, z = 7},
 {x = 32719, y = 32348, z = 7}
 },
 summons = {
 [8288] = {
 [5] = {'Braindeath', 'Braindeath', 'Braindeath', 'Bonebeast'},
 [10] = {'Betrayed Wraith', 'Betrayed Wraith'}
 },
 [8289] = {
 [5] = {'Lich', 'Lich', 'Lich'},
 [10] = {'Dark Torturer', 'Blightwalker'}
 },
 [8290] = {
 [5] = {'Banshee', 'Banshee', 'Banshee'},
 [10] = {'Grim Reaper'}
 },
 [8291] = {
 [5] = {'Giant Spider', 'Giant Spider', 'Lich'},
 [10] = {'Undead Dragon', 'Hand of Cursed Fate'}
 }
 },
 storages = {
 [8288] = Storage.DemonOak.AxeBlowsBird,
 [8289] = Storage.DemonOak.AxeBlowsLeft,
 [8290] = Storage.DemonOak.AxeBlowsRight,
 [8291] = Storage.DemonOak.AxeBlowsFace
 }
}

local function getRandomSummonPosition()
 return config.summonPositions[math.random(#config.summonPositions)]
end

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
 if not isInArray(config.demonOakIds, target.itemid) then
 return true
 end

 local totalProgress = 0
 for k,v in pairs(config.storages) do
 totalProgress = totalProgress + math.max(0, player:getStorageValue(v))
 end

 local spectators, hasMonsters = Game.getSpectators(DEMON_OAK_POSITION, false, false, 9, 9, 6, 6), false
 for i = 1, #spectators do
 if spectators[i]:isMonster() then
 hasMonsters = true
 break
 end
 end

 local isDefeated = totalProgress == (#config.demonOakIds * (config.waves + 1))
 if (config.killAllBeforeCut or isDefeated)
 and hasMonsters then
 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You need to kill all monsters first.')
 return true
 end

 if isDefeated then
 player:teleportTo(DEMON_OAK_KICK_POSITION)
 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'Tell Oldrak about your great victory against the demon oak.')
 player:setStorageValue(Storage.DemonOak.Done, 1)
 player:setStorageValue(Storage.DemonOak.Progress, 3)
 return true
 end

 local cStorage = config.storages[target.itemid]
 local progress = math.max(player:getStorageValue(cStorage), 1)
 if progress >= config.waves + 1 then
 toPosition:sendMagicEffect(CONST_ME_POFF)
 return true
 end

 local isLastCut = totalProgress == (#config.demonOakIds * (config.waves + 1) - 1)
 local summons = config.summons[target.itemid]
 if summons and summons[progress] then
 -- Summon a single demon on the last hit
 if isLastCut then
 Game.createMonster('Demon', getRandomSummonPosition(), false, true)

 -- Summon normal monsters otherwise
 else
 for i = 1, #summons[progress] do
 Game.createMonster(summons[progress][i], getRandomSummonPosition(), false, true)
 end
 end

 -- if it is not the 5th or 10th there is only a chance to summon bonebeasts
 elseif math.random(100) >= config.bonebeastChance then
 for i = 1, config.bonebeastCount do
 Game.createMonster('Bonebeast', getRandomSummonPosition(), false, true)
 end
 end

 player:say(isLastCut and 'HOW IS THAT POSSIBLE?!? MY MASTER WILL CRUSH YOU!! AHRRGGG!' or config.sounds[math.random(#config.sounds)], TALKTYPE_MONSTER_YELL, false, player, DEMON_OAK_POSITION)
 toPosition:sendMagicEffect(CONST_ME_DRAWBLOOD)
 player:setStorageValue(cStorage, progress + 1)
 player:say('-krrrrak-', TALKTYPE_MONSTER_YELL, false, player, toPosition)
 doTargetCombatHealth(0, player, COMBAT_EARTHDAMAGE, -170, -210, CONST_ME_BIGPLANTS)
 return true
end

En la misma carpeta agregas los siguiente:

demonOakChest.lua
Código:
local chests = {
 [9008] = {itemid = 2495, count = 1},
 [9009] = {itemid = 8905, count = 1},
 [9010] = {itemid = 16111, count = 1},
 [9011] = {itemid = 16112, count = 1}
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
 if chests[item.uid] then
 if player:getStorageValue(Storage.DemonOak.Done) ~= 2 then
 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'It\'s empty.')
 return true
 end

 local chest = chests[item.uid]
 local itemType = ItemType(chest.itemid)
 if itemType then
 local article = itemType:getArticle()
 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have found ' .. (#article > 0 and article .. ' ' or '') .. itemType:getName() .. '.')
 end

 player:addItem(chest.itemid, chest.count)
 player:setStorageValue(Storage.DemonOak.Done, 3)
 end

 return true
end

Por ultimo agregas esta:

demonOakGravestone.lua
Código:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
 if player:getStorageValue(Storage.DemonOak.Done) == 2 then
 player:teleportTo(DEMON_OAK_REWARDROOM_POSITION)
 DEMON_OAK_REWARDROOM_POSITION:sendMagicEffect(CONST_ME_TELEPORT)
 return true
 end
end

Ahora en Data/actions/actions.xml agregas lo siguiente:

Código:
<!-- Demon Oak -->
 <action itemid="8293" script="quests/demon oak/demonOak.lua" />
 <action fromuid="9008" touid="9011" script="quests/demon oak/demonOakChest.lua" />
 <action uniqueid="9007" script="quests/demon oak/demonOakGravestone.lua" />

Por ultimo en data/movements/scripts/quests haces una carpeta llamada demon oak y dentro colocas lo siguiente:

areaDamage.lua
Código:
function onStepIn(creature, item, position, fromPosition)
 local player = creature:getPlayer()
 if not player then
 return true
 end

 if math.random(24) == 1 then
 doTargetCombatHealth(0, player, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
 end
 return true
end

Despues este:

entrance.lua
Código:
function onStepIn(creature, item, position, fromPosition)
 local player = creature:getPlayer()
 if not player then
 return true
 end

 if player:getStorageValue(Storage.DemonOak.Done) >= 1 then
 player:teleportTo(DEMON_OAK_KICK_POSITION)
 player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
 return true
 end

 if player:getLevel() < 120 then
 player:say("LEAVE LITTLE FISH, YOU ARE NOT WORTH IT!", TALKTYPE_MONSTER_YELL, false, player, DEMON_OAK_POSITION)
 player:teleportTo(DEMON_OAK_KICK_POSITION)
 player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
 return true
 end

 if player:getStorageValue(Storage.DemonOak.Squares) == 5 and #Game.getSpectators(DEMON_OAK_POSITION, false, true, 9, 9, 6, 6) == 0 then
 player:teleportTo(DEMON_OAK_ENTER_POSITION)
 player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
 player:setStorageValue(Storage.DemonOak.Progress, 1)
 player:say("I AWAITED YOU! COME HERE AND GET YOUR REWARD!", TALKTYPE_MONSTER_YELL, false, player, DEMON_OAK_POSITION)
 else
 player:teleportTo(DEMON_OAK_KICK_POSITION)
 player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
 end
 return true
end

otro mas:

squares.lua
Código:
local voices = {
 'Release me and you will be rewarded greatefully!',
 'What is this? Demon Legs lying here? Someone might have lost them!',
 'I\'m trapped, come here and free me fast!!',
 'I can bring your beloved back from the dead, just release me!',
 'What a nice shiny golden armor. Come to me and you can have it!',
 'Find a way in here and release me! Pleeeease hurry!',
 'You can have my demon set, if you help me get out of here!'
}

local startUid = 9000
function onStepIn(creature, item, position, fromPosition)
 local player = creature:getPlayer()
 if not player then
 return true
 end

 local status = math.max(player:getStorageValue(Storage.DemonOak.Squares), 0)
 if item.uid - startUid == status + 1 then
 player:setStorageValue(Storage.DemonOak.Squares, status + 1)
 player:say(voices[math.random(#voices)], TALKTYPE_MONSTER_YELL, false, player, DEMON_OAK_POSITION)
 end
 return true
end

Ahora en data/movements/movements.xml agregas lo siguiente:

Código:
<!-- Demon Oak Quest -->
 <movevent event="StepIn" uniqueid="9000" script="quests/demon oak/entrance.lua" />
 <movevent event="StepIn" itemid="8292" script="quests/demon oak/areaDamage.lua" />
 <movevent event="StepIn" fromuid="9001" touid="9005" script="quests/demon oak/squares.lua" />



[Tienes que estar registrado y conectado para ver esa imagen]
http://facebook.com/kruger.sytes.net/

#3 Re: demon oak tfs 1.0 el Lun Nov 02, 2015 11:32 pm

yaicko


Novato
Gracias amigo lo probare y estare posteando si me funciono

#4 Re: demon oak tfs 1.0 el Mar Nov 03, 2015 12:06 am

yaicko


Novato
Hola ya puse todo al pie de la letra, pero el npc oldrak cuando le digo mission me pregunta que si ya estube en el area infectada le digo que si y me contesta disiendome que no es sierto y de ayi no puedo avanzar ..... configura la posicion del redward y los baules tambien el area del demon oak y nada quisa hay algo que seme esta pasando

#5 Re: demon oak tfs 1.0 el Mar Nov 03, 2015 2:43 am

ricker


Moderador Global
puede que sea un error de tu npc debido a que no reconoce el storage que se le entrega al player D: revisalo y cambialo.



[Tienes que estar registrado y conectado para ver esa imagen]
http://facebook.com/kruger.sytes.net/

#6 Re: demon oak tfs 1.0 el Mar Nov 03, 2015 11:05 am

yaicko


Novato
ya probe con todos los npc oldrak que tenia ala mano y nada de nada sigo sin poder pasar al demon oak el npc nome hace caso cuando le digo mission abeses si me hace caso pero del sigiente texto ya no dice nada si podrias fasilitarme el script del npc U.U

#7 Re: demon oak tfs 1.0 el Mar Nov 03, 2015 2:59 pm

ricker


Moderador Global
Oldrak.xml
Código:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Oldrak" script="Oldrak.lua" walkinterval="2000" floorchange="0">
     <health now="150" max="150" />
   <look type="57" head="115" body="113" legs="31" feet="38" addons="3" />
   <parameters>
      <parameter key="message_greet" value="Welcome |PLAYERNAME|! Rarely I can welcome visitors in these days." />
      <parameter key="message_walkaway" value="Take care, it's dangerous out there." />
      <parameter key="message_farewell" value="Good bye, |PLAYERNAME|!" />
   </parameters>
</npc>


Oldrak.lua
Código:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

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

keywordHandler:addKeyword({'job'}, StdModule.say, {npcHandler = npcHandler, text = "I guard this humble temple as a monument for the order of the nightmare knights."})
keywordHandler:addKeyword({'name'}, StdModule.say, {npcHandler = npcHandler, text = "My name is Oldrak."})
keywordHandler:addKeyword({'monster'}, StdModule.say, {npcHandler = npcHandler, text = "These plains are not safe for ordinary travellers. It will take heroes to survive here."})
keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, text = "I can't help you, sorry!"})
keywordHandler:addKeyword({'goshnar'}, StdModule.say, {npcHandler = npcHandler, text = "The greatest necromant who ever cursed our land with the steps of his feet. He was defeated by the nightmare knights."})
keywordHandler:addKeyword({'nightmare'}, StdModule.say, {npcHandler = npcHandler, text = "This ancient order was created by a circle of wise humans who were called 'the dreamers'. The order became extinct a long time ago."})
keywordHandler:addKeyword({'extinct'}, StdModule.say, {npcHandler = npcHandler, text = "Many perished in their battles against evil, some went mad, not able to stand their nightmares any longer. Others were seduced by the darkness."})
keywordHandler:addKeyword({'dreamers'}, StdModule.say, {npcHandler = npcHandler, text = "They learned the ancient art of dreamwalking from some elves they befriended."})
keywordHandler:addKeyword({'dreamwalking'}, StdModule.say, {npcHandler = npcHandler, text = "While the dreamwalkers of the elves experienenced the brightest dreams of pleasure, the humans strangely had dreams of dark omen."})
keywordHandler:addKeyword({'omen'}, StdModule.say, {npcHandler = npcHandler, text = "They dreamed of doom, destruction, talked to dead, tormented souls, and gained unwanted insight into the schemes of darkness."})
keywordHandler:addKeyword({'schemes'}, StdModule.say, {npcHandler = npcHandler, text = "They figured out how to interpret their dark dreams and so could foresee the plans of the dark gods and their minions."})
keywordHandler:addKeyword({'plan'}, StdModule.say, {npcHandler = npcHandler, text = "Using this knowledge they formed an order to thwart these plans, and because they battled their nightmares as brave as knights, they named their order accordingly."})
keywordHandler:addKeyword({'necromant'}, StdModule.say, {npcHandler = npcHandler, text = "It is rumoured to open the entrance to the pits of inferno, also called the nightmare pits. Even if I knew about this secret I wouldn't tell you."})
keywordHandler:addKeyword({'havok'}, StdModule.say, {npcHandler = npcHandler, text = "Before the battles raged across them, they were called the fair plains."})
keywordHandler:addKeyword({'tibia'}, StdModule.say, {npcHandler = npcHandler, text = "That's where we are. The world of Tibia."})
keywordHandler:addKeyword({'god'}, StdModule.say, {npcHandler = npcHandler, text = "They created Tibia and all life on it ... and unlife, too."})
keywordHandler:addKeyword({'unlife'}, StdModule.say, {npcHandler = npcHandler, text = "Beware the foul undead!"})
keywordHandler:addKeyword({'undead'}, StdModule.say, {npcHandler = npcHandler, text = "Beware the foul undead!"})
keywordHandler:addKeyword({'excalibug'}, StdModule.say, {npcHandler = npcHandler, text = "A weapon of myth and legend. It was lost in ancient times ... perhaps lost forever."})
keywordHandler:addKeyword({'hugo'}, StdModule.say, {npcHandler = npcHandler, text = "Ah, the bane of the Plains of Havoc, the hidden beast, the unbeatable foe. I live here for years and I am sure it's only a myth."})
keywordHandler:addKeyword({'yenny'}, StdModule.say, {npcHandler = npcHandler, text = "Yenny, known as the Gentle, was one of most powerfull magicwielders in ancient times and known throughout the world for her mercy and kindness."})
keywordHandler:addKeyword({'offer'}, StdModule.say, {npcHandler = npcHandler, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'trade'}, StdModule.say, {npcHandler = npcHandler, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'sell'}, StdModule.say, {npcHandler = npcHandler, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'buy'}, StdModule.say, {npcHandler = npcHandler, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'have'}, StdModule.say, {npcHandler = npcHandler, text = "I can offer you the holy tible for a small fee."})
keywordHandler:addKeyword({'time'}, StdModule.say, {npcHandler = npcHandler, text = "Now, it is |TIME|."})

local function creatureSayCallback(cid, type, msg)
   if not npcHandler:isFocused(cid) then
      return false
   end

   local player = Player(cid)
   if msgcontains(msg, 'mission') or msgcontains(msg, 'demon oak') then
      if player:getStorageValue(Storage.DemonOak.Done) < 1 and player:getStorageValue(Storage.DemonOak.Progress) < 2 then
         npcHandler:say("How do you know? Did you go into the infested area?", cid)
         npcHandler.topic[cid] = 1
      elseif player:getStorageValue(Storage.DemonOak.Progress) == 2 and player:getStorageValue(Storage.DemonOak.Done) < 1 then
         npcHandler:say("You better don't return here until you've defeated the Demon Oak.", cid)
      elseif player:getStorageValue(Storage.DemonOak.Done) == 1 then
         npcHandler:say({
            "You chopped down the demon oak?!? Unbelievable!! Let's hope it doesn't come back. As long as evil is still existent in the soil of the plains, it won't be over. Still, the demons suffered a setback, that's for sure. ...",
            "For your brave action, I tell you a secret which has been kept for many many years. There is an old house south of the location where you found the demon oak. There should be a grave with the name 'Yesim Adeit' somewhere close by. ...",
            "It belongs to a Daramian nobleman named 'Teme Saiyid'. I knew him well and he told me -almost augured- that someone will come who is worthy to obtain his treasure. I'm sure this 'someone' is you. Good luck in finding it!"
         }, cid)
         player:setStorageValue(Storage.DemonOak.Done, 2)
      end
   elseif msgcontains(msg, 'yes') and npcHandler.topic[cid] == 1 then
      if player:getStorageValue(Storage.DemonOak.Progress) == 1 then
         npcHandler:say("A demon oak?!? <mumbles some blessings> May the gods be on our side. You'll need a {hallowed axe} to harm that tree. Bring me a simple {axe} and I'll prepare it for you.",cid)
         player:setStorageValue(Storage.DemonOak.Progress, 2)
         npcHandler.topic[cid] = 0
      else
         npcHandler:say("I don't believe a word of it! How rude to lie to a monk!",cid)
         npcHandler.topic[cid] = 0
      end
   elseif msgcontains(msg, 'axe') then
      if player:getStorageValue(Storage.DemonOak.Progress) == 2 then
         npcHandler:say("Ahh, you've got an axe. Very good. I can make a hallowed axe out of it. It will cost you... er... a donation of 1,000 gold. Alright?",cid)
         npcHandler.topic[cid] = 2
      else
         npcHandler:say("You have to first talk about {demon oak} or the {mission} before we continue.",cid)
         npcHandler.topic[cid] = 0
      end
   elseif msgcontains(msg, 'yes') and npcHandler.topic[cid] == 2 then
      if player:getStorageValue(Storage.DemonOak.Progress) == 2 then
         if player:getMoney() >= 1000 then
            if player:removeItem(2386, 1) and player:removeMoney(1000) then
               npcHandler:say("Let's see....<mumbles a prayer>....here we go. The blessing on this axe will be absorbed by all the demonic energy around here. I presume it will not last very long, so better hurry. Actually, I can refresh the blessing as often as you like.",cid)
               player:addItem(8293, 1)
               Npc():getPosition():sendMagicEffect(CONST_ME_YELLOWENERGY)
               npcHandler.topic[cid] = 0
            else
               npcHandler:say("There is no axe with you.",cid)
               npcHandler.topic[cid] = 0
            end
         else
            npcHandler:say("There is not enough of money with you.",cid)
            npcHandler.topic[cid] = 0
         end
      end
   elseif msgcontains(msg, 'no') and npcHandler.topic[cid] == 1 then
      npcHandler:say("What a pity! Let me know when you managed to get in there. Maybe I can help you when we know what we are dealing with.",cid)
      npcHandler.topic[cid] = 0
   elseif msgcontains(msg, 'no') and npcHandler.topic[cid] == 2 then
      npcHandler:say("No then.",cid)
      npcHandler.topic[cid] = 0
   end
   return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())



[Tienes que estar registrado y conectado para ver esa imagen]
http://facebook.com/kruger.sytes.net/

#8 Re: demon oak tfs 1.0 Hoy a las 8:45 pm

Contenido patrocinado


Ver el tema anterior Ver el tema siguiente Volver arriba  Mensaje [Página 1 de 1.]

Permisos de este foro:
No puedes responder a temas en este foro.

 

¿Quién está en línea?

En total hay 0 usuarios en línea: 0 Registrados, 0 Ocultos y 0 Invitado

Usuarios navegando en este foro: Ninguno

Forum Statistics

Nuestros miembros han públicado un total de posts en temas.
Actualmente hay miembros registrados.
Démosle la bienvenida al miembro más reciente,
La mayor cantidad de usuarios en línea ha sido de .