What's new

Drzwi dla profesji

Status
Not open for further replies.

Jbx14

Active User
Joined
Mar 28, 2010
Messages
78
Reaction score
3
Mam pytanie jak zrobi? drzwi dla profesji aby m?g? np wej?c tylko druid ???
Za pomoc dam reputa ;]
 

Sassin

Forum friend
Joined
Jun 13, 2009
Messages
1,281
Reaction score
107
Odp: Drzwi dla profesji

actions.xml:
<action uniqueid="10094" script="sorcerer.lua" />
<action uniqueid="10093" script="druid.lua" />
<action uniqueid="10092" script="paladin.lua" />
<action uniqueid="10091" script="knight.lua" />

knight.lua:
function onUse(cid, item, frompos, item2, topos)
if item.uid == 10091 then
if isKnight(cid) then
doPlayerSendTextMessage(cid, 22, "You can pass, you are a Knight.")
pos = getPlayerPosition(cid)
if pos.x == topos.x then
if pos.y < topos.y then
pos.y = topos.y + 1
else
pos.y = topos.y - 1
end
elseif pos.y == topos.y then
if pos.x < topos.x then
pos.x = topos.x + 1
else
pos.x = topos.x - 1
end
else
doPlayerSendTextMessage(cid,22,'Please stand in front of the door.')
return 1
end
doTeleportThing(cid,pos)
doSendMagicEffect(topos,12)
else
doPlayerSendTextMessage(cid,22,'You can\'t pass, you aren\'t a Knight.')
end
return 1
else
return 0
end
end

paladin.lua:
function onUse(cid, item, frompos, item2, topos)
if item.uid == 10092 then
if isPaladin(cid) then
doPlayerSendTextMessage(cid, 22, "You can pass, you are a Paladin.")
pos = getPlayerPosition(cid)
if pos.x == topos.x then
if pos.y < topos.y then
pos.y = topos.y + 1
else
pos.y = topos.y - 1
end
elseif pos.y == topos.y then
if pos.x < topos.x then
pos.x = topos.x + 1
else
pos.x = topos.x - 1
end
else
doPlayerSendTextMessage(cid,22,'Please stand in front of the door.')
return 1
end
doTeleportThing(cid,pos)
doSendMagicEffect(topos,12)
else
doPlayerSendTextMessage(cid,22,'You can\'t pass, you aren\'t a Paladin.')
end
return 1
else
return 0
end
end

druid.lua:
function onUse(cid, item, frompos, item2, topos)
if item.uid == 10093 then
if isDruid(cid) then
doPlayerSendTextMessage(cid, 22, "You can pass, you are a Druid.")
pos = getPlayerPosition(cid)
if pos.x == topos.x then
if pos.y < topos.y then
pos.y = topos.y + 1
else
pos.y = topos.y - 1
end
elseif pos.y == topos.y then
if pos.x < topos.x then
pos.x = topos.x + 1
else
pos.x = topos.x - 1
end
else
doPlayerSendTextMessage(cid,22,'Please stand in front of the door.')
return 1
end
doTeleportThing(cid,pos)
doSendMagicEffect(topos,12)
else
doPlayerSendTextMessage(cid,22,'You can\'t pass, you aren\'t a Druid.')
end
return 1
else
return 0
end
end

sorcerer.lua:
function onUse(cid, item, frompos, item2, topos)
if item.uid == 10094 then
if isSorcerer(cid) then
doPlayerSendTextMessage(cid, 22, "You can pass, you are a Sorcerer.")
pos = getPlayerPosition(cid)
if pos.x == topos.x then
if pos.y < topos.y then
pos.y = topos.y + 1
else
pos.y = topos.y - 1
end
elseif pos.y == topos.y then
if pos.x < topos.x then
pos.x = topos.x + 1
else
pos.x = topos.x - 1
end
else
doPlayerSendTextMessage(cid,22,'Please stand in front of the door.')
return 1
end
doTeleportThing(cid,pos)
doSendMagicEffect(topos,12)
else
doPlayerSendTextMessage(cid,22,'You can\'t pass, you aren\'t a Sorcerer.')
end
return 1
else
return 0
end
end

Pozdrawiam,
Sassin
 
Status
Not open for further replies.
Top