Jump to content
×
×
  • Create New...

SrNaja

Suporter
  • Posts

    31
  • Joined

  • Last visited

  • Days Won

    2

SrNaja last won the day on January 14

SrNaja had the most liked content!

Social Info

3 Followers

About SrNaja

Informações

  • Forma que conheci o xTibia
    Amigos
  • Sou
    Programador

Recent Profile Visitors

335 profile views
  1. troca o código da sua lib : function effectWhenWalking(player_uid, id_effect) local player = Player(player_uid) if player then local player_position = player:getPosition() local player_direction = player:getDirection() local player_pos_x = player_position.x local player_pos_y = player_position.y local player_pos_z = player_position.x local position = Position(player_pos_x + Config_.back[player_direction].x, player_pos_y + Config_.back[player_direction].y, player_pos_y) if position then position:sendMagicEffect(id_effect) addEvent(effectWhenWalking, 1, player_uid, id_effect) end end end
  2. local delay = 0.1 local effect = 12 -- id do effect local bonusSpeed = 1.2 local outfitMale = 1315 local outfitFemale = 1316 local condition = Condition(CONDITION_OUTFIT) condition:setTicks(-1) function onUse(player, item, fromPosition, target, toPosition, isHotkey) if os.time() > player:getStorageValue(storageDelay) then player:setStorageValue(storageDelay, os.time() + delay) else player:sendCancelMessage(RETURNVALUE_YOUAREEXHAUSTED) return true end if fromPosition.x ~= 65535 then player:sendCancelMessage("First pick up the bike.") return true end if player:getStorageValue(storageRide) == 1 then player:sendCancelMessage("Sorry, not possible while on ride.") return true end if player:getStorageValue(storageFly) == 1 then player:sendCancelMessage("Sorry, not possible while on fly.") return true end if player:getStorageValue(storageSurf) > 0 then player:sendCancelMessage("Sorry, not possible while on surf.") return true end if player:getStorageValue(storageDive) > 0 then player:sendCancelMessage("Sorry, not possible while on dive.") return true end if player:getStorageValue(storageEvent) > 0 then player:sendCancelMessage("Sorry, not possible while on event.") return true end if player:getStorageValue(storageBike) > 0 then player:removeCondition(CONDITION_OUTFIT) player:changeSpeed(player:getBaseSpeed()-player:getSpeed()) player:setStorageValue(storageBike, -1) else local delta = player:getSpeed() * bonusSpeed if player:getSex() == PLAYERSEX_MALE then outfit = outfitMale else outfit = outfitFemale end condition:setOutfit({lookType = outfit}) player:addCondition(condition) player:setStorageValue(storageBike, 1) player:changeSpeed(delta) effectWhenWalking(player.uid, effect) end return true end
  3. coloca a função na lib, uma pergunta você tem o script da bike?, se sim me mande
  4. o sistema já esta pronto, e já falei aonde tem que colocar
  5. troca : Config_ = { back = { [0] = {x = 0, y = 1}, [1] = {x = -1, y = 0}, [2] = {x = 0, y = -1}, [3] = {x = 1, y = 0}, }; } function effectWhenWalking(player_uid, id_effect) local player = Player(player_uid) if player then local player_position = player:getPosition() local player_direction = player:getDirection() local player_pos_x = player_position.x local player_pos_y = player_position.y local player_pos_z = player_position.z local position = {x = player_pos_x + Config_.back[player_direction].x,y = player_pos_y + Config_.back[player_direction].y,z = player_pos_y} position:sendMagicEffect(id_effect) addEvent(effectWhenWalking, 1, player_uid, id_effect) end end
  6. vai em creaturescripts, e me mande o arquivo chamado firstitems.lua
  7. Coloca la na sua lib : Config_ = { back = { [0] = {x = 0, y = 1}, [1] = {x = -1, y = 0}, [2] = {x = 0, y = -1}, [3] = {x = 1, y = 0}, }; } function effectWhenWalking(player_uid, id_effect) local player = Player(player_uid) if player then local player_position = player:getPosition() local player_direction = player:getDirection() local player_pos_x = player_position.x local player_pos_y = player_position.y local player_pos_z = player_position.x local position = {x = player_pos_x + Config_.back[player_direction].x,y = player_pos_y + Config_.back[player_direction].y,z = player_pos_y} position:sendMagicEffect(id_effect) addEvent(effectWhenWalking, 1, player_uid, id_effect) end end um jeito para você utilizar essa função : local player_uid = player.uid effectWhenWalking(player_uid, 10)
  8. me passa seu discord, que vou te ajudar
  9. posso sim : https://github.com/mehah/otclient
  10. Obrigado pela contribuição, a comunidade agradece!
  11. Sistema funciona da seguinte forma, ao digitar : !aura on, a aura do player vai ligar, enquanto ela estiver ligada o player vai ficar regenerando a vida dele, ao digitar : !aura off, ela vai desligar e o player vai parar de regenerar a vida dele, vou estar deixando um video aqui em baixo Agora vamos colocar o codigo Em data/talkactions/script/, crie um arquivo chamado aura.lua, e coloque isso dentro dele : local config_aurea = { effect = 50; -- efeito que vai ficar girando no player effect_health = 162; -- efeito qnd curar o player level_use = { -- level que vai ser usado (min/max) min = 1, max = 600, } ; health = 10; -- tanto que vai curar por time configurado pos_aurea = { -- não mexa [1] = {x = 0, y = -1}; [2] = {x = 1, y = -1}; [3] = {x = 1, y = 0}; [4] = {x = 1, y = 1}; [5] = {x = 0, y = 1}; [6] = {x = -1, y = 1}; [7] = {x = -1, y = 0}; [8] = {x = -1, y = -1}; }; storage_pos = 1547637649; -- não mexa e nem repita esse valor em outro script!! storage = 165477963; -- não mexa e nem repita esse valor em outro script!! tempo_aurea = 1; -- tempo da aurea para passar em cada posição } local function calculePosAurea(player_uid) local player = Player(player_uid) if not player then return end if player:getStorageValue(config_aurea.storage) <= 0 then return end if(player:getStorageValue(config_aurea.storage_pos) >= 8)then player:setStorageValue(config_aurea.storage_pos, 0) end local storage_ = player:getStorageValue(config_aurea.storage_pos) player:setStorageValue(config_aurea.storage_pos, storage_ + 1) local new_storage_ = player:getStorageValue(config_aurea.storage_pos) return new_storage_ end local function posAurea(player_uid) local player = Player(player_uid) if not player then return end if player:getStorageValue(config_aurea.storage) <= 0 then return end local pos_x = player:getPosition().x local pos_y = player:getPosition().y local pos_z = player:getPosition().z local aa = calculePosAurea(player_uid) local pos = Position(pos_x + config_aurea.pos_aurea[aa].x, pos_y + config_aurea.pos_aurea[aa].y, pos_z) if not pos then return end return pos end local function aurea(player_uid) local player = Player(player_uid) if not player then return end if player:getStorageValue(config_aurea.storage) <= 0 then return end local player_position = player:getPosition() player:addHealth(config_aurea.health) player_position:sendMagicEffect(config_aurea.effect_health) local position = posAurea(player_uid) local position_ = posAurea(player_uid) position:sendDistanceEffect(position_, config_aurea.effect) addEvent(aurea, config_aurea.tempo_aurea, player_uid) end function onSay(player, words, param) if words == "!aura on" then if player:getLevel() > config_aurea.level_use.max then player:sendTextMessage(MESSAGE_STATUS_SMALL, player:getName() .. " seu level(" .. player:getLevel() .. ") precisa ser maior(" .. config_aurea.level_use.max) return false end if player:getLevel() < config_aurea.level_use.min then player:sendTextMessage(MESSAGE_STATUS_SMALL, player:getName() .. " seu level(" .. player:getLevel() .. ") precisa ser menor(" .. config_aurea.level_use.max) return false end if player:getStorageValue(config_aurea.storage) >= 1 then player:sendTextMessage(MESSAGE_STATUS_SMALL, player:getName() .. " Você ja esta com a aurea ligada") return false end player:setStorageValue(config_aurea.storage, 1) player:setStorageValue(config_aurea.storage_pos, 0) aurea(player.uid) elseif words == "!aura off" then player:setStorageValue(config_aurea.storage, 0) end return false end Agora em data/talkactions/talkactions.xml, abra ele e coloque : <talkaction words="!aura on;!aura off" script="aura.lua"/> Agora em data/creaturescript/script/login.lua, abra ele e embaixo de : player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr) Coloque : player:setStorageValue(165477963, 0) player:setStorageValue(1547637649, 0) Creditos : Sr. Naja 20210927_210547.mp4
  • Recently Browsing   0 members

    • No registered users viewing this page.