Pocket Plane Group
Miscellany, Inc. => Infinity Engine Modding Q&A => Topic started by: Diana on July 01, 2005, 05:57:34 PM
-
Guys and gals, can you all give me a hint as to how I would envoke something like Daystar's light ability which destroys wraiths and such? I know how to code wizard spells, innate spells, but I'm not sure how you code stuff associated with items in your inventory so it goes off via scripting when one encounters enemies.
Thanks all and have a happy holdiay! Don't work too hard!
-
I can't help you craft the spell (although certainly, looking at Daystar's usable effects would be a great start!) but do you mean you just want the bad guys to go poof even if the item isn't equipped or activated?
In that case, you might consider putting some sort of code like this in the _creature's_ script:
IF
PartyHasItem("TheKillingMeItem")
THEN
RESPONSE #100
DestroySelfInAnInterestingMannerMaybeWithTheFlashyDeathYeahSpellOrSomething()
END
-
That's pretty much it. I want to activate DayStar's ability via script in certain situations rather than having to cllick on the backpack icon and manully do it.
Thanks
-
My simplistic method wouldn't actually decrement Daystar's times-per-day counter, and of course you'd probably want to work in something so that the bad guys were in range of the Daystar wielder, etc. etc. But, yeah, in lieu of better advice from somebody who knows what they're talking about, I would suggest putting the relevant "kill-me" scripting bit into the enemy AI in question, presuming that the baddies you want to destroy have an AI specific to their creature type. If not, you may need to patch or assign a new override script.
-
You might want to experiment with SelectWeaponAbility(I:WeaponNum*Slots,I:AbilityNum*).
-
I decompiled GMAGE.BS from the gSeries to see how they invoked the ability of the Girdle of Fortitude and it appears that they do a simple check to see if you have the spell and then proceed from there. So I guess I can do a check for baddies within range and a check for the spell 'Sunray' and if I haven't drained the item just simply cast it.