Aller au contenu

Photo

Questions about a simple crafting mod


  • Veuillez vous connecter pour répondre
Aucune réponse à ce sujet

#1
killermadman

killermadman
  • Members
  • 30 messages
Hello everybody

I just got back into Dragon Age and I am loving it.  Archery is a fun but lets face it you can't make arrows, and running out of your favorite arrow is a major buzz kill.

So I ask myself,  "What can I do from a semipurist perspective to remedy the situation?"

Well what about weapon coatings?  If I can coat a blade with flaming liquid I don't see why Bioware won't let us do the same with our "infinite" supply of mundane arrows (don't get me started on that and yea I know I am not the first one who failed to see the logic in that).

After some reading and alittle trial and error I managed to do exactly that.

So far I have added three recipes to the Poison skill under a new heading called Ammunition.  The recipes are currently available for sell at your local dwarf-mart, and since they require crafted weapon coatings to produce I figured a 1st tier poison skill should suffice.

My questions obviously relate more to how I have done it rather then what or why.  Basic break down of what I've done
  • Added the new recipes and recipe type using the recipes.xls blah blah.
  • Added new recipe items and injected them into the dwarfs inventory using a PRCSCR
  • Added new items that serve as the craftables providing descriptions and an on acquire event
  • Added module event handler that destroys the crafted item and creates a full stack (99) of the relevent arrows when triggered.
The module event as I understand it runs anytime there is an event but only really does anything in the event that one of my custom items is aquired/crafted then falls through to the default event handler.
Are there any better ways of doing it and can I clean up this code any?

#include "events_h"
#include "wrappers_h"

void main()
{
    event ev = GetCurrentEvent();
    int nEventType = GetEventType(ev);

    switch(nEventType)
    {
        case EVENT_TYPE_CAMPAIGN_ITEM_ACQUIRED:
        {
            object oAcquirer = GetEventCreator(ev); // item acquirer
            object oItemAcquired = GetEventObject(ev, 0); // the item that's been acquired
    // Insert event-handling code here.
            if (GetTag(oItemAcquired) == "gen_im_wep_rng_amm_far_qui")
            {
                RemoveItem(oItemAcquired);
                CreateItemOnObject(R"gen_im_wep_rng_amm_far.uti", oAcquirer, 99, "", TRUE); // repeat this for each item
                break;
            }
            if (GetTag(oItemAcquired) == "gen_im_wep_rng_amm_fil_qui")
            {
                RemoveItem(oItemAcquired);
                CreateItemOnObject(R"gen_im_wep_rng_amm_fil.uti", oAcquirer, 99, "", TRUE); // repeat this for each item
                break;
            }
            if (GetTag(oItemAcquired) == "gen_im_wep_rng_amm_iar_qui")
            {
                RemoveItem(oItemAcquired);
                CreateItemOnObject(R"gen_im_wep_rng_amm_iar.uti", oAcquirer, 99, "", TRUE); // repeat this for each item
                break;
            }
            break;
        }
    }
    HandleEvent(ev, RESOURCE_SCRIPT_AREA_CORE);
}

Everything seem so work fine just curious and thanks.  Oh uh personal mod blah blah.