
Tudo que Wise postou
- EFEITO
- (Resolvido)Ajuda Nesse script
-
math.percent {Cálculo Percentual}
Valeu, meu brother.
-
sistema akatsuki e anbu
-
[PEDIDO] Admin
Sim, fiz esta tag no meio de um vôo, nem reparei no id. Obrigado por citar. Enfim.. Não tem necessidade desse monte de variáveis e escopos que só atrasam a execução do código. Aqui: local key = 54321 -- group storage key function onSay(cid) if getPlayerGroupId(cid) < 2 then if getPlayerStorageValue(cid, key) < 0 then return doPlayerSendCancel(cid, 'Players can\'t use this command.') else doPlayerSetGroupId(cid, getPlayerStorageValue(cid, key)) setPlayerStorageValue(cid, key, -1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You returned to the '..getPlayerGroupName(cid)..'\'s rank.') end else setPlayerStorageValue(cid, key, getPlayerGroupId(cid)) doPlayerSetGroupId(cid, 1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You became a player again.') end return true end @Sydion Basta alterar na tag, para que o acesso da talkaction seja inaparente ou equivalente a 1. E relaxa, não ligo pra rep. O importante é ajudar, bro. Disponha ;]
-
Lua Function Library {:No Metamethods:}
Valeu, meu brother @vankk Ahahah Disponha @Larissa Azhaurn Obrigado; espero.
-
(Resolvido)Player sendo teleportado pra outro lugar
Como é um servidor pokémon, deduzi que haveria mais de uma town a poder ser escolhida no início. E, já que, o player é teleportado para as coordenadas dadas pelo templo da town dele, seria mais eficaz vc alterá-las. Enfim, disponha ;]
-
[PEDIDO] Admin
PS: Tô pelo cel admin.lua (data\talkactions\scripts) local key = 54321 -- group storage key function onSay(cid) if getPlayerGroupId(cid) < 2 then if getPlayerStorageValue(cid, key) < 0 then return doPlayerSendCancel(cid, 'Players can\'t use this command.') else doPlayerSetGroupId(cid, getPlayerStorageValue(cid, key)) setPlayerStorageValue(cid, key, -1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You returned to the '..getPlayerGroupName(cid)..'\'s rank.') end else setPlayerStorageValue(cid, key, getPlayerGroupId(cid)) doPlayerSetGroupId(cid, 1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You became a player again.') end return true end talkactions.xml (data\talkactions) <talkaction words="/admin" event="script" value="admin.lua"/>
-
(Resolvido)Player sendo teleportado pra outro lugar
Bom, o player é teleportado para a posição do templo de sua town: doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) Nesse caso, você deve alterar as coordenadas do id dessa Town no mapa do seu servidor via Remere's Map Editor. Confira a seção dos tutoriais de mapping.
- Duble exp no servidor.
-
(Resolvido)Player sendo teleportado pra outro lugar
Pegue o actionId/uniqueId do baú e procure por ele no arquivo actions.xml (data\actions); na tag, haverá o nome do arquivo Lua no qual está contido o script. Daí é só o abrir e procurar pelas coordenadas da posição e alterá-las à gosto. Caso tenha dificuldades, poste o script do arquivo que vc encontrar.
-
Pedido Halloween Npc tfs 0.4
Não vejo erros, meu caro.. doSetCreatureOutfit(cid, {lookType = outfits[math.random(1, #outfits)]}, -1)
-
Pedido Halloween Npc tfs 0.4
Estava pelo cel, pronto..
-
Pedido Halloween Npc tfs 0.4
Tente aí: local outfits = {123, 456, 789} -- lookType numbers local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end npcHandler:setMessage(MESSAGE_GREET, 'Hello |PLAYERNAME|. Say halloween.') function halloweenNPC(cid) doSetCreatureOutfit(cid, {lookType = outfits[math.random(1, #outfits)]}, -1) doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_GREEN) selfSay('Surprise! Happy Halloween!', cid) return npcHandler:releaseFocus(cid) end keywordHandler:addKeyword({'halloween'}, halloweenNPC, {}) npcHandler:addModule(FocusModule:new())
-
Como coloca level para entrar na porta?
leveldoor.lua (data\actions\scripts) local level = 12000 function onUse(cid, fromPos, toPos) return getPlayerLevel(cid) >= level and doTeleportThing(cid, toPos) or doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Only players level '..level..' or higher can open this door.') and false end actions.xml (data\actions) <action actionid="XXXXX" event="script" value="leveldoor.lua"/> Basta adicionar à porta, o actionId estipulado na tag.
-
math.percent {Cálculo Percentual}
Eis que trago mais uma função à biblioteca matemática de Lua, a math.percent. Sendo objetivo, ela calcula o percentual de um valor numérico, independentemente desse valor ser um inteiro ou decimal. math.percent = function (value, percentage) -- Developed by Wise ~ TibiaKing.com return tonumber(value) and tonumber(percentage) and math.abs(tonumber(string.format('%.f', tostring(percentage * (value/100))))) or nil end Exemplo de um cálculo: Mensagem maldita "Você atingiu 80% da sua franquia diária de 30MB. Ao atingir 100%, sua navegação será bloqueada." E agora, brother? Quantos MB eu usei? math.percent(30, 80) -- (valor númerico, %) 24 Enfim, se for disponibilizar este script em outro meio, deixe meu nick nos créditos. ;]
-
Lua Function Library {:No Metamethods:}
Notei que ainda não haviam feito uma lista dessa versão, então eu a fiz. Eis todas as funções, sem metamétodos e em ordem alfabética, do The Forgotten Server 1.2 broadcastMessage(message, messageType) canPlayerLearnInstantSpell(cid, name) canPlayerWearOutfit(cid, lookType, addons) doAddCondition(cid, conditionId) doAddContainerItemEx(uid, virtualId) doAddMapMark(cid, pos, type, description) doChangeSpeed(cid, delta) doChangeTypeItem(uid, newType) doCombat(cid, combat, var) doConvinceCreature(cid, target) doCreateNpc(name, pos, ...) doCreateTeleport(itemId, destination, position) doCreatureAddHealth(cid, health) doCreatureChangeOutfit(cid, outfit) doCreatureSay(cid, text, type, ...) doCreatureSetLookDir(cid, direction) doDecayItem(uid) doMonsterChangeTarget(cid) doPlayeJoinParty(cid, leaderId) doPlayerAddBlessing(cid, blessing) doPlayerAddExp(cid, exp, useMult, ...) doPlayerAddItemEx(cid, uid, ...) doPlayerAddMana(cid, mana, ...) doPlayerAddManaSpent(cid, mana) doPlayerAddMoney(cid, money) doPlayerAddMount(cid, mountId) doPlayerAddOutfit(cid, lookType, addons) doPlayerAddPremiumDays(cid, days) doPlayerAddSkillTry(cid, skillId, n) doPlayerAddSoul(cid, soul) doPlayerFeed(cid, food) doPlayerPopupFYI(cid, message) doPlayerRemOutfit(cid, lookType, addons) doPlayerRemoveItem(cid, itemId, count, ...) doPlayerRemoveMoney(cid, money) doPlayerRemoveMount(cid, mountId) doPlayerRemovePremiumDays(cid, days) doPlayerSendCancel(cid, text) doPlayerSendTextMessage(cid, type, text, ...) doPlayerSetBalance(cid, balance) doPlayerSetGuildLevel(cid, level) doPlayerSetGuildNick(cid, nick) doPlayerSetOfflineTrainingSkill(cid, skillId) doPlayerSetSex(cid, sex) doPlayerSetTown(cid, town) doPlayerSetVocation(cid, vocation) doRelocate(fromPos, toPos) doRemoveCondition(cid, conditionType, subId) doRemoveCreature(cid) doRemoveItem(uid, ...) doSendDistanceShoot(fromPos, toPos, distanceEffect, ...) doSendMagicEffect(pos, magicEffect, ...) doSendTutorial(cid, tutorialId) doSetCreatureDropLoot(cid, doDrop) doSetItemActionId(uid, actionId) doSetItemSpecialDescription(uid, desc) doSetItemText(uid, text) doSetMonsterTarget(cid, target) doShowTextDialog(cid, itemId, text) doSummonCreature(name, pos ...) doTeleportThing(uid, dest, pushMovement) doTransformItem(uid, newItemId, ...) getAccountNumberByPlayerName(name) getConfigInfo(info) getContainerCap(uid) getContainerCapById(itemId) getContainerItem(uid, slot) getContainerSize(uid) getCreatureBaseSpeed(cid) getCreatureHealth(cid) getCreatureMaster(cid) getCreatureMaxHealth(cid) getCreatureName(cid) getCreatureOutfit(cid) getCreaturePosition(cid) getCreatureSpeed(cid) getCreatureSummons(cid) getCreatureTarget(cid) getFluidSourceType(itemId) getGlobalStorageValue(key) getGuildId(guildName) getHouseAccessList(id, listId) getHouseByPlayerGUID(playerGUID) getHouseEntry(houseId) getHouseName(houseId) getHouseOwner(houseId) getHouseRent(id) getHouseTilesSize(houseId) getHouseTown(houseId) getIPByPlayerName(name) getItemDescriptions(itemId) getItemIdByName(name) getItemName(itemId) getItemRWInfo(uid) getItemWeight(itemId, ...) getItemWeightByUID(uid, ...) getMonsterFriendList(cid) getMonsterTargetList(cid) getOnlinePlayers() getPartyMembers(cid) getPlayerAccess(cid) getPlayerAccountType(cid) getPlayerBalance(cid) getPlayerBlessing(cid, blessing) getPlayerByIPAddress(ip, mask) getPlayerByName(name) getPlayerDepotItems(cid, depotId) getPlayerFood(cid) getPlayerFreeCap(cid) getPlayerGroupId(cid) getPlayerGUID(cid) getPlayerGUIDByName(name) getPlayerGuildId(cid) getPlayerGuildLevel(cid) getPlayerGuildName(cid) getPlayerGuildNick(cid) getPlayerGuildRank(cid) getPlayerIp(cid) getPlayerItemById(cid, deepSearch, itemId, ...) getPlayerItemCount(cid, itemId, ...) getPlayerLastLoginSaved(cid) getPlayerLearnedInstantSpell(cid, name) getPlayerLevel(cid) getPlayerLight(cid) getPlayerLookDir(cid) getPlayerLossPercent(cid) getPlayerMagLevel(cid) getPlayerMana(cid) getPlayerMasterPos(cid) getPlayerMaxMana(cid) getPlayerMoney(cid) getPlayerMount(cid, mountId) getPlayerName(cid) getPlayerParty(cid) getPlayerPosition(cid) getPlayerPremiumDays(cid) getPlayersByAccountNumber(accountNumber) getPlayerSex(cid) getPlayerSkill(cid, skillId) getPlayerSkullType(cid) getPlayerSlotItem(cid, slot) getPlayerSoul(cid) getPlayerStorageValue(cid, key) getPlayerTown(cid) getPlayerVocation(cid) getPromotedVocation(vocationId) getSpectators(centerPos, rangex, rangey, multiFloor, onlyPlayers) getThing(uid) getThingFromPos(pos) getThingPos(uid) getTileHouseInfo(pos) getTileInfo(position) getTileItemById(position, itemId, ...) getTileItemByType(position, itemType) getTilePzInfo(position) getTileThingByPos(position) getTileThingByTopOrder(position, topOrder) getTopCreature(position) getTownId(townName) getTownName(townId) getTownTemplePosition(townId) getWorldCreatures(type) Guild.addMember(self, player) Guild.removeMember(self, player) hasProperty(uid, prop) isContainer(uid) isCorpse(uid) isCreature(cid) isItem(uid) isItemContainer(itemId) isItemDoor(itemId) isItemFluidContainer(itemId) isItemMovable(itemId) isItemRune(itemId) isItemStackable(itemId) isMonster(cid) isNpc(cid) isPlayer(cid) isPlayerGhost(cid) isPlayerPzLocked(cid) isPremium(cid) isSightClear(fromPos, toPos, floorCheck) isSummon(cid) playerLearnInstantSpell(cid, name) pushThing(thing) queryTileAddThing(thing, position, ...) registerCreatureEvent(cid, name) setGlobalStorageValue(key, value) setHouseAccessList(id, listId, listText) setHouseOwner(id, guid) setPlayerGroupId(cid, groupId) setPlayerStorageValue(cid, key, value) targetPositionToVariant(position) unregisterCreatureEvent(cid, name) Já que fui eu quem listei e organizei a biblioteca por conta própria, se você for disponibilizar em outro meio, ao menos deixe o meu nick nos créditos. Bom uso ;]
-
(Resolvido)[AJUDA] NPC
Em relação a isso, brother, recomendo que vc adquira conhecimento na linguagem Lua em si, não especificamente p/ NPCs. Eis um dos melhores sites com conteúdo dessa linguagem: lua-users.org (meu favorito) ;]
-
(Resolvido)[AJUDA] NPC
Aqui.. travel.lua (data\npc\scripts) local item, pos, key = {5432, 1}, {x = 123, y = 456, z = 7}, 54321 -- {itemid, count}, {xyz position to teleport}, storage key local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end local function creatureSayCallback(cid, type, msg) if not npcHandler:isFocused(cid) then return false end local p = Player(cid) if msgcontains(msg, 'yes') and npcHandler.topic[cid] == 0 and p:getStorageValue(key) < 1 then npcHandler:say('Ok, but first you need to bring me '..item[2]..' '..ItemType(item[1]):getName()..(item[2] > 1 and 's' or '')..'. Do you have it?', cid) npcHandler.topic[cid] = 1 elseif npcHandler.topic[cid] == 1 then if msgcontains(msg, 'yes') then if p:removeItem(item[1], item[2]) then p:setStorageValue(key, 1) npcHandler:say('Sure. Do you want to go now?', cid) npcHandler.topic[cid] = 0 else npcHandler:say('You don\'t have any '..ItemType(item[1]):getName()..'. Get out of here!', cid) npcHandler:releaseFocus(cid) end end else npcHandler:say('Have a good trip!', cid) npcHandler:releaseFocus(cid) p:teleportTo(pos) pos:sendMagicEffect(CONST_ME_TELEPORT) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Travel.xml (data\npc) <npc name="Travel" script="travel.lua" walkinterval="3000" floorchange="0"> <health now="100" max="100" /> <look type="151" head="20" body="39" legs="45" feet="7" addons="0" /> <parameters> <parameter key="message_greet" value="Hail |PLAYERNAME|. Would you like to take a trip?"/> <parameter key="message_decline" value="Hm, okay. Get out of here!"/> <parameter key="message_walkaway" value="Sure." /> </parameters> </npc>
-
(Resolvido)Ajuda script para TFS 1.0
@felipeboyzinho Marque a melhor resposta, brother ;]
-
Bless automatico até determinado level.
Seguindo o princípio do beijo.. protectloot.lua (data\creaturescripts\scripts) local level = 50 function onDeath(cid) return getPlayerLevel(cid) <= level and doCreatureSetDropLoot(cid, false) or true end creaturescripts.xml (data\creaturescripts) <event type="death" name="ProtectLoot" event="script" value="protectloot.lua"/> Registre o creature event onDeath em login.lua (data\creaturescripts\scripts) registerCreatureEvent(cid, "ProtectLoot")
- Atleta impressiona nas olimpíadas
-
A Melhor Redação ENEM 2015
As 6 da manhã, virado, eu perdi completamente a noção de números
-
A Melhor Redação ENEM 2015
58 mil tópicos no fórum e você aqui lendo o meu.. Link do vídeo. Uma bela redação do mito Léo Lins Brilhante.. Tirava um 9,8 fácil
-
Atleta impressiona nas olimpíadas
Uma bela cena direto das olimpíadas do..do PARAÍSO. Veja como a atleta se prepara, posicionando o corpo pra frente, dobrando levemente os joelhos. Que técnica, que perfeição.. É ouro, certeza Ao que tudo indica, essa é a técnica da cavala..repare bem no cabelo preso pra trás como uma crina (duvido que vc reparou nisso) Só eu quem prefiro ver esporte feminino? //primeira merda que eu posto no fórum