Ir para conteúdo

diarmaint

Visconde
  • Total de itens

    314
  • Registro em

  • Última visita

  • Dias Ganhos

    5

Posts postados por diarmaint

  1. Galera, estou com as seguintes mensagens ao compilar um tfs 0.4 no ubuntu .

    o processo termina tudo correto, mas por ser tantas mensagens de aviso, não sei se isso pode prejudicar o servidor de alguma forma, como lags etc..

    Citar
    
      CXX      luascript.o
    luascript.cpp: In static member function ‘static int32_t LuaInterface::luaSetCre                                                                                                             atureName(lua_State*)’:
    luascript.cpp:8820:52: warning: suggest parentheses around assignment used as tr                                                                                                             uth value [-Wparentheses]
      if (creature = env->getCreatureByUID(popNumber(L)))
                                                        ^
      CXX      mailbox.o
      CXX      manager.o
      CXX      map.o
      CXX      monster.o
      CXX      monsters.o
      CXX      movement.o
    monsters.cpp: In member function ‘void MonsterType::dropLoot(Container*)’:
    monsters.cpp:211:9: warning: suggest explicit braces to avoid ambiguous ‘else’ [                                                                                                             -Wparentheses]
      else if(message == LOOTMSG_PLAYER || message == LOOTMSG_BOTH)
             ^
      CXX      networkmessage.o
      CXX      npc.o
      CXX      otserv.o
      CXX      outfit.o
    otserv.cpp: In function ‘void otserv(StringVec, ServiceManager*)’:
    otserv.cpp:687:41: warning: suggest parentheses around assignment used as truth                                                                                                              value [-Wparentheses]
      if(result = db->storeQuery(query.str()))
                                             ^
    otserv.cpp:697:57: warning: suggest parentheses around assignment used as truth                                                                                                              value [-Wparentheses]
         if(result_ = db->storeQuery(query_playeritems.str()))
                                                             ^
    otserv.cpp:716:62: warning: suggest parentheses around assignment used as truth                                                                                                              value [-Wparentheses]
         if(result_ = db->storeQuery(query_playerdepotitems.str()))
                                                                  ^
    otserv.cpp:735:55: warning: suggest parentheses around assignment used as truth                                                                                                              value [-Wparentheses]
         if(result_ = db->storeQuery(query_tileitems.str()))
                                                           ^
      CXX      party.o
      CXX      player.o
      CXX      protocolgame.o
    player.cpp: In member function ‘void Player::manageAccount(const string&)’:
    player.cpp:5184:30: warning: NULL used in arithmetic [-Wpointer-arith]
         if(msg.str().length() == NULL)
                                  ^
      CXX      protocollogin.o
    protocolgame.cpp: In member function ‘void ProtocolGame::sendMagicEffect(const P                                                                                                             osition&, uint16_t)’:
    protocolgame.cpp:2098:12: warning: comparison is always false due to limited ran                                                                                                             ge of data type [-Wtype-limits]
      if(type > MAGIC_EFFECT_LAST || !canSee(pos))

     

    Isso afeta em algo o servidor?

    é normal? teria uma forma de resolver?

  2. Então cara, to corrigindo os erros do servidor, e chegou nesse 

    Spoiler

    [18:30:17.523] [Warning - IOMapSerialize::loadItem] Unserialization error [1] for item type 2590
    [18:30:17.523] [Error - IOMapSerialize::loadMapBinary] Unserialization of invalid tile at position ( 12544 / 42499 / 000 )
    [18:30:17.524] [Warning - IOMapSerialize::loadItem] Unserialization error [1] for item type 2590
    [18:30:17.524] [Error - IOMapSerialize::loadMapBinary] Unserialization of invalid tile at position ( 08960 / 43011 / 000 )
    [18:30:17.524] [Warning - IOMapSerialize::loadItem] Unserialization error [1] for item type 2590
    [18:30:17.524] [Error - IOMapSerialize::loadMapBinary] Unserialization of invalid tile at position ( 41216 / 43010 / 000 )

    não tem essas coordenadas no mapa, dei uma pesquisada e vi uma galera falando que é problema na database. mas estou a usando a que vc disponibilizou que está limpa, sabe como arrumar?

     

    e tem esse outro problema, não consegui achar nada duplicado no talkactions

    Spoiler

    [18:35:54.775] >> Carregando Sistema
    [18:35:54.950] [Warning - TalkAction::registerEvent] Duplicate registered talkaction with words:
    [18:35:54.983] >> Carregando Mods...
    [18:35:54.984] > Loading ExpPotion.xml... done.

     

     

    como arrumar essa verificação de itens?

    Spoiler

    [18:36:03.117] > Inicializando estado do jogo e registrando servicos...

     Check Items : Nenhum item encontrado.

     Check Items : Nenhum item encontrado.
    [18:36:03.259] > IP do Servidor: 127.0.0.1

     

  3. Em 08/08/2015 em 01:28, zipter98 disse:

    Spell:

    
    local config = {
        time = 10,             --Tempo de stun.
        statue = xxx,          --ID da estátua.
        storage = 9181
    }
     
    function onCastSpell(cid)
        local target = getCreatureTarget(cid)
        if not isCreature(target) then
            return doPlayerSendCancel(cid, "You do not have a target.")
        end
        doCreatureSetNoMove(target, true)
        doCreateItem(config.statue, 1, getThingPos(target))
        setPlayerStorageValue(target, config.storage, 1)
        local guid, toPos = getPlayerGUID(target), getThingPos(target)
        addEvent(function()
            local item = getTileItemById(toPos, config.statue).uid
            if item > 0 then
                doRemoveItem(item)
            end
            local pid = isCreature(target) and target or getPlayerByName(getPlayerNameByGUID(guid))
            if isCreature(pid) then
                setPlayerStorageValue(pid, config.storage, -1)
                doCreatureSetNoMove(pid, false)
            else
                db.executeQuery("UPDATE player_storage SET value = -1 WHERE key = "..config.storage.." AND player_id = "..guid)
            end
        end, config.time * 1000)     
        return true
    end
    data/creaturescripts/scripts:
    
    local storage = 9181
     
    function onTarget(cid, target)
        return getPlayerStorageValue(target, storage) < 1
    end
     
    function onStatsChange(cid, attacker, type, combat, value)
        return getPlayerStorageValue(cid, storage) < 1
    end
     
    function onLogin(cid)
        registerCreatureEvent(cid, "stunStatsChange")
        registerCreatureEvent(cid, "stunTarget")
        return true
    end
    Tags:
    
    <event type="login" name="stunLogin" event="script" value="nome_do_arquivo.lua"/>
    <event type="statschange" name="stunStatsChange" event="script" value="nome_do_arquivo.lua"/>
    <event type="target" name="stunTarget" event="script" value="nome_do_arquivo.lua"/>

    Desculpe reviver mas preciso muito.

    usando tfs 1.3 e dá esse erro.

    Spoiler

    [Error - CreatureEvent::configureEvent] Invalid type for creature event: stunTarget
    [Warning - BaseEvents::loadFromXml] Failed to configure event
    [Error - CreatureEvent::configureEvent] Invalid type for creature event: SpellBuff
    [Warning - BaseEvents::loadFromXml] Failed to configure event

     

  4. Ao usar em tfs 1.3 dá esse erro

    Spoiler

    [Error - CreatureEvent::configureEvent] Invalid type for creature event: SpellBuff
    [Warning - BaseEvents::loadFromXml] Failed to configure event

    e também gostaria de adicionar ícone de buff quando estivesse ativa, e limitar o tempo desse buff em x segundos.

     

     

     

     

  5. Em 21/03/2019 em 04:13, Woox disse:

    Deixei as tags as serem usadas no XML nas primeiras linhas do script. Você provavelmente configurou algo errado, o script está funcional.

    Desculpa pela burrice, pensei que as tags eram pra ficar dentro do script, igual vc postou. rsrs

    EDIT.

    @Woox deixei as tags assim

    <event type="statschange" name="SpellBuff" event="script" value="diarmaint/passiva.lua"/>
    <event type="login" name="RegisterBuff" event="script" value="diarmaint/passiva.lua"/>

    Não dá nenhum erro no console mas o personagem não loga, fica conectando..

    e fica registrado no console

    [20:4:41.940] Diarmaint has logged in.
    [20:4:41.943] Diarmaint has logged out.

     

  6. 18 horas atrás, Woox disse:
    
    --<event type="statschange" name="SpellBuff" event="script" value="spellbuff.lua"/>--
    --<event type="login" name="RegisterBuff" event="script" value="registerbuff.lua"/>--
    
    local vocations = {4, 8} -- ID das vocations que receberao o buff
    local percentageToActive = 0.30 -- 30%
    local bonusSkill = 20 -- Quantidade de skill que o buff vai dar
    
    local condition = createConditionObject(CONDITION_ATTRIBUTES)
    setConditionParam(condition, CONDITION_PARAM_TICKS, -1)
    setConditionParam(condition, CONDITION_PARAM_SKILL_MELEE, bonusSkill)
    setConditionParam(condition, CONDITION_PARAM_SUBID, 10)
    setConditionParam(condition, CONDITION_PARAM_BUFF, true)
    
    function onStatsChange(cid, attacker, type, combat, value)
    	local health_now, health_max = getCreatureHealth(cid), getCreatureMaxHealth(cid)
    	if (type == STATSCHANGE_HEALTHGAIN) then
    		if (health_now + value) > math.ceil(health_max * percentageToActive) then
    			doRemoveCondition(cid, CONDITION_ATTRIBUTES, 10)
    		end
    	elseif (type == STATSCHANGE_HEALTHLOSS)	then
    		if (health_now - value) > 0 and (health_now - value) < math.ceil(health_max * percentageToActive) then
    			doAddCondition(cid, condition)
    		end	
    	end
    	return true
    end
    
    function onLogin(cid)
    	if isInArray(vocations, getPlayerVocation(cid)) then
    		registerCreatureEvent(cid, "SpellBuff")
    	end
    end

     

    Então vou deixar o xml como 

    spellbuff.lua

    dai eu mudei a vocação e pronto, to usando 0.4 e não aconteceu nada..

  7. 1 minuto atrás, Woox disse:
    
    CONDITION_PARAM_SKILL_FIST
    CONDITION_PARAM_SKILL_CLUB
    CONDITION_PARAM_SKILL_SWORD
    CONDITION_PARAM_SKILL_AXE
    CONDITION_PARAM_SKILL_DISTANCE
    CONDITION_PARAM_SKILL_SHIELD

     

    Algo além de skills? tipo almento de dano ?

    increasemagicpercent

     

  8. 8 minutos atrás, Woox disse:

    Tinha postado tarde, tava cansado pra explicar, é creaturescript. Editei o script e deixei esses dados configuráveis e já vai com login pra registrar, o buff já está funcionando desta maneira, ativa com -30% de life, acima disso é desativado.

    o que mais eu poderia usar no lugar desse 

    setConditionParam(condition, CONDITION_PARAM_SKILL_MELEE, 20)

    para outras vocações?

  9. 17 horas atrás, Woox disse:
    
    local condition = createConditionObject(CONDITION_ATTRIBUTES)
    setConditionParam(condition, CONDITION_PARAM_TICKS, -1)
    setConditionParam(condition, CONDITION_PARAM_SKILL_MELEE, 20)
    setConditionParam(condition, CONDITION_PARAM_SUBID, 10)
    setConditionParam(condition, CONDITION_PARAM_BUFF, true)
    
    function onStatsChange(cid, attacker, type, combat, value)
    	local health_now, health_max = getCreatureHealth(cid), getCreatureMaxHealth(cid)
    	if (type == STATSCHANGE_HEALTHGAIN) then
    		if (health_now + value) > math.ceil(health_max * 0.30) then
    			doRemoveCondition(cid, CONDITION_ATTRIBUTES, 10)
    		end
    	elseif (type == STATSCHANGE_HEALTHLOSS)	then
            if (health_now - value) > 0 and (health_now - value) < math.ceil(health_max * 0.30) then
    			doAddCondition(cid, condition)
            end	
    	end
    	return true
    end

     

    Aonde colocamos ela? globalevents? tem que registar no login?

    como colocar pra enquanto o personagem ficar com 30% de hp ela ficar ativa?
    se caso ele healar e ficar com + de 30% de hp essa "passiva" acabe?

  • Quem Está Navegando   0 membros estão online

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