mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-08-03 03:15:55 -04:00
194 lines
6.3 KiB
Plaintext
194 lines
6.3 KiB
Plaintext
include library.create;
|
|
include library.utils;
|
|
include java.util.StringTokenizer;
|
|
|
|
//include ai.ai_combat;
|
|
//include library.ai_lib;
|
|
|
|
//trandoshan
|
|
const string[] VICTIM1 = {"ep3_npc_wookiee_battleleader", "ep3_npc_wookiee_commando", "ep3_npc_wookiee_forest_stalker", "ep3_npc_wookiee_freedom_fighters"};
|
|
const string[] AGGRESSOR1 = {"ep3_slaver_blackscale_assault", "ep3_slaver_blackscale_guard", "ep3_slaver_blackscale_trooper"};
|
|
|
|
//kkorrwrot
|
|
const string[] VICTIM2 = {"ep3_hracca_kkorrwrot", "ep3_hracca_kkorrwrot"};
|
|
const string[] AGGRESSOR2 = {"stormtrooper", "stormtrooper"};
|
|
|
|
//katarn
|
|
const string[] VICTIM3 = {"ep3_rryatt_katarn", "ep3_rryatt_katarn"};
|
|
const string[] AGGRESSOR3 = {"stormtrooper", "stormtrooper"};
|
|
|
|
//mouf
|
|
const string[] VICTIM4 = {"ep3_etyyy_mouf", "ep3_etyyy_mouf"};
|
|
const string[] AGGRESSOR4 = {"stormtrooper", "stormtrooper"};
|
|
|
|
//walluga
|
|
const string[] VICTIM5 = {"ep3_etyyy_walluga", "ep3_etyyy_walluga"};
|
|
const string[] AGGRESSOR5 = {"stormtrooper", "stormtrooper"};
|
|
|
|
//uller
|
|
const string[] VICTIM6 = {"ep3_kachirho_uller", "ep3_kachirho_uller"};
|
|
const string[] AGGRESSOR6 = {"stormtrooper", "stormtrooper"};
|
|
|
|
//webweaver
|
|
const string[] VICTIM7 = {"ep3_etyyy_webweaver", "ep3_etyyy_webweaver"};
|
|
const string[] AGGRESSOR7 = {"stormtrooper", "stormtrooper"};
|
|
|
|
//urnsoris
|
|
const string[] VICTIM8 = {"ep3_urnsoris_worker", "ep3_urnsoris_worker"};
|
|
const string[] AGGRESSOR8 = {"stormtrooper", "stormtrooper"};
|
|
|
|
//minstyngar
|
|
const string[] VICTIM9 = {"ep3_rryatt_minstyngar_breeder", "ep3_rryatt_minstyngar_breeder"};
|
|
const string[] AGGRESSOR9 = {"stormtrooper", "stormtrooper"};
|
|
|
|
//random monster
|
|
const string[] VICTIM10 = {"ep3_hracca_kkorrwrot", "ep3_rryatt_katarn", "ep3_etyyy_mouf", "ep3_etyyy_walluga", "ep3_kachirho_uller",
|
|
"ep3_kachirho_uller", "ep3_etyyy_webweaver", "ep3_urnsoris_worker", "ep3_rryatt_minstyngar_breeder"};
|
|
const string[] AGGRESSOR10 = {"stormtrooper", "stormtrooper"};
|
|
|
|
trigger OnHearSpeech(obj_id objSpeaker, string strText)
|
|
{
|
|
|
|
if(objSpeaker!=self)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
if(!isGod(self))
|
|
{
|
|
sendSystemMessage(self, "You need to activate God Mode to start battles.", null);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
if(toLower(strText).startsWith("battle"))
|
|
{
|
|
StringTokenizer st = new StringTokenizer(strText);
|
|
|
|
if(st.countTokens() == 2)
|
|
{
|
|
if(utils.hasScriptVar(self, "ep3demoSanityChecker") )
|
|
{
|
|
sendSystemMessage(self, "You just started a battle. If you really want to start another wait a couple seconds and try again.", null);
|
|
}
|
|
|
|
string command = st.nextToken();
|
|
string battleIndexStr = st.nextToken();
|
|
int battleIndex = utils.stringToInt(battleIndexStr);
|
|
|
|
if(battleIndex < 1 || battleIndex > 10)
|
|
{
|
|
sendSystemMessage(self, "Battle index out of range. Valid ranges are between 1 and 2.", null);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
startBattle(self, battleIndex);
|
|
utils.setScriptVar(self, "ep3demoSanityChecker", 1);
|
|
messageTo(self, "allowMoreBattles", null, 10, false);
|
|
sendSystemMessage(self, "Battle commencing. Say stop battle at this location to end the battle.", null);
|
|
}
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
messageHandler allowMoreBattles()
|
|
{
|
|
utils.removeScriptVar(self, "ep3demoSanityChecker");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
void startBattle(obj_id self, int battleIndex)
|
|
{
|
|
float timeStamp = getGameTime();
|
|
// string aggressor = AGGRESSOR[battleIndex];
|
|
// string victim = VICTIM[battleIndex];
|
|
location here = getLocation(self);
|
|
|
|
obj_id battleSpawner = create.object("object/tangible/poi/base/poi_base.iff", here);
|
|
|
|
if(battleIndex == 1)
|
|
{
|
|
setObjVar(battleSpawner, "ep3demo.aggressorTemplate", AGGRESSOR1);
|
|
setObjVar(battleSpawner, "ep3demo.victimTemplate", VICTIM1);
|
|
setObjVar(battleSpawner, "ep3demo.aggressorNumber", 4);
|
|
setObjVar(battleSpawner, "ep3demo.victimNumber", 4);
|
|
}
|
|
|
|
if(battleIndex == 2)
|
|
{
|
|
setObjVar(battleSpawner, "ep3demo.aggressorTemplate", AGGRESSOR2);
|
|
setObjVar(battleSpawner, "ep3demo.victimTemplate", VICTIM2);
|
|
setObjVar(battleSpawner, "ep3demo.aggressorNumber", 4);
|
|
setObjVar(battleSpawner, "ep3demo.victimNumber", 1);
|
|
}
|
|
|
|
if(battleIndex == 3)
|
|
{
|
|
setObjVar(battleSpawner, "ep3demo.aggressorTemplate", AGGRESSOR3);
|
|
setObjVar(battleSpawner, "ep3demo.victimTemplate", VICTIM3);
|
|
setObjVar(battleSpawner, "ep3demo.aggressorNumber", 4);
|
|
setObjVar(battleSpawner, "ep3demo.victimNumber", 1);
|
|
}
|
|
|
|
if(battleIndex == 4)
|
|
{
|
|
setObjVar(battleSpawner, "ep3demo.aggressorTemplate", AGGRESSOR4);
|
|
setObjVar(battleSpawner, "ep3demo.victimTemplate", VICTIM4);
|
|
setObjVar(battleSpawner, "ep3demo.aggressorNumber", 4);
|
|
setObjVar(battleSpawner, "ep3demo.victimNumber", 1);
|
|
}
|
|
|
|
if(battleIndex == 5)
|
|
{
|
|
setObjVar(battleSpawner, "ep3demo.aggressorTemplate", AGGRESSOR5);
|
|
setObjVar(battleSpawner, "ep3demo.victimTemplate", VICTIM5);
|
|
setObjVar(battleSpawner, "ep3demo.aggressorNumber", 4);
|
|
setObjVar(battleSpawner, "ep3demo.victimNumber", 1);
|
|
}
|
|
|
|
if(battleIndex == 6)
|
|
{
|
|
setObjVar(battleSpawner, "ep3demo.aggressorTemplate", AGGRESSOR6);
|
|
setObjVar(battleSpawner, "ep3demo.victimTemplate", VICTIM6);
|
|
setObjVar(battleSpawner, "ep3demo.aggressorNumber", 4);
|
|
setObjVar(battleSpawner, "ep3demo.victimNumber", 1);
|
|
}
|
|
|
|
if(battleIndex == 7)
|
|
{
|
|
setObjVar(battleSpawner, "ep3demo.aggressorTemplate", AGGRESSOR7);
|
|
setObjVar(battleSpawner, "ep3demo.victimTemplate", VICTIM7);
|
|
setObjVar(battleSpawner, "ep3demo.aggressorNumber", 4);
|
|
setObjVar(battleSpawner, "ep3demo.victimNumber", 1);
|
|
}
|
|
|
|
if(battleIndex == 8)
|
|
{
|
|
setObjVar(battleSpawner, "ep3demo.aggressorTemplate", AGGRESSOR8);
|
|
setObjVar(battleSpawner, "ep3demo.victimTemplate", VICTIM8);
|
|
setObjVar(battleSpawner, "ep3demo.aggressorNumber", 4);
|
|
setObjVar(battleSpawner, "ep3demo.victimNumber", 1);
|
|
}
|
|
|
|
if(battleIndex == 9)
|
|
{
|
|
setObjVar(battleSpawner, "ep3demo.aggressorTemplate", AGGRESSOR9);
|
|
setObjVar(battleSpawner, "ep3demo.victimTemplate", VICTIM9);
|
|
setObjVar(battleSpawner, "ep3demo.aggressorNumber", 4);
|
|
setObjVar(battleSpawner, "ep3demo.victimNumber", 1);
|
|
}
|
|
|
|
if(battleIndex == 10)
|
|
{
|
|
setObjVar(battleSpawner, "ep3demo.aggressorTemplate", AGGRESSOR10);
|
|
setObjVar(battleSpawner, "ep3demo.victimTemplate", VICTIM10);
|
|
setObjVar(battleSpawner, "ep3demo.aggressorNumber", 4);
|
|
setObjVar(battleSpawner, "ep3demo.victimNumber", 1);
|
|
}
|
|
|
|
setObjVar(battleSpawner, "ep3demo.timeStamp", timeStamp);
|
|
attachScript(battleSpawner, "event.ep3demo.battle_spawner");
|
|
|
|
return;
|
|
} |