oen432
Legendary OT User
I'm getting more free time now so I'm back with new stuff, starting with update to Item Sets.
[1.1.0] - 2019-05-19
Bonus types are located here -
Example
[1.1.0] - 2019-05-19
- 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).
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 replacelocal description = "You see " .. thing:getDescription(distance)
to thisLua:local description = nil local itemSetLook = onItemSetLook(self, thing, position, distance) if itemSetLook ~= nil then description = itemSetLook else description = "You see " .. thing:getDescription(distance) end
- 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
.Example
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
}
}
}
}
Attachments
-
item_sets-1_1_0.rar4.8 KB · Views: 20 · VirusTotal
Last edited: