Aller au contenu

Photo

Earn Experience For Stealing?


  • Veuillez vous connecter pour répondre
2 réponses à ce sujet

#1
Katabug

Katabug
  • Members
  • 3 messages
I've decided to try my hand at making a mod for DA:O. What I'd like to do, is create a thief friendly mod that gives XP for successfuly pickpocketing/stealing (the way lockpicking and disarming traps does).

But unfortunately, I have very little experience with scripting and so far, I haven't even been able to find the scripts that govern stealing and lockpicking.

Does anybody know if what I want to do is possible? And if so, where would I start?

Any advice would be much appreciated.

#2
Katabug

Katabug
  • Members
  • 3 messages
Aha! I found the 'skill_stealing.nss'.

I think the section I need to add to is this part:

-----------------------------------------------------------------------------------------------------------------------------------------------------------

     // determine outcome
                    if (fThiefScore > fTargetScore)
                    {
                        // if there is space in inventory
                        int nCurrentInventory = GetArraySize(GetItemsInInventory(stEvent.oCaster, GET_ITEMS_OPTION_BACKPACK, 0, "", TRUE));
                        int nMaxInventory = GetMaxInventorySize(stEvent.oCaster);
                        if (nCurrentInventory < nMaxInventory)
                        {
                            // mark as stolen from
                            SetLocalInt(stEvent.oTarget, FLAG_STOLEN_FROM, TRUE);

                            // generate new stolen treasure
                            TreasureStolen(stEvent.oTarget, stEvent.oCaster);

                            // signal area if friendly
                            if (bTargetFriendly == TRUE)
                            {
                                // signal area
                                event ev = Event(EVENT_TYPE_STEALING_SUCCESS);
                                ev = SetEventObject(ev, 0, stEvent.oCaster);
                                ev = SetEventObject(ev, 1, stEvent.oTarget);
                                SignalEvent(GetArea(stEvent.oCaster), ev);
                            }

                            // Track success stat
                            STATS_TrackStealing(TRUE);

---------------------------------------------------------------------------------------------------------------------------------------------------------

I'm not sure what I'm doing, but I've been looking at 'sys_rewards_h.nss' and I'm wondering if I add this line:

                nXP = FloatToInt(RewardGetXPValue(oTarget) * 2.5f);

To the //signal area section, like so:

                                // signal area

                                event ev = Event(EVENT_TYPE_STEALING_SUCCESS);

                                ev = SetEventObject(ev, 0, stEvent.oCaster);

                                ev = SetEventObject(ev, 1, stEvent.oTarget);

                                SignalEvent(GetArea(stEvent.oCaster), ev);
                                nXP = FloatToInt(RewardGetXPValue(oTarget) * 2.5f);

Would it work? Would I now get experience for successfuly stealing?

#3
Sunjammer

Sunjammer
  • Members
  • 926 messages
I'm AFT at the moment but from looking at the code you posted it would only work if bTargetFriendly was equal to TRUE which I don't think is what you want. The if (fThiefScore > fTargetScore) determines if they attempt was successful, the if (nCurrentInventory < nMaxInventory) determines if there was actually something to steal. So I suspect you want place the line giving the XP in one of those blocks rather than nesting the the bTargetFriendly block.

I'll take a closer look when I get back to the toolset.