who isn't sick of converting the freaking scripts? this negates the need

This commit is contained in:
DarthArgus
2015-11-24 09:27:45 -06:00
parent 2e64106bc8
commit bbee2d328c
11077 changed files with 2604347 additions and 3425075 deletions
@@ -0,0 +1,52 @@
package script.npc.converse;
import script.*;
import script.base_class.*;
import script.combat_engine.*;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
import script.base_script;
import script.library.ai_lib;
import script.library.hue;
import script.library.colors;
import script.library.chat;
public class philosopher extends script.base_script
{
public philosopher()
{
}
public static final String CONVO = "static_npc/philosopher";
public int OnAttach(obj_id self) throws InterruptedException
{
ai_lib.setDefaultCalmBehavior(self, ai_lib.BEHAVIOR_SENTINEL);
attachScript(self, "npc.converse.npc_converse_menu");
return SCRIPT_CONTINUE;
}
public int OnStartNpcConversation(obj_id self, obj_id speaker) throws InterruptedException
{
String lineToSay = "philosopher_1";
String datatable = "datatables/npc/convo/philosopher.iff";
if (ai_lib.isInCombat(self) || ai_lib.isInCombat(speaker) || hasScript(self, "themepark.poi.tatooine.city.npc_mission_convo") || hasScript(self, "themepark.poi.tatooine.city.npc_mission_01_friend_convo"))
{
return SCRIPT_OVERRIDE;
}
int numLines = dataTableGetNumRows(datatable);
if (numLines == 0)
{
numLines = rand(1, 5);
lineToSay = "philosopher_" + numLines;
}
else
{
int total = numLines - 1;
int pickLine = rand(0, total);
lineToSay = dataTableGetString(datatable, pickLine, "philosopher_lines");
}
string_id message = new string_id(CONVO, lineToSay);
chat.chat(self, speaker, message);
return SCRIPT_CONTINUE;
}
}