mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-13 22:01:04 -04:00
85 lines
3.2 KiB
Java
Executable File
85 lines
3.2 KiB
Java
Executable File
package script.conversation;
|
|
|
|
import script.library.ai_lib;
|
|
import script.library.chat;
|
|
import script.*;
|
|
|
|
public class bestine_rumor01 extends script.base_script
|
|
{
|
|
public bestine_rumor01()
|
|
{
|
|
}
|
|
public static String c_stringFile = "conversation/bestine_rumor01";
|
|
public boolean bestine_rumor01_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return true;
|
|
}
|
|
public boolean bestine_rumor01_condition_nonoffice(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return hasObjVar(npc, "bestine.electionEnded");
|
|
}
|
|
public void bestine_rumor01_action__defaultAction(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
}
|
|
public int OnInitialize(obj_id self) throws InterruptedException
|
|
{
|
|
if ((!isMob(self)) || (isPlayer(self)))
|
|
{
|
|
detachScript(self, "npc.conversation.bestine_rumor01");
|
|
}
|
|
setCondition(self, CONDITION_CONVERSABLE);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public int OnAttach(obj_id self) throws InterruptedException
|
|
{
|
|
setCondition(self, CONDITION_CONVERSABLE);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException
|
|
{
|
|
int menu = menuInfo.addRootMenu(menu_info_types.CONVERSE_START, null);
|
|
menu_info_data menuInfoData = menuInfo.getMenuItemById(menu);
|
|
menuInfoData.setServerNotify(false);
|
|
setCondition(self, CONDITION_CONVERSABLE);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException
|
|
{
|
|
clearCondition(self, CONDITION_CONVERSABLE);
|
|
detachScript(self, "npc.conversation.bestine_rumor01");
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException
|
|
{
|
|
if (ai_lib.isInCombat(self) || ai_lib.isInCombat(player))
|
|
{
|
|
return SCRIPT_OVERRIDE;
|
|
}
|
|
if (!bestine_rumor01_condition_nonoffice(player, self))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_a886b683");
|
|
chat.chat(self, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (bestine_rumor01_condition_nonoffice(player, self))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_b1225bbd");
|
|
chat.chat(self, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
chat.chat(self, "Error: All conditions for OnStartNpcConversation were false.");
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException
|
|
{
|
|
if (!conversationId.equals("bestine_rumor01"))
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
int branchId = getIntObjVar(player, "conversation.bestine_rumor01.branchId");
|
|
chat.chat(self, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
|
|
removeObjVar(player, "conversation.bestine_rumor01.branchId");
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|