Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Scriptname HTCW_PerkBrewCharismaScript extends activemagiceffect
- {Adds a Perk/Rank}
- Message Property HTCW_PerkBrewCharismaMessage auto const
- GlobalVariable Property HTCW_PerkBrewMenuFlag01 auto const
- GlobalVariable Property HTCW_PerkBrewMenuFlag02 auto const
- GlobalVariable Property HTCW_PerkBrewMenuFlag03 auto const
- GlobalVariable Property HTCW_PerkBrewMenuFlag04 auto const
- GlobalVariable Property HTCW_PerkBrewMenuFlag05 auto const
- GlobalVariable Property HTCW_PerkBrewMenuFlag06 auto const
- GlobalVariable Property HTCW_PerkBrewMenuFlag07 auto const
- GlobalVariable Property HTCW_PerkBrewMenuFlag08 auto const
- GlobalVariable Property HTCW_PerkBrewMenuFlag09 auto const
- GlobalVariable Property HTCW_PerkBrewMenuFlag10 auto const
- ActorValue Property Charisma auto const
- Perk Property CapCollector01 auto const
- Perk Property LadyKiller01 auto const
- Perk Property BlackWidow01 auto const
- Perk Property LoneWanderer01 auto const
- Perk Property AttackDog01 auto const
- Perk Property AnimalFriend01 auto const
- Perk Property LocalLeader01 auto const
- Perk Property PartyBoy01 auto const
- Perk Property PartyGirl01 auto const
- Perk Property Inspirational01 auto const
- Perk Property WastelandWhisperer01 auto const
- Perk Property Intimidation01 auto const
- Perk Function GetLastPerk(Perk firstPerk)
- Perk tp = firstPerk
- Perk p = tp.GetNextPerk()
- while(p!=firstPerk)
- tp = p;
- p=tp.GetNextPerk()
- endwhile
- return tp
- EndFunction
- Function AddNextRank(Perk firstPerk)
- Perk fp = firstPerk
- while(Game.GetPlayer().HasPerk(firstPerk))
- firstPerk=firstPerk.GetNextPerk()
- if(firstPerk==fp)
- return
- endif
- endwhile
- Game.GetPlayer().AddPerk(firstPerk)
- endfunction
- Event OnEffectStart(Actor akTarget, Actor akCaster)
- ; prepare the message dialog
- HTCW_PerkBrewMenuFlag01.SetValue((akTarget.GetBaseValue(Charisma)>0) as float * (!akTarget.HasPerk(GetLastPerk(CapCollector01))) as float)
- if(akTarget.GetActorBase().GetSex()==0)
- HTCW_PerkBrewMenuFlag02.SetValue((akTarget.GetBaseValue(Charisma)>1) as float * (!akTarget.HasPerk(GetLastPerk(LadyKiller01))) as float)
- Else
- HTCW_PerkBrewMenuFlag02.SetValue((akTarget.GetBaseValue(Charisma)>1) as float * (!akTarget.HasPerk(GetLastPerk(BlackWidow01))) as float)
- endif
- HTCW_PerkBrewMenuFlag03.SetValue((akTarget.GetBaseValue(Charisma)>2) as float * (!akTarget.HasPerk(GetLastPerk(LoneWanderer01))) as float)
- HTCW_PerkBrewMenuFlag04.SetValue((akTarget.GetBaseValue(Charisma)>3) as float * (!akTarget.HasPerk(GetLastPerk(AttackDog01))) as float)
- HTCW_PerkBrewMenuFlag05.SetValue((akTarget.GetBaseValue(Charisma)>4) as float * (!akTarget.HasPerk(GetLastPerk(AnimalFriend01))) as float)
- HTCW_PerkBrewMenuFlag06.SetValue((akTarget.GetBaseValue(Charisma)>5) as float * (!akTarget.HasPerk(GetLastPerk(LocalLeader01))) as float)
- if(akTarget.GetActorBase().GetSex()==0)
- HTCW_PerkBrewMenuFlag07.SetValue((akTarget.GetBaseValue(Charisma)>6) as float * (!akTarget.HasPerk(GetLastPerk(PartyBoy01))) as float)
- Else
- HTCW_PerkBrewMenuFlag07.SetValue((akTarget.GetBaseValue(Charisma)>6) as float * (!akTarget.HasPerk(GetLastPerk(PartyGirl01))) as float)
- endif
- HTCW_PerkBrewMenuFlag08.SetValue((akTarget.GetBaseValue(Charisma)>7) as float * (!akTarget.HasPerk(GetLastPerk(Inspirational01))) as float)
- HTCW_PerkBrewMenuFlag09.SetValue((akTarget.GetBaseValue(Charisma)>8) as float * (!akTarget.HasPerk(GetLastPerk(WastelandWhisperer01))) as float)
- HTCW_PerkBrewMenuFlag10.SetValue((akTarget.GetBaseValue(Charisma)>9) as float * (!akTarget.HasPerk(GetLastPerk(Intimidation01))) as float)
- int but = HTCW_PerkBrewCharismaMessage.Show()
- if(but==0)
- AddNextRank(CapCollector01)
- endif
- if(but==1)
- AddNextRank(LadyKiller01)
- endif
- if(but==2)
- AddNextRank(BlackWidow01)
- endif
- if(but==3)
- AddNextRank(LoneWanderer01)
- endif
- if(but==4)
- AddNextRank(AttackDog01)
- endif
- if(but==5)
- AddNextRank(AnimalFriend01)
- endif
- if(but==6)
- AddNextRank(LocalLeader01)
- endif
- if(but==7)
- AddNextRank(PartyBoy01)
- endif
- if(but==8)
- AddNextRank(PartyGirl01)
- endif
- if(but==9)
- AddNextRank(Inspirational01)
- endif
- if(but==10)
- AddNextRank(WastelandWhisperer01)
- endif
- if(but==10)
- AddNextRank(Intimidation01)
- endif
- EndEvent
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement