Kish Posted May 16, 2014 Share Posted May 16, 2014 Is there a way, by script, to have a character automatically equip a ring (not just hold it) during play, i.e., before a conversation Edwin doesn't have any rings on, after the conversation he has this particular ring on? Link to comment
Kulyok Posted May 16, 2014 Share Posted May 16, 2014 O, wow, Kish is back! (waves) (Don't know, alas. I suspect not, otherwise I'd use it many, many times. You can disrobe a character, but you can't put a sword in their hand). Link to comment
polytope Posted May 16, 2014 Share Posted May 16, 2014 You can use this action: FillSlot(SLOT_RING_LEFT) The slot needs to be empty though, and the specified ring needs to be referenced in the block, i.e. IF !HasItemSlot(Myself,SLOT_RING_LEFT) !HasItem("ringxyz",Myself) Global("giveringxyz","LOCALS",0) //This line is probably redundant, but better to be safe THEN RESPONSE #100 GiveItemCreate("ringxyz",Myself) FillSlot(SLOT_RING_LEFT) SetGlobal("giveringxyz","LOCALS",1) END If the character already wears a ring, they need to de-equip it somehow. As an example GiveItem("ring09",Myself) should shift it from equipped to their inventory. Link to comment
Kish Posted May 16, 2014 Author Share Posted May 16, 2014 Thanks. Is there a way to automatically dump whatever rings the character is wearing beforehand to the inventory? (Ideally without also removing the rest of their equipment.) Link to comment
polytope Posted May 17, 2014 Share Posted May 17, 2014 It appears that a creature won't GiveItem() to themselves, but this block seems to work: IF Allegiance(Myself,PC) HasItemEquiped("ring09",Myself) // Ring of Free Action HasItemSlot(Myself,SLOT_RING_LEFT) THEN RESPONSE #100 GiveItem("ring09",Player1) // Move it out of their inventory Continue() END IF !HasItemSlot(Myself,SLOT_RING_LEFT) !HasItem("ring18",Myself) // Fire Opal Ring, just as an example Global("giveringxyz","LOCALS",0) THEN RESPONSE #100 GiveItemCreate("ring18",Myself,1,0,0) // Need to specify charges with GiveItemCreate() command, even if item doesn't have limited use ability FillSlot(SLOT_RING_LEFT) SetGlobal("giveringxyz","LOCALS",1) END You'd need to repeat this for every magic ring in game though, at least by checking HasItemSlot() you can ensure that the creature won't try equipping the new ring if another unlisted (mod-added) ring is on their left hand. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.