Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

[SKY] Horrifying scripts


shogran
 Share

Recommended Posts

I've looked, And looked. but I may not have looked super all the way thorough to see if this had been done in some way or was taken care of in game somehow. But I want a script that administers a command when the pc kills an npc. preferably with a specific weapon. I want it to happen everytime The PC actually kills any npc at all. Any of them. Even Ulfric Stormcloak. The result I want is pretty simple to code, infact the whole script should be easy but there seems to be "onpckilledanynpc" call function in papyrus. :( Can I get a hand oh great and mighty scripting gods?

Link to comment
Share on other sites

Ok, it's too early to think clearly, but I believe i may have found some stuff to help you out.

So, first you need to learn the OnDeath() function. Now we need to attach to every single NPC. Yay!

 

Or we could just dynamically attach the script to any Npcs in our area. Combined with a simple check to see if the player was involved with the death using an OnHit() we can create a script to do whatever it is you want.

 

Link to the dynamic Tuturial. Link

Link to comment
Share on other sites

Right. But I don't want everything around me to have the effect. What If I don't kill them and something else does? I want the effect to start when they are hit with the specific weapon.. so maybe an enchantment on the weapon that gives the spell to the other npc and then that spell, have it with ondeath do the action to the player?

Link to comment
Share on other sites

What is it you want to happen when this NPC dies? How many NPCS are we talking about? If this is a boss it'd be alot easier than a faction.

For instance, if it's just a single NPC or a small amount, you could just add this script to them:

Event OnDeath(Actor akKiller)
if (akKiller == Game.GetPlayer())
endIf
endEvent
Edited by Walrus
Link to comment
Share on other sites

I want it to be every person the player kills, aslong as its an npc. and yeah. That script you gave me is PERFECT for what happens.  But, I want it to be applied easily. I'm thinking 

EVENT onEffectStart(ACTOR akTarget, ACTOR akCaster)
If akTargetRace.HasKeyword(ActorTypeNPC) == 1
  akTarget.addspell ittickles
endif
endevent
 
and then. ittickles effect :
EVENT OnDeath(actor akKiller)
if (akKiller == game.getplayer())
 player.additem 0002e504 1
endif
endevent 
 
do you think that will work?
Link to comment
Share on other sites

You 'might' be able to put an enchantment on the weapon, that checks for death during its duration. It might catch 'most' of the deaths, but may not register the actual 'killing' blow if multiple targets are attacking the NPC. The games is not that dynamic to know that.

Link to comment
Share on other sites

So, Plan C.

Here's my thinking; You want to add a Black Soul Gem to your inventory everytime you kill an NPC. For lore purposes, only people can fill Black Soul Gems right? So we track the number of people killed by the player and give them a BSG everytime it updates. Here's how I THINK the script would look like;

 

BLAH BLAH SCRIPT NAME STUFF
 
Function DeathTracker
    RegisterForTrackedStatsEvent()
EndFunction
 
Event OnTrackedStatsEvent(string asStatfilter, int aiStatValue)
     if (asStatFilter == "People Killed")
          player.additem 0002e504 1
     endif
endEvent

 

This should give you a BSG everytime the People Killed Stat is updated. BUT I have never tried it and am talking out of my bytt basically. Hope it works though.

Link to comment
Share on other sites

Scriptname AAASoulCreation extends activemagiceffect  
{This Script is For the Sword that Steals men souls}
 
SoulGem Property FilledBlackSoulGem Auto
 
Actor MySelf
Float Health
 
EVENT onEffectStart(ACTOR akTarget, ACTOR akCaster)
Debug.Notification("Soul")
MySelf = akTarget
Health = Myself.getActorvalue("Health")
endevent
 
Event OnUpdate()
Health = Myself.GetActorValue("Health")
endEvent
 
 
event Oneffectfinish(actor akTarget, actor akCaster)
 Health = Myself.GetActorValue("Health")
if Health < 1
game.getplayer().additem(FilledBlackSoulGem)
endif
endEvent 
 
^^ that didn't work. but it did compile.
Gonna keep hacking away at this afterall
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...