The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Guildstone system get fixed?
Author Message
Ben
Sphere Developer
*****

Posts: 612
Likes Given: 2
Likes Received: 123 in 70 posts
Joined: Mar 2010
Reputation: 18

SphereCommunity

Post: #3
RE: Guildstone system get fixed?
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...

AxisII's current version: 2.0.4j
AxisII SourceCode on Github
AxisII up to date changelog
(This post was last modified: 02-26-2017 06:34 AM by Ben.)
02-26-2017 01:25 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
Guildstone system get fixed? - x77x - 02-09-2017, 11:38 PM
RE: Guildstone system get fixed? - x77x - 02-25-2017, 11:30 PM
RE: Guildstone system get fixed? - Ben - 02-26-2017 01:25 AM
RE: Guildstone system get fixed? - x77x - 03-03-2017, 11:45 PM
RE: Guildstone system get fixed? - x77x - 07-22-2017, 09:29 PM
RE: Guildstone system get fixed? - x77x - 07-24-2017, 09:24 AM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)