Manual:DIL Manual/guild
Jump to navigation
Jump to search
Contents
guild
Field (string, read/write; units: PC).
pc.guild : string
The name of the player's main (default) guild, e.g. "Udgaard Fighter". The guild names are the GUILD_* constants in values.h (GUILD_UDG_FIGHTER, GUILD_KNIGHT, ...). Empty when the player has no guild.
A player can be in several guilds; this field names only the main one. Membership and guild levels are kept as "$guild/<name>" extras in info by guilds.zon. Use guilds.zon's functions (JoinGuild, IsInGuild, SetDefaultGuild, GetGuildLevel) rather than setting the field by hand: SetDefaultGuild@guilds sets it only for a guild the player is in, and sets auto-training to match.
Notes
- Players only. On an NPC, an object, a room or null the field fails.
- Assigning
""or null clears it.
Example
dilbegin integer same_guild(a : unitptr, b : unitptr);
code
{
if ((a.type != UNIT_ST_PC) or (b.type != UNIT_ST_PC))
return (FALSE);
if (a.guild == "")
return (FALSE);
return (a.guild == b.guild);
}
dilend
Tells whether two players have the same main guild, as the experience boards in baselook.zon (exp_board) compare activator.guild.