Jump to content
Sign in to follow this  
Elwyn

Habilitando onEquip e onDeEquip para actionId

Recommended Posts

Elwyn    106
Elwyn

Atualmente o TFS 1.0, em moveevents, não reconhece items com actionId para as funções onEquip e onDeEquip. Para adicionar é simples.

 

 

Em movement.cpp procure por:

    if (it != m_itemIdMap.end()) {
        std::list<MoveEvent*>& moveEventList = it->second.moveEvent[eventType];
        for (MoveEvent* moveEvent : moveEventList) {
            if ((moveEvent->getSlot() & slotp) != 0) {
                return moveEvent;
            }
        }
    }

Isso deve estar na função MoveEvents::getEvent.

Depois de achar essa parte, abaixo dela cole o seguinte:

    uint16_t actionId = item->getActionId();
    if (actionId != 0) {
        it = m_actionIdMap.find(actionId);
        if (it != m_actionIdMap.end()) {
            std::list<MoveEvent*>& moveEventList = it->second.moveEvent[eventType];
            if (!moveEventList.empty()) {
                return *moveEventList.begin();
            }
        }
    }

Agora onEquip e onDeEquip aceita itens com actionId. Tenha em mente que onEquip e onDeEquip definidos com o id do item toma preferencia em relação aos com action id. Se você colar de forma invertida, ou seja, colar acima daquele trecho que eu falei para procurar, a ordem também vai inverter e action id vai ter agora preferencia sobre item id.

Edited by Inaluna

Share this post


Link to post
Yamaken    41
Yamaken

Então você cria uma regra pra um equipamento que tem action ID? Legal.

Share this post


Link to post
Elwyn    106
Elwyn

A regra vem como consequência de poder ter eventos com actionid em equipamento. Seria legal não precisar dela.

Share this post


Link to post
somos13    0
somos13

gracias

Share this post


Link to post
Guest
This topic is now closed to further replies.
Sign in to follow this  
  • Recently Browsing   0 members

    No registered users viewing this page.

×