Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

My PKClear Guard source :P

Newbie Spellweaver
Joined
Oct 19, 2007
Messages
20
Reaction score
0
Here is my PK Clear Guard Source...


Code:
void PKClearGuard(int aIndex)
{
    if (!PKClear_Active) return;
    if (!gObjIsConnected(aIndex)) return;
    lpObj->Init(aIndex);
    int Price = PKClear_Price * (lpObj->PKLevel - 3);
    if (lpObj->PKLevel < 4)
    {
        Send->PM(aIndex, "[PK Clear] You are already a commoner!");
        return;
    }
    if (lpObj->Money < Price)
    {
        Send->PM(aIndex, "[PK Clear] You don't have enough money! Lacking %d.", Price - lpObj->Money);
        return;
    }
    int Amount = lpObj->Money - Price;
    lpObj->SetInt(0xB4, Amount);
    GCMoneySend(aIndex, Amount);
    lpObj->SetInt(0x101, 3);
    GCPKLevelSend(aIndex, 3);
    Send->PM(aIndex, "[PK Clear] You are a commoner again! %d Zen left.", Amount);
    GCFireWorkSend(aIndex, lpObj->PosX, lpObj->PosY, 1);
    Log(Black, "[PK Clear] [%s][%s] Used PK Clear Guard.", lpObj->Login, lpObj->Nick);
}
Part of Protocol Core hook:

Code:
    switch (mobObj->Class)
    {
        case 249:
            PKClearGuard(aIndex);
            break;
Have fun. :)

Thanks to UnicorN, FeN$X and eRRoR on the PKClear Guard idea :p
 
Newbie Spellweaver
Joined
Sep 16, 2007
Messages
24
Reaction score
0
Re: [Release] My PKClear Guard source :P

I semm to always have trouble compiling your stuff. I'd preffer if it was in asm, soo much easier to make than with C++, Dev C++ Compiler is fussy for what I put in it.
 
Junior Spellweaver
Joined
Jun 10, 2006
Messages
136
Reaction score
100
Re: [Release] My PKClear Guard source :P

Consept can you post the functions who have the source like this

GCMoneySend
GCFireWorkSend

And what is the offset for function logadd ???

If you can answer i
 
Newbie Spellweaver
Joined
Mar 31, 2007
Messages
16
Reaction score
0
Re: [Release] My PKClear Guard source :P

rodrigobmg

In CzF 1.00.16:
//GSMoneySend
00403FCB $ E9 60F90200 JMP GameServ.00433930
GCMoneySend DD 00403FCBH

And GCFireWorkSend i don't find :(
 
Newbie Spellweaver
Joined
Oct 19, 2007
Messages
20
Reaction score
0
Re: [Release] My PKClear Guard source :P

GCFireWorkSend is my function
here is it:

Code:
void GCFireWorkSend(int aIndex, BYTE X, BYTE Y, int Amount)
{
	BYTE Packet[7] = {0xC1, 0x07, 0xF3, 0x40, 0x00, X, Y};
	for (int i=0; i<Amount; i++)
		DoMsg->DataSendNear(aIndex, Packet, Packet[1]);
}

DataSendNear (Thanks to Sobieh's Sources 'DGE SOURCES')

Code:
void Messages::DataSendNear(int aIndex, unsigned char* Packet, int Len)
{
	User *lpObj = new User();
	lpObj->Init(aIndex);
	int MyMap = lpObj->Map;
	int MyX = lpObj->PosX;
	int MyY = lpObj->PosY;
	for (int i=6400; i<7400; i++)
        {
		if (gObjIsConnected(i))
		{
			lpObj->Init(i);
			int Map = lpObj->Map;
			int X = lpObj->PosX;
			int Y = lpObj->PosY;
			if (MyMap == Map)
				if (X < (MyX + 6) && X > (MyX - 6))
					if (Y < (MyY + 6) && Y > (MyY - 6))
						DataSend(i, Packet, Len);
		}
        }
}
 
Junior Spellweaver
Joined
Dec 24, 2004
Messages
195
Reaction score
13
Re: [Release] My PKClear Guard source :P

Sorry for my neebie question but where you put this codes!??? i mean in wich part of server files or SQL?? Thank in advance to anyone who answer me :D
 
Experienced Elementalist
Loyal Member
Joined
Sep 18, 2007
Messages
252
Reaction score
1
Re: [Release] My PKClear Guard source :P

elche, try the shutdown button
 
Newbie Spellweaver
Joined
Jan 9, 2008
Messages
34
Reaction score
4
Re: [Release] My PKClear Guard source :P

Hahahaha i think the same, i don't f***ing know what to do whit that but i know he should try whit that button
 
Newbie Spellweaver
Joined
Oct 19, 2006
Messages
39
Reaction score
0
Re: [Release] My PKClear Guard source :P

I don't understand this point

switch (mobObj->Class)
{
case 249:
PKClearGuard(aIndex);
break;
How can I deal with it? I put it in a file call Protocol.h and include it in my .cpp file. It always show error:
...............Protocol.h expected unqualified-id before "switch"
..................Protocol.h expected `,' or `;' before "switch"

I know I did totally wrong, can you explain to me how to do with that figure?

Thax a lot.
 
Newbie Spellweaver
Joined
Nov 11, 2006
Messages
7
Reaction score
0
Re: [Release] My PKClear Guard source :P

Sorry i am a newbie because i don't understand that code to where put ? (My English is Bad :D)
 
Junior Spellweaver
Joined
Jun 26, 2006
Messages
178
Reaction score
12
Re: [Release] My PKClear Guard source :P

notice in the credits he was given thanx for the idea...means he helped to come up with th idea
 
Hybrid
Loyal Member
Joined
Mar 15, 2006
Messages
451
Reaction score
285
Re: [Release] My PKClear Guard source :P

GCFireWorkSend is my function
here is it:

DataSendNear (Thanks to Sobieh's Sources 'DGE SOURCES')

Code:
void Messages::DataSendNear(int aIndex, unsigned char* Packet, int Len)
{
	User *lpObj = new User();
	lpObj->Init(aIndex);
	int MyMap = lpObj->Map;
	int MyX = lpObj->PosX;
	int MyY = lpObj->PosY;
	for (int i=6400; i<7400; i++)
        {
		if (gObjIsConnected(i))
		{
			lpObj->Init(i);
			int Map = lpObj->Map;
			int X = lpObj->PosX;
			int Y = lpObj->PosY;
			if (MyMap == Map)
				if (X < (MyX + 6) && X > (MyX - 6))
					if (Y < (MyY + 6) && Y > (MyY - 6))
						DataSend(i, Packet, Len);
		}
        }
}


not needed, use MsgSendV2
 
Experienced Elementalist
Joined
Nov 29, 2009
Messages
226
Reaction score
18
Re: [Release] My PKClear Guard source :P

sry guys i know its old topic...but..
can i ask where i must insert these code ?...
i'm newbie sry =(

i need it please !
 
Newbie Spellweaver
Joined
Oct 6, 2007
Messages
13
Reaction score
4
Re: [Release] My PKClear Guard source :P

sry guys i know its old topic...but..
can i ask where i must insert these code ?...
i'm newbie sry =(

i need it please !

im new too.. but this about "gs moding" or adding custom functions to gs

and usually u make a dll and hook to gameserver :)

i have 3 or 4 days reading this forum (and sinrepacks)... and u should start to read instead asking those kind of question :)
 
Back
Top