- Joined
- Feb 17, 2014
- Messages
- 232
- Solutions
- 17
- Reaction score
- 319
Installation:
1. data/lib/lib.lua add:
2. data/creaturescripts/creaturescripts.xml add:
3. data/actions/actions.xml add (you can change item ids, default ones are some unused runes):
4. data/events/events.xml make sure those are enabled:
5. data/events/scripts/player.lua:
below:
add:
below:
add:
6. data/scripts/eventcallbacks/monster/default_onDropLoot.lua:
change:
to:
below:
add:
7. data/scripts/eventcallbacks/player/deafult_onLook.lua:
below:
add:
8. data/lib/core/container.lua:
change whole function:
to:
9. data/events/scripts/creature.lua:
below:
add:
10. unpack scripts from item_upgrade_system.zip to correct folders (same as in zip)
11 buy my onlyfans
1. data/lib/lib.lua add:
Lua:
-- Item upgrade system
dofile('data/lib/item_upgrade_system/init.lua')
2. data/creaturescripts/creaturescripts.xml add:
XML:
<event type="login" name="UpgradeSystemLogin" event="script" script="item_upgrade_system/onLogin.lua" />
<event type="kill" name="UpgradeSystemKill" event="script" script="item_upgrade_system/onKill.lua" />
<event type="healthchange" name="UpgradeSystemHealthChange" event="script" script="item_upgrade_system/onHealthChange.lua" />
<event type="logout" name="UpgradeSystemLogout" script="item_upgrade_system/onLogout.lua" />
3. data/actions/actions.xml add (you can change item ids, default ones are some unused runes):
XML:
<action itemid="2284" script="item_upgrade_system/upgrade.lua"/>
<action itemid="2276" script="item_upgrade_system/add_enchant.lua"/>
<action itemid="2270" script="item_upgrade_system/remove_enchant.lua"/>
<action itemid="2298" script="item_upgrade_system/remove_enchants.lua"/>
<action itemid="2272" script="item_upgrade_system/reroll_enchant.lua"/>
<action itemid="2296" script="item_upgrade_system/reroll_enchants.lua"/>
<action itemid="2312" script="item_upgrade_system/reroll_tier.lua"/>
4. data/events/events.xml make sure those are enabled:
XML:
<event class="Creature" method="onTargetCombat" enabled="1" />
<event class="Player" method="onLook" enabled="1" />
<event class="Monster" method="onDropLoot" enabled="1" />
<event class="Player" method="onItemMoved" enabled="1" />
<event class="Player" method="onGainExperience" enabled="1" />
5. data/events/scripts/player.lua:
below:
Lua:
function Player:onItemMoved(item, count, fromPosition, toPosition, fromCylinder, toCylinder)
Lua:
self:onItemMovedUpgradeSystem(item, count, fromPosition, toPosition, fromCylinder, toCylinder)
below:
Lua:
-- Apply experience stage multiplier
exp = exp * Game.getExperienceStage(self:getLevel())
add:
Lua:
exp = self:onGainExperienceUpgradeSystem(source, exp, rawExp)
6. data/scripts/eventcallbacks/monster/default_onDropLoot.lua:
change:
Lua:
for i = 1, #monsterLoot do
local item = corpse:createLootItem(monsterLoot[i])
if not item then
print('[Warning] DropLoot:', 'Could not add loot item to corpse.')
end
end
to:
Lua:
for i = 1, #monsterLoot do
local item = corpse:createLootItem(monsterLoot[i])
if item ~= nil and item:getType():isUpgradable() then
local randomItemLevel = getRandomItemLevel(mType:getHealth(), mType:getExperience())
item:setItemLevel(randomItemLevel)
item:rollItemTier(true)
end
end
below:
Lua:
if player then
add:
Lua:
local itemLevel = calculateItemLevel(mType:getHealth(), mType:getExperience())
local additionalLoot = getAdditionalLoot(player:getLevel(), itemLevel)
if additionalLoot ~= nil then
corpse:addItem(additionalLoot, 1)
end
7. data/scripts/eventcallbacks/player/deafult_onLook.lua:
below:
Lua:
local description = "You see " .. thing:getDescription(distance)
add:
Lua:
if thing:isPlayer() then
description = thing:onLookUpgradeSystem(description)
end
8. data/lib/core/container.lua:
change whole function:
Lua:
function Container.createLootItem(self, item)
to:
Lua:
function Container.createLootItem(self, item)
if self:getEmptySlots() == 0 then
return nil
end
local itemCount = 0
local randvalue = getLootRandom()
if randvalue < item.chance then
if ItemType(item.itemId):isStackable() then
itemCount = randvalue % item.maxCount + 1
else
itemCount = 1
end
end
if itemCount > 0 then
local tmpItem = self:addItem(item.itemId, math.min(itemCount, 100))
if not tmpItem then
return nil
end
if tmpItem:isContainer() then
for i = 1, #item.childLoot do
if not tmpItem:createLootItem(item.childLoot[i]) then
tmpItem:remove()
return nil
end
end
end
if item.subType ~= -1 then
tmpItem:setAttribute(ITEM_ATTRIBUTE_CHARGES, item.subType)
end
if item.actionId ~= -1 then
tmpItem:setActionId(item.actionId)
end
if item.text and item.text ~= "" then
tmpItem:setText(item.text)
end
return tmpItem
end
return nil
end
9. data/events/scripts/creature.lua:
below:
Lua:
function Creature:onTargetCombat(target)
Lua:
Creature:onTargetCombatUpgradeSystem(target)
10. unpack scripts from item_upgrade_system.zip to correct folders (same as in zip)
11 buy my onlyfans
Attachments
-
item_upgrade_system.zip18.7 KB · Views: 90 · VirusTotal
Last edited: