Adding an item when a player takes a perk?

Post » Mon Jun 18, 2012 9:06 am

I'm trying to make a perk add a weapon into the players inventory when they select it but I'm confused as to where to put the additem script. Would it go in the script section of the perk? An activate with a fragment in the entries? I'm assuming the defaultadditemweaponscript would work fine but it doesn't seem to add anything when the player gets the perk regardless of where I put it.
User avatar
MARLON JOHNSON
 
Posts: 3377
Joined: Sun May 20, 2007 7:12 pm

Post » Tue Jun 19, 2012 12:06 am

There would be various approaches. If the Perk is a normal selectable Perk (you can select at it at level ups) add an ability entry point to it and use a custom ability type spell and effect and add a script to the effect adding the item to the player on the onStartEffect event.

If you add the perk to a player any other way you might cover the itemadd at this point that might be easier.
User avatar
Nany Smith
 
Posts: 3419
Joined: Sat Mar 17, 2007 5:36 pm

Post » Mon Jun 18, 2012 9:47 pm

Example to Add Spell

If you want to add a weapon, just replace Spell Type with Weapon, and use game.getplayer().AddItem(WeaponPropertyToAdd, 1)

0Step 1: Create a New Quest for this example we will use ZZ_MyNewQuest
Step 2: Add Quest Stages, for this example we will use Stage 5
Step 3: Click on New Log, now we are going to have to add some scripting. Click on Properties
Step 4: Click on Add Property, and Type = Spell and Name will give it for this example FireRuneSpell

Step 5: Click ok ok to apply, Now Click on your spell property you made select the FireRune spell and apply and in the fragment section type game.getplayer().AddSpell(FireRuneSpell)

Step 6: Goo Actors -> Perks -> Add New Perk -> Name it ZZ_MyNewPerk
Step 7: Goto the event area and select QUEST and select your Quest you created ZZ_MyNewQuest and put the Stage at 5
Step 8: Apply the new perk goto Character Menu -> Actor Value (ALT+C,A)
Step 9: Goto AVDestruction skill click on "Perks" now click on a perk hierarchy and select "Add Perk"
Step 10: Select your new perk you created ZZ_MyNewPerk and apply the changes and save your mod
Step 11: Test in game

Now i might of forgotten some stages its possible, because im doing this from memory i dont have the ck open
User avatar
Margarita Diaz
 
Posts: 3511
Joined: Sun Aug 12, 2007 2:01 pm


Return to V - Skyrim