Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [CENTER][B][SIZE=7]Shrines[/SIZE][/B]
- Shrines are new objects that can be added on the map. After activation, shrine becomes inactive and can change type upon reactivation.[/CENTER]
- [B][SIZE=5]Power Shrine[/SIZE][/B]
- [LIST]
- [*]30% chance to spawn
- [*]25% damage bonus
- [*]30 seconds duration
- [/LIST]
- [B][SIZE=5]Protection Shrine[/SIZE][/B]
- [LIST]
- [*]15% chance to spawn
- [*]25% damage reduction
- [*]15 seconds duration
- [/LIST]
- [B][SIZE=5]Recovery Shrine[/SIZE][/B]
- [LIST]
- [*]5% chance to spawn
- [*]10% of Max HP & MP every second
- [*]20 seconds duration
- [/LIST]
- [B][SIZE=5]Wisdom Shrine[/SIZE][/B]
- [LIST]
- [*]20% chance to spawn
- [*]25% bonus experience
- [*]20 seconds duration
- [/LIST]
- [MEDIA=youtube]xNNaUqGDeRg[/MEDIA]
- [CENTER]
- [B][SIZE=7]Installation[/SIZE][/B][/CENTER]
- [LIST=1]
- [*]Open [ICODE]data/actions/actions.xml[/ICODE].
- [*]Add [CODE=xml]<action itemid="7823" script="custom/shrine.lua" />[/CODE]
- [*]Open [ICODE]data/creaturescripts/creaturescripts.xml[/ICODE].
- [*]Add [CODE=xml]<event type="login" name="ShrinesLogin" script="shrines.lua" />
- <event type="logout" name="ShrinesLogout" script="shrines.lua" />
- <event type="kill" name="ShrinesKill" script="shrines.lua" />
- <event type="death" name="ShrinesDeath" script="shrines.lua" />
- <event type="healthchange" name="ShrinesHealth" script="shrines.lua" />[/CODE]
- [*]Open [ICODE]data/globalevents/globalevents.xml[/ICODE].
- [*]Add (60000 = 1 minute) [CODE=xml]<globalevent name="ShrineSpawn" interval="60000" script="shrine_spawner.lua"/>[/CODE]
- [*]Open [ICODE]data/globalevents/scripts/startup.lua[/ICODE].
- [*]At the end of the function [ICODE]onStartup[/ICODE] (before last [ICODE]end[/ICODE]) add this [ICODE]ShrinesLoad()[/ICODE].
- [*]Open [ICODE]data/lib/core/position.lua[/ICODE].
- [*]Add [CODE=lua]function Position:compare(pos1, pos2)
- if pos1.x == pos2.x and pos1.y == pos2.y and pos1.z == pos2.z then
- return true
- end
- return false
- end
- function Position.sendAnimatedText(self, message)
- local specs = Game.getSpectators(self, false, true, 9, 9, 8, 8)
- if #specs > 0 then
- for i = 1, #specs do
- local player = specs[i]
- player:say(message, TALKTYPE_MONSTER_SAY, false, player, self)
- end
- end
- end[/CODE]
- [*]Download [ICODE]shrines.rar[/ICODE] from attachment at the bottom of this post.
- [*]Copy [ICODE]shrine.lua[/ICODE] to [ICODE]data/actions/scripts/custom/shrine.lua[/ICODE].
- [*]Copy [ICODE]shrines.lua[/ICODE] to [ICODE]data/creaturescripts/scripts/shrines.lua[/ICODE].
- [*]Copy [ICODE]shrine_spawner.lua[/ICODE] to [ICODE]data/globalevents/scripts/shrine_spawner.lua[/ICODE].
- [/LIST]
- [CENTER][B][SIZE=7]Configuration[/SIZE][/B][/CENTER]
- Every configuration is inside [ICODE]data/actions/scripts/custom/shrine.lua[/ICODE].
- [ICODE]SHRINES_STORAGE_BASE[/ICODE] - this is base storage that Shrines are using, leave it or change if in use.
- [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).
- [ICODE]SHRINES_CONFIG[/ICODE] - here you can add, remove and adjust shrines.
- [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.
- [ICODE]effect[/ICODE] - shrine indicator, displayed on the shrine and on the player if shrine effect is active.
- [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.
- [ICODE]spawnChance[/ICODE] - chance in % to spawn this particular shrine type by [ICODE]shrine_spawner.lua[/ICODE].
- [ICODE]duration[/ICODE] - how long will shrine effect be active when player uses it.
- [ICODE]bonus[/ICODE] - value in % that affects bonuses.
- [ICODE]text[/ICODE] - text that will appear on the shrine if active.
- [ICODE]message[/ICODE] - text that will appear when shrine is activated by the player.
- [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.
- [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]
- [CENTER][B][SIZE=7]Changelog[/SIZE][/B][/CENTER]
- [B][SIZE=5][1.0.3] - 2019-03-22[/SIZE][/B]
- [LIST]
- [*]Fixed HealthChange event for Power Shrine
- [*]Corrected installation instructions (forgot about events.xml)
- [/LIST]
- [B][SIZE=5][1.0.2] - 2019-03-20[/SIZE][/B]
- [LIST]
- [*]Removed unnecessary code
- [/LIST]
- [B][SIZE=5][1.0.1] - 2019-03-14[/SIZE][/B]
- [LIST]
- [*]Fixed [ICODE]onLogin[/ICODE] causing error
- [*]Added version print
- [*]Renamed [B]Damage Shrine[/B] to [B]Power Shrine[/B]
- [/LIST]
- [B][SIZE=5][1.0.0] - 2019-03-12[/SIZE][/B]
- [LIST]
- [*]Release version
- [/LIST]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement