mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-08-01 01:15:59 -04:00
262 lines
8.1 KiB
Plaintext
262 lines
8.1 KiB
Plaintext
/**
|
|
* Copyright (c)2000-2002 Sony Online Entertainment Inc.
|
|
* All Rights Reserved
|
|
*
|
|
* Title: regions.scriptlib
|
|
* Description: Base library for spawn regions
|
|
* @author Anthony Castoro
|
|
* @version $Revision:$
|
|
*/
|
|
|
|
/***** INCLUDES ********************************************************/
|
|
include library.utils;
|
|
include library.sui;
|
|
include library.datatable;
|
|
include java.util.*;
|
|
|
|
/***** INHERITS ********************************************************/
|
|
|
|
/***** CONSTANTS *******************************************************/
|
|
//
|
|
// Region system version for spawning (see systems.spawning.spawn_regions.regions_"planet".script
|
|
// change these constants any time you change the spawn regions in the spawning scripts
|
|
|
|
|
|
/***** TRIGGERS *******************************************************/
|
|
//
|
|
|
|
|
|
// Handle the starting convo
|
|
|
|
/** @brief
|
|
|
|
@param skillName
|
|
|
|
@return
|
|
|
|
@author
|
|
*/
|
|
|
|
trigger OnAttach ()
|
|
{
|
|
|
|
debugSpeakMsg(self, "Skill Test Script Attached");
|
|
|
|
//report current remaining skill points
|
|
//int intSkillPoints = getRemainingSkillPoints(self);
|
|
//int intTotalSkillPoints = getTotalSkillPoints(self);
|
|
//debugSpeakMsg(self, "I have " + intSkillPoints + " remaining, out of a possible " + intTotalSkillPoints +".");
|
|
|
|
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
/** @brief Retreive the number of levels that are required before this skill may be
|
|
granted to a creature.
|
|
|
|
@param skillName The name of the skill to query for the aprrentice levels prerequisite.
|
|
|
|
@return An int describing the number of levels apprentices must acquire before this
|
|
skill is granted to a creature.
|
|
|
|
@author Justin Randall <[email protected]>
|
|
*/
|
|
|
|
trigger OnSpeaking (string text)
|
|
{
|
|
|
|
/*
|
|
if( text == "reportskillpoints" )
|
|
{
|
|
int intSkillPoints;
|
|
intSkillPoints = getRemainingSkillPoints(self);
|
|
debugSpeakMsg(self, "I have " + intSkillPoints + " remaining...");
|
|
return SCRIPT_OVERRIDE; //don't speak the command outloud
|
|
}
|
|
*/
|
|
|
|
if( text == "reportskills" )
|
|
{
|
|
string[] skillnames = getAllSkills(self);
|
|
reportSkillNames(self, skillnames);
|
|
}
|
|
|
|
if( text == "testall")
|
|
{
|
|
|
|
debugServerConsoleMsg(self, "testing getExperiencePoints");
|
|
int intXpOfType = getExperiencePoints(self, "rifle");
|
|
|
|
debugServerConsoleMsg(self, "getSkillCommandsProvided");
|
|
string[] stringCommandsProvided = getSkillCommandsProvided("basic_ranged_weapons");
|
|
|
|
//debugServerConsoleMsg(self, "getSkillFactionStandingModifiers");
|
|
//dictionary dictFactionStandingMods = getSkillFactionStandingModifiers("basic_ranged_weapons");
|
|
|
|
debugServerConsoleMsg(self, "getSkillListingForPlayer");
|
|
string[] stringSkillListing = getSkillListingForPlayer(self);
|
|
|
|
//debugServerConsoleMsg(self, "getSkillPrerequisiteApprenticeLevels");
|
|
//int intPrereqApprenticeLevels = getSkillPrerequisiteApprenticeLevels("basic_ranged_weapons");
|
|
|
|
//debugServerConsoleMsg(self, "getSkillPrerequisiteApprentices");
|
|
//int intSkillPrerequisiteApprentices = getSkillPrerequisiteApprentices("basic_ranged_weapons");
|
|
|
|
debugServerConsoleMsg(self, "getSkillPrerequisiteExperience");
|
|
dictionary dictSkillPrerequisiteXp = getSkillPrerequisiteExperience("basic_ranged_weapons");
|
|
|
|
//debugServerConsoleMsg(self, "getSkillPrerequisiteFactionStanding");
|
|
//dictionary dictSkillPrerequisiteFactionStanding = getSkillPrerequisiteFactionStanding("basic_ranged_weapons");
|
|
|
|
//debugServerConsoleMsg(self, "getSkillPrerequisiteMissions");
|
|
//string[] stringPrerequisiteMissions = getSkillPrerequisiteMissions("basic_ranged_weapons");
|
|
|
|
debugServerConsoleMsg(self, "getSkillPrerequisiteSkills");
|
|
string[] stringSkillPrerequisiteSkills = getSkillPrerequisiteSkills("basic_ranged_weapons");
|
|
|
|
debugServerConsoleMsg(self, "etSkillPrerequisiteSpecies");
|
|
dictionary dictSkillPrerequisiteSpecies = getSkillPrerequisiteSpecies("basic_ranged_weapons");
|
|
|
|
//debugServerConsoleMsg(self, "getSkillPrerequisiteStatistics");
|
|
//dictionary dictSkillPrerequisiteStats = getSkillPrerequisiteStatistics("basic_ranged_weapons");
|
|
|
|
debugServerConsoleMsg(self, "getSkillProfession");
|
|
string stringProfession = getSkillProfession("basic_ranged_weapons");
|
|
|
|
//debugServerConsoleMsg(self, "getSkillDescription");
|
|
//string stringSkillDescript = getSkillDescription("basic_ranged_weapons");
|
|
|
|
//debugServerConsoleMsg(self, "getSkillPointCost");
|
|
//int intSkillPointCost = getSkillPointCost("basic_ranged_weapons");
|
|
|
|
debugServerConsoleMsg(self, "getSkillStatisticModifiers");
|
|
dictionary dictSkillStatMod = getSkillStatisticModifiers("basic_ranged_weapons");
|
|
|
|
debugServerConsoleMsg(self, "getSkillTitleGranted");
|
|
string stringSkillTitle = getSkillTitleGranted("basic_ranged_weapons");
|
|
|
|
debugServerConsoleMsg(self, "grantCommand");
|
|
boolean boolCommandGranted = grantCommand(self, "diveshot");
|
|
|
|
debugServerConsoleMsg(self, "grantExperiencePoints");
|
|
int intXpGranted = grantExperiencePoints(self, "rifle", 10);
|
|
|
|
debugServerConsoleMsg(self, "grantSkill");
|
|
boolean boolSkillGranted = grantSkill(self, "basic_ranged_weapons");
|
|
|
|
debugServerConsoleMsg(self, "hasCommand");
|
|
boolean boolHasCommand = hasCommand(self, "diveshot");
|
|
|
|
debugServerConsoleMsg(self, "hasSkill");
|
|
boolean boolHasSkill = hasSkill(self, "basic_ranged_weapons");
|
|
|
|
debugServerConsoleMsg(self, "revokeCommand");
|
|
revokeCommand(self, "diveshot");
|
|
|
|
debugServerConsoleMsg(self, "revokeSkill");
|
|
revokeSkill(self, "basic_ranged_weapons");
|
|
|
|
//debugServerConsoleMsg(self, "skillHasCommand");
|
|
//boolean boolSkillHasCommand = skillHasCommand("basic_ranged_weapons", "diveshot");
|
|
|
|
//debugServerConsoleMsg(self, "getRemainingSkillPoints");
|
|
//int intSkillPointsRemaining = getRemainingSkillPoints(self);
|
|
|
|
//int intSkillStatMod = getSkillStatMod(self, String statModName);
|
|
|
|
//debugServerConsoleMsg(self, "getSpentSkillPoints");
|
|
//int intSpentSkillPoints = getSpentSkillPoints(self);
|
|
|
|
//debugServerConsoleMsg(self, "getTotalSkillPoints");
|
|
//int intTotalSkillPoints = getTotalSkillPoints(self);
|
|
|
|
return SCRIPT_OVERRIDE;
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
trigger OnStartNpcConversation ( obj_id speaker )
|
|
{
|
|
string_id greeting = new string_id ("bar_e3_convo", "bar_1"); // I hope you haven't come looking for work..
|
|
string_id response[] = new string_id [2];
|
|
response[0] = new string_id ("bar_e3_convo", "bar_2"); // Why not?
|
|
response[1] = new string_id ("bar_e3_convo", "bar_3"); // Where is everyone?
|
|
npcStartConversation (speaker, self, "bar_e3_convo", greeting, response);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
|
|
trigger OnNpcConversationResponse (string convo, self, string_id response)
|
|
{
|
|
if ( response.getAsciiId().equals("bar_2")) // Why not?
|
|
{
|
|
string_id message = new string_id ("bar_e3_convo", "bar_4"); // The Imperials are setting up...
|
|
npcSpeak (player, message);
|
|
npcAddConversationResponse ( player, new string_id ("bar_e3_convo", "bar_6") );
|
|
npcRemoveConversationResponse (player, new string_id ("bar_e3_convo", "bar_2") );
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if ( response.getAsciiId().equals("bar_3")) // Where is Everyone?
|
|
{
|
|
string_id message = new string_id ("bar_e3_convo", "bar_5"); // They're getting ready...
|
|
npcSpeak (player, message);
|
|
npcAddConversationResponse ( player, new string_id ("bar_e3_convo", "bar_6") );
|
|
npcRemoveConversationResponse (player, new string_id ("bar_e3_convo", "bar_3") );
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if ( response.getAsciiId().equals("bar_6")) // Well, I guess I'll...
|
|
{
|
|
string_id message = new string_id ("bar_e3_convo", "bar_7"); // Don't hang around.
|
|
npcSpeak (player, message);
|
|
npcEndConversation (player);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
*/
|
|
|
|
/***** FUNCTIONS *******************************************************/
|
|
//
|
|
//
|
|
|
|
/** @brief Get all of the skills possessed by the player for processing.
|
|
|
|
@param self
|
|
|
|
@return a string array of skillanems
|
|
|
|
@author Anthony Castoro
|
|
*/
|
|
string[] getAllSkills(obj_id self)
|
|
{
|
|
string[] skillnames = getSkillListingForPlayer(self);
|
|
|
|
int counter = skillnames.length;
|
|
|
|
if( counter == 0 )
|
|
{
|
|
LOG("skills", "skills.script: getSkillListingForPlayer returned an empty array.");
|
|
}
|
|
|
|
return skillnames;
|
|
}
|
|
|
|
|
|
void reportSkillNames(obj_id self, string[] skillnames)
|
|
{
|
|
string skillname;
|
|
for(int i = 0;i <= skillnames.length; i++)
|
|
{
|
|
skillname = skillnames[i];
|
|
LOG("skills", "skill.skills: " + skillname);
|
|
}
|
|
return;
|
|
}
|
|
|