Jump to content

item Coding help


bomo99

Recommended Posts

i am in the process of making an item that is an unbreakable repair hammer and a portable spellmaker and enchanter all in one but i have no idea how to make a custom repair hammer that kind of acts like a skeleton key but for repairing ik that master armorer is practically the same thing just wondering if it can be done

 

ps. i want to know if i can do this just on CS

pss. if you want the code for the item as we speak so you know how the item will function let me know

Edited by bomo99
Link to comment
Share on other sites

there two simple way to achieve that

 

1. use game setting fDamageToWeaponPercentage (default 0.06)

set to 0 then all weapons never get broken, when used

 

2. use event handler on hit, whenever hit occur just repair the weapon with syntax SetEquippedCurrentHealth

Link to comment
Share on other sites

First thing that i need to do is find out is how to get the item to activate the repair menu, then make it unbreakable like the skeleton key i dont want to make every item in the game unbreakable because then their would be no reason to make unbreakable repair hammer

Edited by bomo99
Link to comment
Share on other sites

Begin GameMode

Set Button to GetButtonPressed

If Button == 0
Showenchantment

Elseif Button == 1
Showspellmaking

 

"Elseif Button == 2";Where the Repair option will be

Endif
End

will the event handler work if the item is inventory or "will it work if the "Player" clicks on the button (I prefer it be this option)". for this SetEquippedCurrentHealth will it work for the health at 125 from expert or just send it back to 100 kind of like dawn/duskfang

Link to comment
Share on other sites

if you want it validated based on Armorer skill

that's your choice :smile:

 

it will work regardless

event handler that should be perfect for this is OnHit

you should get the item with this command --> Player.GetEquipmentSlot 16

 

EDIT : oh woops my mistake, revision --> Player.GetEquippedObject 16

Edited by lubronbrons
Link to comment
Share on other sites

don't use CS when building mods, use CSE instead

you need to install this mod successfully in your setup --> https://www.nexusmods.com/oblivion/mods/36370/

googling it if you has trouble installing it, sorry my troubleshooting skill is not that good. my strong point in modding is scripting, also my English is not that good please be tolerate with me~

Link to comment
Share on other sites

oh no... you've got it wrong

it should be like this

 

--> declarer this only once by using command like GetGameLoaded or GetGameRestarted. this script type is Quest. attach it to quest and make sure 'start game' flag is checked on

scn myQuestScript
begin GameMode
if GetGameRestarted
	SetEventHandler "OnHit" myFunc "second"::PlayerRef
endif
end

--> create this script, type Object

scn myFunc
ref victim
ref attacker
ref rf1
short sh1
begin function{victim attacker}
Let rf1 := Player.GetEquippedObject 16
if rf1
	if CompareName "-INF-" rf1
		Let sh1 := GetObjectHealth rf1
		Player.SetEquippedCurrentHealth sh1 16
	endif
endif
end 

--> you might use this for your menu script

scn myMenu
short choice
ref rf1
begin GameMode
Let choice := GetButtonPressed
if choice == 0
	Showenchantment
elseif choice == 1
	Showspellmaking
elseif choice == 2 ;Where the Repair option will be
	Let rf1 := Player.GetEquippedObject 16
	if rf1
		if CompareName "-INF-" rf1
			ModName "-INF-|" rf1
		else
			AppendToName "-INF-" rf1
		endif
	endif
endif
end
Edited by lubronbrons
Link to comment
Share on other sites

  • Recently Browsing   0 members

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