Jump to content

Auto-Target


bromy2004

Recommended Posts

I am not new to programming, however I am new to scripting within Skyrim.

 

I'm trying to set up some clothes with the following effects.

1. On Equip, Send Orb above players head. (Like candlelight)

2. When Hostile people/creatures come close to the player...

a. If health is more than the player, Attack (or if their level is higher than the player...haven't decided yet)

b. Otherwise Attack if they are attacking the Player (i.e. if they are hostile but attacking a wolf or a party member it wont do anything)

3. Function Attack

If Player.mana > (spell.cost * 1.5) then

Spell.RemoteCast(CandleLightObject, Player(), Target)

Player.Mana = Player.Mana - (Spell.Cost * 1.5)

End If

4. Spell will probably be fireball, possibly other items for other types of spells

 

A. The problem i'm getting is how do I loop through all hostiles in the area?

B. How does the Spell get passed to the script so the right one is cast?

C. Is this set in Event OnInit() ??

 

At the moment I am modifying the example from the CreationKit site Script to Make an Item Cast a Spell

 

Thanks in advance for any help

 

Bromy

Link to comment
Share on other sites

  • 3 weeks later...
  • Recently Browsing   0 members

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