Ir para conteúdo

Anderson Sacani

Membro
  • Registro em

  • Última visita

Solutions

  1. Refiz teu script:

     
    function onUse(cid, item, frompos, item2, topos) local dexsoftCoinId = 6535 if getPlayerItemCount(cid, dexsoftCoinId) < 1 then doPlayerSendCancel(cid, "Voce precisa de 1 DexSoft Coin para comprar!") return true end doPlayerRemoveItem(cid, dexsoftCoinId, 1) doPlayerAddItem(cid, 7881, 1) doSendMagicEffect(topos, 14) doBroadcastMessage("O jogador " .. getPlayerName(cid) .. " comprou donate axe", MESSAGE_STATUS_CONSOLE_BLUE) return true end  
  2. Anderson Sacani's post in (Resolvido)Change Name Scroll was marked as the answer   
    local scrollId = 1234 function onSay(cid, words, param) if param == "" then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'To use the command: !changename "NEW_NAME') return false end if getPlayerItemCount(cid, scrollId) < 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You need a ' .. getItemNameById(scrollId)) return false end if getTilePzInfo(getPlayerPosition(cid)) ~= true then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You can only use this command in a protected area.') return false end doPlayerRemoveItem(cid, scrollId, 1) local guid = getPlayerGUID(cid) doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `name` = '" .. param .. "' WHERE `id` = " .. guid .. ";") doRemoveCreature(guid) return true end  
    Achei um script bem mais completo do que esse que criei:
    local config = { item = {Id = 1111, count = 0}, paramBlacklist = {"account manager", "god", "tutor", "tester"}, kick = {enabled = true, delay = 2 * 1000}, forceLogout = false, namelockCheck = true, vowelsCheck = true, maxTextLenght = 29, minWordLenght = 2, maxWordLenght = 14, maxWords = 3 } config.kick.enabled = getBooleanFromString(config.kick.enabled) config.forceLogout = getBooleanFromString(config.forceLogout) config.namelockCheck = getBooleanFromString(config.namelockCheck) config.vowelsCheck = getBooleanFromString(config.vowelsCheck) function onSay(cid, words, param, channel) local t = string.explode(param, ",") local len, firstWord, wordCount, textCancel, limit = string.len(tostring(t[1])), true, 0, '', ";" if(getConfigValue('sqlType') == 'mysql') then limit = db.updateLimiter() end if(param == '') then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.") elseif(getPlayerGUIDByName(t[1], true) ~= nil) then textCancel = "That name is already in use." elseif(getPlayerItemCount(cid, config.item.Id) < config.item.count) then textCancel = "You do not fulfill the requirements." elseif(not getTilePzInfo(getCreaturePosition(cid))) then textCancel = "You must be inside a protection zone to use this command." elseif(len > config.maxTextLenght) then textCancel = "A name must have at least " .. config.minWordLenght .. " but no more than " .. config.maxTextLenght .. " letters!" elseif(config.namelockCheck and db.getResult("SELECT * FROM `player_namelocks` WHERE `name` = " .. db.escapeString(t[1]) .. "" .. limit .. ""):getID() ~= 1) then textCancel = "That name is namelocked." elseif(string.find(t[1]:lower(), "[^%l%s]") ~= nil) then textCancel = "This name contains invalid letters. Please use only A-Z, a-z and space!" else paramTemp = '' for word in string.gmatch(t[1], "%a+") do len, wordCount = string.len(word), wordCount + 1 if(isInArray(config.paramBlacklist, paramTemp:lower())) then textCancel = "Invalid name entry." break elseif(len < config.minWordLenght) then textCancel = "This name contains a word with only " .. len .. " letter" .. (len > 1 and "s" or '') .. ". Please use more than " .. len .. " letter" .. (len > 2 and "s" or '') .. " for each word!" break elseif(len > config.maxWordLenght) then textCancel = "This name contains a word that is too long. Please use no more than " .. config.maxWordLenght .. " letters for each word!" break elseif(wordCount > config.maxWords) then textCancel = "This name contains more than 3 words. Please choose another name!" break elseif(config.vowelsCheck and string.find(word:lower(), "[aeiouy]") == nil) then textCancel = "This name contains a word without vowels. Please choose another name!" break else wordTemp = '' for i = 1, len do letter = string.sub(word, i, i) if(i == 1) then if(getBooleanFromString(firstWord) and string.find(letter, "%l")) then letter = string.upper(letter) end else if(string.find(letter, "%u")) then letter = string.lower(letter) end end firstWord = false wordTemp = "" .. wordTemp .. "" .. letter .. "" end end paramTemp = "" .. paramTemp .. "" .. (paramTemp ~= '' and " " or '') .. "" .. wordTemp .. "" end end if(textCancel ~= '') then doPlayerSendCancel(cid, textCancel) return true end local oldName, guid = getCreatureName(cid), getPlayerGUID(cid) t[1] = paramTemp doPlayerRemoveItem(cid, config.item.Id, config.item.count) if(pcall(doPlayerChangeName, guid, oldName, t[1]) ~= true) then db.executeQuery("INSERT INTO `player_namelocks` (`player_id`, `name`, `new_name`, `date`) VALUES (" .. guid .. ", " .. db.escapeString(oldName) .. ", " .. db.escapeString(t[1]) .. ", " .. os.time() .. ");") db.executeQuery("UPDATE `players` SET `name` = " .. db.escapeString(t[1]) .. " WHERE `id` = " .. guid .. "" .. limit .. "") end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your name has been changed successfully." .. (config.kick.enabled and " You will be kicked in " .. config.kick.delay / 1000 .. " seconds." or " Re-enter the game to see the changes.") .. "") if(config.kick.enabled) then addEvent(function(cid, forceLogout) if(isPlayer(cid)) then doRemoveCreature(cid, forceLogout) end end, config.kick.delay, cid, config.forceLogout) end return true end  
    A parte do .xml fica assim:
    <talkaction log="yes" words="!changename;/changename;!namechange;/namechange" access="0" event="script" value="changename.lua"/>  
     
  3. Anderson Sacani's post in Wand Pasta Weapons Que Drena LIFE E A MANA DO PLAYER E DAS CRIATURAS BASEADO NESSE SCRIPT NAO SOLTA EFEITO was marked as the answer   
    Tem certeza que o 
    CONST_ME_MAGIC_YALAHARIGHOST Existe no teu servidor?
  4. Anderson Sacani's post in -=[TFS]=- 8.60 v0.4 GEMA IGUAL DO FOX WORLD MAIS MODIFICADA EDIT by Anderson Sacani was marked as the answer   
    Só alterar o script da gema para este:
    local config = { itemId = 2154, vocationId_1 = 2, -- Sorcerer vocationId_2 = 6, -- Master sorcerer vocationName = "Mage", } function onUse(cid, item, fromPosition, itemEx, toPosition) local itemId, amount = config.itemId, 1 local storage, getItemName = 6318964231, getItemNameById(itemId) if not ((getPlayerVocation(cid) == config.vocationId_1) or (getPlayerVocation(cid) == config.vocationId_2)) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Para usar a gema voce precisa ser um " .. config.vocationName) return true end if getPlayerStorageValue(cid, storage) > 0 then doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Voce ja usou uma " .. getItemName) return true end doRemoveItem(item.uid, amount) setPlayerStorageValue(cid, storage, 1) return true end  
    E criar um novo creaturescript para login, com esse algorítmo:
    local text = "´ . ,", ". ´ ,", "` . ,", ", ` ." local function effect(cid) local storage = 6318964231 if isPlayer(cid) then if getPlayerStorageValue(cid, storage) > 0 then doCreatureSay(cid, text, TALKTYPE_ORANGE_1) end addEvent(effect, 1000, cid) end end function onLogin(cid) effect(cid) return true end  
  5. Anderson Sacani's post in System reset was marked as the answer   
    local config = { onlyPremium = true, requiredLevel = 330, newLevel = 8, newExp = 4200, } function onSay(player, words, param) local resets = player:getStorageValue(1020) if ((player:getCondition(CONDITION_INFIGHT, CONDITIONID_DEFAULT)) or (player:isPzLocked())) then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You cannot be in battle, please go to some protected zone.") return false end if ((config.onlyPremium) and (player:getPremiumDays() >= 1)) then if player:getLevel() >= config.requiredLevel then if player:getStorageValue(resets) < 0 then player:setStorageValue(resets, 0) end if player:getStorageValue(resets) >= 0 then player:setStorageValue(resets, (resets) + 1) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Congratulations! Your character has been reseted. Now you have " .. resets .. " resets.") db.query("UPDATE `players` SET `level` = " .. config.newLevel .. ", `experience` = " .. config.newExp .. ", `resets` = " .. ((resets) + 1) .. " WHERE `id` = " .. player:getGuid()) player:remove() end else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to be level " .. config.requiredLevel .. " or higher.") end else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to be premium account.") end return true end  
  6. Anderson Sacani's post in Como faço o LookType do Cake Golem? was marked as the answer   
    No arquivo do monstro, ao invés de usar:
    <look type=" usa o:
    <look typeex=" Lembrando de fechar o aspas.
    Quando tu usa o typeex, tu pode colocar o id do item, por exemplo um cake.
  7. Anderson Sacani's post in Ajuda Script was marked as the answer   
    local config = { days = 30, } function onUse(player, item, fromPosition, itemEx, toPosition, isHotkey) player:addPremiumDays(config.days) item:remove() player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have added " .. config.days .. " days of premium to your account.") addEvent(function() if player:isPlayer() then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Now your account has " .. player:getPremiumDays() .. " days of premium.") end end, 1500) return true end  
  8. Anderson Sacani's post in Spell Cura was marked as the answer   
    Este funcionará perfeitamente:
    local config = { heal = 500, -- Quanto irá curar? Obs.: Valor fixo. } local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE) setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1) setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0) setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE) function onGetFormulaValues(cid, level, maglevel) local max = config.heal local min = max return min, max end setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues") function onCastSpell(cid, var) return doCombat(cid, combat, var) end  
  9. Anderson Sacani's post in Puxar alavanca e abrir um teleport. was marked as the answer   
    local teleport = { id = 1387, position = { x = 100, y = 100, z = 7 }, gotoPosition = { x = 200, y = 200, z = 7 }, } function onUse(cid, item, fromPosition, itemEx, toPosition) local leverId = 10030 if item.itemid == leverId then addEvent(function() doRemoveItem(getTileItemById(teleport.position, teleport.id).uid) doTransformItem(item.uid, leverId) end, 5 * 60 * 1000) doTransformItem(item.uid, leverId - 1) doCreateTeleport(teleport.id, teleport.gotoPosition, teleport.position) else doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "A portal already exists.") end return true end  
  10. Anderson Sacani's post in [Pedido] Talkaction que altera storages de todas as missões e questline pelo nome da quest TFS 1.3 was marked as the answer   
    local config = { ["The White Raven Monastery"] = { storage = { 84231, 32476 } }, ["The Queen of the Banshees"] = { storage = { 32147, 5878, 365474, 16574 } }, ["The New Frontier"] = { storage = { 874231 } }, } function onSay(player, words, param) if not config[param] then return false end for i = 1, #config[param].storage, 1 do player:setStorageValue(config[param].storage[i], 0) end player:sendTextMessage(MESSAGE_STATUS_SMALL, "You have zeroed the values of all the storages of " .. config[param]) end  
  11. Anderson Sacani's post in (Resolvido)Item vendedor was marked as the answer   
    local item, count, storage = {}, 0, 0 function onUse(cid, item, frompos, itemEx, topos) item = { [1] = { id = 2537, price = 4800 }, [2] = { id = 2377, price = 480 }, [3] = { id = 2663, price = 600 }, [4] = { id = 2472, price = 90000 }, } storage = 556655123 if getPlayerStorageValue(cid, storage) <= 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You want to sell multiple items. Be careful, because the equipment you are using can be sold too, keep them.") addEvent(function() if isPlayer(cid) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Use this item again to sell the items. REMEMBER TO STORE THE EQUIPMENT YOU ARE USING!") end end, 1500) setPlayerStorageValue(cid, storage, 1) else for i = 1, #item, 1 do count = getPlayerItemCount(cid, item[i].id) if count > 0 then doPlayerRemoveItem(cid, item[i].id, count) doPlayerAddMoney(cid, item[i].price * count) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sold " .. count .. "x " .. getItemNameById(item[i].id) .. " for " .. item[i].price .. " gold.") end end setPlayerStorageValue(cid, storage, 0) end return true end  
  12. Anderson Sacani's post in [PEDIDO] TFS 1.x Action script: recompensas aleatórias ao usar canivete em vários itens diferentes was marked as the answer   
    local easy = { 7618, 7620, 2389 } local rare = { 7588, 7589, 2268 } local veryRare = { 7367 } function onUse(player, item, fromPosition, target, toPosition, isHotkey) if target.actionid ~= 10001 then return false end target:remove() toPosition:sendMagicEffect(CONST_ME_POFF) local random = math.random(1, 100) if ((random > 0) and (random <= 50)) then player:addItem(easy[math.random(#easy)], 1) elseif ((random > 50) and (random <= 85)) then player:addItem(rare[math.random(#rare)], 1) else player:addItem(veryRare[math.random(#veryRare)], 1) end return true end  
    Segue uma segunda versão:
    local itens = { 7618, 7620, 2389, 7588, 7589, 2268, 7367 } function onUse(player, item, fromPosition, target, toPosition, isHotkey) if target.actionid ~= 10001 then return false end if math.random(1, 100) <= 20 then player:addItem(itens[math.random(#itens)], 1) end target:remove() toPosition:sendMagicEffect(CONST_ME_POFF) return true end  
  13. Anderson Sacani's post in [DÚVIDA] Criar item em baixo / cima de outro. TFS 1.3 was marked as the answer   
    O corpo já está no mapa?
    Se não, basta fazer um script que crie primeiramente este item específico e logo em seguida crie o corpo, exatamante nesta ordem.
    local items = { [1] = { itemId = 2393, itemAmount = 1, itemPos = { x = 100, y = 100, z = 7 } }, -- Giant Sword [2] = { itemId = 3061, itemAmount = 1, itemPos = { x = 100, y = 100, z = 7 } }, -- Dead Human } for i = 1, #items do Game.createItem(items[i].itemId, items[i].itemAmount, items[i].itemPos) end  

Informação Importante

Confirmação de Termo