From 9fa8061135aa8e2c350689ece87e63636b751480 Mon Sep 17 00:00:00 2001 From: unimatrixgit <95320811+unimatrixgit@users.noreply.github.com> Date: Sat, 28 Nov 2026 08:03:30 +0100 Subject: [PATCH] Run starter kit collection and repair from chat --- .../main/java/com/dunerealms/gui/QuestMenus.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/DuneRealmsGUI/src/main/java/com/dunerealms/gui/QuestMenus.java b/DuneRealmsGUI/src/main/java/com/dunerealms/gui/QuestMenus.java index 6585e4d4..e30b3185 100644 --- a/DuneRealmsGUI/src/main/java/com/dunerealms/gui/QuestMenus.java +++ b/DuneRealmsGUI/src/main/java/com/dunerealms/gui/QuestMenus.java @@ -42,9 +42,10 @@ final class QuestMenus implements Listener { if(args.length==0){open(player);return;} String verb=args[0].toLowerCase(Locale.ROOT); boolean list=verb.equals("list"); + boolean starterAction=Set.of("obtain","parts","repair").contains(verb); boolean roleStep=Set.of("dossier","cargo","partner").contains(verb); boolean nativeStep=roleStep||Set.of("research","meat","supply","refine").contains(verb); - if((roleStep?args.length<3||args.length>5:args.length!=(list?2:3))||!nativeStep&&!Set.of("list","show","start","claim","briefing").contains(verb)|| + if((roleStep?args.length<3||args.length>5:args.length!=(list?2:3))||!nativeStep&&!starterAction&&!Set.of("list","show","start","claim","briefing").contains(verb)|| !Set.of("personal","pol").contains(args[1].toLowerCase(Locale.ROOT))){ player.sendMessage("Use /missions list or /missions . POL steps: /missions pol ."); return; @@ -60,6 +61,13 @@ final class QuestMenus implements Listener { if(!id.equalsIgnoreCase(args[2]))continue; if(website(row)){website(player);return;} String state=text(row,"state",""); + if(starterAction){ + String expected=verb.equals("obtain")?"S1-H-01":"S1-H-02"; + if(kind.equals("personal")&&id.equals(expected)&&(yes(row,"canStart")||Set.of("active","completed","claimed").contains(state))){ + starter(player,kind,text(row,"branch",""),0,row,verb,false); + }else player.sendMessage("This starter-equipment action is unavailable for the current mission."); + return; + } if(roleStep){roleMissionCommand(player,kind,data,row,verb,Arrays.copyOfRange(args,3,args.length));return;} if(nativeStep){nativeMissionStep(player,kind,row,verb);return;} if(verb.equals("briefing")){ @@ -71,6 +79,8 @@ final class QuestMenus implements Listener { player.sendMessage(id+" · "+text(row,"title","Mission")+" · "+state); player.sendMessage(text(row,"objective","Complete the verified objective.")); player.sendMessage("Progress: "+text(row,"progress","0")+" / "+text(row,"target","0")); + if(kind.equals("personal")&&id.equals("S1-H-01"))player.sendMessage("Starter kit: /missions obtain personal "+id); + if(kind.equals("personal")&&id.equals("S1-H-02"))player.sendMessage("Starter repair: /missions parts personal "+id+" or /missions repair personal "+id); if(state.equals("active")&&!yes(row,"canClaim")&&text(row,"metric","").equals("citizen-introduction")){ player.sendMessage(CITIZEN_BRIEFING); player.sendMessage("Record it with /missions briefing "+kind+" "+id+"."); @@ -364,7 +374,8 @@ final class QuestMenus implements Listener { private void cargoPartners(Player p,JsonObject data,PolQuestNpc.Role role,JsonObject row,int page){var cargo=row.getAsJsonObject("cargo");var screen=panel(p,"NPC turn-in · "+role.name());screen.description="";roleAvatar(screen,data,role);var candidates=cargo.has("candidates")?cargo.getAsJsonArray("candidates"):new JsonArray();int offset=page*30,slot=9;for(int i=offset;icargoPartner(p,role,row,"offer",id));}if(candidates.size()==0)put(screen,13,"No current eligible partners","A matching active mission and current affiliation are required.",Material.CLOCK,null);if(page>0)put(screen,45,"Previous","More eligible partners",Material.ARROW,()->cargoPartners(p,data,role,row,page-1));if(offset+30cargoPartners(p,data,role,row,page+1));put(screen,49,"Back","Selected mission",Material.ARROW,()->details(p,"pol",data,text(row,"branch",""),0,row));show(p,screen);} private void cargoPartner(Player p,PolQuestNpc.Role role,JsonObject row,String phase,String id){cargoPartner(p,role,row,phase,id,true);} private void cargoPartner(Player p,PolQuestNpc.Role role,JsonObject row,String phase,String id,boolean reopen){try{var input=new JsonObject();input.addProperty("action","cargo_partner");input.addProperty("kind","pol");input.addProperty("definitionId",text(row,"id",""));input.addProperty("requestId",UUID.randomUUID().toString());input.addProperty("confirmed",true);input.addProperty("npcRole",role.key());input.addProperty("npcUuid",bridge.questCharacterNpc(p,role.key()).toString());input.addProperty("phase",phase);input.addProperty(phase.equals("offer")?"partnerId":"pairId",id);request(p,input,result->{if(reopen)load(p,"pol",text(row,"branch",""),text(row,"id",""),0);else p.sendMessage("Cooperative assignment updated.");});}catch(Exception unavailable){p.sendMessage("Meet Edric with your current cooperative mission.");}} - private void starter(Player p,String kind,String branch,int page,JsonObject row,String operation){try{var input=new JsonObject();input.addProperty("action","prepare_starter");input.addProperty("kind","personal");input.addProperty("definitionId",text(row,"id",""));input.addProperty("operation",operation);input.addProperty("requestId",UUID.randomUUID().toString());input.addProperty("access","journal");input.addProperty("confirmed",true);request(p,input,permit->{try{bridge.starterKit(p,permit);load(p,kind,branch,text(row,"id",""),page);}catch(Exception failure){p.sendMessage(Component.text(failure.getMessage()==null?"Your equipment exchange remains available. Reopen the quest.":failure.getMessage(),NamedTextColor.RED));}});}catch(Exception failure){p.sendMessage(Component.text(failure.getMessage()==null?"Open /start in Survival or Adventure mode.":failure.getMessage(),NamedTextColor.RED));}} + private void starter(Player p,String kind,String branch,int page,JsonObject row,String operation){starter(p,kind,branch,page,row,operation,true);} + private void starter(Player p,String kind,String branch,int page,JsonObject row,String operation,boolean reopen){try{var input=new JsonObject();input.addProperty("action","prepare_starter");input.addProperty("kind","personal");input.addProperty("definitionId",text(row,"id",""));input.addProperty("operation",operation);input.addProperty("requestId",UUID.randomUUID().toString());input.addProperty("access","journal");input.addProperty("confirmed",true);request(p,input,permit->{try{bridge.starterKit(p,permit);if(reopen)load(p,kind,branch,text(row,"id",""),page);else p.sendMessage("Starter equipment action submitted. Check /missions show personal "+text(row,"id","")+" for progress.");}catch(Exception failure){p.sendMessage(Component.text(failure.getMessage()==null?"Your equipment exchange remains available. Reopen the quest.":failure.getMessage(),NamedTextColor.RED));}});}catch(Exception failure){p.sendMessage(Component.text(failure.getMessage()==null?"Open /start in Survival or Adventure mode.":failure.getMessage(),NamedTextColor.RED));}} private static final String CITIZEN_BRIEFING="Your House determines normal travel authority.\nGuild travel uses boarding windows and your central bank.\nClan and company actions follow current deeds.\nBlue missions require ingame actions or item turn-ins.\nWebsite missions use your linked website account.\nRead your Mentat Report for current news and duties."; private void recordCitizenBriefing(Player player){ try{