My PKClear Guard source :P

Results 1 to 18 of 18
  1. #1
    Enthusiast coNsept is offline
    MemberRank
    Oct 2007 Join Date
    39Posts

    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


  2. #2
    Member Dev-Star is offline
    MemberRank
    Sep 2007 Join Date
    LorenciaLocation
    68Posts

    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.

  3. #3
    Account Upgraded | Title Enabled! rodrigobmg is offline
    MemberRank
    Jun 2006 Join Date
    217Posts

    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

  4. #4
    Enthusiast an12345 is offline
    MemberRank
    Mar 2007 Join Date
    31Posts

    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 :(

  5. #5
    Account Upgraded | Title Enabled! rodrigobmg is offline
    MemberRank
    Jun 2006 Join Date
    217Posts

    Re: [Release] My PKClear Guard source :P

    Thanks an12345

    and the offset for ADDLOG ?? you have this ??

    Thanks :D

  6. #6
    Enthusiast coNsept is offline
    MemberRank
    Oct 2007 Join Date
    39Posts

    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);
    		}
            }
    }

  7. #7
    Account Upgraded | Title Enabled! elche27 is offline
    MemberRank
    Dec 2004 Join Date
    TucumanLocation
    302Posts

    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

  8. #8
    Account Upgraded | Title Enabled! Saint is offline
    MemberRank
    Sep 2007 Join Date
    GermanyLocation
    1,128Posts

    Re: [Release] My PKClear Guard source :P

    elche, try the shutdown button

  9. #9
    Member 53rJ is offline
    MemberRank
    Jan 2008 Join Date
    Rosario y vos?Location
    58Posts

    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

  10. #10
    Alpha Tester darkxl is offline
    MemberRank
    Jul 2005 Join Date
    ArgentinaLocation
    847Posts

    Re: [Release] My PKClear Guard source :P

    good job

  11. #11
    Member hellboy5684 is offline
    MemberRank
    Oct 2006 Join Date
    98Posts

    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.

  12. #12
    LastLand Mu -UnicorN- is offline
    MemberRank
    Jul 2006 Join Date
    Milan - ItalyLocation
    691Posts

    Re: [Release] My PKClear Guard source :P

    Quote Originally Posted by coNsept View Post
    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

  13. #13
    Apprentice sontung306 is offline
    MemberRank
    Nov 2006 Join Date
    10Posts

    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)

  14. #14
    Member hellboy5684 is offline
    MemberRank
    Oct 2006 Join Date
    98Posts

    Re: [Release] My PKClear Guard source :P

    Quote Originally Posted by -UnicorN- View Post
    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!

  15. #15
    Account Upgraded | Title Enabled! UnForSaken is offline
    MemberRank
    Jun 2006 Join Date
    alpha terraLocation
    512Posts

    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

  16. #16
    Hybrid Gembrid is offline
    MemberRank
    Mar 2006 Join Date
    1,121Posts

    Re: [Release] My PKClear Guard source :P

    Quote Originally Posted by coNsept View Post
    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

  17. #17
    Account Upgraded | Title Enabled! DesmondMiles is offline
    MemberRank
    Nov 2009 Join Date
    BulgariaLocation
    235Posts

    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 !

  18. #18
    Apprentice perita is offline
    MemberRank
    Oct 2007 Join Date
    13Posts

    Re: [Release] My PKClear Guard source :P

    Quote Originally Posted by DesmondMiles View Post
    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 :)



Advertisement