oen432
Legendary OT User
Item Sets
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.
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.
Bonuses
- % 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
Installation
- Open
data/global.lua
. - Add somewhere on top (2nd-3rd line)
Lua:
dofile('data/item_sets_const.lua')
- Under that add
Lua:
dofile('data/item_sets.lua')
- Open
data/creaturescripts/creaturescripts.xml
. - Add
XML:
<event type="login" name="ItemSetsLogin" script="item_sets_core.lua" /> <event type="healthchange" name="ItemSetsHealth" script="item_sets_core.lua" />
- Open
data/events/events.xml
. - Enable
onTargetCombat
,onGainExperience
,onItemMoved
andonLook
. - Open
data/events/scripts/creature.lua
. - Add
target:registerEvent("ItemSetsHealth")
insideCreature:onTargetCombat
. - Open
data/events/scripts/player.lua
. - Find
Player:onGainExperience
and addonItemSetsGainExperience(self, source, exp, rawExp)
at the end beforereturn exp
- Find
Player:onItemMoved
and addonItemSetMoved(self, item, count, fromPosition, toPosition, fromCylinder, toCylinder)
inside. - Find
Player:onLook
and underlocal description = "You see " .. thing:getDescription(distance)
addLua:description = onItemSetLook(self, thing, position, distance, description)
- Open
data/talkactions/talkactions.xml
and add<talkaction words="!sets" separator=" " script="sets_cmd.lua" />
- Download
item_sets.rar
from attachment at the bottom of this post. - Copy
item_sets_const.lua
todata/item_sets_const.lua
. - Copy
item_sets.lua
todata/item_sets.lua
. - Copy
item_sets_core.lua
todata/creaturescripts/scripts/item_sets_core.lua
. - Copy
sets_cmd.lua
todata/talkactions/scripts/sets_cmd.lua
.
Configuration
Every configuration in - data/item_sets.lua
. If you were using version previous to v1.1, just move ITEM_SETS
from data/creaturescripts/scripts/item_sets.lua
to data/item_sets.lua
.Bonus types are located here -
data/item_sets_const.lua
.ITEM_SETS
- add sets hereExample
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
}
}
}
}
Changelog
[1.1.1] - 2019-05-21- Fixed item moving
- Added HP and MP regeneration when switching items
- 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).
- Fixed bonuses refreshing when item was unequipped by dragging on a backpack item and not the container window.
- Release version
Attachments
-
item_sets-1_1_1.rar4.9 KB · Views: 288 · VirusTotal
Last edited by a moderator: