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
in actions.xml
Turtle Teleporters -- used on the TFS Map
in movements.xml
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
trap2.lua
in movements.xml
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
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"/>
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" />
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" />