Hi members of OtLand!
Once again I need your help again!
I am trying to edit a Lua Script for Inquisition to add StorageValues, but...<_<
As stupid as I am... I am not sure how to "get" information from a "Variable"(?).
Posting the script here:
As you see in the code ( at the variable Bosses), I have added StorageValue Number( exmple: 14014, at boss name Hellgorak)
and then use that StorageValue with this code
I think that you maybe understand what I am trying to ask, but if you don't understand please ASK
Thanks in Advance!
PS: Is it possible to do that EVERYONE who hits the boss could get the storageValue, and not only the last hitter? If it's possible, how?
Edit:
I am not sure but changing:
To:
and adding :
Might work?
Edit:
Worthless<_< didn't work
EDIT: (Solved).
Okey I solved this, by creating a new mod with only storagevalues.
Once again I need your help again!
I am trying to edit a Lua Script for Inquisition to add StorageValues, but...<_<
As stupid as I am... I am not sure how to "get" information from a "Variable"(?).
Posting the script here:
Lua:
local config = {
message = "Go into the teleporter in 3 minutes, else it will disappear.",
timeToRemove = 180, -- seconds
teleportId = 1387,
bosses = { -- Monster Name, Teleport To Position, Teleport Position, StorageValue
["Ushuriel"] = { { x=10359, y=10926, z=5 }, { x=10314, y=10995, z=5, stackpos=1 }, 14012 },
["Annihilon"] = { { x=10431, y=11083, z=5 }, { x=10373, y=10985, z=5, stackpos=1 }, 14013 },
["Hellgorak"] = { { x=10252, y=11095, z=5 }, { x=10378, y=11027, z=5, stackpos=1 }, 14014 },
["Madareth"] = { { x=10231, y=10990, z=6 }, { x=10298, y=110275, z=5, stackpos=1 }, 14015 },
["Zugurosh"] = { { x=10314, y=10937, z=5 }, { x=10336, y=11000, z=5, stackpos=1 }, 14016 },
["Latrivan"] = { { x=10338, y=10982, z=6 }, { x=10333, y=11031, z=5, stackpos=1 }, 14017 }
}
}
local function removal(position)
if getThingfromPos(position).itemid == config.teleportId then
doRemoveItem(getThingfromPos(position).uid)
end
return TRUE
end
function onKill(cid, target, lastHit)
if lastHit == true then
local position = getCreaturePosition(target)
for name, pos in pairs(config.bosses) do
if name == getCreatureName(target) then
teleport = doCreateTeleport(config.teleportId, pos[1], pos[2])
doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
addEvent(removal, config.timeToRemove * 1000, pos[2])
doSendMagicEffect(pos[2], 10)
end
end
end
return TRUE
end
and then use that StorageValue with this code
Lua:
if getPlayerStorageValue(cid,14014) == -1 then
setPlayerStorageValue(cid,14014,1)
I think that you maybe understand what I am trying to ask, but if you don't understand please ASK
Thanks in Advance!
PS: Is it possible to do that EVERYONE who hits the boss could get the storageValue, and not only the last hitter? If it's possible, how?
Edit:
I am not sure but changing:
Lua:
for name, pos in pairs(config.bosses) do
Lua:
for name, pos in pairs, storage(config.bosses) do
Lua:
if getPlayerStorageValue(cid,storage) == -1 then
setPlayerStorageValue(cid,storage,1)
end
Edit:
Worthless<_< didn't work
Code:
[Error - CreatureScript Interface]
buffer:onKill
Description:
[string "loadBuffer"]:49: attempt to call global 'storage' (a nil value)
stack traceback:
[string "loadBuffer"]:49: in function <[string "loadBuffer"]:44>
Okey I solved this, by creating a new mod with only storagevalues.
Last edited: