Debian Codegraph @

dat/missions/empire/longdistanceshipping/emp_longdistancecargo2.lua

raw
1 --[[
2 <?xml version='1.0' encoding='utf8'?>
3 <mission name="Dvaered Long Distance Recruitment">
4 <flags>
5 <unique />
6 </flags>
7 <avail>
8 <priority>4</priority>
9 <cond>faction.playerStanding("Empire") &gt;= 0</cond>
10 <chance>75</chance>
11 <done>Soromid Long Distance Recruitment</done>
12 <location>Bar</location>
13 <faction>Empire</faction>
14 </avail>
15 <notes>
16 <campaign>Long Distance Shipping</campaign>
17 </notes>
18 </mission>
19 --]]
20 --[[
21
22 Second diplomatic mission to Dvaered space that opens up the Empire long-distance cargo missions.
23
24 Author: micahmumper
25
26 ]]--
27
28 require "numstring.lua"
29 require "jumpdist.lua"
30 require "missions/empire/common.lua"
31
32 bar_desc = _("Lieutenant Czesc from the Empire Armada Shipping Division is sitting at the bar.")
33 misn_title = _("Dvaered Long Distance Recruitment")
34 misn_desc = _("Deliver a shipping diplomat for the Empire to Praxis in the Ogat system")
35 title = {}
36 title[1] = _("Spaceport Bar")
37 title[2] = _("Dvaered Long Distance Recruitment")
38 title[3] = _("Mission Accomplished")
39 text = {}
40 text[1] = _([[Lieutenant Czesc waves you over when he notices you enter the bar. "I knew we would run into each other soon enough. Great job delivering that bureaucrat. We should be up and running in Soromid space in no time!" He presses a button on his wrist computer. "We're hoping to expand to Dvaered territory next. Can I count on your help?"]])
41 text[2] = _([["Great!" says Lieutenant Czesc. "I'll send a message to the bureaucrat to meet you at the hanger. The Dvaered are, of course, allies of the Empire. Still, they offend easily, so try not to talk too much. Your mission is to drop the bureaucrat off on Praxis in the Ogat system. He will take it from there and report back to me when the shipping contract has been confirmed. Afterwards, keep an eye out for me in Empire space and we can continue the operation."]])
42 text[3] = _([[You drop the bureaucrat off on Praxis, and he hands you a credit chip. You remember Lieutenant Czesc told you to look for him on Empire controlled planets after you finish.]])
43
44 log_text = _([[You delivered a shipping bureaucrat to Praxis for the Empire. Lieutenant Czesc told you to look for him on Empire controlled planets after you finish.]])
45
46
47 function create ()
48 -- Note: this mission does not make any system claims.
49
50 -- Get the planet and system at which we currently are.
51 startworld, startworld_sys = planet.cur()
52
53 -- Set our target system and planet.
54 targetworld_sys = system.get("Ogat")
55 targetworld = planet.get("Praxis")
56
57
58 misn.setNPC( _("Lieutenant"), "empire/unique/czesc" )
59 misn.setDesc( bar_desc )
60 end
61
62
63 function accept ()
64 -- Set marker to a system, visible in any mission computer and the onboard computer.
65 misn.markerAdd( targetworld_sys, "low")
66 ---Intro Text
67 if not tk.yesno( title[1], text[1] ) then
68 misn.finish()
69 end
70 -- Flavour text and mini-briefing
71 tk.msg( title[2], text[2] )
72 ---Accept the mission
73 misn.accept()
74
75 -- Description is visible in OSD and the onboard computer, it shouldn't be too long either.
76 reward = 500000 -- 500K
77 misn.setTitle(misn_title)
78 misn.setReward(creditstring(reward))
79 misn.setDesc( string.format( misn_desc, targetworld:name(), targetworld_sys:name() ) )
80 misn.osdCreate(title[2], {misn_desc})
81 -- Set up the goal
82 hook.land("land")
83 person = misn.cargoAdd( "Person" , 0 )
84 end
85
86
87 function land()
88
89 if planet.cur() == targetworld then
90 misn.cargoRm( person )
91 player.pay( reward )
92 -- More flavour text
93 tk.msg( title[3], text[3] )
94 faction.modPlayerSingle( "Empire",3 )
95 emp_addShippingLog( log_text )
96 misn.finish(true)
97 end
98 end
99
100 function abort()
101 misn.finish(false)
102 end