ForgeryQeynosCitizenshipPapers.lua 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634
  1. --[[
  2. Script Name : ItemScripts/ForgeryQeynosCitizenshipPapers.lua
  3. Script Author : Dorbin
  4. Script Date : 2023.06.10 11:06:34
  5. Script Purpose :
  6. :
  7. --]]
  8. local BB = 5718 --Welcome to Qeynos (Babbuelshrie)
  9. local BB_Q = 5760 --Baubbleshire Citizenship Task
  10. local CV = 5719 --Castleview
  11. local CV_Q = 5765
  12. local NV = 5721 --Nettleville
  13. local NV_Q = 5763
  14. local GS = 5720 --Graystone
  15. local GS_Q = 5764
  16. local SC = 5722 --Starcrest
  17. local SC_Q = 5762
  18. local WW = 5723 --Willow Wood
  19. local WW_Q = 5761
  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_Q)
  25. and not HasQuest(Player,CV)
  26. and not HasQuest(Player,CV_Q)
  27. and not HasQuest(Player,GS)
  28. and not HasQuest(Player,GS_Q)
  29. and not HasQuest(Player,NV)
  30. and not HasQuest(Player,NV_Q)
  31. and not HasQuest(Player,SC)
  32. and not HasQuest(Player,SC_Q)
  33. and not HasQuest(Player,WW)
  34. and not HasQuest(Player,WW_Q) then
  35. if CanReceiveQuest(Player,BB) or
  36. CanReceiveQuest(Player,CV) or
  37. CanReceiveQuest(Player,GS) or
  38. CanReceiveQuest(Player,NV) or
  39. CanReceiveQuest(Player,SC) or
  40. CanReceiveQuest(Player,WW) 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 Qeynos Citzenship forms. They could be useful for someone looking to quickly become a citizen...")
  45. elseif
  46. GetQuestStep(Player,BB_Q) <12 or
  47. GetQuestStep(Player,CV_Q) <12 or
  48. GetQuestStep(Player,GS_Q) <12 or
  49. GetQuestStep(Player,NV_Q) <12 or
  50. GetQuestStep(Player,SC_Q) <12 or
  51. GetQuestStep(Player,WW_Q) <12 then
  52. Welcome2(Item,Player)
  53. elseif
  54. GetQuestStep(Player,BB_Q) ==12 and CanReceiveQuest(Player,BB) or
  55. GetQuestStep(Player,CV_Q) ==12 and CanReceiveQuest(Player,CV) or
  56. GetQuestStep(Player,GS_Q) ==12 and CanReceiveQuest(Player,GS) or
  57. GetQuestStep(Player,NV_Q) ==12 and CanReceiveQuest(Player,NV) or
  58. GetQuestStep(Player,SC_Q) ==12 and CanReceiveQuest(Player,SC) or
  59. GetQuestStep(Player,WW_Q) ==12 and CanReceiveQuest(Player,WW) then
  60. Task1(Item,Player)
  61. elseif
  62. GetQuestStep(Player,BB_Q) ==12 and GetQuestStep(Player,BB)==1 or
  63. GetQuestStep(Player,CV_Q) ==12 and GetQuestStep(Player,CV)==1 or
  64. GetQuestStep(Player,GS_Q) ==12 and GetQuestStep(Player,GS)==1 or
  65. GetQuestStep(Player,NV_Q) ==12 and GetQuestStep(Player,NV)==1 or
  66. GetQuestStep(Player,SC_Q) ==12 and GetQuestStep(Player,SC)==1 or
  67. GetQuestStep(Player,WW_Q) ==12 and GetQuestStep(Player,WW)==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,NV_Q) and not HasCompletedQuest(Player,NV_Q) then
  78. AddConversationOption(conversation, "[Make up a Steward name]","Welcome1")
  79. OfferQuest(nil,Player,NV_Q)
  80. end
  81. -- Erudite
  82. elseif Race == 3 or Race == 20 then
  83. if not HasQuest(Player,SC_Q) and not HasCompletedQuest(Player,SC_Q) then
  84. AddConversationOption(conversation, "[Make up a Steward name]","Welcome1")
  85. OfferQuest(nil,Player,SC_Q)
  86. end
  87. elseif Race == 9 then --Human
  88. local con = CreateConversation()
  89. if not HasQuest(Player,NV_Q) and not HasCompletedQuest(Player,NV_Q) then
  90. AddConversationOption(conversation, "[Make up a Steward name]","Welcome1")
  91. OfferQuest(nil,Player,NV_Q)
  92. end
  93. -- Barbarian / Dwarf
  94. elseif Race == 0 or Race == 2 then
  95. if not HasQuest(Player,GS_Q) and not HasCompletedQuest(Player,GS_Q) then
  96. AddConversationOption(conversation, "[Make up a Steward name]","Welcome1")
  97. OfferQuest(nil,Player,GS_Q)
  98. end
  99. -- Froglok / High Elf
  100. elseif Race == 4 or Race == 8 then
  101. if not HasQuest(Player,CV_Q) and not HasCompletedQuest(Player,CV_Q) then
  102. AddConversationOption(conversation, "[Make up a Steward name]","Welcome1")
  103. OfferQuest(nil,Player,CV_Q)
  104. end
  105. -- Half Elf / Wood Elf
  106. elseif Race == 6 or Race == 15 or Race == 16 then
  107. if not HasQuest(Player,WW_Q) and not HasCompletedQuest(Player,WW_Q) then
  108. AddConversationOption(conversation, "[Make up a Steward name]","Welcome1")
  109. OfferQuest(nil,Player,WW_Q)
  110. end
  111. -- Gnome / Halfling
  112. elseif Race == 5 or Race == 7 then
  113. if not HasQuest(Player,BB_Q) and not HasCompletedQuest(Player,BB_Q) then
  114. AddConversationOption(conversation, "[Make up a Steward name]","Welcome1")
  115. OfferQuest(nil,Player,BB_Q)
  116. end
  117. else
  118. if not HasQuest(Player,NV_Q) and not HasCompletedQuest(Player,NV_Q) then
  119. AddConversationOption(conversation, "[Make up a Steward name]","Welcome1")
  120. OfferQuest(nil,Player,NV_Q)
  121. end
  122. end
  123. AddConversationOption(conversation, "[Put the pages away]","CloseItemConversation")
  124. StartDialogConversation(conversation, 2, Item, Player, "It states a Steward 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_Q)
  130. and not HasQuest(Player,CV)
  131. and not HasQuest(Player,CV_Q)
  132. and not HasQuest(Player,GS)
  133. and not HasQuest(Player,GS_Q)
  134. and not HasQuest(Player,NV)
  135. and not HasQuest(Player,NV_Q)
  136. and not HasQuest(Player,SC)
  137. and not HasQuest(Player,SC_Q)
  138. and not HasQuest(Player,WW)
  139. and not HasQuest(Player,WW_Q) 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. Qeynos = GetFactionAmount(Player, 11)
  151. Qeynos_Add = (10000-Qeynos)
  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 Qeynos <10000 and Qeynos >=0 then ChangeFaction(Player, 11, Qeynos_Add)
  160. elseif Qeynos <0 then ChangeFaction(Player, 11, (Qeynos*-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,NV_Q) then
  188. SetStepComplete(Player,NV_Q,1)
  189. SetStepComplete(Player,NV_Q,2)
  190. SetStepComplete(Player,NV_Q,3)
  191. SetStepComplete(Player,NV_Q,4)
  192. SetStepComplete(Player,NV_Q,5)
  193. SetStepComplete(Player,NV_Q,6)
  194. SetStepComplete(Player,NV_Q,7)
  195. SetStepComplete(Player,NV_Q,8)
  196. SetStepComplete(Player,NV_Q,9)
  197. SetStepComplete(Player,NV_Q,10)
  198. SetStepComplete(Player,NV_Q,11)
  199. SetStepComplete(Player,NV_Q,12)
  200. end
  201. -- Erudite
  202. elseif Race == 3 or Race == 20 then
  203. if HasQuest(Player,SC_Q) then
  204. SetStepComplete(Player,SC_Q,1)
  205. SetStepComplete(Player,SC_Q,2)
  206. SetStepComplete(Player,SC_Q,3)
  207. SetStepComplete(Player,SC_Q,4)
  208. SetStepComplete(Player,SC_Q,5)
  209. SetStepComplete(Player,SC_Q,6)
  210. SetStepComplete(Player,SC_Q,7)
  211. SetStepComplete(Player,SC_Q,8)
  212. SetStepComplete(Player,SC_Q,9)
  213. SetStepComplete(Player,SC_Q,10)
  214. SetStepComplete(Player,SC_Q,11)
  215. SetStepComplete(Player,SC_Q,12)
  216. end
  217. elseif Race == 9 then --Human
  218. local con = CreateConversation()
  219. if HasQuest(Player,NV_Q) then
  220. SetStepComplete(Player,NV_Q,1)
  221. SetStepComplete(Player,NV_Q,2)
  222. SetStepComplete(Player,NV_Q,3)
  223. SetStepComplete(Player,NV_Q,4)
  224. SetStepComplete(Player,NV_Q,5)
  225. SetStepComplete(Player,NV_Q,6)
  226. SetStepComplete(Player,NV_Q,7)
  227. SetStepComplete(Player,NV_Q,8)
  228. SetStepComplete(Player,NV_Q,9)
  229. SetStepComplete(Player,NV_Q,10)
  230. SetStepComplete(Player,NV_Q,11)
  231. SetStepComplete(Player,NV_Q,12)
  232. elseif HasQuest(Player,SC_Q) then
  233. SetStepComplete(Player,SC_Q,1)
  234. SetStepComplete(Player,SC_Q,2)
  235. SetStepComplete(Player,SC_Q,3)
  236. SetStepComplete(Player,SC_Q,4)
  237. SetStepComplete(Player,SC_Q,5)
  238. SetStepComplete(Player,SC_Q,6)
  239. SetStepComplete(Player,SC_Q,7)
  240. SetStepComplete(Player,SC_Q,8)
  241. SetStepComplete(Player,SC_Q,9)
  242. SetStepComplete(Player,SC_Q,10)
  243. SetStepComplete(Player,SC_Q,11)
  244. SetStepComplete(Player,SC_Q,12)
  245. end
  246. -- Barbarian / Dwarf
  247. elseif Race == 0 or Race == 2 then
  248. if HasQuest(Player,GS_Q) then
  249. SetStepComplete(Player,GS_Q,1)
  250. SetStepComplete(Player,GS_Q,2)
  251. SetStepComplete(Player,GS_Q,3)
  252. SetStepComplete(Player,GS_Q,4)
  253. SetStepComplete(Player,GS_Q,5)
  254. SetStepComplete(Player,GS_Q,6)
  255. SetStepComplete(Player,GS_Q,7)
  256. SetStepComplete(Player,GS_Q,8)
  257. SetStepComplete(Player,GS_Q,9)
  258. SetStepComplete(Player,GS_Q,10)
  259. SetStepComplete(Player,GS_Q,11)
  260. SetStepComplete(Player,GS_Q,12)
  261. end
  262. -- Froglok / High Elf
  263. elseif Race == 4 or Race == 8 then
  264. if HasQuest(Player,CV_Q) then
  265. SetStepComplete(Player,CV_Q,1)
  266. SetStepComplete(Player,CV_Q,2)
  267. SetStepComplete(Player,CV_Q,3)
  268. SetStepComplete(Player,CV_Q,4)
  269. SetStepComplete(Player,CV_Q,5)
  270. SetStepComplete(Player,CV_Q,6)
  271. SetStepComplete(Player,CV_Q,7)
  272. SetStepComplete(Player,CV_Q,8)
  273. SetStepComplete(Player,CV_Q,9)
  274. SetStepComplete(Player,CV_Q,10)
  275. SetStepComplete(Player,CV_Q,11)
  276. SetStepComplete(Player,CV_Q,12)
  277. end
  278. -- Half Elf / Wood Elf
  279. elseif Race == 6 or Race == 15 then
  280. if HasQuest(Player,WW_Q) then
  281. SetStepComplete(Player,WW_Q,1)
  282. SetStepComplete(Player,WW_Q,2)
  283. SetStepComplete(Player,WW_Q,3)
  284. SetStepComplete(Player,WW_Q,4)
  285. SetStepComplete(Player,WW_Q,5)
  286. SetStepComplete(Player,WW_Q,6)
  287. SetStepComplete(Player,WW_Q,7)
  288. SetStepComplete(Player,WW_Q,8)
  289. SetStepComplete(Player,WW_Q,9)
  290. SetStepComplete(Player,WW_Q,10)
  291. SetStepComplete(Player,WW_Q,11)
  292. SetStepComplete(Player,WW_Q,12)
  293. end
  294. -- Gnome / Halfling
  295. elseif Race == 5 or Race == 7 then
  296. if HasQuest(Player,BB_Q) then
  297. SetStepComplete(Player,BB_Q,1)
  298. SetStepComplete(Player,BB_Q,2)
  299. SetStepComplete(Player,BB_Q,3)
  300. SetStepComplete(Player,BB_Q,4)
  301. SetStepComplete(Player,BB_Q,5)
  302. SetStepComplete(Player,BB_Q,6)
  303. SetStepComplete(Player,BB_Q,7)
  304. SetStepComplete(Player,BB_Q,8)
  305. SetStepComplete(Player,BB_Q,9)
  306. SetStepComplete(Player,BB_Q,10)
  307. SetStepComplete(Player,BB_Q,11)
  308. SetStepComplete(Player,BB_Q,12)
  309. end
  310. else
  311. if HasQuest(Player,NV_Q) then
  312. SetStepComplete(Player,NV_Q,1)
  313. SetStepComplete(Player,NV_Q,2)
  314. SetStepComplete(Player,NV_Q,3)
  315. SetStepComplete(Player,NV_Q,4)
  316. SetStepComplete(Player,NV_Q,5)
  317. SetStepComplete(Player,NV_Q,6)
  318. SetStepComplete(Player,NV_Q,7)
  319. SetStepComplete(Player,NV_Q,8)
  320. SetStepComplete(Player,NV_Q,9)
  321. SetStepComplete(Player,NV_Q,10)
  322. SetStepComplete(Player,NV_Q,11)
  323. SetStepComplete(Player,NV_Q,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 == 11 then --Kerra
  334. if CanReceiveQuest(Player,NV) then
  335. OfferQuest(nil,Player,NV)
  336. end
  337. -- Erudite
  338. elseif Race == 3 or Race == 20 then
  339. if CanReceiveQuest(Player,SC) then
  340. OfferQuest(nil,Player,SC)
  341. end
  342. elseif Race == 9 then --Human
  343. local con = CreateConversation()
  344. if CanReceiveQuest(Player,NV) then
  345. OfferQuest(nil,Player,NV)
  346. end
  347. -- Barbarian / Dwarf
  348. elseif Race == 0 or Race == 2 then
  349. if CanReceiveQuest(Player,GS) then
  350. OfferQuest(nil,Player,GS)
  351. end
  352. -- Froglok / High Elf
  353. elseif Race == 4 or Race == 8 then
  354. if CanReceiveQuest(Player,CV) then
  355. OfferQuest(nil,Player,CV)
  356. end
  357. -- Half Elf / Wood Elf
  358. elseif Race == 6 or Race == 15 then
  359. if CanReceiveQuest(Player,WW) then
  360. OfferQuest(nil,Player,WW)
  361. end
  362. -- Gnome / Halfling
  363. elseif Race == 5 or Race == 7 then
  364. if CanReceiveQuest(Player,BB) then
  365. OfferQuest(nil,Player,BB)
  366. end
  367. else
  368. if CanReceiveQuest(Player,NV) then
  369. OfferQuest(nil,Player,NV)
  370. end
  371. end
  372. AddConversationOption(conversation, "[Put the pages away]","CloseItemConversation")
  373. 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 ]")
  374. end
  375. function Task2(Item,Player)
  376. local Race = GetRace(Player)
  377. if Race == 11 then --Kerra
  378. if HasQuest(Player,NV_Q) then
  379. SetStepComplete(Player,NV_Q,13)
  380. end
  381. if HasQuest(Player,NV) then
  382. SetStepComplete(Player,NV,1)
  383. SetStepComplete(Player,NV,2)
  384. SetStepComplete(Player,NV,3)
  385. SetStepComplete(Player,NV,4)
  386. SetStepComplete(Player,NV,5)
  387. SetStepComplete(Player,NV,6)
  388. SetStepComplete(Player,NV,7)
  389. end
  390. -- Erudite
  391. elseif Race == 3 or Race == 20 then
  392. if HasQuest(Player,SC_Q) then
  393. SetStepComplete(Player,SC_Q,13)
  394. end
  395. if HasQuest(Player,SC) then
  396. SetStepComplete(Player,SC,1)
  397. SetStepComplete(Player,SC,2)
  398. SetStepComplete(Player,SC,3)
  399. SetStepComplete(Player,SC,4)
  400. SetStepComplete(Player,SC,5)
  401. SetStepComplete(Player,SC,6)
  402. SetStepComplete(Player,SC,7)
  403. end
  404. elseif Race == 9 then --Human
  405. local con = CreateConversation()
  406. if HasQuest(Player,NV_Q) then
  407. SetStepComplete(Player,NV_Q,13)
  408. end
  409. if HasQuest(Player,NV) then
  410. SetStepComplete(Player,NV,1)
  411. SetStepComplete(Player,NV,2)
  412. SetStepComplete(Player,NV,3)
  413. SetStepComplete(Player,NV,4)
  414. SetStepComplete(Player,NV,5)
  415. SetStepComplete(Player,NV,6)
  416. SetStepComplete(Player,NV,7)
  417. end
  418. if HasQuest(Player,SC_Q) then
  419. SetStepComplete(Player,SC_Q,13)
  420. end
  421. if HasQuest(Player,SC) then
  422. SetStepComplete(Player,SC,1)
  423. SetStepComplete(Player,SC,2)
  424. SetStepComplete(Player,SC,3)
  425. SetStepComplete(Player,SC,4)
  426. SetStepComplete(Player,SC,5)
  427. SetStepComplete(Player,SC,6)
  428. SetStepComplete(Player,SC,7)
  429. end
  430. -- Barbarian / Dwarf
  431. elseif Race == 0 or Race == 2 then
  432. if HasQuest(Player,GS_Q) then
  433. SetStepComplete(Player,GS_Q,13)
  434. end
  435. if HasQuest(Player,GS) then
  436. SetStepComplete(Player,GS,1)
  437. SetStepComplete(Player,GS,2)
  438. SetStepComplete(Player,GS,3)
  439. SetStepComplete(Player,GS,4)
  440. SetStepComplete(Player,GS,5)
  441. SetStepComplete(Player,GS,6)
  442. SetStepComplete(Player,GS,7)
  443. end
  444. -- Froglok / High Elf
  445. elseif Race == 4 or Race == 8 then
  446. if HasQuest(Player,CV_Q) then
  447. SetStepComplete(Player,CV_Q,13)
  448. end
  449. if HasQuest(Player,CV) then
  450. SetStepComplete(Player,CV,1)
  451. SetStepComplete(Player,CV,2)
  452. SetStepComplete(Player,CV,3)
  453. SetStepComplete(Player,CV,4)
  454. SetStepComplete(Player,CV,5)
  455. SetStepComplete(Player,CV,6)
  456. SetStepComplete(Player,CV,7)
  457. end
  458. -- Half Elf / Wood Elf
  459. elseif Race == 6 or Race == 15 then
  460. if HasQuest(Player,WW_Q) then
  461. SetStepComplete(Player,WW_Q,13)
  462. end
  463. if HasQuest(Player,WW) then
  464. SetStepComplete(Player,WW,1)
  465. SetStepComplete(Player,WW,2)
  466. SetStepComplete(Player,WW,3)
  467. SetStepComplete(Player,WW,4)
  468. SetStepComplete(Player,WW,5)
  469. SetStepComplete(Player,WW,6)
  470. SetStepComplete(Player,WW,7)
  471. end
  472. -- Gnome / Halfling
  473. elseif Race == 5 or Race == 7 then
  474. if HasQuest(Player,BB_Q) then
  475. SetStepComplete(Player,BB_Q,13)
  476. end
  477. if HasQuest(Player,BB) then
  478. SetStepComplete(Player,BB,1)
  479. SetStepComplete(Player,BB,2)
  480. SetStepComplete(Player,BB,3)
  481. SetStepComplete(Player,BB,4)
  482. SetStepComplete(Player,BB,5)
  483. SetStepComplete(Player,BB,6)
  484. SetStepComplete(Player,BB,7)
  485. end
  486. else
  487. if HasQuest(Player,NV_Q) then
  488. SetStepComplete(Player,NV_Q,13)
  489. end
  490. if HasQuest(Player,NV) then
  491. SetStepComplete(Player,NV,1)
  492. SetStepComplete(Player,NV,2)
  493. SetStepComplete(Player,NV,3)
  494. SetStepComplete(Player,NV,4)
  495. SetStepComplete(Player,NV,5)
  496. SetStepComplete(Player,NV,6)
  497. SetStepComplete(Player,NV,7)
  498. end
  499. end
  500. conversation = CreateConversation()
  501. if GetClass(Player)==1 then
  502. AddConversationOption(conversation, ""..GetName(Player).." the Fighter", "Task3")
  503. elseif GetClass(Player)==11 then
  504. AddConversationOption(conversation, ""..GetName(Player).." the Priest", "Task3")
  505. elseif GetClass(Player)==21 then
  506. AddConversationOption(conversation, ""..GetName(Player).." the Mage", "Task3")
  507. elseif GetClass(Player)==31 then
  508. AddConversationOption(conversation, ""..GetName(Player).." the Scout", "Task3")
  509. else
  510. AddConversationOption(conversation, ""..GetName(Player).."", "Task3")
  511. end
  512. AddConversationOption(conversation, "[Put the pages away]","CloseItemConversation")
  513. StartDialogConversation(conversation, 2, Item, Player, "All that is left to do is sign your name...\n\nAre you ready to be a citizen of Qeynos?")
  514. end
  515. function Task3(Item,Player)
  516. local Race = GetRace(Player)
  517. if Race == 11 then --Kerra
  518. if HasQuest(Player,NV_Q) then
  519. SetStepComplete(Player,NV_Q,14)
  520. end
  521. if HasQuest(Player,NV) then
  522. SetStepComplete(Player,NV,8)
  523. end
  524. -- Erudite
  525. elseif Race == 3 or Race == 20 then
  526. if HasQuest(Player,SC_Q) then
  527. SetStepComplete(Player,SC_Q,14)
  528. end
  529. if HasQuest(Player,SC) then
  530. SetStepComplete(Player,SC,8)
  531. end
  532. elseif Race == 9 then --Human
  533. local con = CreateConversation()
  534. if HasQuest(Player,NV_Q) then
  535. SetStepComplete(Player,NV_Q,14)
  536. end
  537. if HasQuest(Player,NV) then
  538. SetStepComplete(Player,NV,8)
  539. end
  540. if HasQuest(Player,SC_Q) then
  541. SetStepComplete(Player,SC_Q,14)
  542. end
  543. if HasQuest(Player,SC) then
  544. SetStepComplete(Player,SC,8)
  545. end
  546. -- Barbarian / Dwarf
  547. elseif Race == 0 or Race == 2 then
  548. if HasQuest(Player,GS_Q) then
  549. SetStepComplete(Player,GS_Q,14)
  550. end
  551. if HasQuest(Player,GS) then
  552. SetStepComplete(Player,GS,8)
  553. end
  554. -- Froglok / High Elf
  555. elseif Race == 4 or Race == 8 then
  556. if HasQuest(Player,CV_Q) then
  557. SetStepComplete(Player,CV_Q,14)
  558. end
  559. if HasQuest(Player,CV) then
  560. SetStepComplete(Player,CV,8)
  561. end
  562. -- Half Elf / Wood Elf
  563. elseif Race == 6 or Race == 15 then
  564. if HasQuest(Player,WW_Q) then
  565. SetStepComplete(Player,WW_Q,14)
  566. end
  567. if HasQuest(Player,WW) then
  568. SetStepComplete(Player,WW,8)
  569. end
  570. -- Gnome / Halfling
  571. elseif Race == 5 or Race == 7 then
  572. if HasQuest(Player,BB_Q) then
  573. SetStepComplete(Player,BB_Q,14)
  574. end
  575. if HasQuest(Player,BB) then
  576. SetStepComplete(Player,BB,8)
  577. end
  578. else
  579. if HasQuest(Player,NV_Q) then
  580. SetStepComplete(Player,NV_Q,14)
  581. end
  582. if HasQuest(Player,NV) then
  583. SetStepComplete(Player,NV,8)
  584. end
  585. end
  586. AddSpellBookEntry(Player, 8057, 1) --CALL TO QEYNOS
  587. SendMessage(Player, "You are now a Citizen of Qeynos!","yellow")
  588. SendPopUpMessage(Player, "You are now a Citizen of Qeynos!",250,250,250)
  589. PlaySound(Player, "sounds/test/endquest.wav", GetX(Spawn), GetY(Spawn), GetZ(Spawn), Spawn)
  590. ApplySpellVisual(Player, 324)
  591. AddTimer(Player,1000,"TaskDone",1)
  592. conversation = CreateConversation()
  593. AddConversationOption(conversation, "[Stuff the completed forms away]","TaskDone")
  594. StartDialogConversation(conversation, 2, Item, Player, "Well done, you've faked becoming a citizen of Qeynos!")
  595. end
  596. function TaskDone(Item,Player)
  597. CloseItemConversation(Item,Player)
  598. if HasItem(Player,1001095) then
  599. RemoveItem(Player,1001095,1)
  600. end
  601. end