-
re: [Release] zTeam Season 8 Episode 2 (Source)
Quote:
Originally Posted by
jackbot
PKReset NPC Source
PKReset.h
Code:
#pragma once// -------------------------------------------------------------------------------
#include "user.h"
// -------------------------------------------------------------------------------
#define MAX_PKCLEAR_ITEM 10
// -------------------------------------------------------------------------------
struct PKCLEAR_ITEM_DATA
{
WORD ID;
BYTE MinLevel;
BYTE MaxLevel;
BYTE MinDur;
BYTE MaxDur;
};
// -------------------------------------------------------------------------------
class PKClear
{
public:
PKClear();
~PKClear();
// ----
void Init();
void Load();
void ReadData(char * File);
// ----
bool SearchItem(LPOBJ lpUser, BYTE QuestItemID);
bool DeleteItem(LPOBJ lpUser, BYTE QuestItemID);
bool CheckReq(LPOBJ lpUser);
// ----
bool Dialog(LPOBJ lpUser, LPOBJ lpNpc);
// ----
private:
WORD m_NpcID;
BYTE m_NpcMap;
BYTE m_NpcX;
BYTE m_NpcY;
BYTE m_ReqPK;
WORD m_ReqLevel;
WORD m_ReqReset;
DWORD m_Cost[4];
PKCLEAR_ITEM_DATA m_ItemData[MAX_PKCLEAR_ITEM];
BYTE m_ItemLoaded;
// ----
}; extern PKClear g_PKClear;
// -------------------------------------------------------------------------------
PKReset.cpp
Code:
#include "StdAfx.h"#include "PKReset.h"
#include "GameMain.h"
#include "..\include\ReadScript.h"
#include "..\common\winutil.h"
#include "logproc.h"
// -------------------------------------------------------------------------------
PKClear g_PKClear;
// -------------------------------------------------------------------------------
PKClear::PKClear()
{
this->Init();
}
// -------------------------------------------------------------------------------
PKClear::~PKClear()
{
}
// -------------------------------------------------------------------------------
void PKClear::Init()
{
this->m_NpcID = -1;
this->m_NpcMap = -1;
this->m_NpcX = 0;
this->m_NpcY = 0;
this->m_ReqPK = 4;
this->m_ReqLevel = 1;
this->m_ReqReset = 0;
this->m_ItemLoaded = 0;
ZeroMemory(this->m_ItemData, sizeof(this->m_ItemData));
ZeroMemory(this->m_Cost, sizeof(this->m_Cost));
}
// -------------------------------------------------------------------------------
void PKClear::Load()
{
this->Init();
this->ReadData(gDirPath.GetNewPath("Custom\\PKClear.txt"));
}
// -------------------------------------------------------------------------------
void PKClear::ReadData(char * File)
{
SMDToken Token;
SMDFile = fopen(File, "r");
// ----
if( !SMDFile )
{
MsgBox("[PKClear] %s file not found", File);
return;
}
// ----
int Category = -1;
// ----
while(true)
{
Token = GetToken();
// ----
if( Token == END )
{
break;
}
// ----
Category = TokenNumber;
// ----
while(true)
{
if( Category == 0 ) //-> NPC
{
Token = GetToken();
// ----
if( !strcmp("end", TokenString) )
{
break;
}
// ----
this->m_NpcID = TokenNumber;
// ----
Token = GetToken();
this->m_NpcMap = TokenNumber;
// ----
Token = GetToken();
this->m_NpcX = TokenNumber;
// ----
Token = GetToken();
this->m_NpcY = TokenNumber;
}
else if( Category == 1 ) //-> Requirements
{
Token = GetToken();
// ----
if( !strcmp("end", TokenString) )
{
break;
}
// ----
this->m_ReqPK = TokenNumber;
// ----
Token = GetToken();
this->m_ReqLevel = TokenNumber;
// ----
Token = GetToken();
this->m_ReqReset = TokenNumber;
}
else if( Category == 2 ) //-> Cost
{
Token = GetToken();
// ----
if( !strcmp("end", TokenString) )
{
break;
}
// ----
this->m_Cost[0] = TokenNumber;
// ----
Token = GetToken();
this->m_Cost[1] = TokenNumber;
// ----
Token = GetToken();
this->m_Cost[2] = TokenNumber;
// ----
Token = GetToken();
this->m_Cost[3] = TokenNumber;
}
else if( Category == 3 ) //-> Item list
{
Token = GetToken();
// ----
if( !strcmp("end", TokenString) )
{
break;
}
// ----
WORD ItemType = TokenNumber;
Token = GetToken();
WORD ItemIndex = TokenNumber;
this->m_ItemData[this->m_ItemLoaded].ID = ITEMGET(ItemType, ItemIndex);
// ----
Token = GetToken();
this->m_ItemData[this->m_ItemLoaded].MinLevel = TokenNumber;
// ----
Token = GetToken();
this->m_ItemData[this->m_ItemLoaded].MaxLevel = TokenNumber;
// ----
Token = GetToken();
this->m_ItemData[this->m_ItemLoaded].MinDur = TokenNumber;
// ----
Token = GetToken();
this->m_ItemData[this->m_ItemLoaded].MaxDur = TokenNumber;
// ----
this->m_ItemLoaded++;
}
}
}
// ----
fclose(SMDFile);
LogAddTD("[PKClear] %s file is loaded (Items: %d)", File, this->m_ItemLoaded);
}
// -------------------------------------------------------------------------------
bool PKClear::SearchItem(LPOBJ lpUser, BYTE QuestItemID)
{
WORD ItemID = this->m_ItemData[QuestItemID].ID;
// ----
for( int i = INVETORY_WEAR_SIZE; i < MAIN_INVENTORY_SIZE; i++ )
{
if( !lpUser->pInventory[i].IsItem() || lpUser->pInventory[i].m_Type != ItemID )
{
continue;
}
// ----
if( lpUser->pInventory[i].m_Level < this->m_ItemData[QuestItemID].MinLevel
|| lpUser->pInventory[i].m_Level > this->m_ItemData[QuestItemID].MaxLevel )
{
continue;
}
// ----
if( lpUser->pInventory[i].m_Durability < (float)this->m_ItemData[QuestItemID].MinDur
|| lpUser->pInventory[i].m_Durability > (float)this->m_ItemData[QuestItemID].MaxDur )
{
continue;
}
// ----
return true;
}
// ----
return false;
}
// -------------------------------------------------------------------------------
bool PKClear::DeleteItem(LPOBJ lpUser, BYTE QuestItemID)
{
WORD ItemID = this->m_ItemData[QuestItemID].ID;
// ----
for( int i = INVETORY_WEAR_SIZE; i < MAIN_INVENTORY_SIZE; i++ )
{
if( !lpUser->pInventory[i].IsItem() || lpUser->pInventory[i].m_Type != ItemID )
{
continue;
}
// ----
if( lpUser->pInventory[i].m_Level < this->m_ItemData[QuestItemID].MinLevel
|| lpUser->pInventory[i].m_Level > this->m_ItemData[QuestItemID].MaxLevel )
{
continue;
}
// ----
if( lpUser->pInventory[i].m_Durability < (float)this->m_ItemData[QuestItemID].MinDur
|| lpUser->pInventory[i].m_Durability > (float)this->m_ItemData[QuestItemID].MaxDur )
{
continue;
}
// ----
gObjInventoryDeleteItem(lpUser->m_Index, i);
GCInventoryItemDeleteSend(lpUser->m_Index, i, 1);
// ----
return true;
}
// ----
return false;
}
// -------------------------------------------------------------------------------
bool PKClear::CheckReq(LPOBJ lpUser)
{
if( lpUser->m_PK_Level <= this->m_ReqPK )
{
GCServerMsgStringSend("Your PK Level is small to PK Clear", lpUser->m_Index, 1);
return false;
}
// ----
if( lpUser->Level < this->m_ReqLevel )
{
GCServerMsgStringSend("Your Level is small to PK Clear", lpUser->m_Index, 1);
return false;
}
// ----
if( lpUser->Reset < this->m_ReqReset )
{
GCServerMsgStringSend("Your Reset is small to PK Clear", lpUser->m_Index, 1);
return false;
}
// ----
if( lpUser->Money < this->m_Cost[0] )
{
GCServerMsgStringSend("You need more Zen to PK Clear", lpUser->m_Index, 1);
return false;
}
// ----
if( lpUser->GameShop.WCoinC < this->m_Cost[1] )
{
GCServerMsgStringSend("You need more WCoinC to PK Clear", lpUser->m_Index, 1);
return false;
}
// ----
if( lpUser->GameShop.WCoinP < this->m_Cost[2] )
{
GCServerMsgStringSend("You need more WCoinP to PK Clear", lpUser->m_Index, 1);
return false;
}
// ----
if( lpUser->GameShop.GoblinPoint < this->m_Cost[3] )
{
GCServerMsgStringSend("You need more GoblinPoint to PK Clear", lpUser->m_Index, 1);
return false;
}
// ----
for( int i = 0; i < this->m_ItemLoaded; i++ )
{
if( !this->SearchItem(lpUser, i) )
{
GCServerMsgStringSend("You have not required items to PK Clear", lpUser->m_Index, 1);
return false;
}
}
// ----
return true;
}
// -------------------------------------------------------------------------------
bool PKClear::Dialog(LPOBJ lpUser, LPOBJ lpNpc)
{
if( lpNpc->Class != this->m_NpcID
|| lpNpc->MapNumber != this->m_NpcMap
|| lpNpc->X != this->m_NpcX
|| lpNpc->Y != this->m_NpcY )
{
return false;
}
// ----
if( !this->CheckReq(lpUser) )
{
return false;
}
// ----
for( int i = 0; i < this->m_ItemLoaded; i++ )
{
this->DeleteItem(lpUser, i);
}
// ----
lpUser->Money -= this->m_Cost[0];
lpUser->GameShop.WCoinC -= this->m_Cost[1];
lpUser->GameShop.WCoinP -= this->m_Cost[2];
lpUser->GameShop.GoblinPoint -= this->m_Cost[3];
// ----
gGameShop.GDSavePoint(lpUser->m_Index);
GCMoneySend(lpUser->m_Index, lpUser->Money);
// ----
lpUser->m_PK_Count = 0;
lpUser->m_PK_Level = 3;
lpUser->m_PK_Time = 0;
// ----
if( lpUser->PartyNumber >= 0 )
{
gParty.UpdatePKUserInfo(lpUser->PartyNumber, lpUser->m_Index, lpUser->DBNumber, lpUser->m_PK_Level);
gParty.UpdatePKPartyPanalty(lpUser->PartyNumber);
}
// ----
GCPkLevelSend(lpUser->m_Index, lpUser->m_PK_Level);
GCServerMsgStringSend("Your PK status has been reseted", lpUser->m_Index, 1);
return true;
}
// -------------------------------------------------------------------------------
To initiate:
find
g_BuffSkillEffect.Load();
add this below : g_PKClear.Load();
goodluck :)
Cant compile have tfis error:
1>CustomManager.obj : error LNK2001: unresolved external symbol "public: void __thiscall PKClear::Load(void)" (?Load@PKClear@@QAEXXZ)
1>CustomManager.obj : error LNK2001: unresolved external symbol "class PKClear g_PKClear" (?g_PKClear@@3VPKClear@@A)
-
re: [Release] zTeam Season 8 Episode 2 (Source)
@michi28 any clue on what you did that messed up the jewels? Im using your sources so let know if ypu find the problem.
-
re: [Release] zTeam Season 8 Episode 2 (Source)
Quote:
Originally Posted by
ianvalls90
@
michi28 any clue on what you did that messed up the jewels? Im using your sources so let know if ypu find the problem.
in that I'm seeing there that will cause the problem jewelry.
-
re: [Release] zTeam Season 8 Episode 2 (Source)
Quote:
Originally Posted by
michi28
in that I'm seeing there that will cause the problem jewelry.
https://forum.ragezone.com/attachmen...d=152905&stc=1
Hello :), Michi28 a question as I remove all element mob least the Acheron ??
-
re: [Release] zTeam Season 8 Episode 2 (Source)
Quote:
Originally Posted by
Callejero
if you take the items to the monsters, you will have none. Since Acheron and also the Golden of summon the demons. elements obtained from the season8.3 if not mistaken
-
re: [Release] zTeam Season 8 Episode 2 (Source)
Quote:
Originally Posted by
michi28
if you take the items to the monsters, you will have none. Since Acheron and also the Golden of summon the demons. elements obtained from the season8.3 if not mistaken
what I want is to get the signs of the mob elements that do not have to have, only Acheron must have the signs of the elements :)
-
re: [Release] zTeam Season 8 Episode 2 (Source)
Quote:
Originally Posted by
Callejero
what I want is to get the signs of the mob elements that do not have to have, only Acheron must have the signs of the elements :)
yes and I think so..
-
re: [Release] zTeam Season 8 Episode 2 (Source)
-
re: [Release] zTeam Season 8 Episode 2 (Source)
Quote:
Originally Posted by
Callejero
Share fix please? I think that is "right" way...so I rather make it like that too xD.
-
re: [Release] zTeam Season 8 Episode 2 (Source)
@Callejero It is to teach you how to fix the bug of jewels
-
re: [Release] zTeam Season 8 Episode 2 (Source)
Quote:
Originally Posted by
Callejero
a big wow! new RF set w/ new glow Callejero did you use michi28 client? because when im testing it some bugs appear like options on exc ref +0% and can someone help me what exact version of Visual Studio to use to edit the source i wanna try to edit the source also for me to know how it works thank you!
-
re: [Release] zTeam Season 8 Episode 2 (Source)
Quote:
Originally Posted by
ianvalls90
Share fix please? I think that is "right" way...so I rather make it like that too xD.
search page 79 michi28 gave the solution ^^
-
re: [Release] zTeam Season 8 Episode 2 (Source)
Use for gameserver Visual Studio 2008 , for zclient Visual Studio 2012
-
re: [Release] zTeam Season 8 Episode 2 (Source)
Quote:
Originally Posted by
jeffzkie69
a big wow! new RF set w/ new glow Callejero did you use michi28 client? because when im testing it some bugs appear like options on exc ref +0% and can someone help me what exact version of Visual Studio to use to edit the source i wanna try to edit the source also for me to know how it works thank you!
https://forum.ragezone.com/attachmen...d=152908&stc=1
use cliente original Zteam and add set bloody dragon
-
re: [Release] zTeam Season 8 Episode 2 (Source)
Quote:
Originally Posted by
OvidijusD
Use for gameserver Visual Studio 2008 , for zclient Visual Studio 2012
can you link me bro? thanks a lot!
- - - Updated - - -
Quote:
Originally Posted by
Callejero
thanks Callejero! hope you all could help me to on developing :D:
-
re: [Release] zTeam Season 8 Episode 2 (Source)
[QUOTE=jeffzkie69;8472407]can you link me bro? thanks a lot!
I archived both torrent files with VS2008 and VS2012
Link: Zippyshare.com
-
re: [Release] zTeam Season 8 Episode 2 (Source)
Good, who had problems with jewels testen this gs now. step gs + Exdata
Link: gs data
in five minutes I climb the sources gs
- - - Updated - - -
zGS Source fix jewels : http://www.mediafire.com/download/dfblkw0bh0del30/zGameServer.rar
-
re: [Release] zTeam Season 8 Episode 2 (Source)
@michi28 you are the man :)
I will will analyze the source to know me as you fix this because my intention is to learn
-
3 Attachment(s)
re: [Release] zTeam Season 8 Episode 2 (Source)
Quote:
Originally Posted by
michi28
Good, who had problems with jewels testen this gs now. step gs + Exdata
Link:
gs data
in five minutes I climb the sources gs
- - - Updated - - -
zGS Source fix jewels :
zGameServer
Thank you @michi28 work ...
Attachment 152909Attachment 152910Attachment 152911
-
re: [Release] zTeam Season 8 Episode 2 (Source)
How fix this problem? I downloaded your gs+data and got this error:
https://forum.ragezone.com/cache.php...%2FAYq3cQC.png
-
re: [Release] zTeam Season 8 Episode 2 (Source)
Quote:
Originally Posted by
OvidijusD
edit version and serial in ServerInfo.dat in ExData
-
re: [Release] zTeam Season 8 Episode 2 (Source)
@michi28 One question: What client do you use?
-
re: [Release] zTeam Season 8 Episode 2 (Source)
where i can find my Client version ? Cuz i found Serial in common.z but version: 22779 , in serverlist.dat is 1.04.04
-
re: [Release] zTeam Season 8 Episode 2 (Source)
Quote:
Originally Posted by
OvidijusD
where i can find my Client version ? Cuz i found Serial in common.z but version: 22779 , in serverlist.dat is 1.04.04
1.04.04 = 22749
- - - Updated - - -
Quote:
Originally Posted by
sokabenga
@
michi28 One question: What client do you use?
the same contribution previous comments
-
re: [Release] zTeam Season 8 Episode 2 (Source)
Quote:
Originally Posted by
michi28
1.04.04 = 22749
- - - Updated - - -
the same contribution previous comments
ok is that I downloaded a 2, but I could not see the new wings