Skip to content
This repository has been archived by the owner on Dec 4, 2020. It is now read-only.

Trusts - Hasso probably doesn't work #1537

Open
2 tasks done
zach2good opened this issue Nov 28, 2020 · 1 comment
Open
2 tasks done

Trusts - Hasso probably doesn't work #1537

zach2good opened this issue Nov 28, 2020 · 1 comment

Comments

@zach2good
Copy link
Contributor

I have:

  • searched existing issues (http://project-topaz.com/issues/) to see if the issue has already been opened
  • checked the commit log to see if the issue has been resolved since my server was last updated

Additional Information (Steps to reproduce/Expected behavior) :
From @Omnione

Everything in core works as expected, upon looking in the scripts:

if (target:isWeaponTwoHanded()) then

This call will fail, as trusts are mobs behind the scenes - and don't have equipment.

This call requires equipment:

inline int32 CLuaBaseEntity::isWeaponTwoHanded(lua_State *L)
{
    TPZ_DEBUG_BREAK_IF(m_PBaseEntity == nullptr);
    TPZ_DEBUG_BREAK_IF(m_PBaseEntity->objtype == TYPE_NPC);

    auto weapon = dynamic_cast<CItemWeapon*>(((CBattleEntity*)m_PBaseEntity)->m_Weapons[SLOT_MAIN]);

    if (weapon == nullptr)
    {
        ShowDebug(CL_CYAN"lua::getWeaponDmg weapon in main slot is NULL!\n" CL_RESET);
        return 0;
    }
    lua_pushboolean(L, weapon->isTwoHanded());
    return 1;
}
bool CItemWeapon::isTwoHanded()
{
    return m_twoHanded;
}

Possible ways to handle this:
The mob_pool entries for Trusts have correct cmbSkill, but it isn't assigned to anything. If it was looked at on load and then used to set the m_twoHanded flag - Hasso might start working.

Probably worth looking through all the other abilities that Trusts use and see if there are other gotchas like this

@TeoTwawki
Copy link
Contributor

TeoTwawki commented Dec 1, 2020

cmbSkill should be deprecated phased out and unused by even regular mobs, let alone trusts as its correct and accurate that they do not actually have weapons equipped, and the if check condition should be adjusted to check for 2 handed equipped OR isn't a player.

if target:isWeaponTwoHanded() or not target:isPC() then -- If we're not a PC, we don't care about weapons

Additional note: there will be other things like this and you will run into quotes of SE saying such and such trust "counts as using a 2 handed weapon" - this ONLY means that they get the benefits of traits that in players hands would depend on 2 handed weapons, and not that they are coded to use a 2 handed weapon. Like other things player shave to put effort into (such as certain merit bonuses), mobs (and by extension trusts) just get the perks for free.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants