Ir para conteúdo

keeenzo

Membro
  • Registro em

  • Última visita

Histórico de Curtidas

  1. Gostei
    keeenzo deu reputação a Snowsz em Item para o last hit / mais dano   
    No caso:
     
    doPlayerAddDepotItems(last, lasthit[1], lashit[2]) Era pra ser ?
     
    doPlayerAddDepotItems(last, lasthit[1], lasthit[2]) O lasthit[2] está como lashit, corrige por favor
  2. Gostei
    keeenzo deu reputação a Wise em Item para o last hit / mais dano   
    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>
  3. Gostei
    keeenzo deu reputação a Danihcv em Item para o last hit / mais dano   
    Estou pelo cell então n tenho como te passar o script agora. A idéia: bom, não estou mt certo da função last hit então n posso dizer agr qual seria usada. Sobre o item ir pro player, não dá pra "sobrecarregar" então a solução eh mandar pro dp, pra fazer isso basta fazer uma checagem na cap atual do player e se a mesma for menor que o peso do item, ai manda pro dp através de uma "query' pra data base.
  4. Gostei
    keeenzo recebeu reputação de xWhiteWolf em (Resolvido)Sub nivel e Privilégios   
    Estou com problema, ao usar a porta ela da o efeito (estrelinha azul subindo kkk) porém não abre D: já testei a porta sem a actionid e abre normalmente, ajuda? *o*
     
    -------------------------------
     
    consegui "arrumar" (você passa por cima mesmo kk) com ajuda deste post: http://www.tibiaking.com/forum/topic/25566-pedido-passar-na-porta-so-com-storange/
     
     
    alterei este código 
    subniveldoor.lua (data/actions/scripts):
    function onUse(cid, item, fromPos, item2, toPos) local subnivel = 3 -- nivel local stor = 98765 -- subnivel storage if getPlayerStorageValue(cid, stor) >= subnivel then doTeleportThing(cid, toPos) doSendMagicEffect(fromPos, CONST_ME_MAGIC_BLUE) else doPlayerSendCancel(cid, 'Você precisa ter SubNível '..subnivel) doSendMagicEffect(fromPos, CONST_ME_POFF) end return true end *simplesmente coloquei um item2 na function..
     
    espero ajuda quem precisar do código e passe pelo mesmo problema  
  5. Gostei
    keeenzo deu reputação a xWhiteWolf em (Resolvido)Sub nivel e Privilégios   
    pra alterar o subnivel via db é só ir em player_storage procurar pelo player_id que vc acha facilmente na tabela players, dai vc procura a key que vc colocou no script, 98765 e mudar o value pro subnivel que vc quiser.
  6. Gostei
    keeenzo deu reputação a Wise em (Resolvido)Sub nivel e Privilégios   
    subnivel.lua (data/creaturescripts/scripts):
    function onKill(cid, target)     local b = {'Ghazbaran', 'Morgaroth', 'Orshabaal'} -- bosses     local subnivel = 98765 -- storage          for i = 1, #b do         if getCreatureName(target):lower() == b[i]:lower() then             if getPlayerStorageValue(cid, subnivel) < 0 then                 return setPlayerStorageValue(cid, subnivel, 1) and true             end                      setPlayerStorageValue(cid, subnivel, getPlayerStorageValue(cid, subnivel) + 1)         end     end          return true end
     
    Tag - creaturescritps.xml (data/creaturescripts):
    <event type="kill" name="SubNivel" event="script" value="subnivel.lua"/>
     
    Registre o creature event em login.lua (data/creaturescripts/scripts):
    registerCreatureEvent(cid, "SubNivel")


    subniveldoor.lua (data/actions/scripts):
    function onUse(cid, item, fromPos, toPos)     local subnivel = 3 -- nivel     local stor = 98765 -- subnivel storage          if getPlayerStorageValue(cid, stor) >= subnivel then         doTeleportThing(cid, toPos)         doSendMagicEffect(fromPos, CONST_ME_MAGIC_BLUE)     else         doPlayerSendCancel(cid, 'Você precisa ter SubNível '..subnivel)         doSendMagicEffect(fromPos, CONST_ME_POFF)     end          return true end


    Tag - actions.xml (data/actions):
    <action actionid="ACTIONID" script="subniveldoor.lua"/>

Informação Importante

Confirmação de Termo