UOX3 Script Engine

API and Event handling

Guild Functions

GetGuildType
Prototype
int GetGuildType( trgGuild );
PurposeReturns the type of guild associated with trgGuild.
Valid types are:
0 - Standard
1 - Order
2 - Chaos
3 - Unknown
4 - Count
Example of Usage
if( GetGuild( pTalking ) != -1 )

{
if( GetGuildType( GetGuild( pTalking ) ) == 0 )
{
TextMessage( pTalkingTo, "You're in a standard guild" );
}
}

 

GetGuildName
Prototype
string GetGuildName( trgGUild );
PurposeReturns the name of the guild trgGuild
Example of Usage
if( GetGuild( pTalking ) != -1 )

{
var gName = GetGuildName( GetGuild( pTalking ) );
TextMessage( pTalkingTo, "You belong to: " );
TextMessage( pTalkingTo, gName );
TextMessage( pTalkingTo, ", don't you?" );
}

 

GetGuildMaster
Prototype
CHARACTER GetGuildMaster( trgGuild );
PurposeReturns the character, if any, that is the guildmaster of trgGuild. If the returned value is -1, there is no master
Example of Usage
if( GetGuild( pTalking ) == GetGuild( pTalkingTo ) && GetGuild( pTalking ) != -1 )

{
if( GetGuildMaster( GetGuild( pTalking ) ) == pTalkingTo )
{
TextMessage( pTalkingTo, "Bow to me, I am your master!" );
}
}

 

SetGuildType
Prototype
SetGuildType( trgGuild, newType );
PurposeSets the guild trgGuild's type to newType. newType can be any of:
0 - Standard
1 - Order
2 - Chaos
3 - Unknown
4 - Count
Example of Usage
if( GetGuild( pTalkingTo ) != -1 )

{
SetGuildType( GetGuild( pTalkingTo ), 1 );
TextMessage( pTalkingTo, "We're now an order guild" );
}

 

SetGuildName
Prototype
SetGuildName( trgGUild, newName );
PurposeSets the name of trgGuild to newName.
Example of Usage
if( GetGuild( pTalkingTo ) != -1 )

{
SetGuildName( GetGuild( pTalkingTo ), strSaid ); // new name is whatever we were told
}

 

SetGuildMaster
Prototype
SetGuildMaster( trgGuild, newMaster );
PurposeSet's the guild master of trgGuild to newMaster. Note that newMaster is a SERIAL, not a character. To clear the master, use a value of 0xFFFFFFFF.
Example of Usage
SetGuildMaster( GetGuild( pTalkingTo ), 0xFFFFFFFF );	// no more master

 

GetNumGuildMembers
Prototype
int GetNumGuildMembers( trgGuild, memberType );
PurposeReturns the number of members (memberType == 0) or recruits (memberType == 1) or both (memberType == 2 ) that belongs in the guild trgGuild.
Example of Usage
if( GetNumGuildMembers( GetGuild( pTalking ), 2 ) > 10 )

{
TextMessage( pTalkingTo, "Wow, you have a few members" );
}

 

AddToGuild
Prototype
AddToGuild( trgGuild, trgMember, memberType );
PurposeAdds trgMember to the guild trgGuild as a member (memberType == 0) or recruit (memberType == 1).
Example of Usage
AddToGuild( GetGuild( pTalkingTo ), pTalking, 0 );

 

RemoveFromGuild
Prototype
RemoveFromGuild( trgGuild, trgMember );
PurposeRemoves trgMember from the guild trgGuild.
Example of Usage
RemoveFromGuild( GetGuild( pTalkingTo ), pTalking );

 

CompareGuild
Prototype
int CompareGuild( pOne, pTwo );
PurposeCompare's the relationships between pOne and PTwo's guilds. Possible values are:
0 - Neutral
1 - War
2 - Ally
3 - Unknown
4 - Same
5 - Count
Example of Usage
if( CompareGuild( pTalking, pTalkingTo ) == 2 )

{
TextMessage( pTalkingTo, "Sooo... where's my tribute?" );
}

 

CompareGuildByGuild
Prototype
int CompareGuild( srcGuild, trgGuild );
PurposeCompares the relations between srcGuild and trgGuild.
Possible values are:
0 - Neutral
1 - War
2 - Ally
3 - Unknown
4 - Same
5 - Count
Example of Usage
if( CompareGuildByGuild( GetGuild( pTalking ), GetGuild( pTalkingTo ) ) == 1 )

{
TextMessage( pTalkingTo, "Oh yeah, oh yeah, cmon I can take you!" );
}

 

GetGuildStone
Prototype
SERIAL GetGuildStone( trgGuild );
PurposeReturns the serial of the guild stone associated with trgGuild.
Example of Usage
if( GetGuildStone( GetGuild( pUser ) ) == GetSerial( iUsed, 1 ) )

{
RemoveFromGuild( GetGuild( pUser ), pUser );
}

 

ęCopyright 2000-2001 WWW.UOX3.NET (Daniel Stratton/Matthew Randall)