Mam problem z demon oak quest. Wszystko działa oprócz gravestone, kiedy ide do niego po rozmowie z oldrakiem (i ubiciem wcześniej oaka) klikam na grób i nic się nie dzieje. Pozycje są dobre, może coś ze storage? Jeżeli wiecie jak to naprawić... Oto skrypt;
Oldrak:
HallowedaAxe:
(jeżeli trzeba, dodam też skrypt z demon oakiem).
Próbowałem już z kilkanaście innych skryptów, ale ten sam efekt.
ps. Wszytkie uid, pozycje są dobrze przypisane...
Oldrak:
PHP:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
-- OTServ event handling functions start
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
-- OTServ event handling functions end
local hallowedAxePrice = 2000 -- Price of the hallowed axe.
function creatureSayCallback(cid, type, msg)
-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
if (not npcHandler:isFocused(cid)) then
return false
end
if msgcontains(msg, 'hallowed axe') then
if getPlayerStorageValue(cid,29061) == 1 then
npcHandler:say('Do you want to buy a Hallowed Axe from me?', cid)
talk_state = 1
end
elseif msgcontains(msg, 'yes') and talk_state == 1 then
if getPlayerItemCount(cid,2386) >= 1 and getPlayerMoney(cid) >= hallowedAxePrice then
if doPlayerRemoveMoney(cid, hallowedAxePrice) == true then
npcHandler:say('Here you are. You can now defeat the demon oak with this axe.', cid)
doPlayerRemoveItem(cid, 2386, 1)
doPlayerAddItem(cid, 8293, 1)
talk_state = 0
end
else
npcHandler:say('I need an axe and '.. hallowedAxePrice ..' gold coins to make you an {hallowed axe}.', cid)
talk_state = 0
end
elseif msgcontains(msg, 'demon oak') then
if getPlayerStorageValue(cid,29061) == 1 then
npcHandler:say('Did you defeat the demon oak?', cid)
talk_state = 2
end
elseif msgcontains(msg, 'yes') and talk_state == 2 then
if getPlayerStorageValue(cid,21545) == 2 then
npcHandler:say('Good job!', cid)
setPlayerStorageValue(cid,21545,3)
talk_state = 0
else
npcHandler:say('Go defeat the demon oak first.', cid)
talk_state = 0
end
------------------------------------------------ confirm no ------------------------------------------------
elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 3) then
npcHandler:say('Ok thanks.', cid)
talk_state = 0
end
-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
HallowedaAxe:
PHP:
--- Made by GM Rufus ---
function onUse(cid, item, fromPosition, itemEx, toPosition)
--- Config --
blocktree = {32193} --- The uniqueid of the dead tree. ---
levelneeded = 120 --- How much level you need to enter the arena ---
--- First part ---
summonweak1Position = {x=656, y=1161, z=7}
summonweak2Position = {x=667, y=1161, z=7}
summonweak3Position = {x=656, y=1168, z=7}
summonweak4Position = {x=667, y=1168, z=7}
summonweakone1Position = {x=656, y=1161, z=7}
summonweakone2Position = {x=667, y=1161, z=7}
summonweakone3Position = {x=656, y=1168, z=7}
summonweakone4Position = {x=667, y=1168, z=7}
summonweaktwo1Position = {x=656, y=1161, z=7}
summonweaktwo2Position = {x=667, y=1161, z=7}
summonweaktwo3Position = {x=656, y=1168, z=7}
summonweaktwo4Position = {x=667, y=1168, z=7}
--- Second Part ---
summonnormal1Position = {x=666, y=1164, z=7}
summonnormal2Position = {x=657, y=1164, z=7}
summonnormal3Position = {x=654, y=1164, z=7}
summonnormal4Position = {x=668, y=1164, z=7}
summonnormalone1Position = {x=666, y=1164, z=7}
summonnormalone2Position = {x=657, y=1164, z=7}
summonnormalone3Position = {x=654, y=1164, z=7}
summonnormalone4Position = {x=668, y=1164, z=7}
summonnormaltwo1Position = {x=666, y=1164, z=7}
summonnormaltwo2Position = {x=657, y=1164, z=7}
summonnormaltwo3Position = {x=654, y=1164, z=7}
summonnormaltwo4Position = {x=668, y=1164, z=7}
--- Third Part ---
summonmedium1Position = {x=665, y=1165, z=7}
summonmedium2Position = {x=659, y=1165, z=7}
summonmedium3Position = {x=658, y=1165, z=7}
summonmedium4Position = {x=666, y=1165, z=7}
summonmediumone1Position = {x=665, y=1165, z=7}
summonmediumone2Position = {x=659, y=1165, z=7}
summonmediumone3Position = {x=658, y=1165, z=7}
summonmediumone4Position = {x=666, y=1165, z=7}
summonmediumtwo1Position = {x=665, y=1165, z=7}
summonmediumtwo2Position = {x=659, y=1165, z=7}
summonmediumtwo3Position = {x=658, y=1165, z=7}
summonmediumtwo4Position = {x=666, y=1165, z=7}
--- Fourth Part ---
summonhard1Position = {x=664, y=1166, z=7}
summonhard2Position = {x=660, y=1166, z=7}
summonhard3Position = {x=659, y=1166, z=7}
summonhard4Position = {x=666, y=1166, z=7}
summonhardone1Position = {x=664, y=1166, z=7}
summonhardone2Position = {x=660, y=1166, z=7}
summonhardone3Position = {x=659, y=1166, z=7}
summonhardone4Position = {x=666, y=1166, z=7}
--- Teleport Back Positions ---
back1Position = {x=662, y=1140, z=7}
back2Position = {x=663, y=1140, z=7}
back3Position = {x=664, y=1140, z=7}
back4Position = {x=665, y=1140, z=7}
back5Position = {x=666, y=1140, z=7}
--- End Config ---
demonoak = {8288, 8289, 8290, 8291}
if itemEx.itemid == 2717 and itemEx.itemuid == blocktree and getPlayerLevel(cid) >= levelneeded and (getPlayerStorageValue(cid, 21544) == 3) == FALSE then
doTransformItem(itemEx.uid, 3669)
doTeleportThing(cid, toPosition, TRUE)
elseif itemEx.itemid == 8288 or itemEx.itemid == 8289 or itemEx.itemid == 8290 or itemEx.itemid == 8291 then
if getPlayerStorageValue(cid, itemEx.itemid) == -1 and getPlayerStorageValue(cid, 21541) == -1 then
if math.random(1, 2) == 1 then
setPlayerStorageValue(cid, 21541, 1)
doSendMagicEffect(toPosition, 0)
doSummonCreature("Diabolic Imp", summonweak1Position)
doSummonCreature("Warlock", summonweak2Position)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
elseif math.random(1, 2) == 2 then
doSendMagicEffect(toPosition, 0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
end
elseif getPlayerStorageValue(cid, itemEx.itemid) == -1 and getPlayerStorageValue(cid, 21541) == 1 then
if math.random(1, 2) == 1 then
setPlayerStorageValue(cid, 21541, 2)
doSendMagicEffect(toPosition, 0)
doSummonCreature("Nightmare", summonweakone1Position)
doSummonCreature("Dragon Lord", summonweakone3Position)
doSummonCreature("Grim Reaper", summonweakone4Position)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
elseif math.random(1, 2) == 2 then
doSendMagicEffect(toPosition, 0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
end
elseif getPlayerStorageValue(cid, itemEx.itemid) == -1 and getPlayerStorageValue(cid, 21541) == 2 then
if math.random(1, 2) == 1 then
setPlayerStorageValue(cid, 21541, 3)
doSendMagicEffect(toPosition, 0)
doSummonCreature("Hand of cursed fate", summonweaktwo1Position)
doSummonCreature("Hellfire Fighter", summonweaktwo2Position)
doSummonCreature("Juggernaut", summonweaktwo4Position)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
if itemEx.itemid == 8288 then
setPlayerStorageValue(cid, itemEx.itemid, 1)
elseif itemEx.itemid == 8289 then
setPlayerStorageValue(cid, itemEx.itemid, 1)
elseif itemEx.itemid == 8290 then
setPlayerStorageValue(cid, itemEx.itemid, 1)
elseif itemEx.itemid == 8291 then
setPlayerStorageValue(cid, itemEx.itemid, 1)
end
elseif math.random(1, 2) == 2 then
doSendMagicEffect(toPosition, 0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
end
elseif getPlayerStorageValue(cid, itemEx.itemid) == -1 and getPlayerStorageValue(cid, 21541) == 3 and getPlayerStorageValue(cid, 21542) == -1 then
if math.random(1, 2) == 1 then
setPlayerStorageValue(cid, 21542, 1)
doSendMagicEffect(toPosition, 0)
doSummonCreature("Massive Water Elemental", summonnormal1Position)
doSummonCreature("Earth Elemental", summonnormal2Position)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -500, -700, CONST_ME_BIGPLANTS)
elseif math.random(1, 2) == 2 then
doSendMagicEffect(toPosition, 0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -500, -700, CONST_ME_BIGPLANTS)
end
elseif getPlayerStorageValue(cid, itemEx.itemid) == -1 and getPlayerStorageValue(cid, 21541) == 3 and getPlayerStorageValue(cid, 21542) == 1 then
if math.random(1, 2) == 1 then
setPlayerStorageValue(cid, 21542, 2)
doSendMagicEffect(toPosition, 0)
doSummonCreature("Blazing Fire Elemental", summonnormal1Position)
doSummonCreature("Massive Energy Elemental", summonnormalone2Position)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -500, -700, CONST_ME_BIGPLANTS)
elseif math.random(1, 2) == 2 then
doSendMagicEffect(toPosition, 0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -500, -700, CONST_ME_BIGPLANTS)
end
elseif getPlayerStorageValue(cid, itemEx.itemid) == -1 and getPlayerStorageValue(cid, 21541) == 3 and getPlayerStorageValue(cid, 21542) == 2 then
if math.random(1, 2) == 1 then
setPlayerStorageValue(cid, 21542, 3)
doSendMagicEffect(toPosition, 0)
doSummonCreature("Demon", summonnormaltwo1Position)
doSummonCreature("Demon", summonnormaltwo2Position)
doSummonCreature("Demon", summonnormaltwo3Position)
doSummonCreature("Demon", summonnormaltwo4Position)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -500, -700, CONST_ME_BIGPLANTS)
if itemEx.itemid == 8288 then
setPlayerStorageValue(cid, itemEx.itemid, 1)
elseif itemEx.itemid == 8289 then
setPlayerStorageValue(cid, itemEx.itemid, 1)
elseif itemEx.itemid == 8290 then
setPlayerStorageValue(cid, itemEx.itemid, 1)
elseif itemEx.itemid == 8291 then
setPlayerStorageValue(cid, itemEx.itemid, 1)
end
elseif math.random(1, 2) == 2 then
doSendMagicEffect(toPosition, 0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -500, -700, CONST_ME_BIGPLANTS)
end
elseif getPlayerStorageValue(cid, itemEx.itemid) == -1 and getPlayerStorageValue(cid, 21541) == 3 and getPlayerStorageValue(cid, 21542) == 3 and getPlayerStorageValue(cid, 21543) == -1 then
if math.random(1, 2) == 1 then
setPlayerStorageValue(cid, 21543, 1)
doSendMagicEffect(toPosition, 0)
doSummonCreature("Serpent Spawn", summonmedium2Position)
doSummonCreature("Sea Serpent", summonmedium3Position)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -500, -700, CONST_ME_BIGPLANTS)
elseif math.random(1, 2) == 2 then
doSendMagicEffect(toPosition, 0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -500, -700, CONST_ME_BIGPLANTS)
end
elseif getPlayerStorageValue(cid, itemEx.itemid) == -1 and getPlayerStorageValue(cid, 21541) == 3 and getPlayerStorageValue(cid, 21542) == 3 and getPlayerStorageValue(cid, 21543) == 1 then
if math.random(1, 2) == 1 then
setPlayerStorageValue(cid, 21543, 2)
doSendMagicEffect(toPosition, 0)
doSummonCreature("Grim Reaper", summonmediumone1Position)
doSummonCreature("Grim Reaper", summonmediumone2Position)
doSummonCreature("Wyrm", summonmediumone3Position)
doSummonCreature("Wyrm", summonmediumone4Position)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -500, -700, CONST_ME_BIGPLANTS)
elseif math.random(1, 2) == 2 then
doSendMagicEffect(toPosition, 0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -500, -700, CONST_ME_BIGPLANTS)
end
elseif getPlayerStorageValue(cid, itemEx.itemid) == -1 and getPlayerStorageValue(cid, 21541) == 3 and getPlayerStorageValue(cid, 21542) == 3 and getPlayerStorageValue(cid, 21543) == 2 then
if math.random(1, 2) == 1 then
setPlayerStorageValue(cid, 21543, 3)
doSendMagicEffect(toPosition, 0)
doSummonCreature("Hero", summonmediumtwo1Position)
doSummonCreature("Warlock", summonmediumtwo2Position)
doSummonCreature("Demon", summonmediumtwo3Position)
doSummonCreature("Demon", summonmediumtwo4Position)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -500, -700, CONST_ME_BIGPLANTS)
if itemEx.itemid == 8288 then
setPlayerStorageValue(cid, itemEx.itemid, 1)
elseif itemEx.itemid == 8289 then
setPlayerStorageValue(cid, itemEx.itemid, 1)
elseif itemEx.itemid == 8290 then
setPlayerStorageValue(cid, itemEx.itemid, 1)
elseif itemEx.itemid == 8291 then
setPlayerStorageValue(cid, itemEx.itemid, 1)
end
elseif math.random(1, 2) == 2 then
doSendMagicEffect(toPosition, 0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -500, -700, CONST_ME_BIGPLANTS)
end
elseif getPlayerStorageValue(cid, itemEx.itemid) == -1 and getPlayerStorageValue(cid, 21541) == 3 and getPlayerStorageValue(cid, 21542) == 3 and getPlayerStorageValue(cid, 21543) == 3 and getPlayerStorageValue(cid, 21544) == -1 then
if math.random(1, 2) == 1 then
setPlayerStorageValue(cid, 21545, 1)
doSendMagicEffect(toPosition, 0)
doSummonCreature("The Demon Oak", summonhard3Position)
doPlayerTakeItem(cid,8293,1)
doPlayerAddItem(cid,2386,1)
doPlayerSendTextMessage(cid, 20, 'THAT WAS THE LAST TIME YOU TOUCHED ME! NOW DIE!')
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -800, -1000, CONST_ME_BIGPLANTS)
elseif math.random(1, 2) == 2 then
doSendMagicEffect(toPosition, 0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -500, -700, CONST_ME_BIGPLANTS)
end
elseif getPlayerStorageValue(cid, itemEx.itemid) == -1 and getPlayerStorageValue(cid, 21541) == 3 and getPlayerStorageValue(cid, 21542) == 3 and getPlayerStorageValue(cid, 21543) == 3 and getPlayerStorageValue(cid, 21544) == 1 then
if math.random(1, 2) == 1 then
setPlayerStorageValue(cid, 21544, 2)
doSendMagicEffect(toPosition, 0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -500, -700, CONST_ME_BIGPLANTS)
elseif math.random(1, 2) == 2 then
doSendMagicEffect(toPosition, 0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -500, -700, CONST_ME_BIGPLANTS)
end
elseif getPlayerStorageValue(cid, itemEx.itemid) == -1 and getPlayerStorageValue(cid, 21541) == 3 and getPlayerStorageValue(cid, 21542) == 3 and getPlayerStorageValue(cid, 21543) == 3 and getPlayerStorageValue(cid, 21544) == 2 then
if math.random(1, 2) == 1 then
setPlayerStorageValue(cid, 21544, 3)
doSendMagicEffect(toPosition, 0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -500, -700, CONST_ME_BIGPLANTS)
if itemEx.itemid == 8288 then
setPlayerStorageValue(cid, itemEx.itemid, 1)
if getPlayerStorageValue(cid, 8288) == 1 and getPlayerStorageValue(cid, 8289) == 1 and getPlayerStorageValue(cid, 8290) == 1 and getPlayerStorageValue(cid, 8291) == 1 then
setPlayerStorageValue(cid, 21545, 1)
if math.random(1, 5) == 1 then
doSendMagicEffect(fromPosition, 10)
doTeleportThing(cid,back1Position)
elseif math.random(1, 5) == 2 then
doSendMagicEffect(fromPosition, 10)
doTeleportThing(cid,back2Position)
elseif math.random(1, 5) == 3 then
doSendMagicEffect(fromPosition, 10)
doTeleportThing(cid,back3Position)
elseif math.random(1, 5) == 4 then
doSendMagicEffect(fromPosition, 10)
doTeleportThing(cid,back4Position)
elseif math.random(1, 5) == 5 then
doSendMagicEffect(fromPosition, 10)
doTeleportThing(cid,back5Position)
end
end
elseif itemEx.itemid == 8289 then
setPlayerStorageValue(cid, itemEx.itemid, 1)
if getPlayerStorageValue(cid, 8288) == 1 and getPlayerStorageValue(cid, 8289) == 1 and getPlayerStorageValue(cid, 8290) == 1 and getPlayerStorageValue(cid, 8291) == 1 then
setPlayerStorageValue(cid, 21545, 1)
if math.random(1, 5) == 1 then
doSendMagicEffect(fromPosition, 10)
doTeleportThing(cid,back1Position)
elseif math.random(1, 5) == 2 then
doSendMagicEffect(fromPosition, 10)
doTeleportThing(cid,back2Position)
elseif math.random(1, 5) == 3 then
doSendMagicEffect(fromPosition, 10)
doTeleportThing(cid,back3Position)
elseif math.random(1, 5) == 4 then
doSendMagicEffect(fromPosition, 10)
doTeleportThing(cid,back4Position)
elseif math.random(1, 5) == 5 then
doSendMagicEffect(fromPosition, 10)
doTeleportThing(cid,back5Position)
end
end
elseif itemEx.itemid == 8290 then
setPlayerStorageValue(cid, itemEx.itemid, 1)
if getPlayerStorageValue(cid, 8288) == 1 and getPlayerStorageValue(cid, 8289) == 1 and getPlayerStorageValue(cid, 8290) == 1 and getPlayerStorageValue(cid, 8291) == 1 then
setPlayerStorageValue(cid, 21545, 1)
if math.random(1, 5) == 1 then
doSendMagicEffect(fromPosition, 10)
doTeleportThing(cid,back1Position)
elseif math.random(1, 5) == 2 then
doSendMagicEffect(fromPosition, 10)
doTeleportThing(cid,back2Position)
elseif math.random(1, 5) == 3 then
doSendMagicEffect(fromPosition, 10)
doTeleportThing(cid,back3Position)
elseif math.random(1, 5) == 4 then
doSendMagicEffect(fromPosition, 10)
doTeleportThing(cid,back4Position)
elseif math.random(1, 5) == 5 then
doSendMagicEffect(fromPosition, 10)
doTeleportThing(cid,back5Position)
end
end
elseif itemEx.itemid == 8291 then
setPlayerStorageValue(cid, itemEx.itemid, 1)
if getPlayerStorageValue(cid, 8288) == 1 and getPlayerStorageValue(cid, 8289) == 1 and getPlayerStorageValue(cid, 8290) == 1 and getPlayerStorageValue(cid, 8291) == 1 then
setPlayerStorageValue(cid, 21545, 1)
if math.random(1, 5) == 1 then
doSendMagicEffect(fromPosition, 10)
doTeleportThing(cid,back1Position)
elseif math.random(1, 5) == 2 then
doSendMagicEffect(fromPosition, 10)
doTeleportThing(cid,back2Position)
elseif math.random(1, 5) == 3 then
doSendMagicEffect(fromPosition, 10)
doTeleportThing(cid,back3Position)
elseif math.random(1, 5) == 4 then
doSendMagicEffect(fromPosition, 10)
doTeleportThing(cid,back4Position)
elseif math.random(1, 5) == 5 then
doSendMagicEffect(fromPosition, 10)
doTeleportThing(cid,back5Position)
end
end
end
elseif math.random(1, 2) == 2 then
doSendMagicEffect(toPosition, 0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -500, -700, CONST_ME_BIGPLANTS)
setPlayerStorageValue(cid, 8585, 1)
end
else
doSendMagicEffect(toPosition, 2)
end
end
return TRUE
end
(jeżeli trzeba, dodam też skrypt z demon oakiem).
Próbowałem już z kilkanaście innych skryptów, ale ten sam efekt.
ps. Wszytkie uid, pozycje są dobrze przypisane...
Last edited: