Jump to content

Need script help on spell


midsidion

Recommended Posts

I am trying to figure out how to make a spell use items in players inventory. Like making a summon skeleton spell use bonemeal. So in theory player would cast said spell and have say 4 bonemeal removed from his/her inventory. I've looked up the player remove item script I just seem a bit lost on how to attach it to a spell. Was hoping there would just be a simple remove item condition but nothing is ever that simple for me. Any help would be greatly appreciated. Scripting seems to have gotten me completely lost on what to do as of now so try to keep explanations as user friendly as possible lol

Link to comment
Share on other sites

ok so through some reading I have the spell kinda of working. So far it only summons IF you have the right amount of items required in your inventory. Got that working by attaching the getitemcount condition to the spell effect. However the item removal script compiles but doesn't remove the items on spell cast.

 

 

Scriptname test extends activemagiceffect

 

miscobject property bonedust (custom item for mod)

 

Event OneffectStart(Actor akTarget, Actor akCaster)

if (game.getitemcount (bonedust) >= 1)

Game.getplayer().Removeitem(bonedust, 1)

endif

endEvent

 

 

that's what I have so far and it compiles it just doesn't do anything as per usual my luck lol any advice on changes or help on making it work you be great, thanks.

Edited by midsidion
Link to comment
Share on other sites

Well I spent all night trying and trying. I tried a few other scripts I had seen others post to work, along with other methods of attempting to attach the script to the spell but no luck. For whatever reason the spell will cast but wont remove an item and I am completely stumped as to why. I have a feeling some scripter more experienced then myself would point out some relatively simple mistake which I have more then likely made but I don't have the know how to know where I goofed. I tried making a dummy quest for a player alias but I dunno where the script should be attached, to the quest or the spell effect, tried both with same end result, spell cast with no item taken. Maybe I am using the wrong event , I tried both spellcast and effect with no luck. Maybe being a conjuration spell its a lot more complicated or maybe I'm just a clueless idiot lol. I would paste a few of the ones I tried but cant seem to be able to copy and past in my post and I am dead tired after spending all night banging my head against this issue. Hopefully when I wake up someone far more skilled in this will have shed some insight on it.

Link to comment
Share on other sites

well all my mod is really is what is posted above as the script. Fortunately I managed to get in contact with someone that knew their way around scripting and were able to point me in the right direction After a while of tinkering I got it working perfectly without a hitch. The spell will not cast, nor take mana, nor take up a summon slot if you don't have the regent. If you do have the regent required it fires off as normal and removes it from inventory. Finally I can get down to earnestly trying to get it finished so I can upload it for people to try and hopefully have fun with.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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