Advertisement
Paragorn

UO-Script

Feb 16th, 2015
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.23 KB | None | 0 0
  1. [events e_PlayerGenericEvent]
  2. on=@attack
  3. return <src.trigger @Attacked,<def.tat_as_argo>,<uid>>
  4.  
  5. // Virtue System
  6. on=@UserVirtue
  7. if <def.scp.VirtueSystem> == 0
  8. return 1
  9. endif
  10. if (<argn1>==1)
  11. for 0 8 // if the player doesn't have max status for first level of virtue
  12. if !(<src.tag0.virtuemax_<dlocal._for>>)
  13. src.tag0.virtuemax_<dlocal._for>=4000 // give him the cap.
  14. endif
  15. endfor
  16. argo.sdialog d_virtue_main
  17. else
  18. if (<argn1>==112) /// invoke valor virtue (coded for test.)
  19. src.targetf f_valor_target
  20. return 1
  21. elif <argn1> == 107
  22. f_start_honor
  23. return 1
  24. elif <argn1> == 105
  25. sysmessage @,,2 1053001 // This virtue is not activated through the virtue menu.
  26. return 1
  27. endif
  28. // TODO : Add virtue systems and check them here if is clicked.
  29. //and do not forget to put return 1 for each virtue check.
  30. src.sysmessage @03c1,6,1,1 This virtue is not active.
  31. endif
  32.  
  33. // Skill delays
  34. on=@skillwait
  35. if (<flags>&statf_freeze) || (<flags>&statf_stone)
  36. src.sysmessage <def.scp.skill_cantuse>
  37. return 1
  38. endif
  39. if <flags>&statf_dead
  40. src.sysmessage <def.scp.skill_youaredead>
  41. return 1
  42. endif
  43. if <def.scp.SkillWaitingTimes> == 1
  44. if <ctag0.skillrecovery> > <serv.time>
  45. src.sysmessage <def.scp.skill_mustwait>
  46. return 1
  47. endif
  48. endif
  49.  
  50. // Limitations by Race
  51. on=@equiptest
  52. if <def.scp.LimitationRace> == 1
  53. if <src.isgargoyle>
  54. if !<tag0.item.gargoyle>
  55. return 1
  56. endif
  57. endif
  58. if <tag0.item.elven>
  59. if !<src.iselven>
  60. return 1
  61. endif
  62. endif
  63. endif
  64. if <def.scp.LimitationGenre> == 1
  65. if <tag0.item.female>
  66. if !<src.isfemale>
  67. return 1
  68. endif
  69. endif
  70. endif
  71.  
  72. // Context Menu Display
  73. on=@contextmenurequest
  74. if <uid> == <src.uid>
  75. if <guild>
  76. src.addcontextentry 101,6117
  77. else
  78. src.addcontextentry 101,6117,01
  79. endif
  80. src.addcontextentry 102,6119
  81. else
  82. src.addcontextentry 200,6121
  83. endif
  84. return 0
  85.  
  86. // Context Menu Functions
  87. on=@contextmenuselect
  88. if <uid> == <src.uid>
  89. if <argn> == 101
  90. guildmenu
  91. elif <argn> == 102
  92. openquestlog
  93. endif
  94. else
  95. if <argn> == 200
  96. src.face <uid>
  97. endif
  98. endif
  99.  
  100. // Quest Button
  101. on=@userquestbutton
  102. openquestlog
  103.  
  104. // OSI Guildstones Menu
  105. on=@userguildbutton
  106. src.guildmenu
  107. return 1
  108.  
  109. // Cancel use of Book of Arms
  110. // Until we script it and finish it!
  111. on=@userspecialmove
  112. return 1
  113.  
  114. // OSI Calculation + Stats Bonus
  115. on=@userstats
  116. if <def.scp.Followers> == 1
  117. if <isgm>
  118. maxfollower = 255
  119. else
  120. maxfollower = <def.scp.MaxFollowers>
  121. endif
  122. endif
  123.  
  124. // Followers control
  125. on=@itembuy
  126. if <def.scp.followers> == 1
  127. if <act.type> == t_figurine
  128. local.slots = <qval <serv.chardef.<act.tdata3>.tag0.control.slots> ? <serv.chardef.<act.tdata3>.tag0.control.slots> : 1>
  129. if <eval <src.curfollower>+(<local.slots>*<argn>)> > <src.maxfollower>
  130. src.sysmessage @,,2 1049612,<serv.chardef.<act.tdata3>.name> // ~1_NAME~ remained in the stables because you have too many followers.
  131. src.newgold <local.totalcost>
  132. return 1
  133. endif
  134. src.curfollower += <eval <local.slots>*<argn>>
  135. endif
  136. endif
  137.  
  138. // Ethereal Mounts
  139. on=@dismount
  140. if <argo.tag0.EthMount>
  141. serv.newitem <argo.tag.EthMount>
  142. new.cont = <src.uid>
  143. argo.remove
  144. return 1
  145. endif
  146.  
  147. // Crafting System
  148. on=@skillmenu
  149. if <def.scp.CraftingSystem> == 0
  150. return 0
  151. endif
  152. if <args>==sm_blacksmith
  153. if <def0.scp.NewCrafting_Blacksmithing> == 1
  154. craftskill Blacksmithing
  155. return 1
  156. endif
  157. elif <args>==sm_alchemy
  158. if <def0.scp.NewCrafting_Alchemy> == 1
  159. craftskill Alchemy
  160. return 1
  161. endif
  162. elif <args>==sm_bowcraft
  163. if <def0.scp.NewCrafting_Bowcraft> == 1
  164. craftskill Bowcraft
  165. return 1
  166. endif
  167. elif <args>==sm_cartography
  168. if <def0.scp.NewCrafting_Cartography> == 1
  169. craftskill Cartography
  170. return 1
  171. endif
  172. elif <args>==sm_carpentry
  173. if <def0.scp.NewCrafting_Carpentry> == 1
  174. craftskill Carpentry
  175. return 1
  176. endif
  177. elif (<args>==sm_tailor_leather) || (<args>==sm_tailor_cloth)
  178. if <def0.scp.NewCrafting_Tailoring> == 1
  179. craftskill Tailoring
  180. return 1
  181. endif
  182. elif <args>==sm_tinker
  183. if <def0.scp.NewCrafting_Tinkering> == 1
  184. craftskill Tinkering
  185. return 1
  186. endif
  187. elif <args>==sm_inscription
  188. if <def0.scp.NewCrafting_Inscription> == 1
  189. craftskill Inscription
  190. return 1
  191. endif
  192. endif
  193. return 0
  194.  
  195. // Fishing coast lines
  196. on=@RegionResourceFound
  197. if <src.action> == skill_fishing
  198. if <def.scp.Fishing_CoastLines> == 1
  199. if <serv.map(<src.targp.x>,<src.targp.y>,<src.targp.m>).type> == t_water
  200. local.newbit = <serv.regiontype.r_water.resources.<eval <serv.regiontype.r_water.calcmemberindex <src.uid>>+1>.key>
  201. argo.more1 = <local.newbit>
  202. argo.amount = <r<serv.regionresource.<argo.more1>.amount>>
  203. endif
  204. endif
  205. endif
  206.  
  207. // Chivalry Tithing Points
  208. on=@spellselect
  209. if (<argn1> > 199) && (<argn1> < 211)
  210. if <tithing> < <def.scp.spell.<argn1>.tithing>
  211. sysmessage <def.scp.magery_notithing>
  212. return 1
  213. endif
  214. endif
  215.  
  216. // OSI Spell Difficulty
  217. // Magic WOPs
  218. on=@spellcast
  219. if <def.scp.OSISpellDiff> == 1
  220. local.skill = <serv.skill.<streat <serv.spell.<argn1>.skillreq>>.key>
  221. actdiff = <eval (((<<local.skill>> - <argn2>) * 2.5) + 50.0)>
  222. endif
  223. if !<npc>
  224. if <isempty <serv.spell.<argn1>.runes>>
  225. if <account.plevel> > 2
  226. if <serv.wopstaff>
  227. if <isnum <def.scp.spell_<argn1>_wop>>
  228. say @<serv.wopcolor>,<serv.wopfont>,2 <def.scp.spell_<argn1>_wop>
  229. else
  230. say @<serv.wopcolor>,<serv.wopfont> <def.scp.spell_<argn1>_wop>
  231. endif
  232. endif
  233. elif <account.plevel> < 2
  234. if <isnum <def.spell.<argn1>.wop>>
  235. say @<serv.wopcolor>,<serv.wopfont>,2 <def.scp.spell_<argn1>_wop>
  236. else
  237. say @<serv.wopcolor>,<serv.wopfont> <def.scp.spell_<argn1>_wop>
  238. endif
  239. endif
  240. endif
  241. endif
  242.  
  243. // Magic Reflection Spell
  244. on=@spelleffect
  245. if <flags>&statf_reflection
  246. if <src.uid> != <uid>
  247. if (<serv.spell.<argn1>.flags>&spellflag_harm) || <argn> == 41
  248. flags &= ~statf_reflection
  249. findid.i_rune_magic_reflection.remove
  250. effect 3,i_fx_bless_effect,16,16
  251. if <src.flags>&statf_reflection
  252. src.flags &= ~statf_reflection
  253. src.findid.i_rune_magic_reflection.remove
  254. src.effect 3,i_fx_bless_effect,16,16
  255. else
  256. spelleffect <argn1> <argn2> <argo.uid>
  257. return 1
  258. endif
  259. endif
  260. endif
  261. endif
  262.  
  263. // Proper Statlock Fix
  264. on=@statchange
  265. local.statsum = <qval <tag0.override.statsum> ? <tag0.override.statsum> : <serv.skillclass.0.statsum>>
  266. local.stats = <eval <ostr>+<odex>+<oint>>
  267. if <local.stats> == <local.statsum>
  268. if <statlock[<argn1>]> == lock_locked
  269. return 1
  270. endif
  271. if <statlock[<argn1>]> == lock_up
  272. for 0 2
  273. if <local._for> != <argn1>
  274. if <statlock[<dlocal._for>]> == lock_down
  275. if (<eval <o<def.stat_<dlocal._for>_name>>-1> > 0)
  276. o<def.stat_<dlocal._for>_name> = <eval <o<def.stat_<dlocal._for>_name>>-1>
  277. return 0
  278. endif
  279. return 1
  280. endif
  281. endif
  282. endfor
  283. return 1
  284. endif
  285. endif
  286.  
  287. // Quest System
  288. on=@skillmakeitem
  289. if <tag0.quests>
  290. for x <tag0.quests>
  291. for y <def.quest_<dtag0.quest.<local._for>.id>_objective_amount>
  292. if <def.quest_<dtag0.quest.<local._for>.id>_objective_<dlocal.y>_type> == questobj_craft
  293. if <argo.id> == <def.quest_<dtag0.quest.<local._for>.id>_objective_<dlocal.y>_craft>
  294. f_quest_craftitem <argo.uid>,<local.x>,<local.y>
  295. endif
  296. endif
  297. endfor
  298. endfor
  299. endif
  300.  
  301. // Death Robe Fix
  302. on=@death
  303. if <findlayer.22>
  304. tag.robe=<findlayer.22.uid>
  305. if <findlayer.3>
  306. tag.feet=<findlayer.3.uid>
  307. endif
  308. endif
  309.  
  310. on=@deathcorpse
  311. if <tag0.robe>
  312. uid.<tag.robe>.z = 3
  313. if <tag0.feet>
  314. uid.<tag.feet>.z = 8
  315. endif
  316. tag.robe=
  317. tag.feet=
  318. argo.update
  319. endif
  320.  
  321. // Hunger System triggers
  322. on=@login
  323. if (<ddef0.scp.hunger_on_off>)
  324. if (<src.findid.i_food_and_drink_sys_mem>)
  325. src.findid.i_food_and_drink_sys_mem.timer=60
  326. else
  327. src.f_alimentation
  328. endif
  329. return 0
  330. endif
  331.  
  332. on=@logout
  333. if (<src.findid.i_food_and_drink_sys_mem>)
  334. if (<src.findid.i_food_and_drink_sys_mem.timer> >= 0)
  335. src.findid.i_food_and_drink_sys_mem.timer=-1
  336. endif
  337. return 0
  338. endif
  339.  
  340. ON=@ITEMDCLICK
  341. IF (<DDEF0.SCP.HUNGER_ON_OFF>)
  342. IF (!<SRC.FINDID.i_food_and_drink_sys_mem>)
  343. SRC.F_ALIMENTATION
  344. ENDIF
  345. IF (<ACT.TYPE> == T_FOOD) || (<ACT.TYPE> == t_fruit)
  346. IF (<SRC.FOOD> >= <DDEF0.SCP.MAXFOOD>)
  347. SRC.SYSMESSAGELOC -1,1042971,You're satiated.
  348. RETURN 1
  349. ELSEIF (<SRC.RESTEST 1 <ACT.BASEID>>)
  350. SRC.CONSUME 1 <ACT.BASEID>
  351. IF (<SRC.FOOD> < <DDEF0.SCP.MAXFOOD>)
  352. SRC.FOOD_INCREASE
  353. RETURN 0
  354. ELSE
  355. SRC.SYSMESSAGELOC -1,1042971,You're satiated.
  356. RETURN 1
  357. ENDIF
  358. ELSE
  359. SRC.SYSMESSAGELOC -1,1042971,You must have it in your pack.
  360. RETURN 1
  361. ENDIF
  362. ELSEIF (<ACT.TYPE> == t_booze) || (<ACT.TYPE> == t_drink) || (<ACT.TYPE> == t_water_wash)
  363. IF (<SRC.DTAG0.DRINK> >= <DDEF0.SCP.MAXDRINK>)
  364. SRC.SYSMESSAGELOC -1,1042971,You aren't thirsty.
  365. RETURN 1
  366. ELSEIF (<SRC.RESTEST 1 <ACT.BASEID>>)
  367. SRC.CONSUME 1 <ACT.BASEID>
  368. IF (<SRC.DTAG0.DRINK> < 10)
  369. SRC.DRINK_INCREASE
  370. RETURN 0
  371. ELSE
  372. SRC.SYSMESSAGELOC -1,1042971,You aren't thirsty.
  373. RETURN 1
  374. ENDIF
  375. ELSE
  376. SRC.SYSMESSAGELOC -1,1042971,You must have it in your pack.
  377. RETURN 1
  378. ENDIF
  379. ENDIF
  380. ENDIF
  381.  
  382. ON=@Hunger
  383. IF (<DDEF0.SCP.HUNGER_ON_OFF>)
  384. RETURN 1
  385. ENDIF
  386.  
  387.  
  388. ON=@ItemSell
  389. IF (<ACT.TYPE> == t_container)
  390. FORCONT <act.uid> 0 //Looking for ANY item in the container.
  391. IF <IsItem>
  392. SMSGL -1,500196 //You may not sell containers unless they are empty
  393. RETURN 1 //Stop the sale.
  394. ENDIF
  395. ENDFOR
  396. ENDIF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement