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

Komic's Scripts

Komic

MChem
Joined
Jun 8, 2007
Messages
359
Reaction score
51
Here are several of my scripts that I have made:
Cult Piano
cultpiano.lua
Code:
function onUse(cid, item, frompos, item2, topos)

VERSE = {6087, 6088, 6089, 6090}
queststatus = getPlayerStorageValue(cid,item.itemid)
versestatus1 = getPlayerStorageValue(cid, 6087)
versestatus2 = getPlayerStorageValue(cid, 6088)
versestatus3 = getPlayerStorageValue(cid, 6089)
versestatus4 = getPlayerStorageValue(cid, 6090)
npos = {x=topos.x+5, y=topos.y, z=topos.z} -- The posistion you want the player to be teleported too

if item.uid == 6087 then
	if versestatus1 == 1 and versestatus2 == 1 and versestatus3 == 1 and versestatus4 == 1 then
		doSendMagicEffect(topos,18)
		doPlayerSendTextMessage(cid,22,"You have successfully played the song.")
		doTeleportThing(cid,npos,1)--Not for TFS delete ,1
	else
		 doPlayerSendTextMessage(cid,22,"You dont know the complete song.")
	end
elseif isInArray(VERSE,item.itemid) == 1 then
	if queststatus ~= 1 then
		doSendMagicEffect(frompos, 18)
		doRemoveItem(item.uid,1)
		setPlayerStorageValue(cid,item.itemid,1)				
		doPlayerSendTextMessage(cid,22,"You have successfully learnt verse number "..(item.itemid - 6086)..".")	
	else
		doPlayerSendTextMessage(cid,22,"You already know this verse.")
	end
end
end
in actions.xml
Code:
<action itemid="6087" script="cultpiano.lua"/>
<action itemid="6088" script="cultpiano.lua"/>
<action itemid="6089" script="cultpiano.lua"/>
<action itemid="6090" script="cultpiano.lua"/>
<action uniqueid="6087" script="cultpiano.lua"/>
Turtle Teleporters -- used on the TFS Map
Code:
function onStepIn(cid, item, pos)
	doSendMagicEffect(pos, 12)
	doTeleportThing(cid, {x = item.actionid - 40000, y = item.uid - 40000, z = pos.z})
	doSendMagicEffect({x = item.actionid - 40000, y = item.uid - 40000, z = pos.z}, 12)
end

in movements.xml
Code:
  <movevent event="StepIn" itemid="5756" script="turtle.lua" />
Set the action and unique ids of the turtle to 40,000 plus the co ords of where you want to go

100% Traps
trap1.lua
Code:
function onStepIn(cid, item, topos)
dmg = 30
if (item.itemid == 1510) or (item.itemid == 1512) or (item.itemid == 4208) then
doPlayerAddHealth(cid,-dmg)
doSendAnimatedText(topos,dmg,180)
doPlayerSendTextMessage(cid, 20, "You lose "..dmg.." hitpoints.")
doTransformItem(item.uid,item.itemid+1)
doSendMagicEffect(topos,0)
blood = doCreateItem(2028, 2, topos)
doDecayItem(blood)
else
return 0
end

end

trap2.lua
Code:
function onStepOut(cid, item, frompos)

if (item.itemid == 1511) or (item.itemid == 1513) or (item.itemid == 4209) then
doTransformItem(item.uid,item.itemid-1)
else
return 0
end

end

in movements.xml
Code:
<movevent event="StepIn" itemid="1512" script="trap.lua" />
<movevent event="StepOut" itemid="1511" script="trap2.lua" />
<movevent event="StepIn" itemid="1510" script="trap.lua" />
<movevent event="StepOut" itemid="1513" script="trap2.lua" />
<movevent event="StepIn" itemid="4208" script="trap.lua" />
<movevent event="StepOut" itemid="4209" script="trap2.lua" />
 
Banshee Quest

banshee.lua
Code:
function onStepIn(cid, item, pos)

queststatus = getPlayerStorageValue(cid,item.actionid)

if item.actionid == 20001 then
	ghost1pos = {x=frompos.x, y=frompos.y, z=frompos.z}
	ghost2pos = {x=frompos.x, y=frompos.y, z=frompos.z}
	dspos = {x=frompos.x, y=frompos.y, z=frompos.z}
	if queststatus ~= 1 then
		setPlayerStorageValue(cid,item.actionid,1)
		doPlayerSendCancel(cid,"Seal Completed.")
		doSendMagicEffect(topos,12)
		doSummonCreature("Ghost",ghost1pos)
		doSummonCreature("Ghost",ghost2pos)
		doSummonCreature("Demon Skeleton",dspos)
	else
		return 0
	end		
elseif item.actionid == 20002 then
	lever1 = getThingfromPos{x=frompos.x, y=frompos.y, z=frompos.z, stackpos=1}
	lever2 = getThingfromPos{x=frompos.x, y=frompos.y, z=frompos.z, stackpos=1}
	lever3 = getThingfromPos{x=frompos.x, y=frompos.y, z=frompos.z, stackpos=1}
	lever4 = getThingfromPos{x=frompos.x, y=frompos.y, z=frompos.z, stackpos=1}
	lever5 = getThingfromPos{x=frompos.x, y=frompos.y, z=frompos.z, stackpos=1}
	lever6 = getThingfromPos{x=frompos.x, y=frompos.y, z=frompos.z, stackpos=1}
	if lever1.itemid == 1945 and lever2.itemid == 1945 and lever3.itemid == 1945 and lever4.itemid == 1945 and lever5.itemid == 1946 and lever6.itemid == 1946 then -- Last 2 switches need to be pulled edit this for your liking
		if queststatus ~= 1 then
			setPlayerStorageValue(cid,item.actionid,1)
			doPlayerSendCancel(cid,"Seal Completed.")
			doSendMagicEffect(topos,12)
		else
			return 0
		end
	end		
elseif item.actionid == 20003 then -- this is linked to a script furtherdown.
	if queststatus ~=1 then
		setPlayerStorageValue(cid,item.actionid,1)
		doPlayerSendCancel(cid,"Seal Completed.")
		doSendMagicEffect(topos,12)
	end
elseif item.actionid == 20004 then
	blood1 = getThingfromPos({x=pos.x, y=pos.y, z=pos.z, stackpos=2})
	blood2 = getThingfromPos({x=pos.x, y=pos.y, z=pos.z, stackpos=2})
	if blood1.itemid == 2006 and blood1.type == 2 and blood2.itemid == 2006 and blood2.type == 2 then
		if queststatus ~= 1 then
			setPlayerStorageValue(cid,item.actionid,1)
			doPlayerSendCancel(cid,"Seal Completed.")
			doSendMagicEffect(topos,12)
		end
	end
elseif item.actionid == 20005 then -- this script is linked to an external script
	if getGlobalStorageValue(20005) == 5 then
		if queststatus ~=1 then
			setPlayerStorageValue(cid,item.actionid,1)
			doPlayerSendCancel(cid,"Seal Completed.")
			doSendMagicEffect(topos,12)
		end
	end
elseif item.actionid == 20006 then
	wpearl = getThingfromPos({x=pos.x, y=pos.y, z=pos.z, stackpos=2})
	bpearl = getThingfromPos({x=pos.x, y=pos.y, z=pos.z, stackpos=2})
	if wpearl.itemid == 2143 and bpearl.itemid == 2144 then
		if queststatus ~= 1 then
			setPlayerStorageValue(cid,item.actionid,1)
			doPlayerSendCancel(cid,"Seal Completed.")
			doSendMagicEffect(topos,12)
			doRemoveItem(wpearl.uid,1)
			doRemoveItem(bpearl.uid,1)
		end
	end
--End of Seals--
elseif item.actionid == 20000 then -- This is for the third seal set this actionid to the tiles that they shouldnt step on.
	startpos = {x=pos.x, y=pos.y, z=pos.z}
	if isPlayer(cid) == 1 then
		doTeleportThing(cid,startpos)
	end
elseif item.actionid == 20007 or item.actionid == 20008 then
	warlock1pos = {x=frompos.x, y=frompos.y, z=frompos.z}
	warlock2pos = {x=frompos.x, y=frompos.y, z=frompos.z}
	if queststatus ~= 1 then
		setPlayerStorageValue(cid,item.actionid,1)
		doSummonCreature("Warlock",warlock1pos)
		doSummonCreature("Warlock",warlock1pos)
	end
end
end

In movements.xml you need it from actionids 20000-20008

bansheeorder.lua
Code:
function onUse(cid, item, frompos, item2, topos)
	queststatus = getGlobalStorageValue(20005)
	if item.actionid == 20105 then
		if item.itemid == 1945 then
			doTransformItem(item.uid,item.itemid+1)
			setGlobalStorageValue(20005,1)
		elseif item.itemid == 1946 then
			doTransformItem(item.uid,item.itemid-1)
			setGlobalStorageValue(20005,0)
		end
	elseif item.actionid == 20205 then
		if item.itemid == 1945 then
			doTransformItem(item.uid,item.itemid+1)
			if queststatus == 1 then				
				setGlobalStorageValue(20005,2)			
			end
		elseif item.itemid == 1946 then
			doTransformItem(item.uid,item.itemid-1)
			setGlobalStorageValue(20005,0)
		end
	elseif item.actionid == 20305 then
		if item.itemid == 1945 then
			doTransformItem(item.uid,item.itemid+1)
			if queststatus == 2 then				
				setGlobalStorageValue(20005,3)			
			end
		elseif item.itemid == 1946 then
			doTransformItem(item.uid,item.itemid-1)
			setGlobalStorageValue(20005,0)
		end
	elseif item.actionid == 20405 then
		if item.itemid == 1945 then
			doTransformItem(item.uid,item.itemid+1)
			if queststatus == 3 then				
				setGlobalStorageValue(20005,4)			
			end
		elseif item.itemid == 1946 then
			doTransformItem(item.uid,item.itemid-1)
			setGlobalStorageValue(20005,0)
		end
	elseif item.actionid == 20505 then
		if item.itemid == 1945 then
			doTransformItem(item.uid,item.itemid+1)
			if queststatus == 4 then				
				setGlobalStorageValue(20005,5)			
			end
		elseif item.itemid == 1946 then
			doTransformItem(item.uid,item.itemid-1)
			setGlobalStorageValue(20005,0)
		end
	end
end


Personalising Items
Code:
function onUse(cid, item, frompos, item2, topos)

altarpos = {x=324, y=99, z=7, stackpos = 2}
altar1pos = {x=326, y=99, z=7}
getaltar = getThingfromPos(altarpos)
queststatus = getPlayerStorageValue(cid,5474)

if item.actionid == 5474 and item.itemid == 1945 then
		doTransformItem(item.uid,item.itemid+1)
		if getaltar.itemid > 0 and queststatus ~= 1 then			
			item = doCreateItem(getaltar.itemid,1,altar1pos)
			doSetItemSpecialDescription(item,"This belongs to "..getPlayerName(cid)..".")
			doRemoveItem(getaltar.uid,1)
			setPlayerStorageValue(cid,5474,1)
		end
elseif item.actionid == 5474 and item.itemid == 1946 then
		doTransformItem(item.uid,item.itemid-1)
	
end
end

you need that in actions with action id 5474
in actions.xml you need to have actions ids 20105,20205...20505
 
Last edited:
No, only the turtle teleporters are relevant and i dont think tala has added yet. think i need to ask again, theres another script or 2 that i have made for the map that need adding like to get keys with key numbers on from quest chests
 
No, only the turtle teleporters are relevant and i dont think tala has added yet. think i need to ask again, theres another script or 2 that i have made for the map that need adding like to get keys with key numbers on from quest chests

Could u send me an pm if the will be included in the next version if no then tell me that to so i can add it in my "[released] lua scripts thread" It's an sticky
 
Back
Top