Author Topic: Recoverable Missile hak  (Read 323 times)

Legacy_Bubba McThudd

  • Sr. Member
  • ****
  • Posts: 254
  • Karma: +0/-0
Recoverable Missile hak
« on: November 21, 2010, 10:00:20 pm »


               Greetings all,

 Many moons ago a kind scripter, whose name I unfortunately have forgotten, assisted me (as in doing all the hard work) in creating this script which I used in my mod "Agrenost - Beneath the Cobbles. Several players have commented on it, so I thought I would offer it to the community. 

This small hak replaces the default Bioware "death" and "on damage" scripts, allowing players to glean their arrows, bolts, bullets and throwing axes from the bodies of their foes. It also includes a modified baseitem 2da file which reduces the stack size of ammo to a more realistic 24 (12 for axes).  The hak is on the vault HERE.

Bubba Thudd 
               
               

               
            

Legacy_CheeseshireCat

  • Jr. Member
  • **
  • Posts: 79
  • Karma: +0/-0
Recoverable Missile hak
« Reply #1 on: November 22, 2010, 07:54:30 pm »


               How is 12 axes stackable is a "more" or at all "realistic" option? '<img'>

As an archer IRL, I can also tell you that while you don't put a lot of high-quality tipped arrows in a quiver, a single "stack" of "sheaf" arrows is easily several dozen. You just tie them into a fascine, which is as easy as pie with two self-tightening loop knots.
               
               

               
            

Legacy_Bubba McThudd

  • Sr. Member
  • ****
  • Posts: 254
  • Karma: +0/-0
Recoverable Missile hak
« Reply #2 on: November 22, 2010, 08:17:22 pm »


               Have you ever tried to carry 99 axes?  : )



Medieval war arrows tend to be much bigger than modern target arrows - some of the arrows recovered from the wreck of the Mary Rose were the size of small javelins.  Two dozen seemed a sensible size for a quiver.



Anyway, if you prefer stacks of 99, you can always run the script without the modified 2da file.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Recoverable Missile hak
« Reply #3 on: November 22, 2010, 08:48:08 pm »


               

Bubba McThudd wrote...

Have you ever tried to carry 99 axes?  : ).

Have you tried to play throwing weapon build? They won't automatically realod like ammunition from ranged weapons. After you threw last one, your character going to unarmed fight. Only thing you can do is to have always one stack in quickslot.

Maybe realistic, but not playable.':sick:'
               
               

               
            

Legacy_Bubba McThudd

  • Sr. Member
  • ****
  • Posts: 254
  • Karma: +0/-0
Recoverable Missile hak
« Reply #4 on: November 22, 2010, 09:05:19 pm »


               I didn't know thrown weapons didn't reload.  Stacking in the quickslot seems a good work-around.  Just out of curiosity, what is an example of a throwing weapon build?
               
               

               
            

Legacy_Bubba McThudd

  • Sr. Member
  • ****
  • Posts: 254
  • Karma: +0/-0
Recoverable Missile hak
« Reply #5 on: November 22, 2010, 09:10:15 pm »


               One of the advantages of this system for archers is that you can afford high quality arrows sooner in the game since you don't have to save up for a stack of 99.  If you are a decent shot and carefully glean your arrows from the dead, a stack of 24 can last you a long time.
               
               

               
            

Legacy_Tyndrel

  • Sr. Member
  • ****
  • Posts: 313
  • Karma: +0/-0
Recoverable Missile hak
« Reply #6 on: November 22, 2010, 09:40:54 pm »


               This would actually make the problem of controlling what type of arrows your archer is firing even worse. While I understand the realism aspect of retrieving ammunition after a battle, should the sheaf of arrows you are using run out mid battle the NwN engine will put seemingly any arrows in it's place and to reuse the examples I used earlier in the general discussion thread it will leave you firing fire arrows at fire giants and your precious arrows of petrification (both of them!) at a passing goblin.  From the point of view of making the game more playable I've modified the 2da to alter stack size to 999, ok it isn't historically realistic but nor is firing arrow types at random at least now we can allow for the unpredictability of the engine in this department.
Your modification would be great in a magic free environment with an emphasis on survival and perhaps in addition to crafting "normal" arrows where each one is a precious commodity, just not in a standard NwN fantasy world. Hmmm, this has got me thinking now...  where did I put that zombie mod I started?
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Recoverable Missile hak
« Reply #7 on: November 22, 2010, 09:42:33 pm »


               

Bubba McThudd wrote...

Just out of curiosity, what is an example of a throwing weapon build?

I have met some on the pvp arena servers. Halfling have +1 ab for them and shurikens are great for him, because even with 6 str, they dont give penalty to damage. Start with rogue, add some fighter for 16 bab and one or two levels of monk for AC and you got one.

Other build use ranger as base class because he is great in hiding and perfect for dex based build with full bab. Then if you not going to use shield, add monk, if not add shadowdancer. As third class add sneak type like assassin or rogue. With SD is easier to reach ED, but also possible with monk. Some of these builds going to Zen Archery route in order to spot other sneakers.

Tyndre wrote...
This would actually make the problem of controlling what type of arrows your archer is firing even worse.

Agreed, currently play as an archer, and this is really annoying.
               
               

               


                     Modifié par ShaDoOoW, 22 novembre 2010 - 09:47 .
                     
                  


            

Legacy_Sharona Curves

  • Full Member
  • ***
  • Posts: 115
  • Karma: +0/-0
Recoverable Missile hak
« Reply #8 on: November 22, 2010, 10:16:55 pm »


               Here's a script function we use on the Eternal Destiny PW Server in the OnDamaged Event of most creatures to facilitate the retrieval of ammo/throwing weapons from the corpses of the creatures you happen to strike.  It places a single resref of the item in the creatures inventory and can be retrieved once the creature is killed.  No hak or realistic(unrealistic) adjustments to ammo amounts required.  All retrievable ammo is logged and there is an included random chance your ammo or throwing weapon either broke on impact(not retrievable) or sunk to deep into the flesh of your opponent to be able to be retrieved. 
 
Things I like about this:
 
- Only Damaging Hits allow retrieving
- Not all damaging hits are retrievable
- Log-Review Day allows you to see who is getting back what
- Unlimited Ammo Properties Ignore this script
- Easily customized to suit your needs.


void CreateAmmo(object oDamager)
{
object oAmmo;
object oItem=GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oDamager);
string sItem = GetName(oItem);
string sDamager = GetName(oDamager);
string sSelf = GetName(OBJECT_SELF);
if (GetWeaponRanged(oItem))
{
if(GetItemHasItemProperty(oItem, ITEM_PROPERTY_UNLIMITED_AMMUNITION)) return;
if(d4(1) <2) // Adjust to allow more or less ammo to be retrieved
    {
        if (GetBaseItemType(oItem)==BASE_ITEM_LONGBOW || GetBaseItemType(oItem)==BASE_ITEM_SHORTBOW)
            {
                oAmmo=GetItemInSlot(INVENTORY_SLOT_ARROWS,oDamager);
                string sAmmy = GetName(oAmmo);             
                  if(GetBaseItemType(oAmmo) != BASE_ITEM_ARROW) return;
                  object oAmmy = CreateItemOnObject(GetResRef(oAmmo));
                       SetDroppableFlag(oAmmy ,TRUE);
                       SetIdentified(oAmmy, TRUE);
                       PrintString("************************");
                       PrintString("     AMMO RETRIEVAL     ");
                       PrintString("PC Name: "+sDamager);
                       PrintString("Creature: "+sSelf);
                       PrintString("Weapon: "+sItem);
                       PrintString("Ammo: "+sAmmy);
                       PrintString("************************");
                return;
            }
        if (GetBaseItemType(oItem)==BASE_ITEM_LIGHTCROSSBOW || GetBaseItemType(oItem)==BASE_ITEM_HEAVYCROSSBOW)
            {
                oAmmo=GetItemInSlot(INVENTORY_SLOT_BOLTS,oDamager);
                  if(GetBaseItemType(oAmmo) != BASE_ITEM_BOLT) return;
                  object oAmmy = CreateItemOnObject(GetResRef(oAmmo));
                   string sAmmy = GetName(oAmmo);
                       SetDroppableFlag(oAmmy ,TRUE);
                       SetIdentified(oAmmy, TRUE);
                       PrintString("************************");
                       PrintString("     AMMO RETRIEVAL     ");
                       PrintString("PC Name: "+sDamager);
                       PrintString("Creature: "+sSelf);
                       PrintString("Weapon: "+sItem);
                       PrintString("Ammo: "+sAmmy);
                       PrintString("************************");
                return;
            }
        if (GetBaseItemType(oItem)==BASE_ITEM_SLING)
            {
                   oAmmo=GetItemInSlot(INVENTORY_SLOT_BULLETS,oDamager);
                    string sAmmy = GetName(oAmmo);
                  if(GetBaseItemType(oAmmo) != BASE_ITEM_BULLET) return;
                  object oAmmy = CreateItemOnObject(GetResRef(oAmmo));
                       SetDroppableFlag(oAmmy ,TRUE);
                       SetIdentified(oAmmy, TRUE);
                       PrintString("************************");
                       PrintString("     AMMO RETRIEVAL     ");
                       PrintString("PC Name: "+sDamager);
                       PrintString("Creature: "+sSelf);
                       PrintString("Weapon: "+sItem);
                       PrintString("Ammo: "+sAmmy);
                       PrintString("************************");
                return;
            }
        if (GetBaseItemType(oItem)== BASE_ITEM_THROWINGAXE || GetBaseItemType(oItem)==BASE_ITEM_SHURIKEN || GetBaseItemType(oItem)==BASE_ITEM_DART)
            {
                       string sAmmy = GetName(oItem);
                       object oAmmy = CreateItemOnObject(GetResRef(oItem));
                       SetDroppableFlag(oAmmy ,TRUE);
                       SetIdentified(oAmmy, TRUE);
                       PrintString("************************");
                       PrintString("     AMMO RETRIEVAL     ");
                       PrintString("PC Name: "+sDamager);
                       PrintString("Creature: "+sSelf);
                       PrintString("Weapon: "+sItem);
                       PrintString("Ammo: "+sAmmy);
                       PrintString("************************");
                return;
            }    
        }
  }
}

               
               

               


                     Modifié par Sharona Curves, 22 novembre 2010 - 10:24 .