• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Solved Golden Key gain - Rookgaard graves script

xardas33

New Member
Joined
Jan 28, 2010
Messages
83
Reaction score
0
Hello guys. I want to make script to get Golden Key like in this film:
watch from 0:57 to 1:10

But I want to do that in my own version:
You put six same items (with same id) on graves, and put other item in central grave, later using on central grave vial of blood, items are removed and you gain golden key.
Now i created this script:
GoldenKey.lua
Code:
function onUse(cid, item, frompos, item2, topos)
skullpos1 = {x=31978, y=32142, z=10, stackpos=1}
skullpos2 = {x=31979, y=32142, z=10, stackpos=1}
skullpos3 = {x=31980, y=32142, z=10, stackpos=1}
skullmpos4 = {x=31981, y=32142, z=10, stackpos=1}
skullpos5 = {x=31982, y=32142, z=10, stackpos=1}
skullpos6 = {x=31983, y=32142, z=10, stackpos=1}
skullpos7 = {x=31984, y=32142, z=10, stackpos=1}
bloodpos = {x=31981, y=32142, z=10}
getskull1 = getThingfromPos(skullpos1)
getskull2 = getThingfromPos(skullpos2)
getskull3 = getThingfromPos(skullpos3)
getskullm4 = getThingfromPos(skullmpos4)
getskull5 = getThingfromPos(skullpos5)
getskull6 = getThingfromPos(skullpos6)
getskull7 = getThingfromPos(skullpos7)
getblood = getThingfromPos(bloodpos)

if item.itemid == 8059 and getskull1.itemid == 2320 and getskull2.itemid == 2320 and getskull3.itemid == 2320 and getskull5.itemid == 2320 and getskull6.itemid == 2320 and getskull7.itemid == 2320 and getPlayerStorageValue(cid,50021) == 8  then
   if item.itemid == 8059 and item.uid == 60007 and getskullm4.itemid == 5669 and getblood.itemid == 2016 then
     doRemoveItem(getskull1.uid,1)
     doSendMagicEffect(skullpos1,13)
     doRemoveItem(getskull2.uid,1)
     doSendMagicEffect(skullpos2,13)
     doRemoveItem(getskull3.uid,1)
     doSendMagicEffect(skullpos3,13)
     doRemoveItem(getskullm4.uid,1)
     doSendMagicEffect(skullmpos4,36)
     doRemoveItem(getskull5.uid,1)
     doSendMagicEffect(skullpos5,13)
     doRemoveItem(getskull6.uid,1)
     doSendMagicEffect(skullpos6,13)
     doRemoveItem(getskull7.uid,1)
     doSendMagicEffect(skullpos7,13)
     local item = doPlayerAddItem(cid,2091,1)
     doItemSetAttribute(item,"aid",4602)
     setPlayerStorageValue(cid,55021,9)
     doPlayerSendTextMessage(cid,25,"You have found a golden key.")
   end
end
return 1
end

Actions.xml
Code:
<action uniqueid="60007" event="script" value="quests/GoldenKey.lua"/>
Graves have normally id 8059, and i writed extra uniqueid 60007 for central grave. And this script doesn't work.
what i should edit? Someone can help?
 
Last edited:
Central grave:
15:26 You see a grave.
ItemID: [8059], UniqueID: [60007].
Position: [X: 31981] [Y: 32142] [Z: 10].


Other graves don't have uniqueid.
 
Ah... Yes, now it's working with 8059 :)
But i need fire efect on central grave, script working but my console shows (when i gain golden key):
[16/09/2014 20:55:14] [Error - Action Interface]
[16/09/2014 20:55:14] data/actions/scripts/liquids/containers.lua:eek:nUse
[16/09/2014 20:55:14] Description:
[16/09/2014 20:55:14] (luaHasItemProperty) Item not found
 
Under function onUse add
Code:
local skullcheck = itemEx.itemid

Then change this
Code:
if(hasProperty(itemEx.uid, CONST_PROP_BLOCKSOLID)) then
     return false
end
To this
Code:
if skullcheck ~= 5669 then
    if hasProperty(itemEx.uid, CONST_PROP_BLOCKSOLID) then
         return false
    end
end


Fire effect, above local thing = doPlayerAddItem(cid, 2091, 1) add
Code:
doSendMagicEffect({x=31981, y=32142, z=10}, CONST_ME_HITBYFIRE)
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local skullcheck = itemEx.itemid
  if item.itemid == 2006 and item.type == TYPE_BLOOD and getTileItemById(toPosition, 8059).uid == 60007 then
  if getPlayerStorageValue(cid, 50021) ~= 8 then
  return doPlayerSendCancel(cid, "You need to do something else first.")
  end
  for x = 1, #graves do
  if getTileItemById(graves[x].pos, graves[x].id).uid == 0 then
  return doPlayerSendCancel(cid, "Something is wrong.") and doSendMagicEffect(graves[x].pos, CONST_ME_POFF)
  end
  end
  for r = 1, #graves do
  doRemoveItem(getTileItemById(graves[r].pos, graves[r].id).uid)
  doSendMagicEffect(graves[r].pos, CONST_ME_MAGIC_RED)
  end
    doSendMagicEffect({x=31981, y=32142, z=10}, CONST_ME_HITBYFIRE)
  local item = doPlayerAddItem(cid, 2091, 1)
  doItemSetAttribute(item, "aid", 4602)
  setPlayerStorageValue(cid, 50021, 9)
  doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a golden key.")
  end

Code:
if(hasProperty(itemEx.uid, CONST_PROP_BLOCKSOLID)) then
       if skullcheck == 5669 then
       return true
       end

Still error in console... But now I have fire effect as I wanted :)
 
Change this
Code:
if(hasProperty(itemEx.uid, CONST_PROP_BLOCKSOLID)) then
     return false
end

To this
Code:
if skullcheck ~= 5669 then
     if hasProperty(itemEx.uid, CONST_PROP_BLOCKSOLID) then
         return false
     end
end
 
Back
Top