Is it possible to add something to the end of a script in order to add gil to all party members when the monster is killed?
Is that done in a script or is that hardcoded?
Making all mobs drop gil
-
- Posts: 16
- Joined: Fri Apr 05, 2013 6:05 pm
Re: Making all mobs drop gil
hmmm... I found the gil drop in the mobentity.cpp
Would it just be possible for me make it so candropgil is always true? Then I would also probably need to change the function above it:
Code: Select all
bool CMobEntity::CanDropGil()
{
// smaller than 0 means drop no gil
if(getMobMod(MOBMOD_GIL_MAX) < 0) return false;
if(getMobMod(MOBMOD_GIL_MIN) > 0 || getMobMod(MOBMOD_GIL_MAX))
{
return true;
}
return m_EcoSystem == SYSTEM_BEASTMEN;
}
Code: Select all
uint32 CMobEntity::GetRandomGil()
{
int16 min = getMobMod(MOBMOD_GIL_MIN);
int16 max = getMobMod(MOBMOD_GIL_MAX);
if(min && max)
{
// make sure divide won't crash server
if(max <= min)
{
max = min+1;
}
if(max-min <= 2)
{
max = min+2;
ShowWarning("CMobEntity::GetRandomGil Max value is set too low, defauting\n");
}
return rand()%(max-min)+min;
}
float gil = pow(GetMLevel(), 1.05f);
if(gil < 1){
gil = 1;
}
uint16 highGil = (float)(gil) / 3 + 4;
if(max)
{
highGil = max;
}
if(highGil < 2){
highGil = 2;
}
// randomize it
gil += rand()%highGil;
// NMs get more gil
if((m_Type & MOBTYPE_NOTORIOUS) == MOBTYPE_NOTORIOUS){
gil *= 10;
}
// thfs drop more gil
if(GetMJob() == JOB_THF){
gil = (float)gil * 1.5;
}
if(min && gil < min)
{
gil = min;
}
return gil;
}
-
- Posts: 16
- Joined: Fri Apr 05, 2013 6:05 pm
Re: Making all mobs drop gil
made the candropgil function always return true,
added:
min += 50;
max += 100;
to the getrandomgil function, and tested it, everything drops 50-100 gold
added:
min += 50;
max += 100;
to the getrandomgil function, and tested it, everything drops 50-100 gold