getPlayerSkillLevel(cid, skillid)
Info
This function checks player skill level.
Skillid can be:
SKILL_FIST (0) = Fist Fighting
SKILL_CLUB (1) = Club Fighting
SKILL_SWORD (2) = Sword Fighting
SKILL_AXE (3) = Axe Fighting
SKILL_DISTANCE (4) = Distance Fighting
SKILL_SHIELD (5) = Shielding
SKILL_FISHING (6) = Fishing
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerSkillLevel(cid, 2) > 20 --sword id == 2
doTeleportThing(cid, fromPosition, TRUE)
else
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You are not meeting the requirements.")
end
return true
end
[Error - LuaInterface::loadFile] data/actions/scripts/quests/door.lua:3: 'then' expected near 'doTeleportThing'
[Warning - Event::loadScript] Cannot load script (data/actions/scripts/quests/door.lua)
data/actions/scripts/quests/door.lua:3: 'then' expected near 'doTeleportThing'
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isSorcerer(cid) or isDruid(cid) then
if getPlayerMagLevel(cid) >= 20 then
doTeleportThing(cid, fromPosition, TRUE)
else
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You are not meeting the requirements , you need magic level 20 to use this.")
end
else
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You are not meeting the requirements , only sorcerer or druid can use this.")
end
if isKnight(cid) then
if getPlayerSkillLevel(cid, 1) >= 20 or getPlayerSkillLevel(cid, 2) >= 20 or getPlayerSkillLevel(cid, 3) >= 20 then
doTeleportThing(cid, fromPosition, TRUE)
else
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You are not meeting the requirements , you need club or sword or axe level 20 to use this.")
end
else
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You are not meeting the requirements , only knight can use this.")
end
if isPaladin(cid) then
if getPlayerSkillLevel(cid, 4) >= 20 then
doTeleportThing(cid, fromPosition, TRUE)
else
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You are not meeting the requirements , you need distance level 20 to use this.")
end
else
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You are not meeting the requirements , only paladin can use this.")
end
return TRUE
end
that last script is 4 scripts in 1 script
1 for knight and based on all skill ids - "club - sword - axe"
1 for paladin and based on skill id - "distance"
1 for sorcerer and druid based on magicLevel
you need to cut this script in pieces
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isSorcerer(cid) or isDruid(cid) then
if getPlayerMagLevel(cid) >= 20 then
doTeleportThing(cid, fromPosition, TRUE)
else
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You are not meeting the requirements , you need magic level 20 to use this.")
end
else
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You are not meeting the requirements , only sorcerer or druid can use this.")
end
return TRUE
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isKnight(cid) then
if getPlayerSkillLevel(cid, 1) >= 20 or getPlayerSkillLevel(cid, 2) >= 20 or getPlayerSkillLevel(cid, 3) >= 20 then
doTeleportThing(cid, fromPosition, TRUE)
else
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You are not meeting the requirements , you need club or sword or axe level 20 to use this.")
end
else
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You are not meeting the requirements , only knight can use this.")
end
return TRUE
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isPaladin(cid) then
if getPlayerSkillLevel(cid, 4) >= 20 then
doTeleportThing(cid, fromPosition, TRUE)
else
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You are not meeting the requirements , you need distance level 20 to use this.")
end
else
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You are not meeting the requirements , only paladin can use this.")
end
return TRUE
end
for Sorcerer and Druid
Code:function onUse(cid, item, fromPosition, itemEx, toPosition) if isSorcerer(cid) or isDruid(cid) then if getPlayerMagLevel(cid) >= 20 then doTeleportThing(cid, fromPosition, TRUE) else doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You are not meeting the requirements , you need magic level 20 to use this.") end else doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You are not meeting the requirements , only sorcerer or druid can use this.") end return TRUE end
for Knight
Code:function onUse(cid, item, fromPosition, itemEx, toPosition) if isKnight(cid) then if getPlayerSkillLevel(cid, 1) >= 20 or getPlayerSkillLevel(cid, 2) >= 20 or getPlayerSkillLevel(cid, 3) >= 20 then doTeleportThing(cid, fromPosition, TRUE) else doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You are not meeting the requirements , you need club or sword or axe level 20 to use this.") end else doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You are not meeting the requirements , only knight can use this.") end return TRUE end
for Paladin
Code:function onUse(cid, item, fromPosition, itemEx, toPosition) if isPaladin(cid) then if getPlayerSkillLevel(cid, 4) >= 20 then doTeleportThing(cid, fromPosition, TRUE) else doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You are not meeting the requirements , you need distance level 20 to use this.") end else doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You are not meeting the requirements , only paladin can use this.") end return TRUE end
i say it again .. not tested
if those have errors ... i will fix tomorrow
doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, toPosition)
You can use a gate of expertise door, then so the doors goes open.
Code:doTransformItem(item.uid, item.itemid + 1) doTeleportThing(cid, toPosition)
You can also do it like the vip doors, so the door won't be openened at all, but you only get teleported to the other side.
http://otland.net/threads/the-best-vip-system-ever-action-movevent-globalevent.71638/
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isKnight(cid) then
if getPlayerSkillLevel(cid, 1) >= 20 or getPlayerSkillLevel(cid, 2) >= 20 or getPlayerSkillLevel(cid, 3) >= 20 then
doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, toPosition)
else
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You are not meeting the requirements , you need club or sword or axe level 20 to use this.")
end
else
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You are not meeting the requirements , only knight can use this.")
end
return TRUE
end