SphereCommunity
Guildstone system get fixed? - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: General Discussion (/Forum-General-Discussion)
+--- Forum: UO/Sphere Discussion (/Forum-UO-Sphere-Discussion)
+--- Thread: Guildstone system get fixed? (/Thread-Guildstone-system-get-fixed)



Guildstone system get fixed? - x77x - 02-09-2017 11:38 PM

did the guildstones get fixed?


RE: Guildstone system get fixed? - x77x - 02-25-2017 11:30 PM

yes? no? maybe so?


RE: Guildstone system get fixed? - Ben - 02-26-2017 01:25 AM

I think it works just fine now, Coruja did edit the code a little while ago.

This is how it works...
Code:
            // Check the guild stuff
            CItemStone *pMyGuild = Guild_Find(MEMORY_GUILD);
            if ( pMyGuild )
            {
                CItemStone *pViewerGuild = pCharViewer->Guild_Find(MEMORY_GUILD);
                if ( pViewerGuild )
                {
                    if ( (pViewerGuild == pMyGuild) || pMyGuild->IsAlliedWith(pViewerGuild) )
                        return NOTO_GUILD_SAME;
                    if ( pMyGuild->IsAtWarWith(pViewerGuild) )
                        return NOTO_GUILD_WAR;
                }
            }

            // Check the town stuff
            CItemStone *pMyTown = Guild_Find(MEMORY_TOWN);
            if ( pMyTown )
            {
                CItemStone *pViewerTown = pCharViewer->Guild_Find(MEMORY_TOWN);
                if ( pViewerTown )
                {
                    if ( pMyTown->IsAtWarWith(pViewerTown) )
                        return NOTO_GUILD_WAR;
                }
            }

And then the code for IsAlliedWith and IsAtWarWith
Code:
bool CItemStone::IsAlliedWith( const CItemStone * pStone) const
{
    ADDTOCALLSTACK("CItemStone::IsAlliedWith");
    if ( pStone == NULL )
        return( false );

    CScriptTriggerArgs Args;
    Args.m_pO1 = const_cast<CItemStone *>(pStone);
    enum TRIGRET_TYPE tr = TRIGRET_RET_DEFAULT;

    if ( const_cast<CItemStone *>(this)->r_Call("f_stonesys_internal_isalliedwith", &g_Serv, &Args, NULL, &tr) )
    {
        if ( tr == TRIGRET_RET_FALSE )
        {
            return false;
        }
        else if ( tr == TRIGRET_RET_TRUE )
        {
            return true;
        }
    }

    // we have declared or they declared.
    CStoneMember * pAllyMember = GetMember(pStone);
    if ( pAllyMember ) // Ok, we might be ally
    {
        if ( pAllyMember->GetTheyDeclaredAlly() && pAllyMember->GetWeDeclaredAlly() )
            return true;
    }

    return false;
}

bool CItemStone::IsAtWarWith( const CItemStone * pEnemyStone ) const
{
    ADDTOCALLSTACK("CItemStone::IsAtWarWith");
    // Boths guild shave declared war on each other.

    if ( pEnemyStone == NULL )
        return( false );

    CScriptTriggerArgs Args;
    Args.m_pO1 = const_cast<CItemStone *>(pEnemyStone);
    enum TRIGRET_TYPE tr = TRIGRET_RET_DEFAULT;

    if ( const_cast<CItemStone *>(this)->r_Call("f_stonesys_internal_isatwarwith", &g_Serv, &Args, NULL, &tr) )
    {
        if ( tr == TRIGRET_RET_FALSE )
        {
            return false;
        }
        else if ( tr == TRIGRET_RET_TRUE )
        {
            return true;
        }
    }

    // Just based on align type.
    if ( IsType(IT_STONE_GUILD) && GetAlignType() != STONEALIGN_STANDARD && pEnemyStone->GetAlignType() != STONEALIGN_STANDARD )
        return (GetAlignType() != pEnemyStone->GetAlignType());

    // we have declared or they declared.
    CStoneMember * pEnemyMember = GetMember(pEnemyStone);
    if (pEnemyMember) // Ok, we might be at war
    {
        if ( pEnemyMember->GetTheyDeclaredWar() && pEnemyMember->GetWeDeclaredWar() )
            return true;
    }

    return false;

}

I thought we had already went over this in another thread...


RE: Guildstone system get fixed? - x77x - 03-03-2017 11:45 PM

we talked about it... but im asking if the devs re-wrote the system to get it working correctly?


meaning ally and enemy & nuetral works


RE: Guildstone system get fixed? - x77x - 07-22-2017 09:29 PM

are you fuckin kidding me !? still broken...

2 waring guild are GREEN to each other

default files from 7/21


old post
https://forum.spherecommunity.net/Thread-guildstones-broke?page=5

tried uncommenting the mentioned lines, and makes no difference


RE: Guildstone system get fixed? - x77x - 07-24-2017 09:24 AM

nevermind... i remember what i did


Code:
[FUNCTION f_stonesys_internal_isalliedwith]
If ((<type> == t_stone_guild) && (<argo.type> == t_stone_guild))
    //If (<guildfromuid.<argo.uid>.isally> && <argo.guildfromuid.<uid>.isally>)
    //  return 1
    //endif

    return 0
endif

return 2