• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

MoveEvent TFS 1.0 Increasing spell % with items

Giddran

Techical Artist
Joined
Sep 8, 2007
Messages
70
Reaction score
25
Location
Sweden
Some of you TFS 1.0 may miss the feature of directly adding spell damage as an item attribute, however there is a easy way to do this, however it will require some additional steps.

First step would be to register a creature event that register a number of storage values, as example:

In creature scripts:
Code:
<event type="login" name="Classlogon" script="classlogin.lua"/>

In classlogin.lua
Code:
function onLogin(cid)
  if getPlayerStorageValue(cid, 40000) < 0 then
  setPlayerStorageValue(cid, 40000, 1)
  setPlayerStorageValue(cid, 40101, 0)  --- All spells
  setPlayerStorageValue(cid, 40102, 0)  --- Fire
  setPlayerStorageValue(cid, 40103, 0)  --- Frost
  setPlayerStorageValue(cid, 40104, 0)  --- Earth
  setPlayerStorageValue(cid, 40105, 0)  --- Lightning
  setPlayerStorageValue(cid, 40106, 0)  --- Death
  setPlayerStorageValue(cid, 40107, 0)  --- Holy
end
end

Then some of the main work will to edit the spells that you want to work, for example the spell flame strike.

Remove:
Code:
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -0.4, 0, -0.5, 0)

Add:
Code:
local magic = 40101
local fire = 40102 -- Change this to the effecting elemental.
function onGetFormulaValues(cid, level, maglevel)
  local min = (100*( (maglevel * 0.4) + (level * 0)  + 0)) / (100 - getPlayerStorageValue(cid, fire) - getPlayerStorageValue(cid, magic))
  local max =(100*( (maglevel * 0.5) + (level * 0)  + 0)) / (100 - getPlayerStorageValue(cid, fire) - getPlayerStorageValue(cid, magic))
  return -min, -max
end
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

Last step be to use my other script located here:
http://otland.net/threads/tfs-1-0-advanced-item-set-item-management.209707/

Then all you would have to do is to add the values here, 1 point equals 1%, add the associated storage value example at [14] for example, to add % magic damage - itemStorageAddNumber = {40101, 5}

Just add one item between [1] and [10] , a special storage value at [11] and a description if you see fit. Also the starting tag [X] has to be unique in the same script.
Code:
[X] = {
        [1] = {},          --- Helmet
        [2] = {},      --- Amulet
        [3] = {},          --- Backpack
        [4] = {},      --- Armor
        [5] = {},          --- Right
        [6] = {},          --- Left
        [7] = {},      --- Legs
        [8] = {},          --- Feet
        [9] = {},          --- Ring
        [10] = {},          --- Ammo
        [11] = {16750},    --- Put a unique storage value here
        [12] = {
[1] = {},        --- Equip Text 1
[2] = {},                          --- Equip Text 2
[3] = {}            --- Equip Text 3
},         
[13] = {
[1] = {enable = true},        --- Enable All items bonus
[2] = {enable = false},        --- Enable All-1 setitems bonus
[3] = {enable = false}},        --- Enable All-2 setitems bonus
        [14] = {
[1] = {itemStorageAddNumber = {40101, 5}},     
[2] = {},     
[3] = {}
}, 
},
 
Last edited:
Been up all night? You seem to have done it! ;)

Kind Regards,
Eldin.
 
Haha ;)
I don't Think you will be getting alot of answers for this, too complicated for people to add and run. (They gotta Think alittle for themselves)
Great release, well done. I will set up a system with this combined with your other item set script and make something Epic.

Kind Regards,
Eldin.
 
This is actually really useful I've been thinking on a way to make a 3rd promotion with certain element affinity bonuses and although i would have to edit spells manually to make this work i think it's great! Would you be willing to upload your already edited default spells?
 
I'm sorry to bring back such an old thread but i'd like to know with regards to this system if anybody can answer me, how an AoE spell would be written.
 
Back
Top