forums | blogs | polls | tutorials | downloads | rules | help

Error message

Deprecated function: The each() function is deprecated. This message will be suppressed on further calls in remember_me_form_alter() (line 78 of /var/www/siegetheday.org/sites/all/modules/contrib/remember_me/remember_me.module).

Items enchantments applying

HardLess's picture

Hi,

I'm trying to make items that apply their enchantments as spell could do.
So applying effects on the owner of the item and apply the enchantments and the whole party, and apply it thanks to a spell components ( for example : spell_mass_echant or something ).
And the enchantments need to go off if the items is no longer on the character.

Something like this :

[t:template,n:book]
{
doc = "book_magic_aura_regen";
specializes = base_book_spell;
[aspect]
{
// aspect @param
}
[common]
{
// common @param
}
[gui]
{
// gui @param
}
[magic]
{
[enchantments]
{
// Some enchantements
}
}
[spell_component]
{
// spell component @param
}
}

I'm really new to skrit, so I'm not able to create my own component I don't really know how it works.

Thank You.

Excuse my english.

HardLess

that's not skrit, that's a template. so in other words u are trying to make an aura on a spell book or weapon?

HardLess's picture

I know that this part is a template, what i'm not able to do by myself is to create my own spell component and this part is skrit. The template here is just to show you the idea.

So, yes, I'm trying to create an aura (so the enchantment is applied on characters who are next to the owner) on a spellbook.

we need more code of what you really want to do, to try to help you better. buffs and debuffs work the same way, broken world has weapons that do buffs and debuffs, as for the auras in ds2 they are more power related, breaking the powers down and making them spells is more complex

HardLess's picture

This is the template of the spell book aura i'm trying to do.

[t:template,n:book_glb_magic_aura_regeneration_hard]

{
doc = "book_magic_aura_regen";
specializes = base_book_spell;
[aspect]
{
[textures]
{
0 = b_i_glb_book-magic-26;
}
}
[common]
{
screen_name = "Aura Spell Book : Regeneration";
}
[gui]
{
equip_requirements = combat magic:0.0|nature magic:0.0;
item_level = 0.0;
inventory_icon = b_gui_ig_i_it_magic-book-21;
}
[magic]
{
[enchantments]
{
[*]
{
alteration = alter_mana_recovery_unit;
description = "Aquatic Embrace";
duration = #infinite;
multiply_value = true;
party_active = true;
value = 1 + (0.2 * (0.5 + 0.5 * ((#magic - 26) * 0.033)) * (1.0 + (#Increased_Defensive_Enhancement_Power * .01)));
}
[aquatic_embrace_a_mana_regen]
{
alteration = alter_mana_recovery_unit;
description = "+% Mana Regeneration Rate";
duration = 0;
value = 20.0 * (0.5 + 0.5 * ((#magic - 26) * 0.033)) * (1.0 + (#Increased_Defensive_Enhancement_Power * .01));
}
[*]
{
alteration = alter_life_recovery_unit;
description = "Eathern Embrace";
duration = #infinite;
multiply_value = true;
party_active = true;
value = 1 + (0.2 * (0.5 + 0.5 * ((#magic - 26) * 0.033)) * (1.0 + (#Increased_Defensive_Enhancement_Power * .01)));
}
[bquatic_embrace_a_mana_regen]
{
alteration = alter_life_recovery_unit;
description = "+% Health Regeneration Rate";
duration = 0;
value = 20.0 * (0.5 + 0.5 * ((#magic - 26) * 0.033)) * (1.0 + (#Increased_Defensive_Enhancement_Power * .01));
}
}
}
[spell_aura]
{
aura_ffx = ffx_spell_earthen_embrace_charge;
aura_actor_ffx = ffx_spell_earthen_embrace_cast;
description = "Aura of Regeneration";
aura_radius = 10.0;
aura_value = 10.0;
aura_state_name = "eathen_aura";
}
}

And, the "spell_aura" component skrit is in Dungeon Siege 2. So if you want me to post it I can.

no need to post the skrit, I know that the magic enchantments work even without the aura, the question is, why doesn't the aura work?, have u re-equipped the spell book?

HardLess's picture

The enchantments are applied on the owner of the spell book but the aura doesn't affect the party members.

Does the "spell_aura" need to be casted, so it doesn't apply on the other members because the game understand the template as a normal template with an enchantment on the spell book ?

spell_mass_enchant may work better with spell books, spell_aura may work better in a spell, not sure it can be cast from a spellbook, spell_aura is always active as long as the character don't die, so even if u unequip the item it would stay active.

[magic]
	{
		apply_enchantments = false;
		cast_range = 10;
		cast_reload_delay = 3.0;
		cast_sub_animation = 4;
		effect_duration = -1;  // -1 = infinite is forever
		is_one_shot = true;
		can_autocast = true;
		mana_cost = 0;
		mana_cost_modifier = ((1.12 * #clamped_intel) - 2.0) * ((100 - #Decreased_Mana_Cost) * .01);	// 25 % mana
		required_level = 0;
		max_intel = 500;
		max_level = 100;
		requires_line_of_sight = false;
		use_intel_level = false;
		speed_bias = 1;
		target_type_flags = tt_human_party_member | tt_summoned;
		target_type_flags_not = tt_unconscious_friend | tt_dead_friend | tt_conscious_enemy;
		usage_context_flags = uc_defensive;
		state_name = aquaticembrace;
		require_state_check = true;
		is_buff = true;

         [enchantments]
		{
			[*]
			{
				alteration = alter_generic;
				duration = 1200 * (0.5 + 0.5 * ((#magic - 26) * 0.033)) * (1.0 + (#Increased_Defensive_Enhancement_Duration * .01));
				value = 0;
				description = "Aquatic Embrace buff effect.";
				custom_effect = "aquatic_embrace";
				custom_effect_skrit = world\global\enchantments\actor_enchant.skrit?enchanted_ffx=ffx_spell_aquatic_embrace;
			}
			[*]
			{
				alteration = alter_mana_recovery_unit;
				description = "Aquatic Embrace";
				duration = 1200 * (0.5 + 0.5 * ((#magic - 26) * 0.033)) * (1.0 + (#Increased_Defensive_Enhancement_Duration * .01));
				multiply_value = true;
				party_active = true;
				// Final Value = Maximum Value * (.5 + .5 * ((Level - 0) / 30)) (See section heading for details)
				value = 1 + (0.2 * (0.5 + 0.5 * ((#magic - 26) * 0.033)) * (1.0 + (#Increased_Defensive_Enhancement_Power * .01)));
			}
			[aquatic_embrace_a_mana_regen]
			{
				alteration = alter_mana_recovery_unit;
				description = "+% Mana Regeneration Rate";
				duration = 0;
				value = 20.0 * (0.5 + 0.5 * ((#magic - 26) * 0.033)) * (1.0 + (#Increased_Defensive_Enhancement_Power * .01));
			}
		}
	}
	[spell_mass_enchant]
	{
		charge_ffx		= ffx_spell_earthen_embrace_charge;
		charge_efct		= efct_spell_earthen_embrace_charge;
		radius			= 10.0;
		description		= "Aura of Regeneration";
		target_friends	= true;
		group_charge_ffx = true;
	}

thats an example that needs reworked with your enchantments

Not an easy task for someone new to skrit. Maybe trying something more simple will be a better beginning. I don't know how this could be done, but I'm not good at skrit. @Darkelf I know you can delete it after unequipping, but I don't know how.

Edit: the clues for deleting it from unequiping might be in the sfx enchantment skrits for bows, swords, etc. Maybe it's not as hard as I thought. The skrit to the template that Dark posted might not be too hard to tweak with a reference to how the sfx skrit for equipable items works.

HardLess's picture

The game crash with my template base on your post. I'll work a bit on it to understand why... And then I'll give you a feedback about it.

See you.

Thanks :).

keke, trial and error, only way to learn.