Jump to content

Small Script Request


Lagruej

Recommended Posts

I'm looking for somebody who can help whip me up a script. Looking through the game's base scripts I don't think it should be too hard, I just don't know how to make it happen.

Basically I have Misc Item "Card Pack"

I want Card Pack to have a script where when it's used;

  Quote

1. Card Pack is removed from the inventory. (By default misc. items remain in inventory even when used)

2. "Leveled List" A is rolled for Item 1 (Common Card)

3. "Leveled List" A is rolled for Item 2 (Common Card)
4. "Leveled List" A is rolled for Item 3 (Common Card)
5. "Leveled List" A is rolled for Item 4 (Common Card)

6. "Leveled List" B is rolled for Item 5 (Uncommon Card)
7. "Leveled List" B is rolled for Item 6 (Uncommon Card)

8. "Leveled List" C is rolled for Item 7 (Rare Card)

9. All 7 rolled items are added to the player's inventory.

I would like all 7 Leveled Lists to be individually selectable in CK script editor - i.e. I don't want/need a "count" feature in case I change the rarity distribution or add new rarities.

I don't know if it's an automatic function of the engine or not, but I also want the deposited items to show in the 'feed' we get in the top left of the screen.

I'm good with adding the .psc myself and all that and compiling it, I just don't know how to write scripts myself.

Edited by Lagruej
Link to comment
Share on other sites

  On 2/5/2020 at 11:15 PM, Lagruej said:
I also want the deposited items to show in the 'feed' we get in the top left of the screen.

It is Debug.Notification function.

 

  On 2/5/2020 at 11:15 PM, Lagruej said:

I'm good with adding the .psc myself and all that and compiling it, I just don't know how to write scripts myself.

 

Did you read the official Papyrus docs?

Edited by shumkar
Link to comment
Share on other sites

Hey, this isn't too difficult. Although, I would use Formlists instead of leveled items, and I would make the card pack a book, instead of a misc item, that way you can use the event OnRead(). Here's a script that should work:

Scriptname LagruejCardPackScript extends ObjectReference 

Actor Property pPlayerRef Auto
Formlist Property LagruejCommonCards Auto 
FormList Property LagruejUnCommonCards Auto 
Formlist Property LagruejRareCards Auto

Event OnRead()
  Int A = Utility.RandomInt(0, (LagruejCommonCards.GetSize() - 1))
  Int B = Utility.RandomInt(0, (LagruejCommonCards.GetSize() - 1))
  Int C = Utility.RandomInt(0, (LagruejCommonCards.GetSize() - 1))
  Int D = Utility.RandomInt(0, (LagruejCommonCards.GetSize() - 1))

  Int E = Utility.RandomInt(0, (LagruejUnCommonCards.GetSize() - 1))
  Int F = Utility.RandomInt(0, (LagruejUnCommonCards.GetSize() - 1))

  Int G = Utility.RandomInt(0, (LagruejRareCards.GetSize() - 1))

  pPlayerRef.AddItem((LagruejCommonCards.GetAt(A) as MiscObject), 1)
  pPlayerRef.AddItem((LagruejCommonCards.GetAt(B) as MiscObject), 1)
  pPlayerRef.AddItem((LagruejCommonCards.GetAt(C) as MiscObject), 1)
  pPlayerRef.AddItem((LagruejCommonCards.GetAt(D) as MiscObject), 1)

  pPlayerRef.AddItem((LagruejUnCommonCards.GetAt(E) as MiscObject), 1)
  pPlayerRef.AddItem((LagruejUnCommonCards.GetAt(F) as MiscObject), 1)

  pPlayerRef.AddItem((LagruejRareCards.GetAt(G) as MiscObject), 1)
EndEvent

Attach this script to your card pack book, and it will run whenever you read the book. Make the formlists and add your cards to them, I assumed they would be misc items. Don't forget to fill properties in the creation kit after attaching the script.

Edited by dylbill
Link to comment
Share on other sites

If you still want to use leveled lists and a misc object card pack

 

  Reveal hidden contents

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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