mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-28 22:15:54 -04:00
137 lines
3.2 KiB
Plaintext
137 lines
3.2 KiB
Plaintext
include ai.ai_combat;
|
|
include library.ai_lib;
|
|
include library.badge;
|
|
include library.buff;
|
|
include library.chat;
|
|
include library.corpse;
|
|
include library.create;
|
|
include library.factions;
|
|
include library.groundquests;
|
|
include library.holiday;
|
|
include library.hue;
|
|
include library.instance;
|
|
include library.pet_lib;
|
|
include library.pgc_quests;
|
|
include library.prose;
|
|
include library.skill_template;
|
|
include library.static_item;
|
|
include library.storyteller;
|
|
include library.sui;
|
|
include library.trial;
|
|
include library.township;
|
|
include library.utils;
|
|
include library.vehicle;
|
|
|
|
|
|
trigger OnAttach()
|
|
{
|
|
if ( hasObjVar(self, "idiot_testing") )
|
|
{
|
|
sendSystemMessage(self, "mfarone_test script attached.", "");
|
|
}
|
|
else
|
|
{
|
|
sendSystemMessage(self, "Attaching script failed.", "");
|
|
detachScript(self, "test.mfarone_test");
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
void areaDebugMessaging(obj_id self, string message)
|
|
{
|
|
obj_id[] players = getAllPlayers(getLocation(getTopMostContainer(self)), 35.0f);
|
|
if ( players != null && players.length > 0 )
|
|
{
|
|
for( int i=0; i<players.length; i++ )
|
|
sendSystemMessage(players[i], message, "");
|
|
}
|
|
}
|
|
|
|
trigger OnSpeaking(string text)
|
|
{
|
|
if ( !isGod(self) )
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
obj_id player = self;
|
|
location here = getLocation(player);
|
|
|
|
int stringCheck = -1;
|
|
|
|
obj_id target = getIntendedTarget(self);
|
|
if ( !isIdValid(target) )
|
|
{
|
|
target = getLookAtTarget(self);
|
|
}
|
|
|
|
string[] commands = { "idiot_pgc_grant_all_tasks",
|
|
"idiot_pgc_revoke_all_tasks"
|
|
};
|
|
|
|
java.util.StringTokenizer st = new java.util.StringTokenizer(text);
|
|
string command = st.nextToken();
|
|
|
|
stringCheck = text.indexOf("idiot_pgc_list");
|
|
if ( stringCheck > -1 )
|
|
{
|
|
for( int i = 0; i < commands.length; i++ )
|
|
{
|
|
sendSystemMessage(self, commands[i], "");
|
|
}
|
|
}
|
|
|
|
stringCheck = text.indexOf("idiot_pgc_grant_all_tasks");
|
|
if ( stringCheck > -1 )
|
|
{
|
|
for ( int i = 0; i < pgc_quests.ALL_PGC_COLLECTION_TASK_NAMES.length; i++ )
|
|
{
|
|
string collectionName = pgc_quests.ALL_PGC_COLLECTION_TASK_NAMES[i];
|
|
string[] collctionSlots = getAllCollectionSlotsInCollection(collectionName);
|
|
if ( collctionSlots != null && collctionSlots.length > 0 )
|
|
{
|
|
for ( int j = 0; j < collctionSlots.length; j++ )
|
|
{
|
|
string slotName = collctionSlots[j];
|
|
if ( slotName != null && slotName.length() > 0 )
|
|
{
|
|
if ( getCollectionSlotValue(self, slotName) <= 0 )
|
|
{
|
|
modifyCollectionSlotValue(self, slotName, 1);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return SCRIPT_OVERRIDE;
|
|
}
|
|
|
|
stringCheck = text.indexOf("idiot_pgc_revoke_all_tasks");
|
|
if ( stringCheck > -1 )
|
|
{
|
|
for ( int i = 0; i < pgc_quests.ALL_PGC_COLLECTION_TASK_NAMES.length; i++ )
|
|
{
|
|
string collectionName = pgc_quests.ALL_PGC_COLLECTION_TASK_NAMES[i];
|
|
string[] collctionSlots = getAllCollectionSlotsInCollection(collectionName);
|
|
if ( collctionSlots != null && collctionSlots.length > 0 )
|
|
{
|
|
for ( int j = 0; j < collctionSlots.length; j++ )
|
|
{
|
|
string slotName = collctionSlots[j];
|
|
if ( slotName != null && slotName.length() > 0 )
|
|
{
|
|
while ( getCollectionSlotValue(self, slotName) > 0 )
|
|
{
|
|
modifyCollectionSlotValue(self, slotName, -1);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return SCRIPT_OVERRIDE;
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|