Popular Post Codex 10 Posted November 29, 2016 Popular Post Share Posted November 29, 2016 I just discovered this game yesterday 11-27-16 and its pretty cool, I also noticed it had a script directory which eventually led me to this community. I tried all the classes, one which I enjoyed the most was Dragon Mage and this one spell called Dragon Berserk. The only bad thing about the spell is it had a long cool down which really didn't make it that useful. So I took a look at the text files in the scripts directory and noticed they are all written in lua. So I started to mess around with some of the files, given I have a background in programming, the worst that can happen is I would have to reinstall the game. So I thought I would investigate these files and see if I could reduce the cool down of this spell. As you can see from the picture below I've done just that reduced the cool down to 1 second. I've also increased the duration 86,401 seconds basically set it to infinity (for a day) The way I did this is actually quite simple, all I did was open up spells.txt and looked for the spell mgr.defineSpell( "dm_dm_berserkerform", { eiStateName = "cSpellCast", fxTypeCast = "FX_DM_MORPH_BERSERKER_C", fxTypeSpell = "FX_DM_MORPH_BERSERKER", fxTypeCastSpecial = "", duration = 10.000000, animType = "ANIM_TYPE_SM17", animTypeApproach = "", animTypeRide = "", animTypeSpecial = "ANIM_TYPE_RIDESM17-SPECIAL", causesSpellDamage = 1, tokens = { entry0 = {"et_self_shapeshift", 1000, 1995, 0, 41 }, entry1 = {"et_duration_sec", 2750, 25, 0, 8 }, entry2 = {"et_life_leech", 75, 25, 0, 9 }, entry3 = {"et_AWVW_rel", 0, 100, 0, 5 }, entry4 = {"et_charge_shapeshift", 120, 0, 0, 5 }, entry5 = {"et_weapondamage_physical", 0, 25, 0, 9 }, entry6 = {"et_charge_shapeshift", 50, 0, 1, 5 }, entry7 = {"et_addAttackspeed", 200, 0, 2, 41 }, entry8 = {"et_duration_sec", 1000, 10, 3, 8 }, entry9 = {"et_life_leech_rel", 35, 0, 4, 9 }, entry10 = {"et_charge_shapeshift", 50, 0, 5, 5 }, entry11 = {"et_addspell_blutrausch", 1000, 0, 6, 5 }, entry12 = {"et_armor_any_rel", 0, 50, 0, 41 }, entry13 = {"et_life_buff", 150, 260, 0, 9 }, entry14 = {"et_chance_surehit", 100, 2, 0, 5 }, entry15 = {"et_physical_to_magic", 250, 0, 0, 5 }, }, fightDistance = 0.000000, aspect = "EA_DM_DRAGONMAGIC", cooldown = 40.000000 soundProfile = 0, cost_level = 250, cost_base = 500, focus_skill_name = "skill_DM_dragonmagic_focus", lore_skill_name = "skill_DM_dragonmagic_lore", spellClass = "cSpellDmMorph", spellcontroltype = "eCAtype_b_boost_self", sorting_rank = 0, }) And made the changes, please note I did not remove the original values all I did was comment them out and apply the changes. mgr.defineSpell( "dm_dm_berserkerform", { eiStateName = "cSpellCast", fxTypeCast = "FX_DM_MORPH_BERSERKER_C", fxTypeSpell = "FX_DM_MORPH_BERSERKER", fxTypeCastSpecial = "", duration = 1.000000, -- 10.000000 -- the 10 seconds might just be a default value animType = "ANIM_TYPE_SM17", animTypeApproach = "", animTypeRide = "", animTypeSpecial = "ANIM_TYPE_RIDESM17-SPECIAL", causesSpellDamage = 1, tokens = { entry0 = {"et_self_shapeshift", 1000, 1995, 0, 41 }, entry1 = {"et_duration_sec", (6000 * 60 * 24), 25, 0, 8 }, -- {"et_duration_sec", 2750, 25, 0, 8 }, entry2 = {"et_life_leech", 75, 25, 0, 9 }, entry3 = {"et_AWVW_rel", 0, 100, 0, 5 }, entry4 = {"et_charge_shapeshift", 120, 0, 0, 5 }, entry5 = {"et_weapondamage_physical", 0, 25, 0, 9 }, entry6 = {"et_charge_shapeshift", 50, 0, 1, 5 }, entry7 = {"et_addAttackspeed", 200, 0, 2, 41 }, entry8 = {"et_duration_sec", 1000, 10, 3, 8 }, entry9 = {"et_life_leech_rel", 35, 0, 4, 9 }, entry10 = {"et_charge_shapeshift", 50, 0, 5, 5 }, entry11 = {"et_addspell_blutrausch", 1000, 0, 6, 5 }, entry12 = {"et_armor_any_rel", 0, 50, 0, 41 }, entry13 = {"et_life_buff", 150, 260, 0, 9 }, entry14 = {"et_chance_surehit", 100, 2, 0, 5 }, entry15 = {"et_physical_to_magic", 250, 0, 0, 5 }, }, fightDistance = 0.000000, aspect = "EA_DM_DRAGONMAGIC", cooldown = 1.000000, -- 40.000000 (cool down period) soundProfile = 0, cost_level = 1, -- 250 (cost level & cost base make up the regen) cost_base = 1, -- 500 focus_skill_name = "skill_DM_dragonmagic_focus", lore_skill_name = "skill_DM_dragonmagic_lore", spellClass = "cSpellDmMorph", spellcontroltype = "eCAtype_b_boost_self", sorting_rank = 0, }) 3 Link to comment
Popular Post Flix 5,116 Posted November 29, 2016 Popular Post Share Posted November 29, 2016 Neat. Dragon Mage is also my favorite. Here are some other threads on the same topic: http://darkmatters.org/forums/index.php?/topic/16309-dm-dragon-berserk-tweaks/ http://darkmatters.org/forums/index.php?/topic/22054-how-to-mod-sacred-2-dragon-magic/ Welcome to the forums. I hope you enjoy the game and the relative ease of modding the scripts. 2 1 Link to comment
Codex 10 Posted November 29, 2016 Author Share Posted November 29, 2016 (edited) I intend to break down each field so that either myself or another member can build a tool which will allow you to automatically update the spells as needed. For instance in the above example: entry0 = {"et_self_shapeshift", 1000, 1995, 0, 41 }, 1995 refers to the creatures id, just using notepad++ I searched the entire spells document for that value where it only found 1 occurrence to the value. This means that its a unique id which only applies to this spell. So I did a directory search on the value 1995 and found in creatures.txt amongst other places, more data in relation to the spell. mgr.createCreature { id = 1995, itemtype_id = 12484, name = "spell_dm_berserker_shapeshift", behaviour = "Invalid", dangerclass = 7, groupmaxcount = 1, elite_creature_id = 1995, probabilityforelite = 0.000000, rank = 0, tenergy_creature_id = 1995, livesremaining = 0, unconscioustime = 20, palettebits = "1111111111111111", monstertype = 0, faction_id = 1, modelscale = 1.000000, rise_from_ground = 0, has_corpse = 1, has_soul = 1, can_strafe = 0, } It could just be a coincidence but spell_dm_berserker_shapeshift does seem to relate to the original spell. Next if I take the itemtype id value found in that block of code and I do a search in the itemtype.txt, I find this. newItemType = { -- standard info renderfamily = "RENDERFAM_CREATURE", renderprio = 0, family = "FAMILY_CREATURE", subfamily = "SUBFAM_LIFE_DRAGON", classification = "CLF_DEFAULT", flags = "FLAG_HASPREVIEWIMAGE", weargroup = "WEARGROUP_INVALID", -- 3d model + animation info model0Data = { name = "models/npc/monsters/draconian/h_draconian.GR2", user = "WEARGROUP_INVALID", }, -- logic bounding box logicBox = { minx=-34.466, miny=-56.174, minz=-0.641, maxx=29.876, maxy=38.901, maxz=94.403, }, dangerclass = 0, } mgr.typeCreate(12484, newItemType); All of this data is relevant its just a matter of picking things apart to see how they relate to one another. Edited November 29, 2016 by Codex 1 Link to comment
Codex 10 Posted November 29, 2016 Author Share Posted November 29, 2016 Some where down the road all of these values can be simplified, in that functions can be created to automatically execute these values so we won't have to search for them all. I've completely re-written game server frameworks to do just that, lua is pretty flexible and easy to work with. Link to comment
Codex 10 Posted November 29, 2016 Author Share Posted November 29, 2016 So for instance if I were to create a test function, labeled testFunction. function testFunction() return (6000 * 60 * 24) end Then call it from within entry1, it will execute and return a value of 86400, which will then be applied to the duration value for the spell. entry1 = {"et_duration_sec", testFunction(), 25, 0, 8 }, Creating a structure in this fashion allows us to consolidate but also easily manage or update the code. The way lua works is that the code is evaluated way before it is sent to whatever called the document, this means that we can write code which manipulates the values prior to sending it to the application. (hopefully that makes sense) Link to comment
Codex 10 Posted November 29, 2016 Author Share Posted November 29, 2016 (edited) Progress so far, if you add the -console in the shortcut to the target.Then while at any point in the game you hit tilde (~) key and a persistent window will overlap the screen, then type help, that is as far as I've gotten so far Currently I am running one of the dll's (s2logic.dll) through a debugger. This is how I came to the conclusion that the game might have a debug window.Initially I did a search for et_duration_sec in notepad++ in txt, exe & dll file types, which lead me to this dll, then I opened it up in x64dbg and did a search for all related strings. Edited November 29, 2016 by Codex Link to comment
Codex 10 Posted November 29, 2016 Author Share Posted November 29, 2016 (edited) I went in the console and typed SYS EXPORTSECTORMAPS and this popped up. Edited November 29, 2016 by Codex 1 Link to comment
Flix 5,116 Posted November 29, 2016 Share Posted November 29, 2016 I intend to break down each field so that either myself or another member can build a tool which will allow you to automatically update the spells as needed. A spell editor... well more power to you. It would be a marvelous tool indeed. I would love it if you could figure out what the fourth number in the spell token string signifies. The first number is (usually) the starting value, the second number is (usually) the gain on level up, the third number signifies a modification, but the fourth number is mystery to me. All of this data is relevant its just a matter of picking things apart to see how they relate to one another. Correct, that is why the Berserk can be replaced with a different form like a Werewolf. 1 Link to comment
gogoblender 3,069 Posted November 30, 2016 Share Posted November 30, 2016 I just discovered this game yesterday 11-27-16 and its pretty cool, I also noticed it had a script directory which eventually led me to this community. I tried all the classes, one which I enjoyed the most was Dragon Mage and this one spell called Dragon Berserk. The only bad thing about the spell is it had a long cool down which really didn't make it that useful. So I took a look at the text files in the scripts directory and noticed they are all written in lua. So I started to mess around with some of the files, given I have a background in programming, the worst that can happen is I would have to reinstall the game. So I thought I would investigate these files and see if I could reduce the cool down of this spell. As you can see from the picture below I've done just that reduced the cool down to 1 second. I've also increased the duration 86,401 seconds basically set it to infinity (for a day) The way I did this is actually quite simple, all I did was open up spells.txt and looked for the spell mgr.defineSpell( "dm_dm_berserkerform", { eiStateName = "cSpellCast", fxTypeCast = "FX_DM_MORPH_BERSERKER_C", fxTypeSpell = "FX_DM_MORPH_BERSERKER", fxTypeCastSpecial = "", duration = 10.000000, animType = "ANIM_TYPE_SM17", animTypeApproach = "", animTypeRide = "", animTypeSpecial = "ANIM_TYPE_RIDESM17-SPECIAL", causesSpellDamage = 1, tokens = { entry0 = {"et_self_shapeshift", 1000, 1995, 0, 41 }, entry1 = {"et_duration_sec", 2750, 25, 0, 8 }, entry2 = {"et_life_leech", 75, 25, 0, 9 }, entry3 = {"et_AWVW_rel", 0, 100, 0, 5 }, entry4 = {"et_charge_shapeshift", 120, 0, 0, 5 }, entry5 = {"et_weapondamage_physical", 0, 25, 0, 9 }, entry6 = {"et_charge_shapeshift", 50, 0, 1, 5 }, entry7 = {"et_addAttackspeed", 200, 0, 2, 41 }, entry8 = {"et_duration_sec", 1000, 10, 3, 8 }, entry9 = {"et_life_leech_rel", 35, 0, 4, 9 }, entry10 = {"et_charge_shapeshift", 50, 0, 5, 5 }, entry11 = {"et_addspell_blutrausch", 1000, 0, 6, 5 }, entry12 = {"et_armor_any_rel", 0, 50, 0, 41 }, entry13 = {"et_life_buff", 150, 260, 0, 9 }, entry14 = {"et_chance_surehit", 100, 2, 0, 5 }, entry15 = {"et_physical_to_magic", 250, 0, 0, 5 }, }, fightDistance = 0.000000, aspect = "EA_DM_DRAGONMAGIC", cooldown = 40.000000 soundProfile = 0, cost_level = 250, cost_base = 500, focus_skill_name = "skill_DM_dragonmagic_focus", lore_skill_name = "skill_DM_dragonmagic_lore", spellClass = "cSpellDmMorph", spellcontroltype = "eCAtype_b_boost_self", sorting_rank = 0, }) And made the changes, please note I did not remove the original values all I did was comment them out and apply the changes. mgr.defineSpell( "dm_dm_berserkerform", { eiStateName = "cSpellCast", fxTypeCast = "FX_DM_MORPH_BERSERKER_C", fxTypeSpell = "FX_DM_MORPH_BERSERKER", fxTypeCastSpecial = "", duration = 1.000000, -- 10.000000 -- the 10 seconds might just be a default value animType = "ANIM_TYPE_SM17", animTypeApproach = "", animTypeRide = "", animTypeSpecial = "ANIM_TYPE_RIDESM17-SPECIAL", causesSpellDamage = 1, tokens = { entry0 = {"et_self_shapeshift", 1000, 1995, 0, 41 }, entry1 = {"et_duration_sec", (6000 * 60 * 24), 25, 0, 8 }, -- {"et_duration_sec", 2750, 25, 0, 8 }, entry2 = {"et_life_leech", 75, 25, 0, 9 }, entry3 = {"et_AWVW_rel", 0, 100, 0, 5 }, entry4 = {"et_charge_shapeshift", 120, 0, 0, 5 }, entry5 = {"et_weapondamage_physical", 0, 25, 0, 9 }, entry6 = {"et_charge_shapeshift", 50, 0, 1, 5 }, entry7 = {"et_addAttackspeed", 200, 0, 2, 41 }, entry8 = {"et_duration_sec", 1000, 10, 3, 8 }, entry9 = {"et_life_leech_rel", 35, 0, 4, 9 }, entry10 = {"et_charge_shapeshift", 50, 0, 5, 5 }, entry11 = {"et_addspell_blutrausch", 1000, 0, 6, 5 }, entry12 = {"et_armor_any_rel", 0, 50, 0, 41 }, entry13 = {"et_life_buff", 150, 260, 0, 9 }, entry14 = {"et_chance_surehit", 100, 2, 0, 5 }, entry15 = {"et_physical_to_magic", 250, 0, 0, 5 }, }, fightDistance = 0.000000, aspect = "EA_DM_DRAGONMAGIC", cooldown = 1.000000, -- 40.000000 (cool down period) soundProfile = 0, cost_level = 1, -- 250 (cost level & cost base make up the regen) cost_base = 1, -- 500 focus_skill_name = "skill_DM_dragonmagic_focus", lore_skill_name = "skill_DM_dragonmagic_lore", spellClass = "cSpellDmMorph", spellcontroltype = "eCAtype_b_boost_self", sorting_rank = 0, }) Welcome to DarkMatters, Codex! I never did modding but loved playing, along with the friends that came with it, this wonderful community just can't be beat Enjoy the boards gogo Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now