Xaiman
New Member
- Joined
- Feb 27, 2010
- Messages
- 94
- Reaction score
- 0
I never script so i really dont know what im doing but this is what i have.. yet i cant get it to work.
and the xml...
Code:
local drunk = createConditionObject(CONDITION_DRUNK)
setConditionParam(drunk, CONDITION_PARAM_TICKS, 10 * 1000)
setConditionParam(drunk, CONDITION_PARAM_BUFF, TRUE)
function onStepIn(cid, item, position, fromPosition, item2)
local p = {cid = cid, position = position}
local position = getCreaturePosition(cid)
position.stackpos = 255
if(item.actionid == 904) then
local lightLevel = math.random(1, 10)
local lightTicks = 1
local lighttextRND = math.random(1, 254)
local rand = math.random(1, 9)
if rand == 1 then
doSetCreatureLight(cid, lightLevel, 78, lightTicks)
return doAddCondition(cid, drunk)
elseif rand == 2 then
doSetCreatureLight(cid, lightLevel, 147, lightTicks)
return TRUE
elseif rand == 3 then
doSetCreatureLight(cid, lightLevel, 203, lightTicks)
return TRUE
elseif rand == 4 then
doSetCreatureLight(cid, lightLevel, 180, lightTicks)
return TRUE
elseif rand == 5 then
doSetCreatureLight(cid, lightLevel, 5, lightTicks)
return TRUE
elseif rand == 6 then
doSetCreatureLight(cid, lightLevel, 6, lightTicks)
return TRUE
elseif rand == 7 then
doSetCreatureLight(cid, lightLevel, 174, lightTicks)
return TRUE
elseif rand == 8 then
doSetCreatureLight(cid, lightLevel, 1, lightTicks)
return TRUE
elseif rand == 9 then
doSetCreatureLight(cid, lightLevel, 1, lightTicks)
return TRUE
end
return 1
end
end
and the xml...
Code:
<movevent event="StepIn" actionid="904" script="discosquare.lua"/>