Postado Fevereiro 12, 2018 7 anos Autor @egyptPOWER isso !! é que a "quest" que estou fazendo existe 4 portas e cada porta vai com a vocação dele ... pq se uma pessoa fazer a quest como "druid" e criar char "knight" funciona ... agora se eu fazer isso de 4 items .. ele vai ter que fazer o druid dele novamente ... caso queira trocar .. terá que trocar entre os players
Postado Fevereiro 12, 2018 7 anos Solução Não tive tempo de testar. Veja ai se funfapromoteitems.lua -- Created by egyptPOWER -- function onUse(cid, item, fromPosition, itemEx, toPosition) local item1 = ID ITEM SORC local item2 = ID ITEM DRUID local item3 = ID ITEM PALADIN local item4 = ID ITEM KNIGHT -- CONFIG MS if (getPlayerLevel(cid) == 8) then if (getPlayerVocation(cid) == 1 and item.itemid == item1) then doRemoveItem(item.uid, 1) doPlayerSetPromotionLevel(cid, getPlayerVocation(cid)+4) doPlayerSay(cid, "You are promoted to ".. getPlayerVocationName(cid) .."!", TALKTYPE_MONSTER_SAY) doSendMagicEffect(getPlayerPosition(cid),10) else doPlayerSay(cid, "To use it, you need be a master sorcerer.", TALKTYPE_MONSTER_SAY) end else doPlayerSay(cid, "You need level 8 to do it!", TALKTYPE_MONSTER_SAY) end -- CONFIG ED if (getPlayerLevel(cid) == 8) then if (getPlayerVocation(cid) == 2 and item.itemid == item2) then doRemoveItem(item.uid, 1) doPlayerSetPromotionLevel(cid, getPlayerVocation(cid)+4) doPlayerSay(cid, "You are promoted to ".. getPlayerVocationName(cid) .."!", TALKTYPE_MONSTER_SAY) doSendMagicEffect(getPlayerPosition(cid),10) else doPlayerSay(cid, "To use it, you need be a elder druid.", TALKTYPE_MONSTER_SAY) end else doPlayerSay(cid, "You need level 8 to do it!", TALKTYPE_MONSTER_SAY) end -- CONFIG RP if (getPlayerLevel(cid) == 8) then if (getPlayerVocation(cid) == 3 and item.itemid == item3) then doRemoveItem(item.uid, 1) doPlayerSetPromotionLevel(cid, getPlayerVocation(cid)+4) doPlayerSay(cid, "You are promoted to ".. getPlayerVocationName(cid) .."!", TALKTYPE_MONSTER_SAY) doSendMagicEffect(getPlayerPosition(cid),10) else doPlayerSay(cid, "To use it, you need be a royal paladin.", TALKTYPE_MONSTER_SAY) end else doPlayerSay(cid, "You need level 8 to do it!", TALKTYPE_MONSTER_SAY) end -- CONFIG EK if (getPlayerLevel(cid) == 8) then if (getPlayerVocation(cid) == 4 and item.itemid == item4) then doRemoveItem(item.uid, 1) doPlayerSetPromotionLevel(cid, getPlayerVocation(cid)+4) doPlayerSay(cid, "You are promoted to ".. getPlayerVocationName(cid) .."!", TALKTYPE_MONSTER_SAY) doSendMagicEffect(getPlayerPosition(cid),10) else doPlayerSay(cid, "To use it, you need be a elite knight.", TALKTYPE_MONSTER_SAY) end else doPlayerSay(cid, "You need level 8 to do it!", TALKTYPE_MONSTER_SAY) end return true end action.xml <action itemid="ID ITEM MS" event="script" value="promoteitem.lua"/> <action itemid="ID ITEM ED" event="script" value="promoteitem.lua"/> <action itemid="ID ITEM RP" event="script" value="promoteitem.lua"/> <action itemid="ID ITEM EK" event="script" value="promoteitem.lua"/> Editado Fevereiro 12, 2018 7 anos por egyptPOWER (veja o histórico de edições) No signature.
Postado Fevereiro 12, 2018 7 anos Autor @egyptPOWER Deu uns erro aqui Citar [12/2/2018 15:15:12] [Error - LuaInterface::loadFile] data/actions/scripts/promoteitem.lua:12: ')' expected near 'then' [12/2/2018 15:15:12] [Error - Event::checkScript] Cannot load script (data/actions/scripts/promoteitem.lua) [12/2/2018 15:15:12] data/actions/scripts/promoteitem.lua:12: ')' expected near 'then' [12/2/2018 15:15:12] [Error - LuaInterface::loadFile] data/actions/scripts/promoteitem.lua:12: ')' expected near 'then' [12/2/2018 15:15:12] [Error - Event::checkScript] Cannot load script (data/actions/scripts/promoteitem.lua) [12/2/2018 15:15:12] data/actions/scripts/promoteitem.lua:12: ')' expected near 'then' [12/2/2018 15:15:12] [Error - LuaInterface::loadFile] data/actions/scripts/promoteitem.lua:12: ')' expected near 'then' [12/2/2018 15:15:12] [Error - Event::checkScript] Cannot load script (data/actions/scripts/promoteitem.lua) [12/2/2018 15:15:12] data/actions/scripts/promoteitem.lua:12: ')' expected near 'then' [12/2/2018 15:15:12] [Error - LuaInterface::loadFile] data/actions/scripts/promoteitem.lua:12: ')' expected near 'then' [12/2/2018 15:15:12] [Error - Event::checkScript] Cannot load script (data/actions/scripts/promoteitem.lua) [12/2/2018 15:15:12] data/actions/scripts/promoteitem.lua:12: ')' expected near 'then'
Postado Fevereiro 12, 2018 7 anos Autor @egyptPOWER Aaeeee valeu mano ta 100% agora :D Como ja foi resolvido ... tenho que mandar alguma mensagem para fechar o topico? Editado Fevereiro 12, 2018 7 anos por Kyllini (veja o histórico de edições)
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.