Ir para conteúdo

Líderes

Conteúdo Popular

Exibindo conteúdo com a maior reputação em 05/31/21 em todas áreas

  1. (Resolvido)Tile que enxe stamina

    Orientalz reagiu a Adriano SwaTT por uma resposta no tópico

    1 ponto
    Teste este: Registre em movements.xml as tags abaixo: <movevent type="StepIn" actionid="12129" event="script" value="tile_stamina.lua"/> <movevent type="StepOut" actionid="12129" event="script" value="tile_stamina.lua"/> Crie o arquivo tile_stamina.lua e cole o código abaixo dentro: ---------- Script by: Adriano Swatt -------- local maxstamina = 2520 -- quantidade máxima de Stamina (Não sei se é este valor mesmo) local qtdd = 1 -- quantidade de Stamina é adicionada local tempo = 5 -- em segundos para cada regeneração local tileid, action = 412, 12129 -- ID do Piso de Stamina, ActionID usada no Piso ----------- FIM DAS CONFIGURAÇÕES ----------- function onStepIn(cid, item, position, fromPosition) local getpos = getPlayerPosition(cid) local tilepos = getTileItemById(getpos, tileid).actionid local getsta = getPlayerStamina(cid) if getsta < maxstamina and isPlayer(cid) then addEvent(GetStamina, 100, cid) else doTeleportThing(cid, fromPosition) doPlayerSendCancel(cid, "Sua stamina já está cheia.") end return true end function onStepOut(cid, item, position, fromPosition) stopEvent(GetStamina) return true end function GetStamina(cid) local getpos = getPlayerPosition(cid) local tilepos = getTileItemById(getpos, tileid).actionid local getsta = getPlayerStamina(cid) if tilepos == action then if getsta < maxstamina and isPlayer(cid) then doPlayerSendCancel(cid, "Sua stamina está subindo.") setPlayerStamina(cid, getsta + qtdd) addEvent(GetStamina, tempo * 1000, cid) else doTeleportThing(cid, fromPosition) doPlayerSendCancel(cid, "Sua stamina já está cheia.") end end return true end Poste o resultado. Boa sorte.
  2. Item para o last hit / mais dano

    Orientalz reagiu a Wise por uma resposta no tópico

    1 ponto
    Ambos (lasthitkiller / mostdamagekiller) recebem um item? Se for: bossreward.lua (data\creaturescripts\scripts): local lasthit = {5432, 1} -- lasthitkiller = {itemid, amount} local mostdmg = {5432, 1} -- mostdamagekiller = {itemid, amount} function doPlayerAddDepotItems(pid, item, count) -- function by magus - modified by vodkart local item, count = {item}, {(count or 1)} for k, v in ipairs(item) do local ls = db.getResult("SELECT `sid` FROM `player_depotitems` WHERE `player_id` = "..pid.." ORDER BY `sid` DESC LIMIT 1") return db.executeQuery("INSERT INTO `player_depotitems` (`player_id`, `sid`, `pid`, `itemtype`, `count`, `attributes`) VALUES ("..pid..", "..(ls:getDataInt("sid")+1)..", 101, "..v..", "..count[k]..", '')") or false end end function onDeath(cid, corpse, deathList) local last, most = deathList[1], deathList[2] if isPlayer(last) then if getPlayerFreeCap(last) > getItemWeightById(lasthit[1], lasthit[2]) then doPlayerAddItem(last, lasthit[1], lasthit[2]) doPlayerSendTextMessage(last, MESSAGE_INFO_DESCR, 'You have received a reward for being the player that gave the last hit on the BOSS.') else doPlayerAddDepotItems(last, lasthit[1], lasthit[2]) doPlayerSendTextMessage(last, MESSAGE_STATUS_CONSOLE_BLUE, 'You have received a reward for being the player that gave the last hit on the BOSS. But you don\'t have enought cap, so it was sent to your depot.') end end if isPlayer(most) then if getPlayerFreeCap(most) > getItemWeightById(mostdmg[1], mostdmg[2]) then doPlayerAddItem(most, mostdmg[1], mostdmg[2]) doPlayerSendTextMessage(most, MESSAGE_INFO_DESCR, 'You have received a reward for being the player that gave the most damage on the BOSS.') else doPlayerAddDepotItems(most, mostdmg[1], mostdmg[2]) doPlayerSendTextMessage(most, MESSAGE_STATUS_CONSOLE_BLUE, 'You have received a reward for being the player that gave the most damage on the BOSS. But you don\'t have enought cap, so it was sent to your depot.') end end return true end Tag - creaturescripts.xml (data\creaturescripts): <event type="death" name="BOSSReward" event="script" value="bossreward.lua"/> Registre o creature event no XML do monster: <script> <event name="BOSSReward"/> </script>
Líderes está configurado para São Paulo/GMT-03:00

Informação Importante

Confirmação de Termo