[Release] zTeam Season 8 Episode 2 (Source)

  1. #1606
    Account Upgraded | Title Enabled! walter29 is offline
    MemberRank
    Dec 2007 Join Date
    316Posts

    re: [Release] zTeam Season 8 Episode 2 (Source)

    Quote Originally Posted by jackbot View Post
    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 :)
    @jackbot please friend to help me to implement this code in the source, after adding and compile is showing me these errors below:

    1>PKReset.cpp(252): error C2039: 'Reset' : is not a member of 'OBJECTSTRUCT'
    1> c:\muserver\tuto\um fix na source do michi28\arquivos do michi mais a source dele atual fixada as jewels\zgameserver\gameserver\source\user.h(660) : see declaration of 'OBJECTSTRUCT'
    1>PKReset.cpp(264): error C2039: 'GameShop' : is not a member of 'OBJECTSTRUCT'
    1> c:\muserver\tuto\um fix na source do michi28\arquivos do michi mais a source dele atual fixada as jewels\zgameserver\gameserver\source\user.h(660) : see declaration of 'OBJECTSTRUCT'
    1>PKReset.cpp(264): error C2228: left of '.WCoinC' must have class/struct/union
    1>PKReset.cpp(270): error C2039: 'GameShop' : is not a member of 'OBJECTSTRUCT'
    1> c:\muserver\tuto\um fix na source do michi28\arquivos do michi mais a source dele atual fixada as jewels\zgameserver\gameserver\source\user.h(660) : see declaration of 'OBJECTSTRUCT'
    1>PKReset.cpp(270): error C2228: left of '.WCoinP' must have class/struct/union
    1>PKReset.cpp(276): error C2039: 'GameShop' : is not a member of 'OBJECTSTRUCT'
    1> c:\muserver\tuto\um fix na source do michi28\arquivos do michi mais a source dele atual fixada as jewels\zgameserver\gameserver\source\user.h(660) : see declaration of 'OBJECTSTRUCT'
    1>PKReset.cpp(276): error C2228: left of '.GoblinPoint' must have class/struct/union
    1>PKReset.cpp(317): error C2039: 'GameShop' : is not a member of 'OBJECTSTRUCT'
    1> c:\muserver\tuto\um fix na source do michi28\arquivos do michi mais a source dele atual fixada as jewels\zgameserver\gameserver\source\user.h(660) : see declaration of 'OBJECTSTRUCT'
    1>PKReset.cpp(317): error C2228: left of '.WCoinC' must have class/struct/union
    1>PKReset.cpp(318): error C2039: 'GameShop' : is not a member of 'OBJECTSTRUCT'
    1> c:\muserver\tuto\um fix na source do michi28\arquivos do michi mais a source dele atual fixada as jewels\zgameserver\gameserver\source\user.h(660) : see declaration of 'OBJECTSTRUCT'
    1>PKReset.cpp(318): error C2228: left of '.WCoinP' must have class/struct/union
    1>PKReset.cpp(319): error C2039: 'GameShop' : is not a member of 'OBJECTSTRUCT'
    1> c:\muserver\tuto\um fix na source do michi28\arquivos do michi mais a source dele atual fixada as jewels\zgameserver\gameserver\source\user.h(660) : see declaration of 'OBJECTSTRUCT'
    1>PKReset.cpp(319): error C2228: left of '.GoblinPoint' must have class/struct/union
    1>PKReset.cpp(321): error C2065: 'gGameShop' : undeclared identifier
    1>PKReset.cpp(321): error C2228: left of '.GDSavePoint' must have class/struct/union
    1> type is ''unknown-type''
    1>PKReset.cpp(330): error C2039: 'UpdatePKUserInfo' : is not a member of 'PartyClass'

  2. #1607
    Member Onne is offline
    MemberRank
    Mar 2014 Join Date
    89Posts

    re: [Release] zTeam Season 8 Episode 2 (Source)

    Please send me main.exe uncompressed or unpacked? I need to install a new anthack dll.

  3. #1608
    Member fenixpe is offline
    MemberRank
    Nov 2008 Join Date
    91Posts

    re: [Release] zTeam Season 8 Episode 2 (Source)

    how edit item with 2 option + 16option ?
    ex: Grand soul + Luck + 16 Option + Damage Decramente + Max Life?

  4. #1609
    Member rimocchino is offline
    MemberRank
    Aug 2013 Join Date
    59Posts

    re: [Release] zTeam Season 8 Episode 2 (Source)

    Quote Originally Posted by michi28 View Post
    main.exe ver 1.05.33 by Webzen's global MU + zClient Hook.

    Link : main 1.05.33 ss10.2 webzen + zClient hook
    not work
    ---------------------------
    main.exe - Application Error
    ---------------------------
    The application was unable to start correctly (0xc000007b). Click OK to close the application.
    ---------------------------
    OK
    ---------------------------

  5. #1610
    Account Upgraded | Title Enabled! michi28 is online now
    MemberRank
    Sep 2014 Join Date
    Maldonado, Uy.Location
    473Posts

    re: [Release] zTeam Season 8 Episode 2 (Source)

    Quote Originally Posted by rimocchino View Post
    not work

    you have zclient.dll correct ? dll s8.3 ?

  6. #1611
    Join our JOURNEY! MaskARRA is offline
    MemberRank
    Mar 2013 Join Date
    416Posts

    re: [Release] zTeam Season 8 Episode 2 (Source)

    Quote Originally Posted by michi28 View Post
    you have zclient.dll correct ? dll s8.3 ?
    Hi mate, do you have anti-hack on client also server side?

  7. #1612
    Account Upgraded | Title Enabled! michi28 is online now
    MemberRank
    Sep 2014 Join Date
    Maldonado, Uy.Location
    473Posts

    re: [Release] zTeam Season 8 Episode 2 (Source)

    Quote Originally Posted by MaskARRA View Post
    Hi mate, do you have anti-hack on client also server side?

    nop, but as the will. as the testing server have what I do not look at the issue of security at least for now

  8. #1613
    Join our JOURNEY! MaskARRA is offline
    MemberRank
    Mar 2013 Join Date
    416Posts

    re: [Release] zTeam Season 8 Episode 2 (Source)

    Quote Originally Posted by michi28 View Post
    nop, but as the will. as the testing server have what I do not look at the issue of security at least for now
    well thanks, wanna ask something do you know how to get a WCoinP automatically in 1 Hour after the logout?
    I try to modify this in WZ.DISCONNECT_MEMB but not work..

    USE [MuOnlineAug]
    GO
    /****** Object: StoredProcedure [dbo].[WZ_DISCONNECT_MEMB] Script Date: 08/06/2015 09:23:38 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    ALTER PROCEDURE [dbo].[WZ_DISCONNECT_MEMB]


    @memb_guid int


    AS
    Begin
    set nocount on
    Declare @find_id varchar(10)
    Declare @MemberGuid int
    Declare @ConnectStat tinyint
    declare @OnlineHours real
    declare @WCoinP int
    Set @ConnectStat = 0
    Set @find_id = 'NOT'
    select @find_id = S.memb___id from MEMB_STAT S INNER JOIN MEMB_INFO I ON S.memb___id = I.memb___id
    where I.memb_guid = @memb_guid
    if( @find_id <> 'NOT' )
    begin
    SELECT @WCoinP= WCoinP FROM GameShop_Data where MemberGuid = @memb_guid
    update MEMB_STAT set ConnectStat = @ConnectStat, DisConnectTM = getdate(), OnlineHours = @OnlineHours/10+(DATEDIFF(mi,ConnectTM,getdate()))
    where memb___id = @memb_guid
    SELECT @OnlineHours = OnlineHours FROM MEMB_STAT WHERE memb___id = @memb_guid


    UPDATE [dbo].[GameShop_Data]
    SET WCoinP=(@OnlineHours * 10)
    WHERE MemberGuid = @memb_guid


    end
    end

    This is my GameShop_Data


    This is my MEMB_STAT I added OnlineHours on column but not work.

  9. #1614
    Account Upgraded | Title Enabled! michi28 is online now
    MemberRank
    Sep 2014 Join Date
    Maldonado, Uy.Location
    473Posts

    re: [Release] zTeam Season 8 Episode 2 (Source)

    Quote Originally Posted by MaskARRA View Post
    well thanks, wanna ask something do you know how to get a WCoinP automatically in 1 Hour after the logout?
    I try to modify this in WZ.DISCONNECT_MEMB but not work..



    This is my GameShop_Data


    This is my MEMB_STAT I added OnlineHours on column but not work.

    you say to RECEIVE wcoin every 1 hour?

  10. #1615
    Join our JOURNEY! MaskARRA is offline
    MemberRank
    Mar 2013 Join Date
    416Posts

    re: [Release] zTeam Season 8 Episode 2 (Source)

    Quote Originally Posted by michi28 View Post
    you say to RECEIVE wcoin every 1 hour?
    exactly mate..

  11. #1616
    Account Upgraded | Title Enabled! michi28 is online now
    MemberRank
    Sep 2014 Join Date
    Maldonado, Uy.Location
    473Posts

    re: [Release] zTeam Season 8 Episode 2 (Source)

    Quote Originally Posted by MaskARRA View Post
    exactly mate..

    why not try to script the webeffect .. configure to change wcoin hours online and ready

  12. #1617
    Join our JOURNEY! MaskARRA is offline
    MemberRank
    Mar 2013 Join Date
    416Posts

    re: [Release] zTeam Season 8 Episode 2 (Source)

    Quote Originally Posted by michi28 View Post
    why not try to script the webeffect .. configure to change wcoin hours online and ready
    I dont have Idea mate, well thank you.. :)

  13. #1618
    Enthusiast PSalazar is offline
    MemberRank
    Jun 2015 Join Date
    44Posts

    re: [Release] zTeam Season 8 Episode 2 (Source)

    Elements 100% cool :)

  14. #1619
    Account Upgraded | Title Enabled! jeffzkie69 is offline
    MemberRank
    Jul 2009 Join Date
    516Posts

    re: [Release] zTeam Season 8 Episode 2 (Source)

    Quote Originally Posted by PSalazar View Post
    Elements 100% cool :)
    pentagrams & ertels can make by sql sript.,PSalazar mate how did you enable new pets? hope you can share you server files + client

  15. #1620
    Account Upgraded | Title Enabled! michi28 is online now
    MemberRank
    Sep 2014 Join Date
    Maldonado, Uy.Location
    473Posts

    re: [Release] zTeam Season 8 Episode 2 (Source)

    Quote Originally Posted by PSalazar View Post
    Elements 100% cool :)

    que bien. me alegro. che como pudiste ver el pet muun usandolo como pets normal. ya que yo intente agregarlo pero al colocarlo no se visualiza en el piso el feo del pet xd



Advertisement