x77x
Master
Posts: 488
Likes Given: 0
Likes Received: 15 in 15 posts
Joined: Mar 2012
Reputation: -4
|
|
02-25-2017 11:30 PM |
|
|
Ben
Sphere Developer
Posts: 612
Likes Given: 2
Likes Received: 123 in 70 posts
Joined: Mar 2010
Reputation: 18
SphereCommunity
|
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 |
|
|
x77x
Master
Posts: 488
Likes Given: 0
Likes Received: 15 in 15 posts
Joined: Mar 2012
Reputation: -4
|
RE: Guildstone system get fixed?
Dragons of Time 2000-2020
http://dragonsoftime.com
(This post was last modified: 07-23-2017 04:01 AM by x77x.)
|
|
07-22-2017 09:29 PM |
|
|