My PKClear Guard source :P
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
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.
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
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 :(
Re: [Release] My PKClear Guard source :P
Thanks an12345
and the offset for ADDLOG ?? you have this ??
Thanks :D
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);
}
}
}
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
Re: [Release] My PKClear Guard source :P
elche, try the shutdown button
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
Re: [Release] My PKClear Guard source :P
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.
Re: [Release] My PKClear Guard source :P
Quote:
Originally Posted by
coNsept
Here is my PK Clear Guard Source...
Thanks to UnicorN, FeN$X and eRRoR on the PKClear Guard idea :P
omg thanks :D
credits!
lol
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)
Re: [Release] My PKClear Guard source :P
Quote:
Originally Posted by
-UnicorN-
omg thanks :D
credits!
lol
So you did it? You activated it to your server? Can you share the way to do it?
Sorry for my English!
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
Re: [Release] My PKClear Guard source :P
Quote:
Originally Posted by
coNsept
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
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 !
Re: [Release] My PKClear Guard source :P
Quote:
Originally Posted by
DesmondMiles
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 :)