• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Pits of inferno real! Bazir mirror and tapestry 26.11.2012

BDG

Banned User
Joined
Nov 26, 2012
Messages
84
Reaction score
1
Code:
<action fromaid="10088" toaid="10089" event="script" value="pitsofinferno/mirror.lua"/>

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local tapestry = 6434
local mirror = 1847
local blue_tapestry_pos_create = { x=915, y=1466, z=14, stackpos=2}
local blue_tapestry_pos = { x=915, y=1467, z=14, stackpos=2}
local remove_blue_tapestry = getThingFromPos(blue_tapestry_pos)
if itemEx.actionid == 10088 and itemEx.itemid == tapestry then
doRemoveItem(remove_blue_tapestry.uid,1)
doCreateItem(6434,1,blue_tapestry_pos_create)
end
local cbtp = { x=915, y=1467, z=14, stackpos=2}
local rbtp = { x=915, y=1466, z=14, stackpos=2}
local rbt = getThingFromPos(rbtp)
local pos = {x = 916, y = 1467, z = 13}
if itemEx.actionid == 10089 and itemEx.itemid == mirror then
local ek = doCreateItem(6434,1,cbtp)
doSetItemActionId(ek, 10088)
doRemoveItem(rbt.uid,1)
doTeleportThing(cid, pos)
doSendMagicEffect(getCreaturePosition(cid),10)
doCreatureSay(cid, "Beauty has to be rewarded! Muahahaha!", TALKTYPE_ORANGE_1)
end
end
 
Use tabs

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local tapestry = 6434
	local mirror = 1847
	local blue_tapestry_pos_create = { x=915, y=1466, z=14, stackpos=2}
	local blue_tapestry_pos = { x=915, y=1467, z=14, stackpos=2}
	local remove_blue_tapestry = getThingFromPos(blue_tapestry_pos)
	local cbtp = { x=915, y=1467, z=14, stackpos=2}
	local rbtp = { x=915, y=1466, z=14, stackpos=2}
	local rbt = getThingFromPos(rbtp)
	local pos = {x = 916, y = 1467, z = 13}
	local ek = doCreateItem(6434,1,cbtp)
	
	if itemEx.actionid == 10088 and itemEx.itemid == tapestry then
		doRemoveItem(remove_blue_tapestry.uid,1)
		doCreateItem(6434,1,blue_tapestry_pos_create)
	end

	if itemEx.actionid == 10089 and itemEx.itemid == mirror then
		doSetItemActionId(ek, 10088)
		doRemoveItem(rbt.uid,1)
		doTeleportThing(cid, pos)
		doSendMagicEffect(getCreaturePosition(cid),10)
		doCreatureSay(cid, "Beauty has to be rewarded! Muahahaha!", TALKTYPE_ORANGE_1)
	end
end
 
It makes it easier for others to read through the script, and it doesn't look like a total mess. :p
 
Back
Top