Ir para conteúdo

Slicer

Príncipe
  • Total de itens

    4014
  • Registro em

  • Última visita

  • Dias Ganhos

    47

Posts postados por Slicer

  1. 1* ele n deve ter esse evento aki... \/... ja q tu registrou diferente ali no .xml -e tb nem eh preciso ja q tu tem q por eh no login.lua-

    registerCreatureEvent(cid, "teleportmonster")

    e n eh questao de da erro... eh questao de n ser usado entao pra q ta ali, sabe? eh aquele velho principio...

    Keep

    It

    Simple,

    Stupid

     

    -n leve o stupid a serio ta...-

    http://pt.wikipedia.org/wiki/Keep_It_Simple

  2. eu odeio esse problema kk'

    achu q agora vai...

     

     

    local speedGain = 100
    local manaLose = 1
    local vocs = {
        [1] = 538,
        [2] = 585,
        [3] = 536,
    }
    
    local function event(uid, mlose, speed)
       if not isPlayer(uid) then
          return true
       end
    
       if getCreatureMana(uid) < mlose then
          setPlayerStorageValue(uid, 9330, -1)
          doRemoveCondition(uid, CONDITION_OUTFIT)
          local sp = getCreatureSpeed(uid) - speed
          doChangeSpeed(uid, -getCreatureSpeed(uid))
          doChangeSpeed(uid, sp)
          return true
       end
     
       if getPlayerStorageValue(uid, 9330) < 1 then
          return true
       end
     
       doPlayerAddMana(uid, -mlose)
       return addEvent(event, 1000, uid, mlose, speed)
    end
    
    function onSay(cid, words, param)
       if not vocs[getPlayerVocation(cid)] then
          return true
       end
     
       if getPlayerStorageValue(cid, 9330) < 1 then
          local out = getCreatureOutfit(cid)
          out.lookType = vocs[getPlayerVocation(cid)]
          setPlayerStorageValue(cid, 9330, 1)
          local sp = getCreatureSpeed(cid)
          doChangeSpeed(cid, -getCreatureSpeed(cid))
          doChangeSpeed(cid, sp + speedGain)
          event(cid, manaLose, speedGain)
          doSetCreatureOutfit(cid, out, -1)
       elseif getPlayerStorageValue(cid, 9330) >= 1 then
          setPlayerStorageValue(cid, 9330, -1)
          doRemoveCondition(cid, CONDITION_OUTFIT)
          local sp = getCreatureSpeed(cid) - speedGain
          doChangeSpeed(cid, -getCreatureSpeed(cid))
          doChangeSpeed(cid, sp)
       end
    return true
    end

  3. testa ae...

     

     

    local speedGain = 100
    local manaLose = 1
    local vocs = {
        [1] = 538,
        [2] = 585,
        [3] = 536,
    }
    
    local function event(uid, mlose, speed)
       if not isPlayer(uid) then
          return true
       end
    
       if getCreatureMana(uid) < mlose then
          setPlayerStorageValue(uid, 9330, -1)
          doRemoveCondition(uid, CONDITION_OUTFIT)
          local sp = getCreatureSpeed(uid) - speed
          doChangeSpeed(uid, -getCreatureSpeed(uid))
          doChangeSpeed(uid, sp)
          return true
       end
     
       if getPlayerStorageValue(uid, 9330) < 1 then
          return true
       end
     
       doPlayerAddMana(uid, -mlose)
       return addEvent(event, 1000, uid, mlose, speed)
    end
    
    function onSay(cid, words, param)
       if not vocs[getPlayerVocation(cid)] then
          return true
       end
     
       if getPlayerStorageValue(cid, 9330) < 1 then
          setPlayerStorageValue(cid, 9330, 1)
          local sp = getCreatureSpeed(cid)
          doChangeSpeed(cid, -getCreatureSpeed(cid))
          doChangeSpeed(cid, sp + speedGain)
          event(cid, manaLose, speedGain)
          doSetCreatureOutfit(cid, {lookType = vocs[getPlayerVocation(cid)]}, -1)
       elseif getPlayerStorageValue(cid, 9330) >= 1 then
          setPlayerStorageValue(cid, 9330, -1)
          doRemoveCondition(cid, CONDITION_OUTFIT)
          local sp = getCreatureSpeed(cid) - speedGain
          doChangeSpeed(cid, -getCreatureSpeed(cid))
          doChangeSpeed(cid, sp)
       end
    return true
    end

     

    rok, rok, rok...

  4. /\ na real eh em game.cpp ...

     

    target->gainHealth(attacker, healthChange);
            if(g_config.getBool(ConfigManager::SHOW_HEALING_DAMAGE) && !target->isGhost() &&
                (g_config.getBool(ConfigManager::SHOW_HEALING_DAMAGE_MONSTER) || !target->getMonster()))
            {
                char buffer[20];
                sprintf(buffer, "+%d", healthChange);
    
                const SpectatorVec& list = getSpectators(targetPos);
                if(combatType != COMBAT_HEALING)
                    addMagicEffect(list, targetPos, MAGIC_EFFECT_WRAPS_BLUE);
    
                addAnimatedText(list, targetPos, TEXTCOLOR_GREEN, buffer);
            }

     

    eh soh mudar ali em TEXTCOLOR_GREEN...

  5. oia... aparentemente, a funçao interna da getItemName ta retornando false e dai ta dando esse erro... isso acontece quando...

    if(thing.itemid < 100) then
       return false
    end

    no caso, caso ele ache um item com id < 100 o.O -nem sei se isso eh possivel de fazer sei la-

     

    tem 2 jeitos de 'contornar' esse erro...

     

    1* trocando essa parte...

    local corpse = -1
    for _, item in ipairs(items) do
    local name = getItemName(item.uid):lower()
    if name:find(target:lower()) then
    corpse = item.uid
    break
    end
    end

    por essa..

    local corpse = -1
    for _, item in ipairs(items) do
       if item and item.itemid >= 100 then
          local name = getItemName(item.uid):lower()
          if name:find(target:lower()) then
             corpse = item.uid
             break
          end
       end
    end
    

    2* indo em lib/050-functions.lua e achando essa funçao..

    function getItemDescriptions(uid)

    e tirando aquela parte ali de thing.itemid < 100...

     

    -mas realmente deve ter um motivo para ter essa proteçao entao recomendo fazer a 1* opçao... ou clr, tentar achar o item com id < 100 e mudar o id dele...-

  6. 1* ta ligado q existem 7 direçoes neh? entao esse teu else ae ta bem falho...

    2* a getPosByDir tb aceita size... e funciona exatamente como a tua... -soh q ela eh completa neh... com as 7 dirs...-

    3* local ret = pos --isso ae n adianta de nd ja q ainda vais alterar a tabela original...

     

    essa eh a getPosByDir...

     

     

    function getPositionByDirection(pos, direction, size)
        local n = size or 1
        local position = {}
        position.x = pos.x
        position.y = pos.y
        position.z = pos.z
            if pos.stackpos then
                position.stackpos = pos.stackpos
            end
        if(direction == NORTH) then
            position.y = position.y - n
        elseif(direction == SOUTH) then
            position.y = position.y + n
        elseif(direction == WEST) then
            position.x = position.x - n
        elseif(direction == EAST) then
            position.x = position.x + n
        elseif(direction == NORTHWEST) then
            position.y = position.y - n
            position.x = position.x - n
        elseif(direction == NORTHEAST) then
            position.y = position.y - n
            position.x = position.x + n
        elseif(direction == SOUTHWEST) then
            position.y = position.y + n
            position.x = position.x - n
        elseif(direction == SOUTHEAST) then
            position.y = position.y + n
            position.x = position.x + n
        end
    
        return position
    end

     

     

     

    PS: AINDA ACHU Q DEVIA TER PARTE DE APROVAÇAO PARA ESSAS AREAS DE SCRIPTING... ¬¬

  7. oia... antes de tudoo achu q eu fiz uma proteçao na 1.9.1/2.9.1 para n da esse crash...

    ----------------------------------        --alterado v1.9.1 \/
    if not isCreature(cid) then
       doRemoveItem(item.uid, 1)
       return true
    elseif (getPlayerFreeCap(cid) >= 6 and not isInArray({5, 6}, getPlayerGroupId(cid))) or not hasSpaceInContainer(getPlayerSlotItem(cid, 3).uid) then
       item2 = doCreateItemEx(item.itemid)
       sendMail = true
    else
       item2 = addItemInFreeBag(getPlayerSlotItem(cid, 3).uid, item.itemid, 1)
    end
    ----------------------------------

    mas vo explicar oq os idiotas fazem...

    eles abrem 2 acc, colocam um item unique na boost machine e entao deslogam... dai eles pegam o outro char e movem o item unique q ta na boost machine... com isso, no codigo antigo, o jogo tentava mandar o item unique pro depot do player e dai, sei la pq essa bosta acontece, da crash no serv...

     

    eu realmente n sei pq o pessoal q fez as sources deixou essa brecha.. mas...

     

    -o vodkart postou um script q manda os itens pro depot ms se o player tiver off... com a funçao q ele usou la da pra consertar esse script de boa... mas sinceramente n to afim de fazer isso entao, good luck...-

  8. ja antecipo q antes de mais nd tem q tirar algumas proteçoes do exp.lua... -de quando o player leva hit-

    achu q deve da pra fazer usando onThink... mas sinceramente, vai ficar pesado pra kct!

     

    teria q ficar checando se o monstro tem target... se tiver, tem q ver se eh summon... se for, tem q ver se o summon ta trapado, faz uma funçao q verifica emvolta do summon e ve se tem alguma pos livre q de para andar -isWalkable-, ou se ta muito distante... se tiver, mudar o target pro player... e ao ms tempo, caso seja um player o target, tem q ficar de olho se ele tem summon e se o summon n ta trapado e n ta longe, para dai mudar o target de volta pro monstro...

     

    resumindo, sistema foda e chato pra kct de fazer kkk' good luck ae

  9. storages values, sendo globais ou nao, sao 'compartimentos' q sao usados para guardar informaçoes...

    as storages 'locais', setPlayerStorageValue/getPlayerStorageValue, sao salvas para cada player, se tu setar uma storage dessa num player ela vai ficar salva soh para esse player...

    as storages globais, setGlobalStorageValue/getGlobalStorageValue, sao salvas na database e elas sao globais para todo o serv... elas funcionam quase como uma variavel global soh q elas continuam com o valor delas salvo ms depois do serv fechar...

  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...