Ir para conteúdo

frerety

Artesão
  • Total de itens

    133
  • Registro em

  • Última visita

Tudo que frerety postou

  1. Créditos: 20% para Soulblaster -> ajudou a garantir compatibilidade com usuários Neverland; 80% para mim por ter feito a versão original e ajudado a montar a versão para Neverland; HiHo! Criei uma função em c++ que será usada nas actions. A função se chama: getPlayerPremmy e é usada: getPlayerPremmy(cid). Ela irá retornar 0 se o player for P.A. e retornar -1 se o player não for P.A. Mãos à obra! C++ em actions.cpp ache: //getPlayerFood(uid) lua_register(luaState, "getPlayerFood", ActionScript::luaActionGetPlayerFood); acima desse code adicione: //getPlayerPremmy(uid) lua_register(luaState, "getPlayerPremmy", ActionScript::luaActionGetPlayerPremmy); Agora no final de actions.cpp adicione: (YurOTS) int ActionScript::luaActionGetPlayerPremmy(lua_State *L){ unsigned int cid = (unsigned int)internalGetNumber(L); //pega u id do player(cid) ActionScript *action = getActionScript(L); //pega a action const KnownThing* tmp = action->GetPlayerByUID(cid); if(tmp) { Player *player = (Player*)(tmp->thing); if(player && player->premiumTicks && player->premiumTicks > 0) { lua_pushnumber(L, 0); } else { lua_pushnumber(L, -1); } } else { lua_pushnumber(L, -1); std::cout << "getPlayerPremmy: player not found" << std::endl; return 1; } return 1;} Agora no final de actions.cpp adicione: (NeverLand 4.2+) int ActionScript::luaActionGetPlayerPremmy(lua_State *L){ unsigned int cid = (unsigned int)internalGetNumber(L); //pega u id do player(cid) ActionScript *action = getActionScript(L); //pega a actionconst KnownThing* tmp = action->GetPlayerByUID(cid);if(tmp) { Player *player = (Player*)(tmp->thing); if(player && player->premmium) { lua_pushnumber(L, 0); } else { lua_pushnumber(L, -1); } }else { lua_pushnumber(L, -1); std::cout << "getPlayerPremmy: player not found" << std::endl; return 1;} return 1;} Agora em actions.h procure por: static int luaActionGetPlayerFood(lua_State *L); Em cima disto adicione: static int luaActionGetPlayerPremmy(lua_State *L); Recompile tudo... Actions Crie um script chamado function.lua com esse code: function onUse(cid, item, frompos, item2, topos)teleportlugar = {x=160, y=54, z=7}ppos = getPlayerPosition(cid)if item.itemid == 1945 then premmy = getPlayerPremmy(cid) if premmy == 0 then doTeleportThing(cid,teleportlugar) doTransformItem(item.uid,item.itemid+1) else doSendMagicEffect(ppos,2) doPlayerSendCancel(cid,"A não! Não sou P.A.!") doTransformItem(item.uid,item.itemid+1) endelseif item.itemid == 1946 then premmy = getPlayerPremmy(cid) if premmy == 0 then doTeleportThing(cid,teleportlugar) doTransformItem(item.uid,item.itemid-1) else doSendMagicEffect(ppos,2) doPlayerSendCancel(cid,"A não! Não sou P.A.!") doTransformItem(item.uid,item.itemid-1) endendreturn 1end Adicionar a alavanca e o UID dela pelo mapeditor. Escolha a que você quiser... Depois vá em data/actions e abra o arquivo actions.xml No final (antes de </actions>) adicione: <action uniqueid="ID_DA_ALAVANCA_QUE_VOCÊ_COLOCOU_PELO_MAPEDITOR" script="function.lua" /> Espero ter ajudado... FlW CyA!
  2. @honux Ty... haUhAUhuA... mas eu naum sei neim colocar delay... aHUaHuhaUhua... ^^... Ty CyA!
  3. Hola! ESSA VERSÃO EH UMA VERSÃO ANTIGA... POR FAVOR, OLHEM A MAIS ATUAL: http://www.xtibia.com/forum/index.php?showtopic=16391 a função desse comando é quando você digitar /of "Bixo", o player fica com o outfit do bixo. Simples... ^^ em commands.cpp em baixo de: coloque Agora vá no final de commands.cpp e adicione: agora em Commands.h em baixo de Adicione Compile e não se esqueça: Coloque o access no commands.xml!!! ----- Como usar ----- digite /of Bixo Primeira letra maiúscula e as outras minúsculas, como escrito acima... Ex: /of Gm Ex: /of Hero Ex: /of Serpent Spawn --------------------- FlW CyA!
  4. OBS: Onde está: 1: Mesa 1, Texto1; 2: Lugar que não dará para ler o livro 3: Mesa 2, Texto2; Si vcs gostaram do script vamu começar... Primeiramente ache no seu "actions.xml" essas linhas: e Delete as duas. Agora crie um novo arquivo chamado livro.lua (pasta scripts, dentro da pasta actions) Code: Alterações necessárias: posmesa1 -> coloque a posição da mesa 1 posmesa2 -> coloque a posição da mesa 2 agora vá em sua pasta actions e adicione isto ao arquivo actions.xml Prontinho... o code está pronto... Aproveitem e Bom RPG p vcs!
  5. kra... mt bom u code... perfeito... ^^ mas... eu sei ki vc naum vai dar suport... mas... vc sabe como é a função de decay? pq eu naum sei... :S... si souber plz fla aki... Ty Flw... PS.: I'm just a noob trying make one ot... ^^
  6. Com certeza a mudança do template do xtibia fórum foi feita com boa intenção, mas essa cor, como já dito acima, é uma cor muito comum. Não era difícil a leitura devido a letra branca e o template preto era uma marca do fórum. Como diz Pitty PS.: Independente da cor que vocês escolherem para o fórum, o mesmo não perderá minha audiência pois o importante é o conteúdo não a embalagem. Flw! Fuiz...
  7. -----edited----- LoL? Issu num era um tópico pedindo code? hAUhauAHuAh... -----fim do edited----- Broadcast color Em commands.cpp em baixo de: Coloque {"/bc",&Commands::broadcastColor}, Agora vá ao final de commands.cpp e adicione bool Commands::broadcastColor(Creature* c, const std::string &cmd, const std::string &param){ int a; int colorInt; Player* player = dynamic_cast<Player*>©; std::string message = param.c_str(); std::stringstream fullMessage; std::string color; MessageClasses mclass; for(a=0; a<param.length(); ++a){ if(param[a] > 3 && param[a] == ' '){ color = param; color.erase(a,1-param.length()); message.erase(0,1+a); break; } else message = param.c_str(); } std::transform(color.begin(), color.end(), color.begin(), tolower); if(color == "blue") mclass = MSG_BLUE_TEXT; else if(color == "red"){ game->creatureBroadcastMessage(c,message); return false; } else if(color == "red2") mclass = MSG_RED_TEXT; else if(color == "orange") mclass = MSG_ORANGE; else if(color == "white") mclass = MSG_ADVANCE; //Invasion else if(color == "white2") mclass = MSG_EVENT; else if(color == "green") mclass = MSG_INFO; else if(color == "small") mclass = MSG_SMALLINFO; else if(color == "yellow") mclass = MSG_YELLOW; else if(color == "private") mclass = MSG_PRIVATE; else{ player->sendTextMessage(MSG_SMALLINFO, "Define a color, or use #b to speak in red."); return false; } fullMessage << c->getName()<< ": "<< message.c_str()<<std::endl; //Name: Message for(AutoList<Player>::listiterator it = Player::listPlayer.list.begin(); it != Player::listPlayer.list.end(); ++it){ if(dynamic_cast<Player*>(it->second)) (*it).second->sendTextMessage(mclass, fullMessage.str().c_str()); } return true;} Pronto. Agora é só declarar. Commands.h em baixo de: Coloque: bool Commands::broadcastColor(Creature* c, const std::string &cmd, const std::string &param); Quase funcionando... Agora é soh declarar as "novas cores": Const76.h em baixo de: Coloque: MSG_YELLOW = 0x01, MSG_PRIVATE = 0x04, MSG_ORANGE = 0x11, Você vai encontrar isso: enum MessageClasses { MSG_YELLOW = 0x01, MSG_PRIVATE = 0x04, MSG_ORANGE = 0x11, MSG_RED_INFO = 0x12, MSG_ADVANCE = 0x13, MSG_EVENT = 0x14, /*MSG_EVENT = 0x15, */ MSG_INFO = 0x16, MSG_SMALLINFO = 0x17, MSG_BLUE_TEXT = 0x18, MSG_RED_TEXT = 0x19,}; Agora recompile e é soh aproveitar... ^^ NÃO SE ESQUEÇA DE ADICIONAR O COMANDO EM commands.xml!!! Como usar: Creditos para "The Chaos" e "Nitrous" ambos do forum otfans... GM Speed Commands.cpp em baixo de: Coloque: {"/speed",&Commands::speedChanger}, No fim adicione: bool Commands::speedChanger(Creature* c, const std::string &cmd, const std::string &param){ int a; Player* player = dynamic_cast<Player*>©; std::string gambiarra = param.c_str(); std::stringstream speedValue; std::string aimeudeus; for(a=0; a<param.length(); ++a){ if(!isdigit(param[a])){ aimeudeus = param; aimeudeus.erase(a,1-param.length()); gambiarra.erase(0,1+a); break; } else aimeudeus = param.c_str(); } int newspeed = atoi(aimeudeus.c_str()); if(newspeed > 9999 || newspeed <= 99){ player->sendTextMessage(MSG_RED_TEXT,"Sorry but the speed must be more than 99 and less than 9999."); return false; } if(Player* toChange = game->getPlayerByName(gambiarra)){ toChange->speed = newspeed; toChange->sendChangeSpeed(game->getCreatureByName(gambiarra.c_str())); speedValue << "GM "<<player->getName()<< " changed your speed to: "<<toChange->speed<<"."<<std::endl; toChange->sendTextMessage(MSG_RED_TEXT,speedValue.str().c_str()); player->sendTextMessage(MSG_RED_TEXT,"Done."); return true; } else{ player->speed = newspeed; player->sendChangeSpeed©; speedValue << "You changed your speed to: "<<player->speed<<"."<<std::endl; player->sendTextMessage(MSG_RED_TEXT,speedValue.str().c_str()); return true; } return false; } Commands.h em baixo de: Coloque: bool speedChanger(Creature* c, const std::string &cmd, const std::string &param); Agora recompile e é soh aproveitar... ^^ NÃO SE ESQUEÇA DE ADICIONAR O COMANDO EM commands.xml!!! Como usar: Creditos ao "The Chaos"
  8. O que significam as funções? OBS01.: Axu q jah tah completu, si eu lembrar outros eu edito OBS02.: Ty Colex pelo apoio e pelas correções. OBS03.: Se você estiver procurando por uma função específica, digite Ctrl + F e irá abrir uma janela. Digite o nome da função e clique em "Localizar Próxima" doChangeTypeItem sintaxe => doChangeTypeItem(uid,novo_tipo) ação => Muda o tipo de um item por exemplo em runas com cargas. exemplo: -- Remove 1 carga de uma runa (item.uid) doChangeTypeItem(item.uid,item.type-1) doCreateItem sintaxe => doCreateItem(itemid,quantidade_ou_cargas,position) ação => Cria um item com um certo numero de cargas(runas) ou quantidade na posição selecionada. exemplo: -- Cria uma uh de 99x na posição selecionada(topos). doCreateItem(2273,99,topos) doDecayItem sintaxe => doDecayItem(uid) ação => Começar o tempo de "volta" para o item anterior. exemplo1: -- Iniciar o tempo de "volta" para o item anterior. doDecayItem(item.uid) exemplo2: -- Exemplo (machete) doDecayItem(). function onUse(cid, item, frompos, item2, topos) if item2.itemid == 2782 then doTransformItem(item2.uid,item2.itemid-1) doDecayItem(item2.uid) else return 0 end return 1 end doPlayerAddHealth sintaxe => doPlayerAddHealth(uid,health) ação => Remove Life do player quando e negativo caso contrario aumenta o life. exemplo1: -- Adiciona 100 de life ao player quando ele usar o objeto. doPlayerAddHealth(cid,100) exemplo2: -- Remove 100 de life do player quando ele usar o objeto. doPlayerAddHealth(cid,-100) OBS => Por mais que você tire life do player com essa action, o player não morre, ele sempre fica com 1 de life exemplo3: -- Um player tem 100 de life doPlayerAddHealth(cid,-200) -- aki ele ficará com 1 de life, não morrerá doPlayerAddItem sintaxe => doPlayerAddItem(uid,itemid,Carga _ou_quantidade) ação => Cria um item no inventario do player se possível caso contrario, embaixo dele. exemplo1: -- Dar uma magic Sword Para o player. doPlayerAddItem(cid,2400,1) exemplo2: -- Quest chest if item.uid == 5002 then queststatus = getPlayerStorageValue(cid,5000) if queststatus == -1 then doPlayerSendTextMessage(cid,22,"You have found a magic sword.") doPlayerAddItem(cid,2400,1) setPlayerStorageValue(cid,5000,1) else doPlayerSendTextMessage(cid,22,"The chest is empty.") end end doPlayerAddMana sintaxe => doPlayerAddMana(uid,mana) ação => Remove Mana do Player caso seja valor negativo e adiciona caso seja positivo exemplo1: -- Adiciona 100 de mana para o player quando ele usar o objeto. doPlayerAddMana(cid,100) exemplo2: -- Remove 100 de mana quando o player usar o objeto doPlayerAddMana(cid,-100) doPlayerAddSkillTry sintaxe => doPlayerAddSkillTry(uid,skillid,numero) ação => Adiciona uma Try de skill ao player, quando try e um hit q o player de em um monstro por exemplo. lista: 0, Fist. 1, Club. 2, Sword. 3, Axe. 4, Distance. 5, Shielding. 6, Fishing. exemplo1: -- Adiciona 5 "tryes" de fist ao player. doPlayerAddSkillTry(cid,0,5) exemplo2: -- Fishing com skills up function onUse(cid, item, frompos, item2, topos) if item2.itemid == 618 then fishingskill = getPlayerSkill(cid,6) formula = fishingskill /200+0.85* math.random() if formula > 0.65 then doTransformItem(item2.uid,619) doDecayItem(item2.uid) doSendMagicEffect(topos,1) doPlayerAddSkillTry(cid,6,2) doPlayerAddItem(cid,2667,1) else doSendMagicEffect(topos,1) doPlayerAddSkillTry(cid,6,1) end elseif item2.itemid == 619 or item2.itemid == 620 then doSendMagicEffect(topos,1) end return 1 end doPlayerFeed sintaxe => doPlayerFeed(uid,food) ação => Adiciona um tempo em segundos em que o player recuperara life e mana(comida) exemplo1: -- Adicionar um tempo de 120 segundos. doPlayerFeed(cid,120) exemplo2: -- Food script function onUse(cid, item, frompos, item2, topos) max_food = 1024 if item.itemid == 2667 then food = 120 elseif item.itemid == 2671 then food = 240 end if getPlayerFood(cid) + food > max_food then doPlayerSendCancel(cid,"You are full.") else doPlayerFeed(cid,food) doRemoveItem(item.uid,1) end return 1 end doPlayerRemoveItem sintaxe => doPlayerRemoveItem(uid,itemid,count) ação => Remove um item do inventario do player exemplo: -- Remove um item de id 2400 do inventório do player doPlayerRemoveItem(cid,2400,1) doPlayerRemoveMoney sintaxe => doPlayerRemoveMoney(uid,money) ação => Remove um valor X de dinheiro do player exemplo: -- Remove 100 gold from the players inventory. doPlayerRemoveMoney(cid,100) doPlayerSay sintaxe => doPlayerSay(uid,text,type) ação => Faz o player falar uma msg. exemplo: -- Enviar uma msg normal. doPlayerSay(cid,"Hello world!",2) doPlayerSendCancel sintaxe => doPlayerSendCancel(uid,text) ação => Envia a msg branca embaixo da tela( You cannot use this object) exemplo: -- Envia uma msg escrita Desculpe mas isso n e possível. doPlayerSendCancel(cid,"desculpe mas isso n e possível.") doPlayerSendTextMessage sintaxe => doPlayerSendTextMessage(uid,MessageClasses,message) ação => Envia diferentes tipos de mensagem ao player. exemplo: -- SEnvia uma msg vermelha no meio da tela para o player. doPlayerSendTextMessage(cid,22,"Hello world!") doPlayerSetMasterPos sintaxe => doPlayerSetMasterPos(uid,pos) ação => Seta uma nova MasterPos (posição do templo) ao player. exemplo: -- Posição do novo templo newpos = {x=20, y=20, z=7} -- atualizar a posição. doPlayerSetMasterPos(cid,newpos) doPlayerSetVocation sintaxe => doPlayerSetVocation(uid,voc) ação => Setar uma nova Vocação ao player. lista: 1, Sorcerer. 2, Druid. 3, Paladin. 4, Knight. exemplo: -- Mudar a vocaçao do player para 1. doPlayerSetVocation(cid,1) doRemoveItem sintaxe => doRemoveItem(item_id,numero) ação => Remover items, so e possivel remover um por tile(exemplo 40 bolts e etc). exemplo: -- Remover 5 items dessa posiçao. (Power bolts etc) doRemoveItem(item.uid,5) doSendMagicEffect sintaxe => doSendMagicEffect(position,type) ação => Fazer um efeito magico. exemplo: -- Enviar efetosinhu de fumaça para a posiçao(topos). doSendMagicEffect(topos,2) doSetItemActionId sintaxe => doSetItemActionId(uid,actionid) ação => Indicar o action id de um item. exemplo1: -- Colocar actionID 5020 no item. doSetItemActionId(item.uid,5020) exemplo2: -- Exemplo em loot de quest function onUse(cid, item, frompos, item2, topos) if item.uid == 5020 then queststatus = getPlayerStorageValue(cid,5020) if queststatus == -1 then doPlayerSendTextMessage(cid,22,"You have found a silver key.") key = doPlayerAddItem(cid,2088,1) doSetItemActionId(key,5020) setPlayerStorageValue(cid,5020,1) else doPlayerSendTextMessage(cid,22,"It is empty.") end end return 1 end doSetItemSpecialDescription sintaxe => doSetItemSpecialDescription(uid,description) ação => Colocar um descrição especial em um item de quest por exemplo. exemplo1: -- Colocar uma descrçao especia no item quando o mesmo for usado. doSetItemSpecialDescription(item.uid,"Hello world!") exemplo2: -- exemplo em quest function onUse(cid, item, frompos, item2, topos) if item.uid == 3000 then queststatus = getPlayerStorageValue(cid,3000) if queststatus == -1 then doPlayerSendTextMessage(cid,22,"You have found a pair of magic boots.") boots = doPlayerAddItem(cid,2640,1) doSetItemActionId(boots,3000) doSetItemSpecialDescription(boots, "This boots are magical.") setPlayerStorageValue(cid,3000,1) else doPlayerSendTextMessage(cid,22,"It is empty.") end end return 1 end doSetItemText sintaxe => doSetItemText(item.uid,"texto") --- para usar a função da tecla "enter" escrever \n ação => Adiciona um texto a um objeto exemplo: doSetItemText(item.uid,"aew\neste livro tem texto.") -- Aparecerá: aew este livro tem texto. doShowTextWindow sintaxe => doShowTextWindow(item.uid,numero_de_letras,editavel) ---- nu editavel é 0 para não poder alterar e 1 para poder alterar ação => Abre uma janela com o texto que está setado em um objeto exemplo: doShowTextWindow(item.uid,500,1) --- este sera editavel com direito a 500 caracteres doSendAnimatedText sintaxe => doSendAnimatedText(position,text,color) ação => Fazer um efeito animado no client do tibia. (Semelhante a perder hp ou ganhar exp) exemplo: -- Mandar um efeito em vemelho escrito 100. doSendAnimatedText(frompos,100,180) doSummonCreature sintaxe => doSummonCreature("nome", posiçao) ação => Sumonar uma criatura. exemplo: -- Summonar um demon para a posição na qual o item foi usado. doSummonCreature("Demon",topos) doTeleportThing sintaxe => doTeleportThing(uid,newpos) ação => Teleportar um item/player para uma nova posição exemplo1: -- Teleportar o player para a posição q o item foi usado. doTeleportThing(cid,topos) exemplo2: -- Teleportar player function onUse(cid, item, frompos, item2, topos) if item2.itemid == 0 then doPlayerSendCancel(cid,"Sorry, not possible.") else if getPlayerAccess(cid) == 3 then playerpos = getPlayerPosition(cid) doTeleportThing(cid,topos) doSendMagicEffect(playerpos,2) doSendMagicEffect(topos,10) else doPlayerSendCancel(cid,"You are not allowed to use this rune.") end end return 1 end doTransformItem sintaxe => doTransformItem(uid,toitemid) ação => Transformar um item em outro exemplo1: -- Trasformar o item usado no item 2400. doTransformItem(item.uid,2400) exemplo2: -- Ex. alavanca function onUse(cid, item, frompos, item2, topos) if item.itemid == 1946 then doTransformItem(item.uid,item.itemid-1) elseif item.itemid == 1945 then doTransformItem(item.uid,item.itemid+1) end return 1 end getPlayerAccess sintaxe => getPlayerAccess(uid) ação => Pegar o Access do Player. exemplo1: -- Pegar o nível de aceso do player. getPlayerAccess(cid) exemplo2: -- Apenas players de access 1 ou + podem usar o item function onUse(cid, item, frompos, item2, topos) if getPlayerAccess(cid) >= 1 then doTransformItem(item.uid,2400) else doPlayerSendCancel(cid,"Sorry, not possible.") end return 1 end getPlayerFood sintaxe => getPlayerFood(uid) ação => Pega o status da food do player exemplo: -- Pegar o status da food do player getPlayerFood(cid) getPlayerGuildId sintaxe => getPlayerGuildId(uid) ação => Pega o id da guild do player. exemplo: -- Pegar o id da quild do player getPlayerGuildId(cid) getPlayerHealth sintaxe => getPlayerHealth(uid) ação => Pegar a quantidade de life do player. exemplo: -- Pega o life do player para alguma ação(se a vida for maior ou igual a 500, no caso abaixo) if getPlayerHealth(cid) >= 500 then getPlayerLevel sintaxe => getPlayerLevel(uid) ação => Pega o level do player exemplo: -- Pegar o level do player para acontecer algo se o lvl for maior q 30. if getPlayerLevel(cid) >= 30 then getPlayerMagLevel sintaxe => getPlayerMagLevel(uid) ação => Pega o ML do Player exemplo: -- Pegar o ml do player. getPlayerMagLevel(cid) getPlayerMana sintaxe => getPlayerMana(uid) ação => Pega a mana atual do player(não a completa) exemplo: -- Pegar o valor atual da mana. getPlayerMana(cid) getPlayerMasterPos sintaxe => getPlayerMasterPos(uid) ação => Pegar a MasterPos do player (posição do templo) exemplo: -- Pegar a MasterPos do Player. getPlayerMasterPos(cid) getPlayerName sintaxe => getPlayerName(uid) ação => Pega o nome do Player exemplo: -- Pegar o nome do Player. getPlayerName(cid) getPlayerPosition sintaxe => getPlayerPosition(uid) ação => Pega posição atual do Player exemplo: -- Pegar a posição atual do Player. getPlayerPosition(cid) getPlayerSkill sintaxe => getPlayerSkill(uid,skillid) ação => Pega o skill atual do Player lista: 0, Fist 1, Club 2, Sword 3, Axe 4, Distance 5, Shielding 6, Fishing exemplo: -- Pegar o skill de fist do Player. getPlayerSkill(cid,0) getPlayerStorageValue sintaxe => getPlayerStorageValue(uid,valueid) ação => Pegar o "Storage Value" do player(usado em quests, vide exemplo) exemplo1: -- Obter a informçao da quest 5000. getPlayerStorageValue(cid,5000) exemplo2: -- Exemplo do getPlayerStorageValue() (num baú de quest). if item.uid == 5002 then queststatus = getPlayerStorageValue(cid,5000) if queststatus == -1 then doPlayerSendTextMessage(cid,22,"You have found a magic sword.") doPlayerAddItem(cid,2400,1) setPlayerStorageValue(cid,5000,1) else doPlayerSendTextMessage(cid,22,"The chest is empty.") end end setPlayerStorageValue sintaxe => setPlayerStorageValue(uid,valueid, newvalue) ação => Atualizar o numero do Storage Value exemplo1: -- Mudar o StorageValue da quest n° 5000 para 1. setPlayerStorageValue(cid,5000,1) exemplo2: -- Exemplo do setPlayerStorageValue() em um baú de quest if item.uid == 5002 then queststatus = getPlayerStorageValue(cid,5000) if queststatus == -1 then doPlayerSendTextMessage(cid,22,"You have found a magic sword.") doPlayerAddItem(cid,2400,1) setPlayerStorageValue(cid,5000,1) else doPlayerSendTextMessage(cid,22,"The chest is empty.") end end getPlayerVocation sintaxe => getPlayerVocation(uid) ação => Pega a Vocação do Player exemplo: -- Obter a Vocação do Player. getPlayerVocation(cid) getThingfromPos sintaxe => getThingfromPos(pos) ação => Seleciona um item que está na posição especificada exemplo1: -- Adquirir informações da posiçao. geti = getThingfromPos(topos) exemplo2: -- Checar se o uniqueID do item q esta na posição e 5000. if geti.uid == 5000 then code end getTilePzInfo sintaxe => getTilePzInfo(pos) ação => Retorna 1 se o tile for PZ e 0 se não for PZ PZ => Protection zone (templos, dps, houses) exemplo1: -- Checar se o Tile e pz. getTilePzInfo(topos) exemplo2: -- Exemplo do getTilePzInfo() num simples script de remoçao -- A action funciona só se o player estiver fora d um pz function onUse(cid, item, frompos, item2, topos) if getPlayerMagLevel(cid) >= 4 then ipos = {x=topos.x, y=topos.y, z=topos.z, stackpos=255} geti = getThingfromPos(ipos) if geti.itemid > 0 then if getTilePzInfo(topos) == 0 then doSendMagicEffect(topos,2) doRemoveItem(geti.uid,100) if item.type > 1 then doChangeTypeItem(item.uid,item.type-1) else doRemoveItem(item.uid,1) end else doSendMagicEffect(frompos,2) doPlayerSendCancel(cid,"This action is not allowed in protection zone.") end else doSendMagicEffect(frompos,2) return 0 end else doSendMagicEffect(frompos,2) doPlayerSendCancel(cid,"You don't have the required magic level to use that rune.") end return 1 end Como colocar texto em um livro arquivo.lua Caso você não saiba criar actions, olhe os seguintes tutoriais, ambos do Colex: .:. Tutorial de Actions 01 .:. .:. Tutorial de Actions 02 .:, .:. Tutorial de Actions 03 .:. Espero que vocês aproveitem porque isso deu um trabalho! ^^ FlW CyA!
  9. não sei se vc jah conseguiu resolver esse bug... tenta fazer u seguinte => 2711 eh u id da alavanca... de todas, naum soh da que vc quer... Para você poder colocar outras alavancas em seu ot, vá em actions.xml e troque issu por issu Não se esqueça de colocar o UID 2711 pelo map editor...Agora troque a posição dos monstros por: (Para mais informações sobre stackpos => http://www.xtibia.com/forum/index.php?show...738entry63738) Vai ficar assim: e em actions.xml flw!
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...