Shanjaq on 24/8/2002 at 03:14
I need a function to return an effect(including physical attributes) on an individual magic effect slot on an object. Like say I have a mace enchanted with effect slot 1 filled with Damage Health 1-5 in 5 feet for 2 seconds, cast when strikes. And other effects on the next couple of slots.
How would I ask "what's in magic effect slot 1 of ObjectID?" I need to be able to transfer an enchantment from one object to another, slot by slot(though all at once would be even better).
Forsythe on 24/8/2002 at 07:02
Good luck... there's a func named 'getspell' that's used to see if the player has a specific spell (eg: if ( Player->GetSpell "wild levitate" == 1 ) ), and while that might work in your case I'd suggest another approach to what you're attempting. If you'll say what you're trying for, someone on here might get a bright idea or two...
Shanjaq on 24/8/2002 at 10:21
1: player drops potion into container
2: 5 new items of type "arrow" are created in the container and are enchanted with the effects associated with the potion, the potion is then destroyed.
3: player opens container to find the 5 items enchanted with exact same effects as the potion, he/she drops 5 arrows into the container.
4: arrows get enchanted with the same effects as the 5 items, then are transfered to the player's inventory automatically.
this way the player can dip arrows in potions, more or less :)
Shanjaq on 24/8/2002 at 10:23
basically I just need to know how to assemble an enchantment purely by script. It would help if I could also detect individual enchantment effect slots on an item.
Forsythe on 25/8/2002 at 01:19
Hmm.. probably the simplest way to do that would be to make a whole bunch of different types of arrows, at least one for each valid usage (Mark/Recall only work on 'self' so they likely won't work on arrows).
Then, make your script check if there's at least one plain arrow in the container, and then go looking for what potion is in the container. Based on what potion is in the container, add the respective arrow type to the container and remove the potion and plain arrow.
Here's a pseudo-code example of what I mean:
arrowOk = 1
potionType = -1
if ( enchant_box->GetItemCount "p_burden_q" > 0 )
potionType = 1
elseif ( enchant_box->GetItemCount "p_burden_e" > 0 )
potionType = 2
endif
if ( potionType < 0 )
return
endif
if ( enchant_box->GetItemCount "iron arrow" > 0 )
enchant_box->removeItem "iron arrow", 1
elseif ( enchant_box->GetItemCount "silver arrow" > 0 )
enchant_box->removeItem "silver arrow", 1
else
arrowOk = -1
endif
if ( arrowType < 0 )
return
endif
if ( potionType == 1 )
enchant_box->additem "arrow_burden_q", 1
enchant_box->removeitem "p_burden_q", 1
elseif ( potionType == 2 )
enchant_box->additem "arrow_burden_e", 1
enchant_box->removeitem "p_burden_e", 1
endif
If you want to simplify things, make a new 'plain arrow' type and make that the only one that'll work; it'll save you on people saying "But why won't the twirlygig arrow from my cousin's plugin work?!?!?!?!" (Oh, and if you don't have a means of kicking the script off worked out, you might look into the Dwemer cranks [in_dwrv_crank_*] under the Activator tab)