Jump to content

Weapon Enchant Spell Tutorial


Recommended Posts

A quick tutorial, in it's most basic form, to show how to do weapon enchantments via spell, much like in Diablo and other similar games.

I decided to do this cuz I noticed a few people requesting similar things but I'm not going to necro an ancient thread.

 

Step 1. Create the enchantment. I did Fire Damage 10 points.

 

Step 2. Create the script. Again, this is in its most basic form. You can do wild things with this script but I won't go in to it. Make sure you set the script type as Magic Effect

 

-----

 

scn FireEnchantScript

 

Ref Weapon

 

Begin ScriptEffectStart

 

set Weapon to GetEquippedObject 16

 

SetEnchantment FireEnchant Weapon

 

End

 

Begin ScriptEffectFinish

 

RemoveEnchantment Weapon

 

End

 

-----

 

Step 3. Create the spell. Create a new effect, and select Script. Attach your script there, then set the duration. The duration determines how long the enchantment will remain on the weapon.

 

Step 4. Save, activate the plugin and get your spell in game. With a weapon equipped, cast a spell and voila, it'll enchant it then remove it once the spell timer is up. Enjoy

 

 

-----EDIT-----

 

 

I know I said I wouldn't get into it, but oh well. There's a few things you can do with this such as

 

-----

 

if GetCurrentTime > 10.00

SetEnchantment Fire Weapon

ElseIf GetCurrentTime < 10.00

SetEnchantment Frost Weapon

EndIf

 

-----

 

 

-----

 

If GetDayOfWeek == 0

SetEnchantment Fire Weapon

Elseif GetDayOfWeek == 1

SetEnchantment Frost Weapon

Elseif GetDayOfWeek == 2

SetEnchantment Poison Weapon

 

etc ….

 

-----

 

If Player.GetFactionRank FightersGuild == xx

SetEnchantment WeakFire Weapon

ElseIf Player.GetFactionRank FightersGuild == xx

SetEnchantment StrongFire Weapon

 

etc...

 

 

-----

 

 

The list of possibilities goes on. From faction rank, to current weather, time of day, day of the week, location, player level, attribute and skill values and so on. It is one of those awesome things that once you figure out the only thing that can stop you is your own creativity, or maybe a lack of knowledge depending on how complex you get with it.

 

Here is a script I made for myself that gives an enchantment based off your Alteration level.

scn RizFireWeapon

ref weapon
short con

begin scripteffectstart

	set con to player.getav Alteration
	set weapon to player.getequippedobject 16

	if con <= 5
		SetEnchantment RizWeakFireEN weapon
	endif
	if con <= 10 && con >= 6
		SetEnchantment RizWeakFrostEN weapon
	endif
	if con <= 15 && con >= 11
		setenchantment RizWeakShockEN weapon
	endif
	if con <= 20 && con >= 16 
		setenchantment RizWeakEleEN weapon
	endif
	if con <= 25 && con >= 21
		SetEnchantment RizWeakFrostDEN weapon
	endif
	if con <= 30 && con >= 26
		setenchantment RizWeakFireDEN weapon
	endif
	if con <= 35 && con >= 31
		SetEnchantment RizShockEN weapon
	endif
	if con <= 40 && con >= 36
		SetEnchantment RizFireEN weapon
	endif
	if con <= 45 && con >= 41
		SetEnchantment RizFrostEN weapon
	endif
	if con <= 50 && con >= 46
		SetEnchantment RizEleEN weapon
	endif
	if con <= 55 && con >= 51
		SetEnchantment RizStrongFireEN weapon
	endif
	if con <= 60 && con >= 56
		SetEnchantment RizStrongShockEN weapon
	endif
	if con <= 65 && con >= 61
		SetEnchantment RizStrongFrostEN
	endif
	if con <= 70 && con >= 66
		SetEnchantment RizShockDEN
	endif
	if con <= 75 && con >= 71
		SetEnchantment RizFireDEN
	endif
	if con <= 80 && con >= 76
		SetEnchantment RizFrostDEN
	endif
	if con <= 85 && con >= 81
		SetEnchantment RizShockBurstEN
	endif
	if con <= 90 && con >= 86
		SetEnchantment RizFrostBurstEN
	endif
	if con <= 95 && con >= 91
		SetEnchantment RizFireBurstEN
	endif
	if con <= 98 && con >= 96
		SetEnchantment RizStrongEleEN
	endif
	if con >= 99
		SetEnchantment RizEleFinalDEN
	endif
		
		
	
end

begin scripteffectupdate

	player.GetEquippedCurrentCharge 16
	player.SetEquippedCurrentCharge 1000 16

end

begin scripteffectfinish

	RemoveEnchantment weapon

end
Edited by Rizalgar
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...