1.00Y mu blue?
or 1.03Y JPN :)
Printable View
What is the main JPN I can use as Season3 Episode 1 ?
May be something know how to fix pk item drop? PKItemDrop = 0/1 don't work
ExpSystem.cpp
ExpSystem.hPHP Code:#include "StdAfx.h"
CExpSysCfg ExpSysCfg;
MapExpRat MapExpRate[255];
int MapCount;
void CostumExpSystem_ConfigLoad()
{
FILE *fp;
BOOL bRead = FALSE;
DWORD dwArgv = 0;
char sLineTxt[255] = {0};
MapCount = 1;
fp = fopen("..//ImperialGames//Script//ExpSystem.script","r");
if(!fp)
{
MessageBoxA(NULL, "ExpSystem.script not found!", "File not found!", MB_OK);
::ExitProcess(0);
}
rewind(fp);
while(fgets(sLineTxt, 255, fp) != NULL)
{
if(sLineTxt[0] == '/')continue;
if(sLineTxt[0] == ';')continue;
int n[8];
float n2;
float n3;
char Name[11];
sscanf(sLineTxt, "%s %d %d %d", &Name, &n[0], &n2,&n3);
sprintf(MapExpRate[MapCount].Name,"%s",Name);
MapExpRate[MapCount].MapID = n[0];
MapExpRate[MapCount].ExpRate = n2;
MapExpRate[MapCount].VipExpRate = n3;
MapCount++;
}
cLog.ConsoleOutput("[File Manager] File ..//ImperialGames//Script//ExpSystem.script has been loaded!");
rewind(fp);
fclose(fp);
}
void SetMapExp(DWORD PlayerID,int Map)
{
Player.SetIndex(PlayerID);
float * EXPERIENCE = (float *)(0x7A81A8); // GameServer 1.00.90
for(int x=1;x < MapCount;x++)
{
if(MapExpRate[x].MapID = Map)
{
if(Player.isVip = false)
{
(*EXPERIENCE)= (float)MapExpRate[x].ExpRate;
}
else
{
(*EXPERIENCE)= (float)MapExpRate[x].VipExpRate;
}
}
else
{
(*EXPERIENCE)= (float)GetPrivateProfileInt("GameServerInfo", "ExperienceRate", 20, "..\\data\\CommonServer.cfg");
}
}
}
Main Function put:PHP Code:void CostumExpSystem_ConfigLoad();
void CostumExpSystem(void * lpParam);
void SetMapExp(DWORD PlayerID,int Map);
void CostumExpSystem_SystemLoad();
struct CExpSysCfg
{
int Enabled;
char msg[255];
};
typedef struct CMapExpRate
{
char Name[255];
int MapID;
float ExpRate;
float VipExpRate;
}MapExpRat;
extern MapExpRat MapExpRate[255];
extern int MapCount;
extern CExpSysCfg ExpSysCfg;
Protocol Monster Kill Function:PHP Code:ExpSysCfg.Enabled = 1;
CostumExpSystem_ConfigLoad();
ExpSystem.scriptPHP Code:SetMapExp(PlayerID,gObj->Map)
[hr]Code://Name Map NormalExp VipExp
Lorencia 0 1000 2000
Note: didnt test...[hr]
NEW UPDATE!!! Support Normal Drop and Vip drop settings!!PHP Code:case 0x17: // NPC Die
.........
break;
ExpSystem.cpp
ExpSystem.hPHP Code:void CostumExpSystem_ConfigLoad()
{
FILE *fp;
BOOL bRead = FALSE;
DWORD dwArgv = 0;
char sLineTxt[255] = {0};
MapCount = 1;
fp = fopen("..//ImperialGames//Script//ExpSystem.script","r");
if(!fp)
{
MessageBoxA(NULL, "ExpSystem.script not found!", "File not found!", MB_OK);
::ExitProcess(0);
}
rewind(fp);
while(fgets(sLineTxt, 255, fp) != NULL)
{
if(sLineTxt[0] == '/')continue;
if(sLineTxt[0] == ';')continue;
int n[8];
float n2;
float n3;
char Name[11];
sscanf(sLineTxt, "%s %d %d %d %d %d", &Name, &n[0], &n2,&n3,&n[1],&n[2]);
sprintf(MapExpRate[MapCount].Name,"%s",Name);
MapExpRate[MapCount].MapID = n[0];
MapExpRate[MapCount].ExpRate = n2;
MapExpRate[MapCount].VipExpRate = n3;
MapExpRate[MapCount].DropRate = n[1];
MapExpRate[MapCount].VipDropRate = n[2];
MapCount++;
}
cLog.ConsoleOutput("[File Manager] File ..//ImperialGames//Script//ExpSystem.script has been loaded!");
rewind(fp);
fclose(fp);
}
void SetMapExp(DWORD PlayerID,int Map)
{
Player.SetIndex(PlayerID);
float * EXPERIENCE = (float *)(0x7A81A8); // GameServer 1.00.90
for(int x=1;x < MapCount;x++)
{
if(MapExpRate[x].MapID = Map)
{
if(Player.isVip = false)
{
int NormalDrop = MapExpRate[x].DropRate;
(*EXPERIENCE)= (float)MapExpRate[x].ExpRate;
__asm
{
MOV EAX,NormalDrop
MOV DWORD PTR DS:[0x007A8170],EAX // GameServer 1.00.90
}
}
else
{
int VipDrop = MapExpRate[x].VipDropRate;
(*EXPERIENCE)= (float)MapExpRate[x].VipExpRate;
__asm
{
MOV EAX,VipDrop
MOV DWORD PTR DS:[0x007A8170],EAX // GameServer 1.00.90
}
}
}
else
{
int OrginalDrop = GetPrivateProfileInt("GameServerInfo", "ItemDropRate", 20, "..\\data\\CommonServer.cfg");
(*EXPERIENCE)= (float)GetPrivateProfileInt("GameServerInfo", "ExperienceRate", 20, "..\\data\\CommonServer.cfg");
__asm
{
MOV EAX,OrginalDrop
MOV DWORD PTR DS:[0x007A8170],EAX // GameServer 1.00.90
}
}
}
}
Config file:PHP Code:typedef struct CMapExpRate
{
char Name[255];
int MapID;
float ExpRate;
float VipExpRate;
int DropRate;
int VipDropRate;
}MapExpRat;
Code://Name Map NormalExp VipExp NormalDrop VipDrop
Lorencia 0 1000 2000 50 100
BootStat,can you give function for this:
Player.SetIndex
and this:
Player.isVip
i have error :-)
Code:Error 1 error C2065: 'Player' : undeclared identifier Z:\kGamesSrc\kGames\GameServer\ExpSystem.cpp 47 1 GameServer
Error 2 error C2228: left of '.SetIndex' must have class/struct/union Z:\kGamesSrc\kGames\GameServer\ExpSystem.cpp 47 1 GameServer
Error 3 error C2065: 'Player' : undeclared identifier Z:\kGamesSrc\kGames\GameServer\ExpSystem.cpp 54 1 GameServer
Error 4 error C2228: left of '.isVip' must have class/struct/union Z:\kGamesSrc\kGames\GameServer\ExpSystem.cpp 54 1 GameServer
hey gyiz does someone have a source for LorenMarket NPC ??????
I think this system causes latency in huge servers with hi-load (easy xp with lot of players). As I can see, all the time that player kills a monster, the function changes the exp/drop, so the server must perform the function several times in second. :(:
Anyway, in hard servers must work fine. Nice release ;)
im aware of that ;) but i dont have any other idea where to hook it! If someone has ideas share them!
And i bring new update, i got interested in exp system so i made new updates, i renamed this source to CostumRateSystem :D!
CostumRateSystem.cpp
CostumRateSystem.hPHP Code://====================================================================
//Costum Server Rate System
//Made by System32 aka BootStat
//====================================================================
#include "StdAfx.h"
//-------------------------------------------------------
extern MapExpRat MapExpRate[255];
extern RateSystem CRateSystem;
//-------------------------------------------------------
void RateSystem::Init()
{
//-------------------------------------------------------
FILE *fp;
//-------------------------------------------------------
this->bRead = FALSE;
this->dwArgv = 0;
this->sLineTxt[255] = {0};
this->SettingsCount = 0;
//-------------------------------------------------------
fp = fopen("..//ImperialGames//Script//CostumRateSystem.script","r");
//-------------------------------------------------------
if(!fp)
{
//-------------------------------------------------------
MessageBoxA(NULL, "CostumRateSystem.script not found!", "File not found!", MB_OK);
::ExitProcess(0);
//-------------------------------------------------------
}
//-------------------------------------------------------
rewind(fp);
//-------------------------------------------------------
while(fgets(sLineTxt, 255, fp) != NULL)
{
//-------------------------------------------------------
if(sLineTxt[0] == '/')continue;
if(sLineTxt[0] == ';')continue;
//-------------------------------------------------------
sscanf(sLineTxt, "%s %d %s %s %d %d %d %d %d %d %d %d %d %d", &this->MapName, &this->Values[0], &this->normExp,&this->vipExp,&this->Values[1],&this->Values[2],&this->Points[0],&this->Points[1],&this->Points[2],&this->Points[3],&this->Points[4],&this->Points[5],&this->Points[6],&this->Points[7]);
//-------------------------------------------------------
sprintf(MapExpRate[this->SettingsCount].Name,"%s",this->MapName);
sprintf(MapExpRate[this->SettingsCount].ExpRate,"%s",this->normExp);
sprintf(MapExpRate[this->SettingsCount].VipExpRate,"%s",this->vipExp);
//-------------------------------------------------------
MapExpRate[this->SettingsCount].MapID = this->Values[0];
MapExpRate[this->SettingsCount].DropRate = this->Values[1];
MapExpRate[this->SettingsCount].VipDropRate = this->Values[2];
//-------------------------------------------------------
MapExpRate[this->SettingsCount].DLPoint = this->Points[0];
MapExpRate[this->SettingsCount].MGPoint = this->Points[1];
MapExpRate[this->SettingsCount].NormalPoint = this->Points[2];
MapExpRate[this->SettingsCount].AfterMarlonPoint = this->Points[3];
//-------------------------------------------------------
MapExpRate[this->SettingsCount].VipDLPoint = this->Points[4];
MapExpRate[this->SettingsCount].VipMGPoint = this->Points[5];
MapExpRate[this->SettingsCount].VipNormalPoint = this->Points[6];
MapExpRate[this->SettingsCount].VipAfterMarlonPoint = this->Points[7];
//-------------------------------------------------------
this->SettingsCount++;
//-------------------------------------------------------
cLog.ConsoleOutput("[CRateSystem] Load Setting: Name %s, MapID %d, NormalExp %s, VipExp %s,NormalDrop %d, VipDrop %d",this->MapName,this->Values[0],this->normExp,this->vipExp,this->Values[1],this->Values[2]);
cLog.ConsoleOutput("[CRateSystem] Point Settings: DL %d, MG %d, Normal %d, AfterMarlon %d / VipDL %d, VipMG %d, VipNormal %d, VipAfterMarlon %d",this->Points[0],this->Points[1],this->Points[2],this->Points[3],this->Points[4],this->Points[5],this->Points[6],this->Points[7]);
}
//-------------------------------------------------------
GetPrivateProfileString("GameServerInfo","ExperienceRate","200",this->OrginalExp,sizeof(this->OrginalExp),"..\\data\\CommonServer.cfg");
this->OrginalDrop = GetPrivateProfileInt("GameServerInfo", "ItemDropRate", 20, "..\\data\\CommonServer.cfg");
this->orgDLPoint = GetPrivateProfileInt("GameServerInfo","LevelUpPointsForDL",7,"..\\data\\CommonServer.cfg");
this->orgMGPoint = GetPrivateProfileInt("GameServerInfo","LevelUpPointsForMG",7,"..\\data\\CommonServer.cfg");
this->orgNormalPoint = GetPrivateProfileInt("GameServerInfo","LevelUpPointsForDK-ELF-DW-SUM",5,"..\\data\\CommonServer.cfg");
this->orgAfterMarlonPoint = GetPrivateProfileInt("GameServerInfo","ExtraPointsAfterMarlonQuest",1,"..\\data\\CommonServer.cfg");
//-------------------------------------------------------
cLog.ConsoleOutput("[File Manager] File ..//ImperialGames//Script//CostumRateSystem.script has been loaded!");
//-------------------------------------------------------
rewind(fp);
fclose(fp);
//-------------------------------------------------------
}
void RateSystem::Work(DWORD PlayerID,int Map)
{
//-------------------------------------------------------
for(int x=1;x < this->SettingsCount;x++)
{
//-------------------------------------------------------
if(MapExpRate[x].MapID = Map)
{
//-------------------------------------------------------
if(isVip(PlayerID) = false)
{
//-------------------------------------------------------
this->EditExp(MapExpRate[x].ExpRate);
this->EditDrop(MapExpRate[x].DropRate);
this->EditPoints(MapExpRate[x].DLPoint,MapExpRate[x].MGPoint,MapExpRate[x].NormalPoint,MapExpRate[x].AfterMarlonPoint);
//-------------------------------------------------------
}
//-------------------------------------------------------
else
{
//-------------------------------------------------------
this->EditExp(MapExpRate[x].VipExpRate);
this->EditDrop(MapExpRate[x].VipDropRate);
this->EditPoints(MapExpRate[x].VipDLPoint,MapExpRate[x].VipMGPoint,MapExpRate[x].VipNormalPoint,MapExpRate[x].VipAfterMarlonPoint);
//-------------------------------------------------------
}
//-------------------------------------------------------
}
//-------------------------------------------------------
else
{
//-------------------------------------------------------
this->EditExp(this->OrginalExp);
this->EditDrop(this->OrginalDrop);
this->EditPoints(this->orgDLPoint,this->orgMGPoint,this->orgNormalPoint,this->orgAfterMarlonPoint);
//-------------------------------------------------------
}
//-------------------------------------------------------
}
//-------------------------------------------------------
}
void RateSystem::EditExp(char Exp[256])
{
//-------------------------------------------------------
float * EXPERIENCE = (float *)(0x7A81A8);
(*EXPERIENCE)= (float)atof(Exp);
//-------------------------------------------------------
}
void RateSystem::EditDrop(int Drop)
{
//-------------------------------------------------------
__asm
{
//-------------------------------------------------------
MOV EAX,Drop
MOV DWORD PTR DS:[0x007A8170],EAX
//-------------------------------------------------------
}
//-------------------------------------------------------
}
void RateSystem::EditPoints(int DL, int MG, int Normal, int AfterMarlon)
{
//-------------------------------------------------------
*(unsigned char*) GS_LVL_UP_DL1 = (BYTE)DL;
*(unsigned char*) GS_LVL_UP_DL2 = (BYTE)DL;
*(unsigned char*) GS_LVL_UP_DL3 = (BYTE)DL;
*(unsigned char*) GS_LVL_UP_DL4 = (BYTE)DL;
*(unsigned char*) GS_LVL_UP_DL5 = (BYTE)DL;
//-------------------------------------------------------
*(unsigned char*) GS_LVL_UP_MG1 = (BYTE)MG;
*(unsigned char*) GS_LVL_UP_MG2 = (BYTE)MG;
*(unsigned char*) GS_LVL_UP_MG3 = (BYTE)MG;
*(unsigned char*) GS_LVL_UP_MG4 = (BYTE)MG;
*(unsigned char*) GS_LVL_UP_MG5 = (BYTE)MG;
//-------------------------------------------------------
*(unsigned char*) GS_LVL_UP_NORMAL1 = (BYTE)Normal;
*(unsigned char*) GS_LVL_UP_NORMAL2 = (BYTE)Normal;
*(unsigned char*) GS_LVL_UP_NORMAL3 = (BYTE)Normal;
*(unsigned char*) GS_LVL_UP_NORMAL4 = (BYTE)Normal;
*(unsigned char*) GS_LVL_UP_NORMAL5 = (BYTE)Normal;
//-------------------------------------------------------
*(unsigned char*) GS_LVL_UP_QUEST1 = (BYTE)AfterMarlon;
*(unsigned char*) GS_LVL_UP_QUEST2 = (BYTE)AfterMarlon;
*(unsigned char*) GS_LVL_UP_QUEST3 = (BYTE)AfterMarlon;
*(unsigned char*) GS_LVL_UP_QUEST4 = (BYTE)AfterMarlon;
*(unsigned char*) GS_LVL_UP_QUEST5 = (BYTE)AfterMarlon;
//-------------------------------------------------------
}
CostumRateSystem.scriptPHP Code://====================================================================
//Costum Server Rate System
//Made by System32 aka BootStat
//====================================================================
class RateSystem
{
public:
void Init();
void Work(DWORD PlayerID,int Map);
void EditExp(char Exp[256]);
void EditDrop(int Drop);
void EditPoints(int DL, int MG, int Normal, int AfterMarlon);
private:
//-------------------------------------------------------
int Enabled;
int SettingsCount;
char OrginalExp[256];
int OrginalDrop;
BOOL bRead;
DWORD dwArgv;
char sLineTxt[255];
int Values[8];
char MapName[255];
char normExp[256];
char vipExp[256];
int Points[8];
int orgDLPoint;
int orgMGPoint;
int orgNormalPoint;
int orgAfterMarlonPoint;
//-------------------------------------------------------
public:
CMapExpRate Rate;
};
//-------------------------------------------------------
typedef struct CMapExpRate
{
//-------------------------------------------------------
char Name[255];
int MapID;
char ExpRate[256];
char VipExpRate[256];
int DropRate;
int VipDropRate;
int DLPoint;
int VipDLPoint;
int MGPoint;
int VipMGPoint;
int NormalPoint;
int VipNormalPoint;
int AfterMarlonPoint;
int VipAfterMarlonPoint;
//-------------------------------------------------------
}MapExpRat;
//-------------------------------------------------------
extern MapExpRat MapExpRate[255];
extern RateSystem CRateSystem;
//-------------------------------------------------------
Note: new update!!!..Code://MapName MapID NormalExp VipExp NormalDrop VipDrop PointsDL PointsMG PointsNormal PointsAfterMarlon VipPointsDL VipPointsMG VipPointsNormal VipPointsAfterMarlon
Lorencia 0 200 2000 50 100 5 5 5 2 7 7 7 3
I think the best pratice to grant VIP bonuses is doing a exclusive room. Use this in one of my servers for almost 1 year and works like a charm. Maybe u can try...
Protocol.cpp:
VIP.cpp:Code:bool ProtocolCoreEx(unsigned char protoNum, unsigned char *aRecv, int aLen, int aIndex, int Encrypt, int serial)
{
...
switch (protoNum)
{
...
case 0x03:
if (Encrypt == 1)
{
SetVipServer(aIndex);
}
...
}
...
}
Coded by me.Code:void SetVipServer(int aIndex)
{
OBJECTSTRUCT *ObjTable = (OBJECTSTRUCT*)OBJECT_BASE;
if (configs.vipserver.active == 1)
{
if (UserInfo[OBJECT_VINDEX(aIndex)].iVIP == 0)
{
GCServerMsgStringSend("Sala destinada exclusivamente a Contas VIP !", aIndex, 0);
ObjTable[aIndex].CloseCount = 6;
ObjTable[aIndex].CloseType = 2;
}
}
}
gObjChatBannedTime somebody know?
Bason4ik:
Credits: ACG & LCTCode:void gObjChatBannedTime(int aIndex)
{
int PlayerID = aIndex-MIN_PLAYERID;
pObj[PlayerID].uPostBan = ANTIMAT.PunishBanPostTime*60;
while(true)
{
_beginthread( ChatRecerveTimeGo, 0, NULL );
pObj[PlayerID].uPostBan -= 1;
if(pObj[PlayerID].uPostBan == 0)
break;
}
}
Crazzy,you too bad :-P
post good func :-)