It's possible to have undroppable and equipped weapons.
Most monsters got that kind of weapons.
*USE* the equiped weapon!! %&()·$=/)
Started by Jewish, Sep 30 2004 09:17 AM
24 replies to this topic
#21
Posted 01 October 2004 - 08:43 AM
Avenger
#22
Posted 01 October 2004 - 11:04 AM
I'd suggest using scripting to keep anyone else from using it, as opposed to making it undroppable. What if the Player just wants the NPC to use a different weapon? Undroppable weapons are good for non-joinable stuff, but not so good for party members.
#23
Posted 01 October 2004 - 04:28 PM
Yes, that is my preference. I have been poking through Chloe's code, and I have found (and ajusted to my NPC) this piece of code. I think this means that this will take effect so long as the other NPCs do not have the weapon actually EQUIPPED. If they do, Chloe apparently has some cutscene take effect. (I have found the cutscenes themselves, but no trigger for them.) This is because Chloe's weapons are given to her by the gods. My NPC, Yasraena, is just sentimentally attached to her weapons. So, do I just add the code in red to make it work if they have the weapon EQUIPPED?
Thanks!
Sillara
IF
HasItem("FIREFLOW",Myself)
!HasItem("FIREFLO2",Myself)
Global("YSHasFireflower1","LOCALS",0)
THEN
RESPONSE #100
SetGlobal("YSHasFireflower1","LOCALS",1)
END
IF
!HasItem("FIREFLOW",Myself)
OR(6)
HasItem("FIREFLOW",Player1)
HasItem("FIREFLOW",Player2)
HasItem("FIREFLOW",Player3)
HasItem("FIREFLOW",Player4)
HasItem("FIREFLOW",Player5)
HasItem("FIREFLOW",Player6)
!HasItemEquiped("FIREFLOW",Player1)
!HasItemEquiped("FIREFLOW",Player2)
!HasItemEquiped("FIREFLOW",Player3)
!HasItemEquiped("FIREFLOW",Player4)
!HasItemEquiped("FIREFLOW",Player5)
!HasItemEquiped("FIREFLOW",Player6)
THEN
RESPONSE #100
ActionOverride(Player1,GiveItem("FIREFLOW","Yasraena"))
ActionOverride(Player2,GiveItem("FIREFLOW","Yasraena"))
ActionOverride(Player3,GiveItem("FIREFLOW","Yasraena"))
ActionOverride(Player4,GiveItem("FIREFLOW","Yasraena"))
ActionOverride(Player5,GiveItem("FIREFLOW","Yasraena"))
ActionOverride(Player6,GiveItem("FIREFLOW","Yasraena"))
DisplayStringHead(Myself,00001)
END
IF
!HasItem("FIREFLOW",Myself)
Global("YSHasFireflower1","LOCALS",1)
!HasItem("FIREFLOW",Player1)
!HasItem("FIREFLOW",Player2)
!HasItem("FIREFLOW",Player3)
!HasItem("FIREFLOW",Player4)
!HasItem("FIREFLOW",Player5)
!HasItem("FIREFLOW",Player6)
THEN
RESPONSE #100
ActionOverride(Player1,PickUpItem("FIREFLOW"))
ActionOverride(Player2,PickUpItem("FIREFLOW"))
ActionOverride(Player3,PickUpItem("FIREFLOW"))
ActionOverride(Player4,PickUpItem("FIREFLOW"))
ActionOverride(Player5,PickUpItem("FIREFLOW"))
ActionOverride(Player6,PickUpItem("FIREFLOW"))
DisplayStringHead(Myself,00002)
END
IF
!HasItem("FIREFLOW",Myself)
OR(6)
HasItemEquiped("FIREFLOW",Player1)
HasItemEquiped("FIREFLOW",Player2)
HasItemEquiped("FIREFLOW",Player3)
HasItemEquiped("FIREFLOW",Player4)
HasItemEquiped("FIREFLOW",Player5)
HasItemEquiped("FIREFLOW",Player6)
THEN
RESPONSE #100
ActionOverride(Player1,GiveItem("FIREFLOW","Yasraena"))
ActionOverride(Player2,GiveItem("FIREFLOW","Yasraena"))
ActionOverride(Player3,GiveItem("FIREFLOW","Yasraena"))
ActionOverride(Player4,GiveItem("FIREFLOW","Yasraena"))
ActionOverride(Player5,GiveItem("FIREFLOW","Yasraena"))
ActionOverride(Player6,GiveItem("FIREFLOW","Yasraena"))
DisplayStringHead(Myself,00001)
END
Thanks!
Sillara
IF
HasItem("FIREFLOW",Myself)
!HasItem("FIREFLO2",Myself)
Global("YSHasFireflower1","LOCALS",0)
THEN
RESPONSE #100
SetGlobal("YSHasFireflower1","LOCALS",1)
END
IF
!HasItem("FIREFLOW",Myself)
OR(6)
HasItem("FIREFLOW",Player1)
HasItem("FIREFLOW",Player2)
HasItem("FIREFLOW",Player3)
HasItem("FIREFLOW",Player4)
HasItem("FIREFLOW",Player5)
HasItem("FIREFLOW",Player6)
!HasItemEquiped("FIREFLOW",Player1)
!HasItemEquiped("FIREFLOW",Player2)
!HasItemEquiped("FIREFLOW",Player3)
!HasItemEquiped("FIREFLOW",Player4)
!HasItemEquiped("FIREFLOW",Player5)
!HasItemEquiped("FIREFLOW",Player6)
THEN
RESPONSE #100
ActionOverride(Player1,GiveItem("FIREFLOW","Yasraena"))
ActionOverride(Player2,GiveItem("FIREFLOW","Yasraena"))
ActionOverride(Player3,GiveItem("FIREFLOW","Yasraena"))
ActionOverride(Player4,GiveItem("FIREFLOW","Yasraena"))
ActionOverride(Player5,GiveItem("FIREFLOW","Yasraena"))
ActionOverride(Player6,GiveItem("FIREFLOW","Yasraena"))
DisplayStringHead(Myself,00001)
END
IF
!HasItem("FIREFLOW",Myself)
Global("YSHasFireflower1","LOCALS",1)
!HasItem("FIREFLOW",Player1)
!HasItem("FIREFLOW",Player2)
!HasItem("FIREFLOW",Player3)
!HasItem("FIREFLOW",Player4)
!HasItem("FIREFLOW",Player5)
!HasItem("FIREFLOW",Player6)
THEN
RESPONSE #100
ActionOverride(Player1,PickUpItem("FIREFLOW"))
ActionOverride(Player2,PickUpItem("FIREFLOW"))
ActionOverride(Player3,PickUpItem("FIREFLOW"))
ActionOverride(Player4,PickUpItem("FIREFLOW"))
ActionOverride(Player5,PickUpItem("FIREFLOW"))
ActionOverride(Player6,PickUpItem("FIREFLOW"))
DisplayStringHead(Myself,00002)
END
IF
!HasItem("FIREFLOW",Myself)
OR(6)
HasItemEquiped("FIREFLOW",Player1)
HasItemEquiped("FIREFLOW",Player2)
HasItemEquiped("FIREFLOW",Player3)
HasItemEquiped("FIREFLOW",Player4)
HasItemEquiped("FIREFLOW",Player5)
HasItemEquiped("FIREFLOW",Player6)
THEN
RESPONSE #100
ActionOverride(Player1,GiveItem("FIREFLOW","Yasraena"))
ActionOverride(Player2,GiveItem("FIREFLOW","Yasraena"))
ActionOverride(Player3,GiveItem("FIREFLOW","Yasraena"))
ActionOverride(Player4,GiveItem("FIREFLOW","Yasraena"))
ActionOverride(Player5,GiveItem("FIREFLOW","Yasraena"))
ActionOverride(Player6,GiveItem("FIREFLOW","Yasraena"))
DisplayStringHead(Myself,00001)
END
Check out my RPG forum!
#24
Posted 01 October 2004 - 05:16 PM
Potencius posted a good, simple script block in the other thread that would provide a good base here:
You could modify that slightly, making two blocks:
1) If Yasraena is in the party, give the item to her instead of dropping it and picking it up.
2) If she isn't in the party...well, do whatever you want at that point.
You can also add in the Display String Head. It's just a lot easier to do this with a couple short blocks than a couple huge ones.
IF
!Name("DeathVariable",Myself)
HasItemEquiped("ITEM",Myself)
THEN
RESPONSE #100
DropItem("ITEM",[0.0])
PickUpItem("ITEM")
END
You could modify that slightly, making two blocks:
1) If Yasraena is in the party, give the item to her instead of dropping it and picking it up.
2) If she isn't in the party...well, do whatever you want at that point.
You can also add in the Display String Head. It's just a lot easier to do this with a couple short blocks than a couple huge ones.
#25
Posted 31 August 2006 - 10:39 AM
Well, I've got a tidbit to add to this old thread.
FillSlot puts items into slots, and it properly replaces anything in the slot. you cannot specify what goes in, it takes everything possible in inventory and puts it in the slot. It will, therefore, destroy everything in inventory that can fill the slot excapt the last item. Very, very dangerous - but if you know what's happening you can script around it.
For instance, if you wanted to fill an armor slot, you could make a script that does a "TakePartyItemsAll" from a custom .2da file, built like the IMPORT01.2DA; and then take back the item you want to equip, and FILLSLOT.
Once you have it in a slot, the EquipMostDamaging Melee and EquipRanged will get your creature using the equipped item, of course.
FillSlot puts items into slots, and it properly replaces anything in the slot. you cannot specify what goes in, it takes everything possible in inventory and puts it in the slot. It will, therefore, destroy everything in inventory that can fill the slot excapt the last item. Very, very dangerous - but if you know what's happening you can script around it.
For instance, if you wanted to fill an armor slot, you could make a script that does a "TakePartyItemsAll" from a custom .2da file, built like the IMPORT01.2DA; and then take back the item you want to equip, and FILLSLOT.
Once you have it in a slot, the EquipMostDamaging Melee and EquipRanged will get your creature using the equipped item, of course.