Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.90 KB | None | 0 0
  1. [CENTER][B][SIZE=7]Shrines[/SIZE][/B]
  2. Shrines are new objects that can be added on the map. After activation, shrine becomes inactive and can change type upon reactivation.[/CENTER]
  3.  
  4. [B][SIZE=5]Power Shrine[/SIZE][/B]
  5. [LIST]
  6. [*]30% chance to spawn
  7. [*]25% damage bonus
  8. [*]30 seconds duration
  9. [/LIST]
  10. [B][SIZE=5]Protection Shrine[/SIZE][/B]
  11. [LIST]
  12. [*]15% chance to spawn
  13. [*]25% damage reduction
  14. [*]15 seconds duration
  15. [/LIST]
  16. [B][SIZE=5]Recovery Shrine[/SIZE][/B]
  17. [LIST]
  18. [*]5% chance to spawn
  19. [*]10% of Max HP & MP every second
  20. [*]20 seconds duration
  21. [/LIST]
  22. [B][SIZE=5]Wisdom Shrine[/SIZE][/B]
  23. [LIST]
  24. [*]20% chance to spawn
  25. [*]25% bonus experience
  26. [*]20 seconds duration
  27. [/LIST]
  28. [MEDIA=youtube]xNNaUqGDeRg[/MEDIA]
  29. [CENTER]
  30. [B][SIZE=7]Installation[/SIZE][/B][/CENTER]
  31.  
  32. [LIST=1]
  33. [*]Open [ICODE]data/actions/actions.xml[/ICODE].
  34. [*]Add [CODE=xml]<action itemid="7823" script="custom/shrine.lua" />[/CODE]
  35. [*]Open [ICODE]data/creaturescripts/creaturescripts.xml[/ICODE].
  36. [*]Add [CODE=xml]<event type="login" name="ShrinesLogin" script="shrines.lua" />
  37. <event type="logout" name="ShrinesLogout" script="shrines.lua" />
  38. <event type="kill" name="ShrinesKill" script="shrines.lua" />
  39. <event type="death" name="ShrinesDeath" script="shrines.lua" />
  40. <event type="healthchange" name="ShrinesHealth" script="shrines.lua" />[/CODE]
  41. [*]Open [ICODE]data/globalevents/globalevents.xml[/ICODE].
  42. [*]Add (60000 = 1 minute) [CODE=xml]<globalevent name="ShrineSpawn" interval="60000" script="shrine_spawner.lua"/>[/CODE]
  43. [*]Open [ICODE]data/globalevents/scripts/startup.lua[/ICODE].
  44. [*]At the end of the function [ICODE]onStartup[/ICODE] (before last [ICODE]end[/ICODE]) add this [ICODE]ShrinesLoad()[/ICODE].
  45. [*]Open [ICODE]data/lib/core/position.lua[/ICODE].
  46. [*]Add [CODE=lua]function Position:compare(pos1, pos2)
  47. if pos1.x == pos2.x and pos1.y == pos2.y and pos1.z == pos2.z then
  48. return true
  49. end
  50. return false
  51. end
  52.  
  53. function Position.sendAnimatedText(self, message)
  54. local specs = Game.getSpectators(self, false, true, 9, 9, 8, 8)
  55. if #specs > 0 then
  56. for i = 1, #specs do
  57. local player = specs[i]
  58. player:say(message, TALKTYPE_MONSTER_SAY, false, player, self)
  59. end
  60. end
  61. end[/CODE]
  62. [*]Download [ICODE]shrines.rar[/ICODE] from attachment at the bottom of this post.
  63. [*]Copy [ICODE]shrine.lua[/ICODE] to [ICODE]data/actions/scripts/custom/shrine.lua[/ICODE].
  64. [*]Copy [ICODE]shrines.lua[/ICODE] to [ICODE]data/creaturescripts/scripts/shrines.lua[/ICODE].
  65. [*]Copy [ICODE]shrine_spawner.lua[/ICODE] to [ICODE]data/globalevents/scripts/shrine_spawner.lua[/ICODE].
  66. [/LIST]
  67. [CENTER][B][SIZE=7]Configuration[/SIZE][/B][/CENTER]
  68. Every configuration is inside [ICODE]data/actions/scripts/custom/shrine.lua[/ICODE].
  69. [ICODE]SHRINES_STORAGE_BASE[/ICODE] - this is base storage that Shrines are using, leave it or change if in use.
  70. [ICODE]SHRINES_ITEM_ID[/ICODE] - this is item / tile id used as a Shrine, see video example above to see which is used (Obsidian Statue, 7823).
  71. [ICODE]SHRINES_CONFIG[/ICODE] - here you can add, remove and adjust shrines.
  72. [ICODE][1234], [1235], [1236], [1237][/ICODE] - these are Action Ids used by shrines, they are used by script to check shrine type and set bonuses.
  73. [ICODE]effect[/ICODE] - shrine indicator, displayed on the shrine and on the player if shrine effect is active.
  74. [ICODE]storage[/ICODE] - this is needed to set which effect is player affected by. It's based on [ICODE]SHRINES_STORAGE_BASE[/ICODE] and increased for every next shrine type.
  75. [ICODE]spawnChance[/ICODE] - chance in % to spawn this particular shrine type by [ICODE]shrine_spawner.lua[/ICODE].
  76. [ICODE]duration[/ICODE] - how long will shrine effect be active when player uses it.
  77. [ICODE]bonus[/ICODE] - value in % that affects bonuses.
  78. [ICODE]text[/ICODE] - text that will appear on the shrine if active.
  79. [ICODE]message[/ICODE] - text that will appear when shrine is activated by the player.
  80. [ICODE]SHRINES_DATA[/ICODE] - here you add positions of every shrine that you added in the map editor. 4 examples are added, follow them to see how to add more.
  81. [B]!!Remember to change Action Ids in [ICODE]ShrinesPlayerEffect[/ICODE], [ICODE]Shrines_onHealthChange[/ICODE], [ICODE]Shrines_onKill[/ICODE] and [ICODE]onUse[/ICODE] if you change them in [ICODE]SHRINES_CONFIG[/ICODE]!![/B]
  82.  
  83. [CENTER][B][SIZE=7]Changelog[/SIZE][/B][/CENTER]
  84. [B][SIZE=5][1.0.3] - 2019-03-22[/SIZE][/B]
  85. [LIST]
  86. [*]Fixed HealthChange event for Power Shrine
  87. [*]Corrected installation instructions (forgot about events.xml)
  88. [/LIST]
  89. [B][SIZE=5][1.0.2] - 2019-03-20[/SIZE][/B]
  90. [LIST]
  91. [*]Removed unnecessary code
  92. [/LIST]
  93. [B][SIZE=5][1.0.1] - 2019-03-14[/SIZE][/B]
  94. [LIST]
  95. [*]Fixed [ICODE]onLogin[/ICODE] causing error
  96. [*]Added version print
  97. [*]Renamed [B]Damage Shrine[/B] to [B]Power Shrine[/B]
  98. [/LIST]
  99. [B][SIZE=5][1.0.0] - 2019-03-12[/SIZE][/B]
  100. [LIST]
  101. [*]Release version
  102. [/LIST]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement