Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [CENTER][B][SIZE=7]Item Sets[/SIZE][/B]
- Another addition known in lots of MMORPG games. By equipping items that are part of a set, bonuses are activated if more parts of the same set are equipped. You can use any item that can be equipped to be part of a set. There are 40 different bonuses that can be added. You can equip different parts of different sets and still get bonuses from all of them. Use command "!sets" to see list of all sets and their bonuses based on parts.[/CENTER]
- [MEDIA=youtube]7D-41hn22l4[/MEDIA]
- [CENTER][B][SIZE=7]Bonuses[/SIZE][/B][/CENTER]
- [LIST=1]
- [*]% Max HP
- [*]% Max MP
- [*]Magic Level
- [*]Melee Skills (all in one)
- [*]Fist Fighting
- [*]Sword Fighting
- [*]Axe Fighting
- [*]Club Fighting
- [*]Distance Fighting
- [*]Shielding
- [*]Life Steal (heal for % of dealt damage)
- [*]Experience
- [*]Physical Damage or Protection
- [*]Energy Damage or Protection
- [*]Earth Damage or Protection
- [*]Fire Damage or Protection
- [*]Ice Damage or Protection
- [*]Holy Damage or Protection
- [*]Death Damage or Protection
- [*]Elemental Damage or Protection (every element in one except physical)
- [*]Cast Flame Strike on Attack
- [*]Cast Flame Strike on Hit
- [*]Cast Ice Strike on Attack
- [*]Cast Ice Strike on Hit
- [*]Cast Terra Strike on Attack
- [*]Cast Terra Strike on Hit
- [*]Cast Death Strike on Attack
- [*]Cast Death Strike on Hit
- [*]Cast Energy Strike on Attack
- [*]Cast Energy Strike on Hit
- [*]Cast Divine Missile on Attack
- [*]Cast Divine Missile on Hit
- [/LIST]
- [CENTER][B][SIZE=7]Installation[/SIZE][/B][/CENTER]
- [LIST=1]
- [*]Open [ICODE]data/global.lua[/ICODE].
- [*]Add somewhere on top (2nd-3rd line)[CODE=lua]dofile('data/item_sets_const.lua')[/CODE]
- [*]Under that add [CODE=lua]dofile('data/item_sets.lua')[/CODE]
- [*]Open [ICODE]data/creaturescripts/creaturescripts.xml[/ICODE].
- [*]Add [CODE=xml]<event type="login" name="ItemSetsLogin" script="item_sets_core.lua" />
- <event type="healthchange" name="ItemSetsHealth" script="item_sets_core.lua" />[/CODE]
- [*]Open [ICODE]data/events/events.xml[/ICODE].
- [*]Enable [ICODE]onTargetCombat[/ICODE], [ICODE]onGainExperience[/ICODE], [ICODE]onItemMoved[/ICODE] and [ICODE]onLook[/ICODE].
- [*]Open [ICODE]data/events/scripts/creature.lua[/ICODE].
- [*]Add [ICODE]target:registerEvent("ItemSetsHealth")[/ICODE] inside [ICODE]Creature:onTargetCombat[/ICODE].
- [*]Open [ICODE]data/events/scripts/player.lua[/ICODE].
- [*]Find [ICODE]Player:onGainExperience[/ICODE] and add [ICODE]onItemSetsGainExperience(self, source, exp, rawExp)[/ICODE] at the end before [ICODE]return exp[/ICODE]
- [*]Find [ICODE]Player:onItemMoved[/ICODE] and add [ICODE]onItemSetMoved(self, item, count, fromPosition, toPosition, fromCylinder, toCylinder)[/ICODE] inside.
- [*]Find [ICODE]Player:onLook[/ICODE] and under [ICODE]local description = "You see " .. thing:getDescription(distance)[/ICODE] add [CODE=lua]description = onItemSetLook(self, thing, position, distance, description)[/CODE]
- [*]Open [ICODE]data/talkactions/talkactions.xml[/ICODE] and add [ICODE]<talkaction words="!sets" separator=" " script="sets_cmd.lua" />[/ICODE]
- [*]Download [ICODE]item_sets.rar[/ICODE] from attachment at the bottom of this post.
- [*]Copy [ICODE]item_sets_const.lua[/ICODE] to [ICODE]data/item_sets_const.lua[/ICODE].
- [*]Copy [ICODE]item_sets.lua[/ICODE] to [ICODE]data/item_sets.lua[/ICODE].
- [*]Copy [ICODE]item_sets_core.lua[/ICODE] to [ICODE]data/creaturescripts/scripts/item_sets_core.lua[/ICODE].
- [*]Copy [ICODE]sets_cmd.lua[/ICODE] to [ICODE]data/talkactions/scripts/sets_cmd.lua[/ICODE].
- [/LIST]
- [CENTER][B][SIZE=7]Configuration[/SIZE][/B][/CENTER]
- Every configuration in - [ICODE]data/item_sets.lua[/ICODE]. If you were using version previous to v1.1, just move [ICODE]ITEM_SETS[/ICODE] from [ICODE]data/creaturescripts/scripts/item_sets.lua[/ICODE] to [ICODE]data/item_sets.lua[/ICODE].
- Bonus types are located here - [ICODE]data/item_sets_const.lua[/ICODE].
- [ICODE]ITEM_SETS[/ICODE] - add sets here
- Example
- [CODE=lua]ITEM_SETS = {
- [1] = { -- set id
- name = "Leather Set", -- name of this set
- parts = { -- items that are part of this set
- {slot = CONST_SLOT_HEAD, item = 2461}, -- slot is where this item can be equipped, item is item id
- {slot = CONST_SLOT_ARMOR, item = 2467},
- {slot = CONST_SLOT_LEGS, item = 2649},
- {slot = CONST_SLOT_FEET, item = 2643}
- },
- bonuses = { -- list of bonuses based on number of parts equipped
- [1] = { -- bonuses when 1 part is equipped
- {type = BONUS_TYPE_MELEE_SKILLS, value = 1}, -- add +1 to all melee skills
- {type = BONUS_TYPE_DISTANCE_FIGHTING, value = 1}, -- add +1 to distance fighting
- {type = BONUS_TYPE_SHIELDING, value = 1}, -- add +1 to shielding
- {type = BONUS_TYPE_MAXHP, value = 5} -- add +5% max HP
- },
- [2] = { -- bonuses when 2 parts are equipped
- {type = BONUS_TYPE_MELEE_SKILLS, value = 3}, -- add +3 to all melee skills
- {type = BONUS_TYPE_DISTANCE_FIGHTING, value = 3}, -- add +3 to distance fighting
- {type = BONUS_TYPE_SHIELDING, value = 3}, -- add +3 to shielding
- {type = BONUS_TYPE_MAXHP, value = 8} -- add +8% max HP
- },
- [3] = { -- bonuses when 3 parts are equipped
- {type = BONUS_TYPE_MELEE_SKILLS, value = 5},
- {type = BONUS_TYPE_DISTANCE_FIGHTING, value = 5},
- {type = BONUS_TYPE_SHIELDING, value = 5},
- {type = BONUS_TYPE_MAXHP, value = 12}
- },
- [4] = { -- bonuses when 4 parts are equipped
- {type = BONUS_TYPE_MELEE_SKILLS, value = 8}, -- add +8 to all melee skills
- {type = BONUS_TYPE_DISTANCE_FIGHTING, value = 8}, -- add +8 to distance fighting
- {type = BONUS_TYPE_SHIELDING, value = 8}, -- add +8 to shielding
- {type = BONUS_TYPE_MAXHP, value = 15}, -- add +15% max HP
- {type = BONUS_TYPE_FLAMESTRIKE_ON_ATTACK, min = 100, max = 150, chance = 40}, -- cast Flame Strike on Attack, 100-150 damage, 40% chance
- {type = BONUS_TYPE_FLAMESTRIKE_ON_HIT, min = 100, max = 150, chance = 40} -- cast Flame Strike on Hit, 100-150 damage, 40% chance
- }
- }
- }
- }[/CODE]
- [CENTER][B][SIZE=7]Changelog[/SIZE][/B][/CENTER]
- [B][SIZE=5][1.1.1] - 2019-05-21[/SIZE][/B]
- [LIST]
- [*]Fixed item moving
- [*]Added HP and MP regeneration when switching items
- [/LIST]
- [B][SIZE=5][1.1.0] - 2019-05-19[/SIZE][/B]
- [LIST]
- [*]Improved code functionality
- [*]Moved ITEM_SETS table to separated file, so future core updates won't interfere with previously created sets
- [*]Added new bonus type - Trigger
- [*]Added 12 new bonuses - Cast on Attack and Cast on Hit: Flame Strike, Ice Strike, Terra Strike, Death Strike, Divine Missile, Energy Strike. Cast on Attack triggers when player attacks any creature (including players) while Cast on Hit triggers when player gets hit by any creature (including players).
- [/LIST]
- [B][SIZE=5][1.0.1] - 2019-03-29[/SIZE][/B]
- [LIST]
- [*]Fixed bonuses refreshing when item was unequipped by dragging on a backpack item and not the container window.
- [/LIST]
- [B][SIZE=5][1.0.0] - 2019-03-24[/SIZE][/B]
- [LIST]
- [*]Release version
- [/LIST]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement