|
Mods Everything about mods |
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Mod Tutorials - Unit Features / Spell Functions
I received a private message from @BB_Shockwave, but unfortunately my response exceeded the 5000 character limit so I thought I'd put the response here in how it applies to TL and then as it applies to AP / CW / WotN.
Quote:
I think you're probably specifically referring to WotN if I'm not mistaken... It should not matter, though, if you're talking about the items below the unit's abilities - i.e. their features (I'll be referring to stuff in TL, but it should be very similar for WotN).
ALCHEMIST.ATOM (located in DATA.KFS): Code:
arena_params { features_label=cpi_alchemist_feat features_hints=poison_resistance_header/poison_resistance_hint,acid_sprays_header/acid_sprays_hint,no_melee_header/no_melee_hint,dungeon_liker_header/dungeon_liker_hint,sea_sick_header/sea_sick_hint race=dwarf . . . features=shot,humanoid resistances { physical=8 poison=33 magic=8 fire=8 } . . . } LOGIC.TXT: Code:
. . . races=human,elf,orc,dwarf,undead,demon,neutral resistances=physical,poison,magic,fire,astral features=armor,shot,mage,undead,eyeless,demon,dragon,plant,mind_immunitet,fire_immunitet,magic_immunitet,poison_immunitet,freeze_immunitet,holy,bone,golem,humanoid,beast,beauty,nonecro,barrier,archer,boss,pawn,orb,wood,cute . . . Code:
cpi_alchemist_feat=Poison Resistance, Acid Spray, No Melee Penalty, Likes Dungeons, Sea Sick. Looking further in EN(G)_UNITS_FEATURES.LNG: Code:
. . . no_melee_header=^def_hint_t0^No Melee Penalty no_melee_hint=^def_hint_t1^The creature inflicts the same damage during Melee and Ranged Attacks. . . . acid_sprays_header=^def_hint_t0^Acid Spray acid_sprays_hint=^def_hint_t1^It discharges an Acid Spray within the area of 3 cells, which burns all in its reach. An enemy has no ability to retaliate. The alchemist receives some of the bonuses which apply to archers. . . . poison_resistance_header=^def_hint_t0^Poison Resistance poison_resistance_hint=^def_hint_t1^Gives the creature +25% Resistance to Poison Damage. . . . dungeon_liker_header=^def_hint_t0^Likes Dungeons dungeon_liker_hint=^def_hint_t1^Likes dungeons: +25% Attack in dungeons. . . . sea_sick_header=^def_hint_t0^Sea Sick sea_sick_hint=^def_hint_t1^Gets sick at sea: -2 Morale. TEMPLATES.LNG (located in LOC_SES.KFS): Code:
def_hint_t1=<shadow=off><font=ft1_14><color=255,243,179><align=left>$ def_hint_t1 { moral=<gen=unit_moral_text> mdesc=<gen=unit_moral_desc> br=<br> sys=<color=222,194,94> sel=<color=250,250,240> dis=<color=138,138,132> /c=</color> res=<br><color=222,194,94><label=cpi_defense_res></color><gen=gen_unit_res> hero_lead=<color=250,250,240><gen=gen_lead_count,hero></color> lead=<color=250,250,240><gen=gen_lead_count,unit></color> unit_count=<color=250,250,240><gen=gen_lead_count></color> add=<gen=gen_lead_count,add> unit_max_count=<color=250,250,240><gen=gen_lead_count,max></color> allhp=<gen=gen_max_hp> krit=<br><color=222,194,94><label=cpi_attack_krit></color><gen=gen_unit_krit> } . . . def_hint_t0=<shadow=off><align=center><font=ft1_14><color=255,243,179>$ . . . Now for the variants to these for AP / CW / WotN. When it came to the text information files (ATOM, TXT, LNG) these were modified with the names staying the same. For the LUA functions, they used the same names for when they modified the stock TL functions. For example, spells that were in SPELLS.LUA were modified per the new AP (i.e. spells like Dispel, Bless, Divine Armor, etc.) in SPELLS.LUA. New spells were put in ADDON_SPELLS.LUA. For AP, both of these files were in SES.KFS. As it turns out, new spells were just appended to the end of SPELLS.TXT rather than creating an ADDON_SPELLS.TXT (which they could have easily done). ATOM's were still in DATA.KFS and all *.TXT in SES.KFS, and *.LNG in LOC_SES.KFS. When they went to CW, they decided to "mod" AP and add all the files to ORCS.KFS (i.e. ATOM's, TXT's, LNG's, etc.). They also created some new LNG files like EN(G)_CHAOS_DRAGON.LNG which not only has Chaos Dragon stuff, but also Shaman and Bone Dragon stuff (go figure). They also created a SPELLS_SPIRIT.TXT file to include the new Spirit Spells (note that there is an ==spells_spirit.txt line at the beginning of the CW SPELLS.TXT file to include other text files). So it is best to get a text editor with a GREP function that allows you to search for text strings in all files (this is what I have and what I needed to find stuff back in the day and now as I modded and am continuing to mod). For WotN they did similar as with CW, but instead of a single *.KFS file they put new ATOM's in SES.KFS, but added new *.LNG's to LOC_SES.KFS. Okay, now on to your second request. I'm not sure if you've realized this, but the way the game is laid out, there are a series of text files that describe objects like units, spells, features, etc. and then there are the LUA scripts that perform some sort of implementation of these kinds of things. So it sounds like you found where Ice Snake is in SPELLS.TXT, but then there are a series of lines in the "scripted" section of that spell's information that describe the LUA functions that it uses. Looking at SPELLS.TXT for WotN: Code:
. . . spell_ice_serpent { category=s profit=4 price=16000 image=book_spell_ice_serpent.png button_image=book_scroll_ice_serpent.png label=SN_ice_serpent attack=scripted school=4 hint_config=object_spell hint=spell_ice_serpent_hint hint_header=spell_ice_serpent_header scripted { script_attack=spell_ice_serpent_attack script_highlight=spell_ice_serpent_highlight script_calccells=calccells_ice_serpent attack_cursor=magicstick ad_factor=0 // use attack/defense nfeatures=magic_immunitet } params { duration=0 typedmg=glacial peri_typedmg=physical damage=130 // óðîí öåëè peri_damage=20-60 // óðîí ñîñåäÿì lvl_dmg=110 freeze=20 //âåðîÿòíîñòü çàìîðîçêè * íà óðîâåíü bleed=10 //âåðîÿòíîñòü êðîâîòå÷åíèÿ * íà óðîâåíü bonus=70 //ëå÷åíèå ëåäÿíûõ ñîçäàíèé } levels { // level = mana_cost, crystals_cost to upgrade from previous level 1=10,8 2=20,14 3=30,20 } } . . . Code:
. . . if Attack.act_feature(target, "ice_creature") then Attack.log_label("null") local delta_hp = Attack.act_get_par(target, "health") - Attack.act_hp(target) if heal > delta_hp then heal = delta_hp end Attack.act_cure(target, heal, dmgts) if Attack.act_size(target) > 1 then Attack.log("add_blog_sheal_2", "hero_name", blog_side_unit(target, 4)..Attack.hero_name(), "spell", blog_side_unit(target, 3).."<label=spell_ice_serpent_name>", "special", cure_hp, "target", blog_side_unit(target, -1)) else Attack.log("add_blog_sheal_1", "hero_name", blog_side_unit(target, 4)..Attack.hero_name(), "spell", blog_side_unit(target, 3).."<label=spell_ice_serpent_name>", "special", cure_hp, "target", blog_side_unit(target, -1)) end else . . . Code:
. . . races=human,elf,orc,dwarf,undead,demon,neutral,lizard,viking resistances=physical,poison,magic,fire,glacial,astral features=armor,shot,mage,undead,eyeless,demon,dragon,plant,mind_immunitet,fire_immunitet,magic_immunitet,poison_immunitet,freeze_immunitet,scare_immunitet,holy,bone,golem,humanoid,beast,nonecro,barrier,archer,boss,pawn,orb,mech,summoned_creature,rune_knowledge,ice_creature,light_step,ghost . . . So I'm not sure why it wouldn't be working unless it is changed in the patches or the unit is not on the above list. Okay, so there you have it! If you have any comments or questions, don't hesitate to ask! /C\/C\ |
|
|