Files
dsrc/sku.0/sys.server/compiled/game/script/conversation/bestine_rumor12.java
T
2018-06-07 00:32:29 +01:00

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_rumor12 extends script.base_script
{
public bestine_rumor12()
{
}
public static String c_stringFile = "conversation/bestine_rumor12";
public boolean bestine_rumor12_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException
{
return true;
}
public boolean bestine_rumor12_condition_nonoffice(obj_id player, obj_id npc) throws InterruptedException
{
return hasObjVar(npc, "bestine.electionEnded");
}
public void bestine_rumor12_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_rumor12");
}
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_rumor12");
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_rumor12_condition_nonoffice(player, self))
{
string_id message = new string_id(c_stringFile, "s_9a4ad400");
chat.chat(self, message);
return SCRIPT_CONTINUE;
}
if (bestine_rumor12_condition_nonoffice(player, self))
{
string_id message = new string_id(c_stringFile, "s_5028a3e0");
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_rumor12"))
{
return SCRIPT_CONTINUE;
}
int branchId = getIntObjVar(player, "conversation.bestine_rumor12.branchId");
chat.chat(self, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
removeObjVar(player, "conversation.bestine_rumor12.branchId");
return SCRIPT_CONTINUE;
}
}