strutZ
Australian OT Member {AKA Beastn}
- Joined
- Nov 16, 2014
- Messages
- 1,391
- Solutions
- 7
- Reaction score
- 550
Hello Otland!
Here is a simple script that will allow you to change the damage type of a weapon. (ideal for wands) This system uses @Non Sequitur modal window system which can be found HERE
You will have to install that in order to be able to use this system.
Tested on TFS 1.2
Special thanks to @Jano
Preview
Information on the system
It has an easy config section for you to customize it how you would like it! You just need to fill out the config table found in the action script (pictured below)
Installation
1) Install the modal window helper: [TFS 1.2] Modal Window Helper Lib (https://otland.net/threads/tfs-1-2-modal-window-helper-lib.238773/)
2) Register the script in /data/actions/actions.xml by adding this line, replacing "ITEMID" with the item you want to use:
3) Download actions-weapon_damage.lua into /data/actions/scripts and name it weapon_damage.lua
4) Add the following line to your global.lua:
5) Download lib-weapon_damage.lua into /data/actions/scripts and name it weapon_damage.lua
7) Download weapons-weapon_damage.lua into /data/weapons/scripts and name it weapon_damage.lua
6) Register the weapon in /data/weapons/weapons.xml by adding this line:
NOTE THIS LINE IS IF YOU ARE USING A WAND!
Enjoy!
Here is a simple script that will allow you to change the damage type of a weapon. (ideal for wands) This system uses @Non Sequitur modal window system which can be found HERE
You will have to install that in order to be able to use this system.
Tested on TFS 1.2
Special thanks to @Jano
Preview
Information on the system
It has an easy config section for you to customize it how you would like it! You just need to fill out the config table found in the action script (pictured below)
Lua:
-- Config
-- Set wand how the wand deals damage
DamageTypeWand = {
values = false, -- If this is set to true then it will use the min and max values. If set to false the wand will use the formula
-- Damage Values min/max
wandMinDam = 20,
wandMaxDam = 50,
-- Damage Formula
formula = {
wandMinDam = function(level, maglevel) return -((level / 5) + (maglevel * 1.4) + 8) end,
wandMaxDam = function(level, maglevel) return -((level / 5) + (maglevel * 2.2) + 14) end,
}
}
-- Modal window config and storage id
local config = {
storage = 10009,
titleMsg = "Change Weapon Damage Type",
mainMsg = "Choose a damage type from the list",
-- End Config
-- Damage Table
[1] = {element = "Holy"},
[2] = {element = "Fire"},
[3] = {element = "Death"},
[4] = {element = "Poison"},
[5] = {element = "Energy"},
[6] = {element = "Earth"},
[7] = {element = "Ice"},
}
Installation
1) Install the modal window helper: [TFS 1.2] Modal Window Helper Lib (https://otland.net/threads/tfs-1-2-modal-window-helper-lib.238773/)
2) Register the script in /data/actions/actions.xml by adding this line, replacing "ITEMID" with the item you want to use:
XML:
<action itemid="ITEMID" script="weapon_damage"/>
<action actionid="ACTIONID" script="weapon_damage"/>
3) Download actions-weapon_damage.lua into /data/actions/scripts and name it weapon_damage.lua
4) Add the following line to your global.lua:
Lua:
dofile('data/lib/weapon_damage.lua')
5) Download lib-weapon_damage.lua into /data/actions/scripts and name it weapon_damage.lua
7) Download weapons-weapon_damage.lua into /data/weapons/scripts and name it weapon_damage.lua
6) Register the weapon in /data/weapons/weapons.xml by adding this line:
NOTE THIS LINE IS IF YOU ARE USING A WAND!
XML:
<wand id="ITEM ID HERE" level="300" mana="20" script="weapon_damage.lua"><!-- Shadow's Sceptre -->
<vocation name="Sorcerer" />
</wand>
Enjoy!
Attachments
-
weapons-weapon_damage.lua1.7 KB · Views: 129 · VirusTotal
-
lib-weapon_damage.lua979 bytes · Views: 117 · VirusTotal
-
actions-weapon_damage.lua1 KB · Views: 114 · VirusTotal
Last edited by a moderator: