Files
dsrc/sku.0/sys.server/compiled/game/script/library/content.scriptlib
T

143 lines
3.6 KiB
Plaintext

//
// Content Path Script Library is for use with the content path granted when the player leaves
// the NPE, including Tatooine and Naboo quests currently, and soon to include more planets
//
// Todd Bailey, 9/21/2005
include library.badge;
// From Panaka
const string SECURITY_CLEARANCE_ASTRO = "bdg_content_rsf_clearance_1";
// From Typho
const string SECURITY_CLEARANCE_BINARY = "bdg_content_rsf_clearance_2";
const string SECURITY_CLEARANCE_CHUBA = "bdg_content_rsf_clearance_3";
const string SECURITY_CLEARANCE_DUSK = "bdg_content_rsf_clearance_4";
// From Pooja
const string SECURITY_CLEARANCE_ECHO = "bdg_content_rsf_clearance_5";
const string SECURITY_CLEARANCE_FALCON = "bdg_content_rsf_clearance_6";
const string SECURITY_CLEARANCE_GORAX = "bdg_content_rsf_clearance_7";
const string REBEL_PATH_OBJVAR_NAME = "legacy.faction.rebelPath";
const string IMPERIAL_PATH_OBJVAR_NAME = "legacy.faction.imperialPath";
// Boolean function to determine if a player's profession
// is a crafting profession
boolean isCrafter (obj_id player)
{
string profession = getSkillTemplate (player);
int crafting = profession.indexOf ("trader");
if (crafting > -1)
{
return true;
}
return false;
}
// Boolean function to determine if a player's profession
// is an entertainer profession
boolean isEntertainer (obj_id player)
{
string profession = getSkillTemplate (player);
int entertaining = profession.indexOf ("entertainer");
if (entertaining > -1)
{
return true;
}
return false;
}
//There are seven levels of RSF Security Clearance that can be granted by multiple NPC's
//This function allows us to write any NPC to grant the next level of security clearance
//Without having to know what the last one held was.
void grantRsfSecurityClearance (obj_id player)
{
if (badge.hasBadge (player, SECURITY_CLEARANCE_GORAX))
{
return;
}
if (badge.hasBadge (player, SECURITY_CLEARANCE_FALCON))
{
badge.grantBadge (player, SECURITY_CLEARANCE_GORAX);
return;
}
if (badge.hasBadge (player, SECURITY_CLEARANCE_ECHO))
{
badge.grantBadge (player, SECURITY_CLEARANCE_FALCON);
return;
}
if (badge.hasBadge (player, SECURITY_CLEARANCE_DUSK))
{
badge.grantBadge (player, SECURITY_CLEARANCE_ECHO);
return;
}
if (badge.hasBadge (player, SECURITY_CLEARANCE_CHUBA))
{
badge.grantBadge (player, SECURITY_CLEARANCE_DUSK);
return;
}
if (badge.hasBadge (player, SECURITY_CLEARANCE_BINARY))
{
badge.grantBadge (player, SECURITY_CLEARANCE_CHUBA);
return;
}
if (badge.hasBadge (player, SECURITY_CLEARANCE_ASTRO))
{
badge.grantBadge (player, SECURITY_CLEARANCE_BINARY);
return;
}
badge.grantBadge (player, SECURITY_CLEARANCE_ASTRO);
return;
}
void grantAllRsfSecurityClearance (obj_id player)
{
if ( !badge.hasBadge (player, "bdg_content_rsf_clearance_1") )
{
badge.grantBadge (player, "bdg_content_rsf_clearance_1");
}
if ( !badge.hasBadge (player, "bdg_content_rsf_clearance_2") )
{
badge.grantBadge (player, "bdg_content_rsf_clearance_2");
}
if ( !badge.hasBadge (player, "bdg_content_rsf_clearance_3") )
{
badge.grantBadge (player, "bdg_content_rsf_clearance_3");
}
if ( !badge.hasBadge (player, "bdg_content_rsf_clearance_4") )
{
badge.grantBadge (player, "bdg_content_rsf_clearance_4");
}
if ( !badge.hasBadge (player, "bdg_content_rsf_clearance_5") )
{
badge.grantBadge (player, "bdg_content_rsf_clearance_5");
}
if ( !badge.hasBadge (player, "bdg_content_rsf_clearance_6") )
{
badge.grantBadge (player, "bdg_content_rsf_clearance_6");
}
if ( !badge.hasBadge (player, "bdg_content_rsf_clearance_7") )
{
badge.grantBadge (player, "bdg_content_rsf_clearance_7");
}
return;
}