ForgeryFreeportCitizenshipPapers.lua 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630
  1. --[[
  2. Script Name : ItemScripts/ForgeryFreeportCitizenshipPapers.lua
  3. Script Author : dorbin
  4. Script Date : 2024.01.09 04:01:41
  5. Script Purpose :
  6. :
  7. --]]
  8. local BB = 5860 --Welcome to Freeport (Big Bend )
  9. local BB_F = 5866 --Big Bend Citizenship Task
  10. local BC = 5861 --Beggar's Court
  11. local BC_F = 5867
  12. local LA = 5862 --Longshadow Alley
  13. local LA_F = 5868
  14. local SB = 5859 --Stonestair Byway
  15. local SB_F = 5870
  16. local SY = 5863 --Scale Yard
  17. local SY_F = 5869
  18. local TS = 5864 --Temple Street
  19. local TS_F = 5871
  20. function examined(Item, Player)
  21. local Race = GetRace(Player)
  22. conversation = CreateConversation()
  23. if not HasQuest(Player,BB)
  24. and not HasQuest(Player,BB_F)
  25. and not HasQuest(Player,BC)
  26. and not HasQuest(Player,BC_F)
  27. and not HasQuest(Player,SB)
  28. and not HasQuest(Player,SB_F)
  29. and not HasQuest(Player,LA)
  30. and not HasQuest(Player,LA_F)
  31. and not HasQuest(Player,SY)
  32. and not HasQuest(Player,SY_F)
  33. and not HasQuest(Player,TS)
  34. and not HasQuest(Player,TS_F) then
  35. if CanReceiveQuest(Player,BB) or
  36. CanReceiveQuest(Player,BC) or
  37. CanReceiveQuest(Player,SB) or
  38. CanReceiveQuest(Player,LA) or
  39. CanReceiveQuest(Player,SY) or
  40. CanReceiveQuest(Player,TS) then
  41. AddConversationOption(conversation, "[Glance over the forms]","Intro")
  42. end
  43. AddConversationOption(conversation, "[Put the papers away]","CloseItemConversation")
  44. StartDialogConversation(conversation, 2, Item, Player, "This stack of papers looks like Freeport Citzenship forms. They could be useful for someone looking to quickly become a citizen...")
  45. elseif
  46. GetQuestStep(Player,BB_F) <12 or
  47. GetQuestStep(Player,BC_F) <12 or
  48. GetQuestStep(Player,SB_F) <12 or
  49. GetQuestStep(Player,LA_F) <12 or
  50. GetQuestStep(Player,SY_F) <12 or
  51. GetQuestStep(Player,TS_F) <12 then
  52. Welcome2(Item,Player)
  53. elseif
  54. GetQuestStep(Player,BB_F) ==12 and CanReceiveQuest(Player,BB) or
  55. GetQuestStep(Player,BC_F) ==12 and CanReceiveQuest(Player,BC) or
  56. GetQuestStep(Player,SB_F) ==12 and CanReceiveQuest(Player,SB) or
  57. GetQuestStep(Player,LA_F) ==12 and CanReceiveQuest(Player,LA) or
  58. GetQuestStep(Player,SY_F) ==12 and CanReceiveQuest(Player,SY) or
  59. GetQuestStep(Player,TS_F) ==12 and CanReceiveQuest(Player,TS) then
  60. Task1(Item,Player)
  61. elseif
  62. GetQuestStep(Player,BB_F) ==12 and GetQuestStep(Player,BB)==1 or
  63. GetQuestStep(Player,BC_F) ==12 and GetQuestStep(Player,BC)==1 or
  64. GetQuestStep(Player,SB_F) ==12 and GetQuestStep(Player,SB)==1 or
  65. GetQuestStep(Player,LA_F) ==12 and GetQuestStep(Player,LA)==1 or
  66. GetQuestStep(Player,SY_F) ==12 and GetQuestStep(Player,SY)==1 or
  67. GetQuestStep(Player,TS_F) ==12 and GetQuestStep(Player,TS)==1 then
  68. Task1(Item,Player)
  69. else
  70. Intro(Item,Player)
  71. end
  72. end
  73. function Intro(Item,Player)
  74. local Race = GetRace(Player)
  75. conversation = CreateConversation()
  76. if Race == 11 then --Kerra
  77. if not HasQuest(Player,LA_F) and not HasCompletedQuest(Player,LA_F) then
  78. AddConversationOption(conversation, "[Make up a Overseer name]","Welcome1")
  79. OfferQuest(nil,Player,LA_F)
  80. end
  81. -- Erudite
  82. elseif Race == 3 or Race == 20 then
  83. if not HasQuest(Player,SY_F) and not HasCompletedQuest(Player,SY_F) then
  84. AddConversationOption(conversation, "[Make up a Overseer name]","Welcome1")
  85. OfferQuest(nil,Player,SY_F)
  86. end
  87. elseif Race == 9 then --Human
  88. local con = CreateConversation()
  89. if not HasQuest(Player,LA_F) and not HasCompletedQuest(Player,LA_F) then
  90. AddConversationOption(conversation, "[Make up a Overseer name]","Welcome1")
  91. OfferQuest(nil,Player,LA_F)
  92. end
  93. -- Barbarian / Dwarf
  94. elseif Race == 0 or Race == 2 then
  95. if not HasQuest(Player,SB_F) and not HasCompletedQuest(Player,SB_F) then
  96. AddConversationOption(conversation, "[Make up a Overseer name]","Welcome1")
  97. OfferQuest(nil,Player,SB_F)
  98. end
  99. -- Froglok / High Elf
  100. elseif Race == 4 or Race == 8 then
  101. if not HasQuest(Player,BC_F) and not HasCompletedQuest(Player,BC_F) then
  102. AddConversationOption(conversation, "[Make up a Overseer name]","Welcome1")
  103. OfferQuest(nil,Player,BC_F)
  104. end
  105. -- Half Elf / Wood Elf
  106. elseif Race == 6 or Race == 15 or Race == 16 then
  107. if not HasQuest(Player,TS_F) and not HasCompletedQuest(Player,TS_F) then
  108. AddConversationOption(conversation, "[Make up a Overseer name]","Welcome1")
  109. OfferQuest(nil,Player,TS_F)
  110. end
  111. -- Gnome / Halfling
  112. elseif Race == 5 or Race == 7 then
  113. if not HasQuest(Player,BB_F) and not HasCompletedQuest(Player,BB_F) then
  114. AddConversationOption(conversation, "[Make up a Overseer name]","Welcome1")
  115. OfferQuest(nil,Player,BB_F)
  116. end
  117. else
  118. if not HasQuest(Player,LA_F) and not HasCompletedQuest(Player,LA_F) then
  119. AddConversationOption(conversation, "[Make up a Overseer name]","Welcome1")
  120. OfferQuest(nil,Player,LA_F)
  121. end
  122. end
  123. AddConversationOption(conversation, "[Put the pages away]","CloseItemConversation")
  124. StartDialogConversation(conversation, 2, Item, Player, "It states a Overseer is suppose to sign the document...\n\n[ ACCEPT THE QUEST ]")
  125. end
  126. function Welcome1(Item,Player) --ALIGNMENT/FACTION CHANGE + CHECK FOR QUEST1
  127. local Race = GetRace(Player)
  128. if not HasQuest(Player,BB)
  129. and not HasQuest(Player,BB_F)
  130. and not HasQuest(Player,BC)
  131. and not HasQuest(Player,BC_F)
  132. and not HasQuest(Player,SB)
  133. and not HasQuest(Player,SB_F)
  134. and not HasQuest(Player,LA)
  135. and not HasQuest(Player,LA_F)
  136. and not HasQuest(Player,SY)
  137. and not HasQuest(Player,SY_F)
  138. and not HasQuest(Player,TS)
  139. and not HasQuest(Player,TS_F) then
  140. Intro(Item,Player)
  141. else
  142. conversation = CreateConversation()
  143. AddConversationOption(conversation, "[Forge an address and check the list]","Welcome2")
  144. AddConversationOption(conversation, "[Put the pages away]","CloseItemConversation")
  145. StartDialogConversation(conversation, 2, Item, Player, "The form states you need signitures from a landlord and to complete their checklist...")
  146. Faction(Item,Player)
  147. end
  148. end
  149. function Faction(Item,Player)
  150. Freeport = GetFactionAmount(Player, 11)
  151. Freeport_Add = (10000-Freeport)
  152. Freeport = GetFactionAmount(Player, 12)
  153. Freeport_Add = (-20000-Freeport)
  154. Neriak = GetFactionAmount(Player, 13)
  155. Kelethin = GetFactionAmount(Player, 14)
  156. Halas = GetFactionAmount(Player, 16)
  157. Gorowyn = GetFactionAmount(Player, 17)
  158. alignment = GetAlignment(Player)
  159. if Freeport <10000 and Freeport >=0 then ChangeFaction(Player, 11, Freeport_Add)
  160. elseif Freeport <0 then ChangeFaction(Player, 11, (Freeport*-1))
  161. Faction(Item,Player)
  162. end
  163. if Freeport <-20000 then ChangeFaction(Player, 12, Freeport_Add)
  164. elseif Freeport >-20000 then ChangeFaction(Player, 12, (Freeport*-1))
  165. end
  166. if Neriak >0 then ChangeFaction(Player, 13, -Neriak)
  167. elseif Neriak <0 then ChangeFaction(Player, 13, (Neriak*-1))
  168. end
  169. if Kelethin >0 then ChangeFaction(Player, 14, -Kelethin)
  170. elseif Kelethin <0 then ChangeFaction(Player, 14, (Kelethin*-1))
  171. end
  172. if Halas >0 then ChangeFaction(Player, 16, -Halas)
  173. elseif Halas <0 then ChangeFaction(Player, 16, (Halas*-1))
  174. end
  175. if Gorowyn >0 then ChangeFaction(Player, 17, -Gorowyn)
  176. elseif Gorowyn <0 then ChangeFaction(Player, 17, (Gorowyn*-1))
  177. end
  178. if GetRace(Player) == 0 or GetRace(Player) == 3 or GetRace(Player) == 5 or GetRace(Player) == 6 or GetRace(Player) == 9 or GetRace(Player) == 11 or GetRace(Player) == 20 then
  179. SetAlignment(Player, 2)
  180. end
  181. end
  182. function Welcome2(Item,Player)
  183. local Race = GetRace(Player)
  184. conversation = CreateConversation()
  185. AddConversationOption(conversation, "[Read the second form]","Task1")
  186. if Race == 11 then --Kerra
  187. if HasQuest(Player,LA_F) then
  188. SetStepComplete(Player,LA_F,1)
  189. SetStepComplete(Player,LA_F,2)
  190. SetStepComplete(Player,LA_F,3)
  191. SetStepComplete(Player,LA_F,4)
  192. SetStepComplete(Player,LA_F,5)
  193. SetStepComplete(Player,LA_F,6)
  194. SetStepComplete(Player,LA_F,7)
  195. SetStepComplete(Player,LA_F,8)
  196. SetStepComplete(Player,LA_F,9)
  197. SetStepComplete(Player,LA_F,10)
  198. SetStepComplete(Player,LA_F,11)
  199. SetStepComplete(Player,LA_F,12)
  200. end
  201. -- Erudite
  202. elseif Race == 3 or Race == 20 then
  203. if HasQuest(Player,SY_F) then
  204. SetStepComplete(Player,SY_F,1)
  205. SetStepComplete(Player,SY_F,2)
  206. SetStepComplete(Player,SY_F,3)
  207. SetStepComplete(Player,SY_F,4)
  208. SetStepComplete(Player,SY_F,5)
  209. SetStepComplete(Player,SY_F,6)
  210. SetStepComplete(Player,SY_F,7)
  211. SetStepComplete(Player,SY_F,8)
  212. SetStepComplete(Player,SY_F,9)
  213. SetStepComplete(Player,SY_F,10)
  214. SetStepComplete(Player,SY_F,11)
  215. SetStepComplete(Player,SY_F,12)
  216. end
  217. elseif Race == 9 then --Human
  218. local con = CreateConversation()
  219. if HasQuest(Player,LA_F) then
  220. SetStepComplete(Player,LA_F,1)
  221. SetStepComplete(Player,LA_F,2)
  222. SetStepComplete(Player,LA_F,3)
  223. SetStepComplete(Player,LA_F,4)
  224. SetStepComplete(Player,LA_F,5)
  225. SetStepComplete(Player,LA_F,6)
  226. SetStepComplete(Player,LA_F,7)
  227. SetStepComplete(Player,LA_F,8)
  228. SetStepComplete(Player,LA_F,9)
  229. SetStepComplete(Player,LA_F,10)
  230. SetStepComplete(Player,LA_F,11)
  231. SetStepComplete(Player,LA_F,12)
  232. elseif HasQuest(Player,SY_F) then
  233. SetStepComplete(Player,SY_F,1)
  234. SetStepComplete(Player,SY_F,2)
  235. SetStepComplete(Player,SY_F,3)
  236. SetStepComplete(Player,SY_F,4)
  237. SetStepComplete(Player,SY_F,5)
  238. SetStepComplete(Player,SY_F,6)
  239. SetStepComplete(Player,SY_F,7)
  240. SetStepComplete(Player,SY_F,8)
  241. SetStepComplete(Player,SY_F,9)
  242. SetStepComplete(Player,SY_F,10)
  243. SetStepComplete(Player,SY_F,11)
  244. SetStepComplete(Player,SY_F,12)
  245. end
  246. -- Barbarian / Dwarf
  247. elseif Race == 0 or Race == 2 then
  248. if HasQuest(Player,SB_F) then
  249. SetStepComplete(Player,SB_F,1)
  250. SetStepComplete(Player,SB_F,2)
  251. SetStepComplete(Player,SB_F,3)
  252. SetStepComplete(Player,SB_F,4)
  253. SetStepComplete(Player,SB_F,5)
  254. SetStepComplete(Player,SB_F,6)
  255. SetStepComplete(Player,SB_F,7)
  256. SetStepComplete(Player,SB_F,8)
  257. SetStepComplete(Player,SB_F,9)
  258. SetStepComplete(Player,SB_F,10)
  259. SetStepComplete(Player,SB_F,11)
  260. SetStepComplete(Player,SB_F,12)
  261. end
  262. -- Froglok / High Elf
  263. elseif Race == 4 or Race == 8 then
  264. if HasQuest(Player,BC_F) then
  265. SetStepComplete(Player,BC_F,1)
  266. SetStepComplete(Player,BC_F,2)
  267. SetStepComplete(Player,BC_F,3)
  268. SetStepComplete(Player,BC_F,4)
  269. SetStepComplete(Player,BC_F,5)
  270. SetStepComplete(Player,BC_F,6)
  271. SetStepComplete(Player,BC_F,7)
  272. SetStepComplete(Player,BC_F,8)
  273. SetStepComplete(Player,BC_F,9)
  274. SetStepComplete(Player,BC_F,10)
  275. SetStepComplete(Player,BC_F,11)
  276. SetStepComplete(Player,BC_F,12)
  277. end
  278. -- Half Elf / Wood Elf
  279. elseif Race == 6 or Race == 15 then
  280. if HasQuest(Player,TS_F) then
  281. SetStepComplete(Player,TS_F,1)
  282. SetStepComplete(Player,TS_F,2)
  283. SetStepComplete(Player,TS_F,3)
  284. SetStepComplete(Player,TS_F,4)
  285. SetStepComplete(Player,TS_F,5)
  286. SetStepComplete(Player,TS_F,6)
  287. SetStepComplete(Player,TS_F,7)
  288. SetStepComplete(Player,TS_F,8)
  289. SetStepComplete(Player,TS_F,9)
  290. SetStepComplete(Player,TS_F,10)
  291. SetStepComplete(Player,TS_F,11)
  292. SetStepComplete(Player,TS_F,12)
  293. end
  294. -- Gnome / Halfling
  295. elseif Race == 5 or Race == 7 then
  296. if HasQuest(Player,BB_F) then
  297. SetStepComplete(Player,BB_F,1)
  298. SetStepComplete(Player,BB_F,2)
  299. SetStepComplete(Player,BB_F,3)
  300. SetStepComplete(Player,BB_F,4)
  301. SetStepComplete(Player,BB_F,5)
  302. SetStepComplete(Player,BB_F,6)
  303. SetStepComplete(Player,BB_F,7)
  304. SetStepComplete(Player,BB_F,8)
  305. SetStepComplete(Player,BB_F,9)
  306. SetStepComplete(Player,BB_F,10)
  307. SetStepComplete(Player,BB_F,11)
  308. SetStepComplete(Player,BB_F,12)
  309. end
  310. else
  311. if HasQuest(Player,LA_F) then
  312. SetStepComplete(Player,LA_F,1)
  313. SetStepComplete(Player,LA_F,2)
  314. SetStepComplete(Player,LA_F,3)
  315. SetStepComplete(Player,LA_F,4)
  316. SetStepComplete(Player,LA_F,5)
  317. SetStepComplete(Player,LA_F,6)
  318. SetStepComplete(Player,LA_F,7)
  319. SetStepComplete(Player,LA_F,8)
  320. SetStepComplete(Player,LA_F,9)
  321. SetStepComplete(Player,LA_F,10)
  322. SetStepComplete(Player,LA_F,11)
  323. SetStepComplete(Player,LA_F,12)
  324. end
  325. end
  326. AddConversationOption(conversation, "[Put the pages away]","CloseItemConversation")
  327. StartDialogConversation(conversation, 2, Item, Player, "There is another form meant to accompany the first. This second mentions a citizenship task. It states something about tokens and needing to prove yourself....\n\nWho has time for that?")
  328. end
  329. function Task1(Item,Player)
  330. local Race = GetRace(Player)
  331. conversation = CreateConversation()
  332. AddConversationOption(conversation, "[Check all the boxes and sign]","Task2")
  333. if Race == 1 or Race == 19 or Race == 17 then
  334. if CanReceiveQuest(Player,LA) then
  335. OfferQuest(nil,Player,LA)
  336. end
  337. -- Barbarian / Iksar / Sarnak
  338. elseif Race == 0 or Race == 10 or Race == 18 then
  339. if CanReceiveQuest(Player,SY) then
  340. OfferQuest(nil,Player,SY)
  341. end
  342. -- Erudite / Kerra
  343. elseif Race == 3 or Race == 11 then
  344. if CanReceiveQuest(Player,SB) then
  345. OfferQuest(nil,Player,SB)
  346. end
  347. -- Human / Half Elf
  348. elseif Race == 9 or Race == 6 then
  349. if CanReceiveQuest(Player,BC) then
  350. OfferQuest(nil,Player,BC)
  351. end
  352. -- Ratonga / Gnome
  353. elseif Race == 5 or Race == 13 then
  354. if CanReceiveQuest(Player,TS) then
  355. OfferQuest(nil,Player,TS)
  356. end
  357. -- Orge / Troll
  358. elseif Race == 12 or Race == 14 then
  359. if CanReceiveQuest(Player,BB) then
  360. OfferQuest(nil,Player,BB)
  361. end
  362. else
  363. if CanReceiveQuest(Player,BC) then
  364. OfferQuest(nil,Player,BC)
  365. end
  366. end
  367. AddConversationOption(conversation, "[Put the pages away]","CloseItemConversation")
  368. StartDialogConversation(conversation, 2, Item, Player, "The second form lists...yadda yadda yadda.\n\nA few marks here and there should finish up everything.\n\n[ ACCEPT THE QUEST ]")
  369. end
  370. function Task2(Item,Player)
  371. local Race = GetRace(Player)
  372. if Race == 11 then --Kerra
  373. if HasQuest(Player,LA_F) then
  374. SetStepComplete(Player,LA_F,13)
  375. end
  376. if HasQuest(Player,LA) then
  377. SetStepComplete(Player,LA,1)
  378. SetStepComplete(Player,LA,2)
  379. SetStepComplete(Player,LA,3)
  380. SetStepComplete(Player,LA,4)
  381. SetStepComplete(Player,LA,5)
  382. SetStepComplete(Player,LA,6)
  383. SetStepComplete(Player,LA,7)
  384. end
  385. -- Erudite
  386. elseif Race == 3 or Race == 20 then
  387. if HasQuest(Player,SY_F) then
  388. SetStepComplete(Player,SY_F,13)
  389. end
  390. if HasQuest(Player,SY) then
  391. SetStepComplete(Player,SY,1)
  392. SetStepComplete(Player,SY,2)
  393. SetStepComplete(Player,SY,3)
  394. SetStepComplete(Player,SY,4)
  395. SetStepComplete(Player,SY,5)
  396. SetStepComplete(Player,SY,6)
  397. SetStepComplete(Player,SY,7)
  398. end
  399. elseif Race == 9 then --Human
  400. local con = CreateConversation()
  401. if HasQuest(Player,LA_F) then
  402. SetStepComplete(Player,LA_F,13)
  403. end
  404. if HasQuest(Player,LA) then
  405. SetStepComplete(Player,LA,1)
  406. SetStepComplete(Player,LA,2)
  407. SetStepComplete(Player,LA,3)
  408. SetStepComplete(Player,LA,4)
  409. SetStepComplete(Player,LA,5)
  410. SetStepComplete(Player,LA,6)
  411. SetStepComplete(Player,LA,7)
  412. end
  413. if HasQuest(Player,SY_F) then
  414. SetStepComplete(Player,SY_F,13)
  415. end
  416. if HasQuest(Player,SY) then
  417. SetStepComplete(Player,SY,1)
  418. SetStepComplete(Player,SY,2)
  419. SetStepComplete(Player,SY,3)
  420. SetStepComplete(Player,SY,4)
  421. SetStepComplete(Player,SY,5)
  422. SetStepComplete(Player,SY,6)
  423. SetStepComplete(Player,SY,7)
  424. end
  425. -- Barbarian / Dwarf
  426. elseif Race == 0 or Race == 2 then
  427. if HasQuest(Player,SB_F) then
  428. SetStepComplete(Player,SB_F,13)
  429. end
  430. if HasQuest(Player,SB) then
  431. SetStepComplete(Player,SB,1)
  432. SetStepComplete(Player,SB,2)
  433. SetStepComplete(Player,SB,3)
  434. SetStepComplete(Player,SB,4)
  435. SetStepComplete(Player,SB,5)
  436. SetStepComplete(Player,SB,6)
  437. SetStepComplete(Player,SB,7)
  438. end
  439. -- Froglok / High Elf
  440. elseif Race == 4 or Race == 8 then
  441. if HasQuest(Player,BC_F) then
  442. SetStepComplete(Player,BC_F,13)
  443. end
  444. if HasQuest(Player,BC) then
  445. SetStepComplete(Player,BC,1)
  446. SetStepComplete(Player,BC,2)
  447. SetStepComplete(Player,BC,3)
  448. SetStepComplete(Player,BC,4)
  449. SetStepComplete(Player,BC,5)
  450. SetStepComplete(Player,BC,6)
  451. SetStepComplete(Player,BC,7)
  452. end
  453. -- Half Elf / Wood Elf
  454. elseif Race == 6 or Race == 15 then
  455. if HasQuest(Player,TS_F) then
  456. SetStepComplete(Player,TS_F,13)
  457. end
  458. if HasQuest(Player,TS) then
  459. SetStepComplete(Player,TS,1)
  460. SetStepComplete(Player,TS,2)
  461. SetStepComplete(Player,TS,3)
  462. SetStepComplete(Player,TS,4)
  463. SetStepComplete(Player,TS,5)
  464. SetStepComplete(Player,TS,6)
  465. SetStepComplete(Player,TS,7)
  466. end
  467. -- Gnome / Halfling
  468. elseif Race == 5 or Race == 7 then
  469. if HasQuest(Player,BB_F) then
  470. SetStepComplete(Player,BB_F,13)
  471. end
  472. if HasQuest(Player,BB) then
  473. SetStepComplete(Player,BB,1)
  474. SetStepComplete(Player,BB,2)
  475. SetStepComplete(Player,BB,3)
  476. SetStepComplete(Player,BB,4)
  477. SetStepComplete(Player,BB,5)
  478. SetStepComplete(Player,BB,6)
  479. SetStepComplete(Player,BB,7)
  480. end
  481. else
  482. if HasQuest(Player,LA_F) then
  483. SetStepComplete(Player,LA_F,13)
  484. end
  485. if HasQuest(Player,LA) then
  486. SetStepComplete(Player,LA,1)
  487. SetStepComplete(Player,LA,2)
  488. SetStepComplete(Player,LA,3)
  489. SetStepComplete(Player,LA,4)
  490. SetStepComplete(Player,LA,5)
  491. SetStepComplete(Player,LA,6)
  492. SetStepComplete(Player,LA,7)
  493. end
  494. end
  495. conversation = CreateConversation()
  496. if GetClass(Player)==1 then
  497. AddConversationOption(conversation, ""..GetName(Player).." the Fighter", "Task3")
  498. elseif GetClass(Player)==11 then
  499. AddConversationOption(conversation, ""..GetName(Player).." the Priest", "Task3")
  500. elseif GetClass(Player)==21 then
  501. AddConversationOption(conversation, ""..GetName(Player).." the Mage", "Task3")
  502. elseif GetClass(Player)==31 then
  503. AddConversationOption(conversation, ""..GetName(Player).." the Scout", "Task3")
  504. else
  505. AddConversationOption(conversation, ""..GetName(Player).."", "Task3")
  506. end
  507. AddConversationOption(conversation, "[Put the pages away]","CloseItemConversation")
  508. StartDialogConversation(conversation, 2, Item, Player, "All that is left to do is sign your name...\n\nAre you ready to be a citizen of Freeport?")
  509. end
  510. function Task3(Item,Player)
  511. local Race = GetRace(Player)
  512. if Race == 11 then --Kerra
  513. if HasQuest(Player,LA_F) then
  514. SetStepComplete(Player,LA_F,14)
  515. end
  516. if HasQuest(Player,LA) then
  517. SetStepComplete(Player,LA,8)
  518. end
  519. -- Erudite
  520. elseif Race == 3 or Race == 20 then
  521. if HasQuest(Player,SY_F) then
  522. SetStepComplete(Player,SY_F,14)
  523. end
  524. if HasQuest(Player,SY) then
  525. SetStepComplete(Player,SY,8)
  526. end
  527. elseif Race == 9 then --Human
  528. local con = CreateConversation()
  529. if HasQuest(Player,LA_F) then
  530. SetStepComplete(Player,LA_F,14)
  531. end
  532. if HasQuest(Player,LA) then
  533. SetStepComplete(Player,LA,8)
  534. end
  535. if HasQuest(Player,SY_F) then
  536. SetStepComplete(Player,SY_F,14)
  537. end
  538. if HasQuest(Player,SY) then
  539. SetStepComplete(Player,SY,8)
  540. end
  541. -- Barbarian / Dwarf
  542. elseif Race == 0 or Race == 2 then
  543. if HasQuest(Player,SB_F) then
  544. SetStepComplete(Player,SB_F,14)
  545. end
  546. if HasQuest(Player,SB) then
  547. SetStepComplete(Player,SB,8)
  548. end
  549. -- Froglok / High Elf
  550. elseif Race == 4 or Race == 8 then
  551. if HasQuest(Player,BC_F) then
  552. SetStepComplete(Player,BC_F,14)
  553. end
  554. if HasQuest(Player,BC) then
  555. SetStepComplete(Player,BC,8)
  556. end
  557. -- Half Elf / Wood Elf
  558. elseif Race == 6 or Race == 15 then
  559. if HasQuest(Player,TS_F) then
  560. SetStepComplete(Player,TS_F,14)
  561. end
  562. if HasQuest(Player,TS) then
  563. SetStepComplete(Player,TS,8)
  564. end
  565. -- Gnome / Halfling
  566. elseif Race == 5 or Race == 7 then
  567. if HasQuest(Player,BB_F) then
  568. SetStepComplete(Player,BB_F,14)
  569. end
  570. if HasQuest(Player,BB) then
  571. SetStepComplete(Player,BB,8)
  572. end
  573. else
  574. if HasQuest(Player,LA_F) then
  575. SetStepComplete(Player,LA_F,14)
  576. end
  577. if HasQuest(Player,LA) then
  578. SetStepComplete(Player,LA,8)
  579. end
  580. end
  581. AddSpellBookEntry(Player, 8057, 1) --CALL TO QEYNOS
  582. SendMessage(Player, "You are now a Citizen of Freeport!","yellow")
  583. SendPopUpMessage(Player, "You are now a Citizen of Freeport!",250,250,250)
  584. PlaySound(Player, "sounds/test/endquest.wav", GetX(Spawn), GetY(Spawn), GetZ(Spawn), Spawn)
  585. ApplySpellVisual(Player, 324)
  586. AddTimer(Player,1000,"TaskDone",1)
  587. conversation = CreateConversation()
  588. AddConversationOption(conversation, "[Stuff the completed forms away]","TaskDone")
  589. StartDialogConversation(conversation, 2, Item, Player, "Well done, you've faked becoming a citizen of Freeport!")
  590. end
  591. function TaskDone(Item,Player)
  592. CloseItemConversation(Item,Player)
  593. if HasItem(Player,1001112) then
  594. RemoveItem(Player,1001112,1)
  595. end
  596. end