• 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!

Lua [Script, Action] Item summon.

davidml

Mapper
Joined
Jul 5, 2012
Messages
24
Reaction score
0
Location
TX
Hi OTland. In this case im looking for a script, that when i "Use" (right click) to this statue,

6iEcrj.png

6iEcrj.png">


a monster appears, like Wrath of The Emperor Quest

I have already tried with these scripts but do not work when i test.

OT/data/actions/scripts/statue1.lua
Code:
local config = {
item = 12383,
uid = 64307,
delay = 1,
monster = "Mutated Zalamon",
msg = "Use the statue again!.",
pos = {x = 1290, y = 1218, z = 12}}
local config = {
item = 12383,
uid = 64308,
delay = 1,
monster = "Scorn Of The Emperor",
msg = "Use the statue again NOOB!.",
pos = {x = 1283, y = 1224, z = 12}}
local config = {
item = 12383,
uid = 64309,
delay = 1,
monster = "Spite Of The Emperor",
msg = "Prepare for die.",
pos = {x = 1293, y = 1224, z = 12}}
local config = {
item = 12383,
uid = 64310,
delay = 1,
monster = "Fury Of The Emperor",
msg = "Grrrroaar!.",
pos = {x = 1293, y = 1230, z = 12}}
local config = {
item = 12383,
uid = 64311,
delay = 1,
monster = "Wrath Of The Emperor",
msg = "Rest In Peace!.",
pos = {x = 1283, y = 1230, z = 12}}
local config = {
item = 12383,
uid = 64312,
delay = 1,
monster = "Snake God Essence",
msg = "Im gonna kill you!.",
pos = {x = 1289, y = 1235, z = 12}}

local active = -1

function onUse(cid, item, fromPosition, itemEx, toPosition)
if (item.itemid == config.item and item.uid == config.uid and active == -1) then
doCreatureSay(cid, config.msg, TALKTYPE_MONSTER_SAY)
active = 1
addEvent(summonMonster, 1000, cid)
end
return true
end

function summonMonster(cid)
if (second == nil) then
second = config.delay
else
second = (second - 1)
end

if (second == 0) then
doCreateMonster(config.monster, config.pos)
second = config.delay
active = -1
else
doCreatureSay(cid, second, TALKTYPE_MONSTER_SAY)
addEvent(summonMonster, 1000, cid)
end
return true
end

OT/data/actions/actions.xml
Code:
       <action uniqueid="64307-64312" event="script" value="statue1.lua"/>

My idea is that it looks like:

url]

k1dDCU.png


Thx for read the thread, have a good day, i hope someone can help me, greetings.
 
Last edited:
Which server do you use? Should it do something else besides spawning 1 monster?
I don't know this quest so more information would be useful.
 
sorry, im using crystal server 9.81, that quest its an edited quest by me, but im just looking for a script to do that using the statue, the monster appears by the statues of the picture.

for example.
when i want to use the statue 1, appears mutated zalamon
when i want to use the statue 2, appears scorn of the emperor
when i want to use the statue 3, appears spite of the emperor
etc...
 
Last edited:
You can do the table like this
Code:
local config = {
   [64307] = {
     item = 12383,
     delay = 1,
     monster = "Mutated Zalamon",
     msg = "Use the statue again!.",
     pos = {x = 1290, y = 1218, z = 12}
   },
   [64308] = {
     item = 12383,
     delay = 1,
     monster = "Scorn Of The Emperor",
     msg = "Use the statue again NOOB!.",
     pos = {x = 1283, y = 1224, z = 12}
   },
   [64309] = {
     item = 12383,
     delay = 1,
     monster = "Spite Of The Emperor",
     msg = "Prepare for die.",
     pos = {x = 1293, y = 1224, z = 12}
   },
   [64310] = {
     item = 12383,
     delay = 1,
     monster = "Fury Of The Emperor",
     msg = "Grrrroaar!.",
     pos = {x = 1293, y = 1230, z = 12}
   },
   [64311] = {
     item = 12383,
     delay = 1,
     monster = "Wrath Of The Emperor",
     msg = "Rest In Peace!.",
     pos = {x = 1283, y = 1230, z = 12}
   },
   [64312] = {
     item = 12383,
     delay = 1,
     monster = "Snake God Essence",
     msg = "Im gonna kill you!.",
     pos = {x = 1289, y = 1235, z = 12}
   }
}
Then instead of config.pos etc, you can make a variable linking item.uid to the table.
Code:
local x = config[item.uid]
Then you can use x.pos, x.monster, etc.
 
Give more information, do you get errors, how did you added it? It's possible I made type mistakes or misunderstood how the script is supposed to work.
But "didn't work" is not a clear description of what should be different.
 
Back
Top