Newbie Spellweaver
- Joined
- Mar 22, 2010
- Messages
- 64
- Reaction score
- 16
To get luna to use the droprate.txt file you must edit 5 source files in mapserver then compile it [i recommend to clean recompile all 3 server exe's after making these changes] .
here is which ones:
ServerGameDefine.h
ServerSystem.cpp
Distributer.cpp
DistributeWay.cpp
ItemDrop.cpp
and here is what to change in them
edit mapserver at the following locations:
mapserver-->common-->ServerGameDefine.h
{look for the following an comment out only the first 4 extern float lines the rest havnt been tested yet}
mapserver-->source files-->ServerSystem.cpp
{look for the following}
{and change it to this}
mapserver-->object-->Distributer.cpp
{look for the following an comment out all these float lines except the last 2 [then go to the next section]}
{look for the following}
{and change it to this}
mapserver-->source files-->gamesystem-->party-->distributeway-->DistributeWay.cpp
{look for the following}
{and change it to this}
mapserver-->source files-->gamesystem-->item-->ItemDrop.cpp
{look for the following}
{and change it to this [then go to the next section]}
{look for the following}
{and change it to this}
[this is for luna classic source but may work for plus as well]
getting luna to read an use the droprate file like this isn't perfect i still have to test some things an as i finish testing i will update this as needed for now at least this is better then haveing to change the source every time to change the rates
[credit to maryjason for helping with the coding]
here is which ones:
ServerGameDefine.h
ServerSystem.cpp
Distributer.cpp
DistributeWay.cpp
ItemDrop.cpp
and here is what to change in them
edit mapserver at the following locations:
mapserver-->common-->ServerGameDefine.h
{look for the following an comment out only the first 4 extern float lines the rest havnt been tested yet}
Code:
#define GRID_BIT 5
extern DWORD gCurTime;
extern DWORD gTickTime;
// °æÇèÄ¡ & ¾Æ?ÌÅÛ & µ· µå¶ø?² ö?ý - RaMa 04.10.16
extern float gExpRate;
extern float gAbilRate;
extern float gItemRate;
extern float gMoneyRate;
//
extern float gDamageReciveRate; // ¹Þ´Â µ¥¹ÌÃö
extern float gDamageRate; // ÃÖ´Â µ¥¹ÌÃö
extern float gNaeRuykRate; // ³»·Â¼Ò¸ð
extern float gUngiSpeed; // ¿î±âö½Ä ½ºÇǵå
extern float gPartyExpRate; // ÆÄƼ°æÇèÄ¡
extern float gGetMoney; // ¾ò´Âµ·?Ç ¹è¼ö
extern float gSkillExpRate; // ¹«°ø°æÇèÄ¡ ¹è¼ö
// Etc
mapserver-->source files-->ServerSystem.cpp
{look for the following}
Code:
// RaMa -04.11.24
while( !file.IsEOF() )
{
file.GetString(Token);
if(strcmp(Token,"#EXP") == 0)
{
//gExpRate = file.GetFloat();
gEventRateFile[eEvent_ExpRate] = file.GetFloat();
}
else if(strcmp(Token, "#ABIL") == 0)
{
//gAbilRate = file.GetFloat();
gEventRateFile[eEvent_AbilRate] = file.GetFloat();
}
else if(strcmp(Token,"#ITEM") == 0)
{
//gItemRate = file.GetFloat();
gEventRateFile[eEvent_ItemRate] = file.GetFloat();
}
else if(strcmp(Token,"#MONEY") == 0)
{
//gMoneyRate = file.GetFloat();
gEventRateFile[eEvent_MoneyRate] = file.GetFloat();
}
else if(strcmp(Token,"#GETMONEY") == 0)
{
//gGetMoney = file.GetFloat();
gEventRateFile[eEvent_GetMoney] = file.GetFloat();
}
else if(strcmp(Token,"#DAMAGERECIVE") == 0)
{
//gDamageReciveRate = file.GetFloat();
gEventRateFile[eEvent_DamageReciveRate] = file.GetFloat();
}
else if(strcmp(Token,"#DAMAGERATE") == 0)
{
//gDamageRate = file.GetFloat();
gEventRateFile[eEvent_DamageRate] = file.GetFloat();
}
else if(strcmp(Token,"#MANASPEND") == 0)
{
//gNaeRuykRate = file.GetFloat();
gEventRateFile[eEvent_ManaRate] = file.GetFloat();
}
else if(strcmp(Token,"#UNGISPEED") == 0)
{
//gUngiSpeed = file.GetFloat();
gEventRateFile[eEvent_UngiSpeed] = file.GetFloat();
}
else if(strcmp(Token,"#PARTYEXP") == 0)
{
//gPartyExpRate = file.GetFloat();
gEventRateFile[eEvent_PartyExpRate] = file.GetFloat();
}
else if(strcmp(Token,"#SKILLEXPRATE") == 0)
{
gEventRateFile[eEvent_SkillExp] = file.GetFloat();
}
}
file.Release();
for(i=0; i<eEvent_Max; ++i)
gEventRate[i] = gEventRateFile[i];
return TRUE;
}
{and change it to this}
Code:
// RaMa -04.11.24
while( !file.IsEOF() )
{
file.GetString(Token);
if(strcmp(Token,"#EXP") == 0)
{
//gExpRate = file.GetFloat();
gEventRateFile[eEvent_ExpRate] = file.GetFloat();
gEventRate[eEvent_ExpRate] = gEventRateFile[eEvent_ExpRate];
}
else if(strcmp(Token, "#ABIL") == 0)
{
//gAbilRate = file.GetFloat();
gEventRateFile[eEvent_AbilRate] = file.GetFloat();
gEventRate[eEvent_AbilRate] = gEventRateFile[eEvent_AbilRate];
}
else if(strcmp(Token,"#ITEM") == 0)
{
//gItemRate = file.GetFloat();
gEventRateFile[eEvent_ItemRate] = file.GetFloat();
gEventRate[eEvent_ItemRate] = gEventRateFile[eEvent_ItemRate];
}
else if(strcmp(Token,"#MONEY") == 0)
{
//gMoneyRate = file.GetFloat();
gEventRateFile[eEvent_MoneyRate] = file.GetFloat();
gEventRate[eEvent_MoneyRate] = gEventRateFile[eEvent_MoneyRate];
}
else if(strcmp(Token,"#GETMONEY") == 0)
{
//gGetMoney = file.GetFloat();
gEventRateFile[eEvent_GetMoney] = file.GetFloat();
gEventRate[eEvent_GetMoney] = gEventRateFile[eEvent_GetMoney];
}
else if(strcmp(Token,"#DAMAGERECIVE") == 0)
{
//gDamageReciveRate = file.GetFloat();
gEventRateFile[eEvent_DamageReciveRate] = file.GetFloat();
gEventRate[eEvent_DamageReciveRate] = gEventRateFile[eEvent_DamageReciveRate];
}
else if(strcmp(Token,"#DAMAGERATE") == 0)
{
//gDamageRate = file.GetFloat();
gEventRateFile[eEvent_DamageRate] = file.GetFloat();
gEventRate[eEvent_DamageRate] = gEventRateFile[eEvent_DamageRate];
}
else if(strcmp(Token,"#MANASPEND") == 0)
{
//gNaeRuykRate = file.GetFloat();
gEventRateFile[eEvent_ManaRate] = file.GetFloat();
gEventRate[eEvent_ManaRate] = gEventRateFile[eEvent_ManaRate];
}
else if(strcmp(Token,"#UNGISPEED") == 0)
{
//gUngiSpeed = file.GetFloat();
gEventRateFile[eEvent_UngiSpeed] = file.GetFloat();
gEventRate[eEvent_UngiSpeed] = gEventRateFile[eEvent_UngiSpeed];
}
else if(strcmp(Token,"#PARTYEXP") == 0)
{
//gPartyExpRate = file.GetFloat();
gEventRateFile[eEvent_PartyExpRate] = file.GetFloat();
gEventRate[eEvent_PartyExpRate] = gEventRateFile[eEvent_PartyExpRate];
}
else if(strcmp(Token,"#SKILLEXPRATE") == 0)
{
gEventRateFile[eEvent_SkillExp] = file.GetFloat();
gEventRate[eEvent_SkillExp] = gEventRateFile[eEvent_SkillExp];
}
}
file.Release();
for(i=0; i<eEvent_Max; ++i)
gEventRate[i] = gEventRateFile[i];
return TRUE;
}
mapserver-->object-->Distributer.cpp
{look for the following an comment out all these float lines except the last 2 [then go to the next section]}
Code:
#include "MHError.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
float gExpRate = 20.0f; //090113 modified by XB delete note
float gItemRate = 8.0f; //090113 modified by XB delete note
float gMoneyRate = 16.0f; //090113 modified by XB delete note
//// RaMa -04.11.24
//float gDamageReciveRate = 1.0f; // ¹Þ´Â µ¥¹ÌÁö
//float gDamageRate = 1.0f; // ÁÖ´Â µ¥¹ÌÁö
//float gNaeRuykRate = 1.0f; // ³»·Â¼Ò¸ð
//float gUngiSpeed = 1.0f; // ¿î±âÁ¶½Ä ½ºÇǵå
//float gPartyExpRate = 1.0f; // ÆÄƼ°æÇèÄ¡
//float gAbilRate = 1.0f; // Ư±âÄ¡
//float gGetMoney = 1.0f; // ¾ò´Âµ·ÀÇ ¹è¼ö
//float gSkillExpRate = 1.0f; // ¹«°ø°æÇèÄ¡ ¹è¼ö
//// Etc - ¾ÆÁ÷¾ÈµÊ
//float gDefence = 1.0f; // ¹æ¾î·Â
//
float gEventRate[eEvent_Max];
float gEventRateFile[eEvent_Max];
BOOL g_bPlusTime = FALSE;
{look for the following}
Code:
// 080530 LYW --- Distributer : Modified data type of exp to DWORDEX ;
//// 071221 KTH --- Add
//Exp = (DWORD)(Exp*gEventRate[eEvent_ExpRate]);
//Exp += EXPTYPE(Exp * (pReceivePlayer->GetRateBuffStatus()->GetExp/100));
float fBuffExp = 0.0f ;
fBuffExp = pReceivePlayer->GetRateBuffStatus()->GetExp ;
//Exp = (DWORDEX)(Exp*gEventRate[eEvent_ExpRate]) ;
Exp += EXPTYPE(Exp*(fBuffExp/100)) ;
// Çʵ庸½º - 05.12 ÀÌ¿µÁØ
// Çʵ庸½ºÀÇ °æÇèÄ¡ ¼ö·ÃÄ¡ µ· ºÐ
if(pMob->GetObjectKind() == eObjectKind_FieldBossMonster)
{and change it to this}
Code:
// 080530 LYW --- Distributer : Modified data type of exp to DWORDEX ;
//// 071221 KTH --- Add
//Exp = (DWORD)(Exp*gEventRate[eEvent_ExpRate]);
//Exp += EXPTYPE(Exp * (pReceivePlayer->GetRateBuffStatus()->GetExp/100));
//float fBuffExp = 0.0f ;
//fBuffExp = pReceivePlayer->GetRateBuffStatus()->GetExp ;
float fBuffExp = pReceivePlayer->GetRateBuffStatus()->GetExp;
char cVal[32];
sprintf(cVal,"%f",gEventRate[eEvent_ExpRate]);
Exp = (DWORDEX)(Exp*gEventRate[eEvent_ExpRate]) ;
Exp += EXPTYPE(Exp*(fBuffExp/100)) ;
// Çʵ庸½º - 05.12 ÀÌ¿µÁØ
// Çʵ庸½ºÀÇ °æÇèÄ¡ ¼ö·ÃÄ¡ µ· ºÐ
if(pMob->GetObjectKind() == eObjectKind_FieldBossMonster)
mapserver-->source files-->gamesystem-->party-->distributeway-->DistributeWay.cpp
{look for the following}
Code:
#include "pet.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CDistributeWay::CDistributeWay()
{
}
CDistributeWay::~CDistributeWay()
{
}
// 080530 LYW --- DistributeWay : Modified data type DWORD to DWORDEX(EXPTYPE).
//void CDistributeWay::SendToPersonalExp(CPlayer* pReceivePlayer, DWORD Exp)
void CDistributeWay::SendToPersonalExp(CPlayer* pReceivePlayer, EXPTYPE Exp)
{
// ºñÀ² Ãß°¡ - RaMa 04.10.18
Exp *= gExpRate; //090113 Modified by XB EXP rat
// ¼öÁ¤ - RaMa 05.05.11
// 070413 LYW --- DistributerWay : Modified SendToPersonalExp.
/*
Exp = (DWORD)(Exp*gEventRate[eEvent_ExpRate]);
//060719 ¹®ÆÄÆ÷ÀÎÆ®
DWORD AddExpFromGuildPlustime = 0;
{and change it to this}
Code:
#include "pet.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CDistributeWay::CDistributeWay()
{
}
CDistributeWay::~CDistributeWay()
{
}
// 080530 LYW --- DistributeWay : Modified data type DWORD to DWORDEX(EXPTYPE).
//void CDistributeWay::SendToPersonalExp(CPlayer* pReceivePlayer, DWORD Exp)
void CDistributeWay::SendToPersonalExp(CPlayer* pReceivePlayer, EXPTYPE Exp)
{
// ºñÀ² Ãß°¡ - RaMa 04.10.18
//Exp *=gExpRate; //090113 Modified by XB EXP rat
// ¼öÁ¤ - RaMa 05.05.11
// 070413 LYW --- DistributerWay : Modified SendToPersonalExp.
Exp = (DWORD)(Exp*gEventRate[eEvent_ExpRate]);
/*
//060719 ¹®ÆÄÆ÷ÀÎÆ®
DWORD AddExpFromGuildPlustime = 0;
mapserver-->source files-->gamesystem-->item-->ItemDrop.cpp
{look for the following}
Code:
ResultMoney *= gMoneyRate; //090113 modified by XB £¬MoneyDrop rate
return ResultMoney ; // ȹµæ ¸Ó´Ï¸¦ ¹ÝȯÇÑ´Ù.
}
// // 070506 LYW --- ItemDrop : Add for test.
//#ifdef _DEBUG
{and change it to this [then go to the next section]}
Code:
//ResultMoney *= gMoneyRate; //090113 modified by XB £¬MoneyDrop rate
ResultMoney *= (MONEYTYPE)gEventRate[eEvent_MoneyRate];
return ResultMoney ; // ȹµæ ¸Ó´Ï¸¦ ¹ÝȯÇÑ´Ù.
}
// // 070506 LYW --- ItemDrop : Add for test.
//#ifdef _DEBUG
{look for the following}
Code:
// 070419 LYW --- ItemDrop : Add new function to drop item.
//#ifdef _DEBUG
BOOL CItemDrop::NewMonsterDropItem(WORD MonsterKind, MONSTER_DROPITEM* pDropItem, CPlayer* pPlayer, int nPenaltyType, MSG_DROPITEM_RESULT* pResult)
{
if( !pDropItem || !pPlayer ) return FALSE ; // ¾ÆÀÌÅÛ Á¤º¸¿Í Ç÷¹À̾î Á¤º¸¸¦ üũÇÑ´Ù.
if( pDropItem->wItemIdx == 0 ) return FALSE ; // µå¶ø ¾ÆÀÌÅÛÀÇ À妽º¸¦ üũÇÑ´Ù.
// 080115 LYW --- ItemDrop : GMÅø¿¡¼ ¾ÆÀÌÅÛ µå¶ø·ü Àû¿ë ó¸®.
//DWORD dwDropRateValue = pDropItem->dwDropPercent ; // µå¶ø·üÀ» ¹Þ´Â´Ù.
if( gEventRate[eEvent_ItemRate] < 0 ) // Ȥ½Ã¶óµµ À½¼ö°¡ µé¾î¿À¸é,
{
gEventRate[eEvent_ItemRate] = 1 ; // ¾Æ·¡ È®·üÀÌ Å«Àϳ´Ù.
}
DWORD dwDropRateValue = 0 ;
//dwDropRateValue = (DWORD)(gEventRate[eEvent_ItemRate] * pDropItem->dwDropPercent) ; // µå¶ø·ü º¯°æ.
dwDropRateValue = (DWORD)(pDropItem->dwDropPercent) ; // µå¶ø·ü º¯°æ.
// 071204 -- KTH µå¶øÀ² »ó½Â Buff Àû¿ë
dwDropRateValue += DWORD( dwDropRateValue * (pPlayer->GetRateBuffStatus()->IncreaseDropRate/100) );
dwDropRateValue *= gItemRate; //090113 modified by XB add droprate
// stdlibÀÇ rand ÇÔ¼ö´Â ÃÖ´ë °ªÀÌ 32767±îÁö ³ª¿À±â ¶§¹®¿¡, random ÇÔ¼ö¸¦ ¾²±â·Î ÇÑ´Ù.
DWORD dwDropRate1 = random(0, 99) ; // ¾ÕÀÚ¸® »Ì±â È®·üÀ» ±¸ÇÑ´Ù.
{and change it to this}
Code:
// 070419 LYW --- ItemDrop : Add new function to drop item.
//#ifdef _DEBUG
BOOL CItemDrop::NewMonsterDropItem(WORD MonsterKind, MONSTER_DROPITEM* pDropItem, CPlayer* pPlayer, int nPenaltyType, MSG_DROPITEM_RESULT* pResult)
{
if( !pDropItem || !pPlayer ) return FALSE ; // ¾ÆÀÌÅÛ Á¤º¸¿Í Ç÷¹À̾î Á¤º¸¸¦ üũÇÑ´Ù.
if( pDropItem->wItemIdx == 0 ) return FALSE ; // µå¶ø ¾ÆÀÌÅÛÀÇ À妽º¸¦ üũÇÑ´Ù.
// 080115 LYW --- ItemDrop : GMÅø¿¡¼ ¾ÆÀÌÅÛ µå¶ø·ü Àû¿ë ó¸®.
//DWORD dwDropRateValue = pDropItem->dwDropPercent ; // µå¶ø·üÀ» ¹Þ´Â´Ù.
if( gEventRate[eEvent_ItemRate] < 0 ) // Ȥ½Ã¶óµµ À½¼ö°¡ µé¾î¿À¸é,
{
gEventRate[eEvent_ItemRate] = 1 ; // ¾Æ·¡ È®·üÀÌ Å«Àϳ´Ù.
}
DWORD dwDropRateValue = 0 ;
dwDropRateValue = (DWORD)(gEventRate[eEvent_ItemRate] * pDropItem->dwDropPercent) ; // µå¶ø·ü º¯°æ.
//dwDropRateValue = (DWORD)(pDropItem->dwDropPercent) ; // µå¶ø·ü º¯°æ.
// 071204 -- KTH µå¶øÀ² »ó½Â Buff Àû¿ë
dwDropRateValue += DWORD( dwDropRateValue * (pPlayer->GetRateBuffStatus()->IncreaseDropRate/100) );
//dwDropRateValue *= gItemRate; //090113 modified by XB add droprate
// stdlibÀÇ rand ÇÔ¼ö´Â ÃÖ´ë °ªÀÌ 32767±îÁö ³ª¿À±â ¶§¹®¿¡, random ÇÔ¼ö¸¦ ¾²±â·Î ÇÑ´Ù.
DWORD dwDropRate1 = random(0, 99) ; // ¾ÕÀÚ¸® »Ì±â È®·üÀ» ±¸ÇÑ´Ù.
[this is for luna classic source but may work for plus as well]
getting luna to read an use the droprate file like this isn't perfect i still have to test some things an as i finish testing i will update this as needed for now at least this is better then haveing to change the source every time to change the rates
[credit to maryjason for helping with the coding]
Last edited: