Extra % Gold Drop with Parameter

11/06/2014 15:03 raventh1984#1
Hi elitepvpers,

I am currently testing some new things and one of them is to have an
DST_GOLD i know its already in the source. But its for something else. At least i think it is.

So what i did was creating my own DST named DST_GOLD1

So i have taken an look into mover.cpp where the nNumGold is located

nNumGold = (int)( nNumGold * prj.m_EventLua.GetGoldDropFactor());

So what i did next was something like this

Code:
//nNumGold	= (int)( nNumGold * prj.m_EventLua.GetGoldDropFactor());
							float fFactor = prj.m_EventLua.GetGoldDropFactor();
							int nDstGold = GetParam( DST_GOLD1, 0 );
							if( nDstGold < 0 )
								fFactor *= ( 1.0f + ( nDstGold / 100.0f ) );
							nNumGold = ( int ) (nNumGold * fFactor);
Original code goes to Wurst

However it aint working.
If i change this

int nDstGold = GetParam( DST_GOLD1, 0 );

to

int nDstGold = 1000;

Then its working like it should be.
So as far as i can see its not picking up the DST_GOLD1 value
Its defined and its located in Spec_Item.txt.

Any help would be appriciated.
11/06/2014 16:18 .SnoX#2
You mean this?
[Only registered and activated users can see links. Click Here To Register...]
11/06/2014 18:40 raventh1984#3
I have taken an look into it. But is it player related? or is it overall?

I want it to be something like this

Ex. Player 1 has 20% increase gold drop.
Player 2 has 45% increase in gold drop.

So for both players the Gold drop is different.

Edit:

Tested the code that Snox has provided.
Didnt worked.
Now i am thinking its because of my Spec_Item
Ex Guardian Sword
Code:
DST_ATTACKSPEED	DST_CHR_CHANCECRITICAL	DST_CRITICAL_BONUS	DST_REFLECT_DAMAGE	DST_ADJ_HITRATE	DST_GOLD1	240	6	10	3	10	100
I changed this code in mover.cpp
Code:
if( pAttacker->GetAdjParam( DST_GOLD1) > 0 )
            {
                npenyafaktor *= pAttacker->GetAdjParam( DST_GOLD1);
            }
To

Code:
if( pAttacker->GetAdjParam( DST_ATTACKSPEED ) > 0 )
            {
                npenyafaktor *= pAttacker->GetAdjParam( DST_ATTACKSPEED );
            }
And now its working.
So i need to check if my problem is not somewhere else.