WhatsApp Discord
Source Post Item Dakosmu - Source Mu - Mu Server Files
 

Noticias:

SMF - Just Installed!

Menú principal

Source Post Item Dakosmu

Publicado por Dakosmu, Mayo 12, 2024, 09:02 PM

Tema anterior - Siguiente tema

0 Miembros y 1 Visitante están viendo este tema.

Dakosmu

Source Post Item Dakosmu

Regístrate para ver el enlace



LADO MAIN

Archivos Necesarios


item_post.h


#pragma once
// -----------------------------------------------------------------------------

#include "macro.h"
#include "linked_list.h"
#include "mu_object_chat_data.h"
#include "mu_object_item_data.h"

//████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
//█░░░░░░░░░░░░███░░░░░░░░░░░░░░█░░░░░░██░░░░░░░░█░░░░░░░░░░░░░░█░░░░░░░░░░░░░░█░░░░░░██████████░░░░░░█░░░░░░██░░░░░░█
//█░░▄▀▄▀▄▀▄▀░░░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██░░▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░░░░░░░░░░░░░▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░░░▄▀▄▀░░█░░▄▀░░░░░░▄▀░░█░░▄▀░░██░░▄▀░░░░█░░▄▀░░░░░░▄▀░░█░░▄▀░░░░░░░░░░█░░▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░███░░▄▀░░██░░▄▀░░█░░▄▀░░█████████░░▄▀░░░░░░▄▀░░░░░░▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░██░░▄▀░░█░░▄▀░░░░░░▄▀░░█░░▄▀░░░░░░▄▀░░███░░▄▀░░██░░▄▀░░█░░▄▀░░░░░░░░░░█░░▄▀░░██░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░██░░▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░███░░▄▀░░██░░▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░██░░▄▀░░█░░▄▀░░░░░░▄▀░░█░░▄▀░░░░░░▄▀░░███░░▄▀░░██░░▄▀░░█░░░░░░░░░░▄▀░░█░░▄▀░░██░░░░░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░███░░▄▀░░██░░▄▀░░█████████░░▄▀░░█░░▄▀░░██████████░░▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░░░▄▀▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░░░█░░▄▀░░░░░░▄▀░░█░░░░░░░░░░▄▀░░█░░▄▀░░██████████░░▄▀░░█░░▄▀░░░░░░▄▀░░█
//█░░▄▀▄▀▄▀▄▀░░░░█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██████████░░▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█
//█░░░░░░░░░░░░███░░░░░░██░░░░░░█░░░░░░██░░░░░░░░█░░░░░░░░░░░░░░█░░░░░░░░░░░░░░█░░░░░░██████████░░░░░░█░░░░░░░░░░░░░░█
//████████████████████████████████████████████████████████████████████████████████████████████████████████████████████


// -----------------------------------------------------------------------------

struct ItemPost : public LinkNode {
public:
    ItemPost(void* item_data) {
        memcpy_s(&item_, sizeof(item_), item_data, sizeof(MuObjectItemData));
        chat_ = nullptr;
    }
    virtual ~ItemPost() {}

public:
    MuObjectChatData* chat_;
    MuObjectItemData item_;

private:
    DISALLOW_COPY_AND_ASSIGN(ItemPost);
};


linked_list.h


#ifndef ARIES_PROTECTOR_INCLUDE_LINKED_LIST_H
#define ARIES_PROTECTOR_INCLUDE_LINKED_LIST_H
// -----------------------------------------------------------------------------

#include "macro.h"

//████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
//█░░░░░░░░░░░░███░░░░░░░░░░░░░░█░░░░░░██░░░░░░░░█░░░░░░░░░░░░░░█░░░░░░░░░░░░░░█░░░░░░██████████░░░░░░█░░░░░░██░░░░░░█
//█░░▄▀▄▀▄▀▄▀░░░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██░░▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░░░░░░░░░░░░░▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░░░▄▀▄▀░░█░░▄▀░░░░░░▄▀░░█░░▄▀░░██░░▄▀░░░░█░░▄▀░░░░░░▄▀░░█░░▄▀░░░░░░░░░░█░░▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░███░░▄▀░░██░░▄▀░░█░░▄▀░░█████████░░▄▀░░░░░░▄▀░░░░░░▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░██░░▄▀░░█░░▄▀░░░░░░▄▀░░█░░▄▀░░░░░░▄▀░░███░░▄▀░░██░░▄▀░░█░░▄▀░░░░░░░░░░█░░▄▀░░██░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░██░░▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░███░░▄▀░░██░░▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░██░░▄▀░░█░░▄▀░░░░░░▄▀░░█░░▄▀░░░░░░▄▀░░███░░▄▀░░██░░▄▀░░█░░░░░░░░░░▄▀░░█░░▄▀░░██░░░░░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░███░░▄▀░░██░░▄▀░░█████████░░▄▀░░█░░▄▀░░██████████░░▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░░░▄▀▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░░░█░░▄▀░░░░░░▄▀░░█░░░░░░░░░░▄▀░░█░░▄▀░░██████████░░▄▀░░█░░▄▀░░░░░░▄▀░░█
//█░░▄▀▄▀▄▀▄▀░░░░█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██████████░░▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█
//█░░░░░░░░░░░░███░░░░░░██░░░░░░█░░░░░░██░░░░░░░░█░░░░░░░░░░░░░░█░░░░░░░░░░░░░░█░░░░░░██████████░░░░░░█░░░░░░░░░░░░░░█
//████████████████████████████████████████████████████████████████████████████████████████████████████████████████████


// -----------------------------------------------------------------------------

template
class LinkNode {
public:
    LinkNode() : previous_(nullptr), next_(nullptr) {}
    LinkNode(LinkNode* previous, LinkNode* next) :
        previous_(previous), next_(next) {}
    virtual ~LinkNode() { RemoveFromList(); }

    // Insert |this| into the linked list, before |e|.
    void InsertBefore(LinkNode* e) {
        this->next_ = e;
        this->previous_ = e->previous_;
        // do linkedlisk có cấu trúc danh sách liên kết vòng
        // nên trường hợp e->previous_ = nullptr là ko xảy ra
        e->previous_->next_ = this;
        e->previous_ = this;
    }

    // Insert |this| into the linked list, after |e|.
    void InsertAfter(LinkNode* e) {
        this->next_ = e->next_;
        this->previous_ = e;
        // do linkedlisk có cấu trúc danh sách liên kết vòng
        // nên trường hợp e->next_ = nullptr là ko xảy ra
        e->next_->previous_ = this;
        e->next_ = this;
    }

    // Remove |this| from the linked list.
    void RemoveFromList() {
        if (this->previous_) {
            this->previous_->next_ = this->next_;
        }

        if (this->next_) {
            this->next_->previous_ = this->previous_;
        }

        // next() and previous() return non-NULL if and only this node is not in any
        // list.
        this->next_ = nullptr;
        this->previous_ = nullptr;
    }

    // DANGEROUS: make sure you create this with new operator before call this
    void Free() {
        RemoveFromList();
        T* v = value();
        delete (v);
    }

    LinkNode* previous() const {
        return previous_;
    }

    LinkNode* next() const {
        return next_;
    }

    // Cast from the node-type to the value type.
    const T* value() const {
        return static_cast (this);
    }

    T* value() {
        return static_cast (this);
    }

protected:
    // not use

private:
    LinkNode* previous_;
    LinkNode* next_;

private:
    DISALLOW_COPY_AND_ASSIGN(LinkNode);
};
// -----------------------------------------------------------------------------

// -----------------------------------------------------------------------------

template
class LinkedList {
public:
    // The "root" node is self-referential, and forms the basis of a circular
    // list (root_.next() will point back to the start of the list,
    // and root_->previous() wraps around to the end of the list).
    LinkedList() : root_(&root_, &root_) {}

    // Appends |e| to the end of the linked list.
    void Append(LinkNode* e) {
        e->InsertBefore(&root_);
    }

    LinkNode* head() const {
        return root_.next();
    }

    LinkNode* tail() const {
        return root_.previous();
    }

    const LinkNode* end() const {
        return &root_;
    }

    bool empty() const {
        return head() == end();
    }

    void FreeAll() {
        while (!empty()) {
            head()->Free();
        }
    }

protected:
    // not use
private:
    LinkNode root_;

private:
    DISALLOW_COPY_AND_ASSIGN(LinkedList);
};
// -----------------------------------------------------------------------------
#endif  // ARIES_PROTECTOR_INCLUDE_LINKED_LIST_H


macro.h


/********************************************************************
  Copyright 2014, Cong Quyen Knight. All rights reserved

  project:  Aries Protector Project
  author:    quyen19492
  email:    quyen19492@gmail.com

  created:  2014/05/24
  created:  24:5:2014  18:39
  filename:  Aries Protector\scr\include\macro.h

  purpose:  * Một số các Macro hữu dụng
*********************************************************************/

// -----------------------------------------------------------------------------
#pragma once
// -----------------------------------------------------------------------------

// -----------------------------------------------------------------------------
#include

//████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
//█░░░░░░░░░░░░███░░░░░░░░░░░░░░█░░░░░░██░░░░░░░░█░░░░░░░░░░░░░░█░░░░░░░░░░░░░░█░░░░░░██████████░░░░░░█░░░░░░██░░░░░░█
//█░░▄▀▄▀▄▀▄▀░░░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██░░▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░░░░░░░░░░░░░▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░░░▄▀▄▀░░█░░▄▀░░░░░░▄▀░░█░░▄▀░░██░░▄▀░░░░█░░▄▀░░░░░░▄▀░░█░░▄▀░░░░░░░░░░█░░▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░███░░▄▀░░██░░▄▀░░█░░▄▀░░█████████░░▄▀░░░░░░▄▀░░░░░░▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░██░░▄▀░░█░░▄▀░░░░░░▄▀░░█░░▄▀░░░░░░▄▀░░███░░▄▀░░██░░▄▀░░█░░▄▀░░░░░░░░░░█░░▄▀░░██░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░██░░▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░███░░▄▀░░██░░▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░██░░▄▀░░█░░▄▀░░░░░░▄▀░░█░░▄▀░░░░░░▄▀░░███░░▄▀░░██░░▄▀░░█░░░░░░░░░░▄▀░░█░░▄▀░░██░░░░░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░███░░▄▀░░██░░▄▀░░█████████░░▄▀░░█░░▄▀░░██████████░░▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░░░▄▀▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░░░█░░▄▀░░░░░░▄▀░░█░░░░░░░░░░▄▀░░█░░▄▀░░██████████░░▄▀░░█░░▄▀░░░░░░▄▀░░█
//█░░▄▀▄▀▄▀▄▀░░░░█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██████████░░▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█
//█░░░░░░░░░░░░███░░░░░░██░░░░░░█░░░░░░██░░░░░░░░█░░░░░░░░░░░░░░█░░░░░░░░░░░░░░█░░░░░░██████████░░░░░░█░░░░░░░░░░░░░░█
//████████████████████████████████████████████████████████████████████████████████████████████████████████████████████


// -----------------------------------------------------------------------------

// -----------------------------------------------------------------------------

#define _assert(x) assert(!(x))

// -----------------------------------------------------------------------------
// Dùng để debug, kiểm tra tính hợp lệ của đầu vào
#define HOPE_NN0(pointer)                      \
            if (pointer == nullptr)            \
              return
#define EXPECT_NN0(pointer)                    \
            assert(pointer != nullptr);        \
            HOPE_NN0(pointer)
#define HOPE_NN1(pointer, return_value)        \
            if (pointer == nullptr)            \
              return return_value
#define EXPECT_NN1(pointer, return_value)      \
            assert(pointer != nullptr);        \
            HOPE_NN1(pointer, return_value)

#define HOPE_NULL0(pointer)                    \
            if (pointer != nullptr)            \
              return
#define EXPECT_NULL0(pointer)                  \
            assert(pointer == nullptr);        \
            HOPE_NULL0(pointer)
#define HOPE_NULL1(pointer, return_value)      \
            if (pointer != nullptr)            \
              return return_value
#define EXPECT_NULL1(pointer, return_value)    \
            assert(pointer == nullptr);        \
            HOPE_NULL1(pointer, return_value)

#define HOPE_NZ0(expression)                    \
            if (expression == 0)                \
              return
#define EXPECT_NZ0(expression)                  \
            assert(expression != 0);            \
            HOPE_NZ0(expression)
#define HOPE_NZ1(expression, return_value)      \
            if (expression == 0)                \
              return return_value
#define EXPECT_NZ1(expression, return_value)    \
            assert(expression != 0);            \
            HOPE_NZ1(expression, return_value)

#define HOPE_EZ0(expression)                    \
            if (expression != 0)                \
              return
#define EXPECT_EZ0(expression)                  \
            assert(expression == 0);            \
            HOPE_EZ0(expression)
#define HOPE_EZ1(expression, return_value)      \
            if (expression != 0)                \
              return return_value
#define EXPECT_EZ1(expression, return_value)    \
            assert(expression == 0);            \
            HOPE_EZ1(expression, return_value)

#define HOPE_TRUE0(expression)                  \
            if (!(expression))                  \
              return
#define EXPECT_TRUE0(expression)                \
            assert(expression);                \
            HOPE_TRUE0(expression)
#define HOPE_TRUE1(expression, return_value)    \
            if (!(expression))                  \
              return return_value
#define EXPECT_TRUE1(expression, return_value)  \
            assert(expression);                \
            HOPE_TRUE1(expression, return_value)

#define HOPE_FALSE0(expression)                \
            if (expression)                    \
              return
#define EXPECT_FALSE0(expression)              \
            assert(!(expression));              \
            HOPE_FALSE0(expression)
#define HOPE_FALSE1(expression, return_value)  \
            if (expression)                    \
              return return_value
#define EXPECT_FALSE1(expression, return_value) \
            assert(!(expression));              \
            HOPE_FALSE1(expression, return_value)

#define HOPE_EQ0(actual, expected)              \
            if (actual != expected)            \
              return
#define EXPECT_EQ0(actual, expected)            \
            assert(actual == expected);        \
            HOPE_EQ0(actual, expected)
#define HOPE_EQ1(actual, expected, return_value)\
            if (actual != expected)            \
              return return_value
#define EXPECT_EQ1(actual, expected, return_value)\
            assert(actual == expected);        \
            HOPE_EQ1(actual, expected, return_value)

#define HOPE_NE0(v1, v2)                        \
            if (v1 == v2)                      \
              return
#define EXPECT_NE0(v1, v2)                      \
            assert(v1 != v2);                  \
            HOPE_NE0(v1, v2)
#define HOPE_NE1(v1, v2, return_value)          \
            if (v1 == v2)                      \
              return return_value
#define EXPECT_NE1(v1, v2, return_value)        \
            assert(v1 != v2);                  \
            HOPE_NE1(v1, v2, return_value)

#define HOPE_LT0(v1, v2)                        \
            if (v1 >= v2)                      \
              return
#define EXPECT_LT0(v1, v2)                      \
            assert(v1 < v2);                    \
            HOPE_LT0(v1, v2)
#define HOPE_LT1(v1, v2, return_value)          \
            if (v1 >= v2)                      \
              return return_value
#define EXPECT_LT1(v1, v2, return_value)        \
            assert(v1 < v2);                    \
            HOPE_LT1(v1, v2, return_value)

#define HOPE_LE0(v1, v2)                        \
            if (v1 > v2)                        \
              return
#define EXPECT_LE0(v1, v2)                      \
            assert(v1 <= v2);                  \
            HOPE_LE0(v1, v2)
#define HOPE_LE1(v1, v2, return_value)          \
            if (v1 > v2)                        \
              return return_value
#define EXPECT_LE1(v1, v2, return_value)        \
            assert(v1 <= v2);                  \
            HOPE_LE1(v1, v2, return_value)

#define HOPE_GT0(v1, v2)                        \
            if (v1 <= v2)                      \
              return
#define EXPECT_GT0(v1, v2)                      \
            assert(v1 > v2);                    \
            HOPE_GT0(v1, v2)
#define HOPE_GT1(v1, v2, return_value)          \
            if (v1 <= v2)                      \
              return return_value
#define EXPECT_GT1(v1, v2, return_value)        \
            assert(v1 > v2);                    \
            HOPE_GT1(v1, v2, return_value)

#define HOPE_GE0(v1, v2)                        \
            if (v1 < v2)                        \
              return
#define EXPECT_GE0(v1, v2)                      \
            assert(v1 >= v2);                  \
            HOPE_GE0(v1, v2)
#define HOPE_GE1(v1, v2, return_value)          \
            if (v1 < v2)                        \
              return return_value
#define EXPECT_GE1(v1, v2, return_value)        \
            assert(v1 >= v2);                  \
            HOPE_GE1(v1, v2, return_value)

#define HOPE_SUCCESS0(result)                  \
            if (result < 0)                    \
              return
#define EXPECT_SUCCESS0(result)                \
            assert(result >= 0);                \
            HOPE_SUCCESS0(result)
#define HOPE_SUCCESS1(result, return_value)    \
            if (result < 0)                    \
              return return_value
#define EXPECT_SUCCESS1(result, return_value)  \
            assert(result >= 0);                \
            HOPE_SUCCESS1(result, return_value)

#define HOPE_FAILED0(result)                    \
            if (result >= 0)                    \
              return
#define EXPECT_FAILED0(result)                  \
            assert(result < 0);                \
            HOPE_FAILED0(result)
#define HOPE_FAILED1(result, return_value)      \
            if (result >= 0)                    \
              return return_value
#define EXPECT_FAILED1(result, return_value)    \
            assert(result < 0);                \
            HOPE_FAILED1(result, return_value)
// -----------------------------------------------------------------------------

// -----------------------------------------------------------------------------
// Dùng để Debug => Attact To Process
#define SHOW(Contents)                (wcslen(Contents) == 19492)
#define TRACE(Contents)              assert(SHOW(L(Contents)))
// -----------------------------------------------------------------------------

// -----------------------------------------------------------------------------
// Chỉ dùng để kiểm tra input của hàm, kiểm tra kết quả trả về của hàm gọi (bool)
// condition là kết quả mong đợi
// return_value là giá trị trả về trong trường hợp kết quả không như mong đợi
//
// Kiểm tra điều kiện
#define CHECK0(condition)                            \
            if (!(condition))                        \
              return

#define DCHECK0(condition)                            \
            assert(condition);                        \
            CHECK0(condition)

#define CHECK1(condition, return_value)              \
            if (!(condition))                        \
              return return_value

#define DCHECK1(condition, return_value)              \
            assert(condition);                        \
            CHECK1(condition, return_value)

// Kiểm tra con trỏ
#define CHECK_POINTER0(lpPointer)                    \
            if (lpPointer == nullptr)                \
              return

#define DCHECK_POINTER0(lpPointer)                    \
            assert(lpPointer != nullptr);            \
            CHECK_POINTER0(lpPointer)

#define CHECK_POINTER1(lpPointer, return_value)      \
            if (lpPointer == nullptr)                \
              return return_value

#define DCHECK_POINTER1(lpPointer, return_value)      \
            assert(lpPointer != nullptr);            \
            CHECK_POINTER1(lpPointer, return_value)

// Kiểm tra string
#define CHECK_STRING0(lpString)                      \
            if (lpString == nullptr)                  \
              return;                                \
            if (strlen(lpString) == 0)                \
              return

#define DCHECK_STRING0(lpString)                      \
            assert(lpString != nullptr);              \
            CHECK_STRING0(lpString)

#define CHECK_STRING1(lpString, return_value)        \
            if (lpString == nullptr)                  \
              return return_value;                                \
            if (strlen(lpString) == 0)                \
              return return_value

#define DCHECK_STRING1(lpString, return_value)        \
            assert(lpString != nullptr);              \
            assert(strlen(lpString) != 0);            \
            CHECK_STRING1(lpString, return_value)

// Kiểm tra Wire String
#define CHECK_WSTRING0(lpWString)                    \
            if (lpWString == nullptr)                \
              return;                                \
            if (wcslen(lpWString) == 0)              \
              return

#define DCHECK_WSTRING0(lpWString)                    \
            assert(lpWString != nullptr);            \
            assert(wcslen(lpWString) != 0);          \
            CHECK_WSTRING0(lpWString)

#define CHECK_WSTRING1(lpWString, return_value)      \
            if (lpWString == nullptr)                \
              return return_value;                                \
            if (wcslen(lpWString) == 0)              \
              return return_value

#define DCHECK_WSTRING1(lpWString, return_value)      \
            assert(lpWString != nullptr);            \
            assert(wcslen(lpWString) != 0);          \
            CHECK_WSTRING1(lpWString, return_value)
// -----------------------------------------------------------------------------

// -----------------------------------------------------------------------------
// A macro to disallow the copy constructor and operator= functions
// This should be used in the private: declarations for a class
#define DISALLOW_COPY_AND_ASSIGN(TypeName)            \
            TypeName(const TypeName&);                \
            void operator=(const TypeName&)
// -----------------------------------------------------------------------------

// -----------------------------------------------------------------------------
// Thread create container
struct ThreadContainer {
    int index;
    void* pointer;
    // mang thêm một số thông tin khác
    long long ext_param;
};
// -----------------------------------------------------------------------------

// -----------------------------------------------------------------------------
//#ifndef _QWORD_DEFINED
//#define _QWORD_DEFINED
//typedef __int64 QWORD, *LPQWORD;
//#endif

#define LO_WORD(x) ((BYTE)((WORD)(x) & 0xFF))
#define HI_WORD(x) ((BYTE)((WORD)(x) >> 8) & 0xFF)
#define LO_DWORD(x) ((WORD)((DWORD)(x) & 0xFFFF))
#define HI_DWORD(x) ((WORD)((DWORD)(x) >> 16) & 0xFFFF)
#define LO_QWORD(x) ((DWORD)((QWORD)(x) & 0xFFFFFFFF))
#define HI_QWORD(x) ((DWORD)((QWORD)(x) >> 32) & 0xFFFFFFFF)

#define MAKE_WORD(l, h) ((WORD)(((WORD)((l) & 0x00FF)) | ((WORD)((h) & 0x00FF) << 8)))
#define MAKE_DWORD(l, h) ((DWORD)(((DWORD)((l) & 0x0000FFFF)) | ((DWORD)((h) & 0x0000FFFF) << 16)))
#define MAKE_QWORD(l, h) ((QWORD)(((QWORD)((l) & 0x00000000FFFFFFFF)) | (((QWORD)((h) & 0x00000000FFFFFFFF)) << 32)))
// -----------------------------------------------------------------------------

// -----------------------------------------------------------------------------
#define ROTARE_LEFT(bits, number) \
    (((number) << (bits)) | ((number) >> ((sizeof(number) * 8) - (bits))))
#define ROTARE_RIGHT(bits, number)  \
    (((number) >> (bits)) | ((number) << ((sizeof(number) * 8) - (bits))))
// -----------------------------------------------------------------------------

// -----------------------------------------------------------------------------
#define SERIALIZED_OBJECT_ON  __pragma(pack(push, 1))
#define SERIALIZED_OBJECT_OFF __pragma(pack(pop))
// -----------------------------------------------------------------------------

// -----------------------------------------------------------------------------
struct CHAR_BITS {
    char bit0 : 1,  // bit thấp nhất
        bit1 : 1,
        bit2 : 1,
        bit3 : 1,
        bit4 : 1,
        bit5 : 1,
        bit6 : 1,
        bit7 : 1;
};
// -----------------------------------------------------------------------------

// -----------------------------------------------------------------------------
#define Zero(obj) memset(&obj, 0, sizeof(obj))
// -----------------------------------------------------------------------------
Bon Dia

Dakosmu

#1

mu_object_chat_data.h


#pragma once
#include "macro.h"
//████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
//█░░░░░░░░░░░░███░░░░░░░░░░░░░░█░░░░░░██░░░░░░░░█░░░░░░░░░░░░░░█░░░░░░░░░░░░░░█░░░░░░██████████░░░░░░█░░░░░░██░░░░░░█
//█░░▄▀▄▀▄▀▄▀░░░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██░░▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░░░░░░░░░░░░░▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░░░▄▀▄▀░░█░░▄▀░░░░░░▄▀░░█░░▄▀░░██░░▄▀░░░░█░░▄▀░░░░░░▄▀░░█░░▄▀░░░░░░░░░░█░░▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░███░░▄▀░░██░░▄▀░░█░░▄▀░░█████████░░▄▀░░░░░░▄▀░░░░░░▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░██░░▄▀░░█░░▄▀░░░░░░▄▀░░█░░▄▀░░░░░░▄▀░░███░░▄▀░░██░░▄▀░░█░░▄▀░░░░░░░░░░█░░▄▀░░██░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░██░░▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░███░░▄▀░░██░░▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░██░░▄▀░░█░░▄▀░░░░░░▄▀░░█░░▄▀░░░░░░▄▀░░███░░▄▀░░██░░▄▀░░█░░░░░░░░░░▄▀░░█░░▄▀░░██░░░░░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░███░░▄▀░░██░░▄▀░░█████████░░▄▀░░█░░▄▀░░██████████░░▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░░░▄▀▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░░░█░░▄▀░░░░░░▄▀░░█░░░░░░░░░░▄▀░░█░░▄▀░░██████████░░▄▀░░█░░▄▀░░░░░░▄▀░░█
//█░░▄▀▄▀▄▀▄▀░░░░█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██████████░░▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█
//█░░░░░░░░░░░░███░░░░░░██░░░░░░█░░░░░░██░░░░░░░░█░░░░░░░░░░░░░░█░░░░░░░░░░░░░░█░░░░░░██████████░░░░░░█░░░░░░░░░░░░░░█
//████████████████████████████████████████████████████████████████████████████████████████████████████████████████████



#define MAX_CHAT_MESSAGE 200

SERIALIZED_OBJECT_ON
struct MuObjectChatData {
    char* message() {
        if (is_external_message()) {
            return long_message_;
        }
        else {
            return short_message_;
        }
    }

    void set_message(const char* msg) {
        if (is_external_message()) {
            long_message_ = (char*)msg;
        }
        else {
            int len = strlen(msg);
            len = (len < 16) ? len : 15;
            memcpy_s(short_message_, sizeof(short_message_), msg, len);
            short_message_[len] = '\0';
        }
    }

    unsigned long message_len() { return message_len_; }

    bool is_external_message() { return external_message_ > 0xF; }

public:
    char unknow1_[4];
    char account_[11];
    char unknow2_[5];
    unsigned long account_len_;
    char unknow3_[8];
    union {
        char short_message_[16];
        char* long_message_;
    };
    unsigned long message_len_;
    unsigned long external_message_;  // >= 0x10
    unsigned long chat_type_;  // [1..9]
    char unknow4_[36];
};
SERIALIZED_OBJECT_OFF


mu_object_item_data.h


#pragma once

#include "macro.h"
//████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
//█░░░░░░░░░░░░███░░░░░░░░░░░░░░█░░░░░░██░░░░░░░░█░░░░░░░░░░░░░░█░░░░░░░░░░░░░░█░░░░░░██████████░░░░░░█░░░░░░██░░░░░░█
//█░░▄▀▄▀▄▀▄▀░░░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██░░▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░░░░░░░░░░░░░▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░░░▄▀▄▀░░█░░▄▀░░░░░░▄▀░░█░░▄▀░░██░░▄▀░░░░█░░▄▀░░░░░░▄▀░░█░░▄▀░░░░░░░░░░█░░▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░███░░▄▀░░██░░▄▀░░█░░▄▀░░█████████░░▄▀░░░░░░▄▀░░░░░░▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░██░░▄▀░░█░░▄▀░░░░░░▄▀░░█░░▄▀░░░░░░▄▀░░███░░▄▀░░██░░▄▀░░█░░▄▀░░░░░░░░░░█░░▄▀░░██░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░██░░▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░███░░▄▀░░██░░▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░██░░▄▀░░█░░▄▀░░░░░░▄▀░░█░░▄▀░░░░░░▄▀░░███░░▄▀░░██░░▄▀░░█░░░░░░░░░░▄▀░░█░░▄▀░░██░░░░░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░███░░▄▀░░██░░▄▀░░█████████░░▄▀░░█░░▄▀░░██████████░░▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░░░▄▀▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░░░█░░▄▀░░░░░░▄▀░░█░░░░░░░░░░▄▀░░█░░▄▀░░██████████░░▄▀░░█░░▄▀░░░░░░▄▀░░█
//█░░▄▀▄▀▄▀▄▀░░░░█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██████████░░▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█
//█░░░░░░░░░░░░███░░░░░░██░░░░░░█░░░░░░██░░░░░░░░█░░░░░░░░░░░░░░█░░░░░░░░░░░░░░█░░░░░░██████████░░░░░░█░░░░░░░░░░░░░░█
//████████████████████████████████████████████████████████████████████████████████████████████████████████████████████


SERIALIZED_OBJECT_ON
struct MuObjectItemData {  //-> Complete (size: 107)
public:
    unsigned char level() {
        return (Level >> 3) & 0x0F;
    }

public:
    /*+00*/  short            ItemID;
    /*+02*/  int              Level;
    /*+06*/  char            Unknown6;
    /*+07*/  char            Unknown7;
    /*+08*/  char            Unknown8;
    /*+09*/  short            DamageMin;
    /*+11*/  short            DamageMax;
    /*+13*/  char            Unknown13;
    /*+14*/  short            Unknown14;
    /*+16*/  short            Unknown16;
    /*+18*/  char            Unknown18;
    /*+19*/  char            Unknown19;
    /*+20*/  short            Unknown20;
    /*+22*/  char            Durability;
    /*+23*/  char            ExcellentOption;
    /*+24*/  char            AncientOption;
    /*+25*/  short            ReqStrenght;
    /*+27*/  short            ReqDextirity;
    /*+29*/  short            ReqEnergy;
    /*+31*/  short            ReqVitality;
    /*+33*/  short            ReqCommand;
    /*+35*/  short            ReqLevel;
    /*+37*/  char            SpecialCount;
    /*+38*/  WORD              SpecialType[8];
    /*+54*/  BYTE              SpecialValue[8];
    /*+62*/  int              UniqueID;
    /*+66*/  char            CurrentActiveSlotIndex;
    /*+67*/  char            PosX;
    /*+68*/  char            PosY;
    /*+69*/  WORD              HarmonyType;
    /*+71*/  short            HarmonyValue;
    /*+73*/  char            Is380Item;
    /*+74*/  char            SocketOption[5];
    /*+79*/  char            Unknown79;
    /*+80*/  char            SocketSeedIndex[5];
    /*+85*/  char            SocketSphereLevel[5];
    /*+90*/  char            SocketSet;
    /*+91*/  BYTE              gap01[5];
    /*+96*/  char            DurabilityState;
    /*+97*/  char            PeriodItem;
    /*+98*/  char            ExpiredItem;
    /*+99*/  int              ExpireDateConvert;
    /*+103*/ int              MaybeRefCount;
};
SERIALIZED_OBJECT_OFF


post_item.cpp



#include "stdafx.h"
#if Post_Item
#include "Defines.h"
#include "Import.h"
#include "Object.h"
#include "post_item.h"
#include "Interface.h"
#include "Protocol.h"
#include "Util.h"
#include
#include "Protect.h"


#include
#include

int main() {
    std::string dakosmu = "DAKOSMU";
    std::cout << dakosmu << std::endl;
    return 0;
}



//████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
//█░░░░░░░░░░░░███░░░░░░░░░░░░░░█░░░░░░██░░░░░░░░█░░░░░░░░░░░░░░█░░░░░░░░░░░░░░█░░░░░░██████████░░░░░░█░░░░░░██░░░░░░█
//█░░▄▀▄▀▄▀▄▀░░░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██░░▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░░░░░░░░░░░░░▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░░░▄▀▄▀░░█░░▄▀░░░░░░▄▀░░█░░▄▀░░██░░▄▀░░░░█░░▄▀░░░░░░▄▀░░█░░▄▀░░░░░░░░░░█░░▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░███░░▄▀░░██░░▄▀░░█░░▄▀░░█████████░░▄▀░░░░░░▄▀░░░░░░▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░██░░▄▀░░█░░▄▀░░░░░░▄▀░░█░░▄▀░░░░░░▄▀░░███░░▄▀░░██░░▄▀░░█░░▄▀░░░░░░░░░░█░░▄▀░░██░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░██░░▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░███░░▄▀░░██░░▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░██░░▄▀░░█░░▄▀░░░░░░▄▀░░█░░▄▀░░░░░░▄▀░░███░░▄▀░░██░░▄▀░░█░░░░░░░░░░▄▀░░█░░▄▀░░██░░░░░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░███░░▄▀░░██░░▄▀░░█████████░░▄▀░░█░░▄▀░░██████████░░▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░░░▄▀▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░░░█░░▄▀░░░░░░▄▀░░█░░░░░░░░░░▄▀░░█░░▄▀░░██████████░░▄▀░░█░░▄▀░░░░░░▄▀░░█
//█░░▄▀▄▀▄▀▄▀░░░░█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██████████░░▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█
//█░░░░░░░░░░░░███░░░░░░██░░░░░░█░░░░░░██░░░░░░░░█░░░░░░░░░░░░░░█░░░░░░░░░░░░░░█░░░░░░██████████░░░░░░█░░░░░░░░░░░░░░█
//████████████████████████████████████████████████████████████████████████████████████████████████████████████████████



// -----------------------------------------------------------------------------

DakosmuPItem gDakosmuPI;

DakosmuPItem::DakosmuPItem()
{
    list_counter_ = 0;
    last_tickcount_moveitem_ = 0;
    last_tickcount_post_ = 0;
    current_item_post_ = &gInterface.item_post_;
    last_tickcount_view_ = &gInterface.last_tickcount_view_;
    draw_character_head_chat_text_ = false;
    DakosmuPItemColor = GetPrivateProfileInt("Game", "PostColor", 7, ".\\Settings.ini");
    if (DakosmuPItemColor < 1 || DakosmuPItemColor > 9) { DakosmuPItemColor = 9; }
    Hook();
}
// -----------------------------------------------------------------------------

DakosmuPItem::~DakosmuPItem() {

}
// -----------------------------------------------------------------------------

void DakosmuPItem::Hook()
{
    SetCompleteHook(0xE9, 0x007DCFD0, &DakosmuPItemToWorldChatChannel);//1.04D-> 0x007DCE80
    SetCompleteHook(0xE9, 0x007897C7, &BuildChatDataLong);//1.04D-> 0x00789677
    SetCompleteHook(0xE9, 0x0078AAA6, &ViewDakosmuPItem);//1.04D->0x0078A956
    SetJmp(0x00599183, 6, ProcessCharacterHeadChatText);
    SetCompleteHook(0xE9, 0x0083B7E4 + 0x150, &Equipments);//1.04D->0x0083B7E4
}

void __declspec (naked) DakosmuPItem::DakosmuPItemToWorldChatChannel() {
    static DWORD register_ecx = 0;
    static DWORD register_edx = 0;
    static DWORD mem = 0;
    _asm {
        MOV register_ecx, ECX;
        MOV register_edx, EDX;
        MOV ECX, DWORD PTR SS : [EBP - 0x10] ;
        MOV EDX, DWORD PTR DS : [ECX + 0x54] ;
        MOV mem, EDX;
    }
    DakosmuPItemToWorldChatChannelImp((void*)mem);
    _asm {
        MOV ECX, register_ecx;
        MOV EDX, register_edx;
        MOV mem, 0x007DD09D; //1.04D-> 0x007DCF4D;
        JMP mem;
    }
}

void DakosmuPItem::DakosmuPItemToWorldChatChannelImp(void* item_data)
{
    // check window, not allow for shop, inventory, warehouse, etc
    if (gInterface.CheckWindow(Trade) ||
        gInterface.CheckWindow(Warehouse) ||
        gInterface.CheckWindow(Shop) ||
        gInterface.CheckWindow(Store) ||
        gInterface.CheckWindow(OtherStore) ||
        gInterface.CheckWindow(CashShop) ||
        gInterface.CheckWindow(ExpandWarehouse))
    {
        return;
    }

    if (GetKeyState(VK_RBUTTON) & 0x8000 && GetKeyState(VK_CONTROL) & 0x8000)
    {
        if (GetTickCount() <= gDakosmuPI.last_tickcount_post_ + 3000) { return; }

        PMSG_POSTITEM iMsg = { '\0' };
        strcpy_s(iMsg.chatmsg, (char*)pCurrentViewingItemName);
        memcpy_s(&iMsg.chatid[0], 10, (char*)oUserObjectStruct_, 10);
        memcpy_s(&iMsg.item_data[0], 107, item_data, 107);
        iMsg.h.set(0x78, sizeof(iMsg));
        DataSend((LPBYTE)&iMsg, iMsg.h.size);
        gDakosmuPI.last_tickcount_post_ = GetTickCount();

    }
    //Click Derecho
    else if (GetKeyState(VK_RBUTTON) & 0x8000
        && GetTickCount() >= gDakosmuPI.last_tickcount_moveitem_ + 300)
    {
        ObjectItem* lItem = (ObjectItem*)item_data;

        if (lItem->ItemID < 0) { return; }

        //clic_right
#if clic_right
        PMSG_ITEM_MOVE_RECV pMsg = { 0 };
#endif

        pMsg.h.set(0x79, 0x01, sizeof(pMsg));
        pMsg.Target = -1;

        if (gInterface.CheckWindow(ChaosBox) && gInterface.CheckWindow(Inventory))
        {
            if ((pCursorX > 460))
            {
                pMsg.sFlag = 0;
                pMsg.tFlag = 3;
                pMsg.Target = 0;
                pMsg.Source = lItem->PosX + lItem->PosY * 8 + 12;
            }
            else if (gInterface.CheckWindow(ExpandInventory) && pCursorX > 260)
            {
                pMsg.sFlag = 0;
                pMsg.tFlag = 3;
                pMsg.Target = 0;
                pMsg.Source = lItem->PosX + lItem->PosY * 8 + 12 + 64;
                if (pCursorY > 130)
                    pMsg.Source += 32;
            }
            else
            {
                pMsg.sFlag = 3;
                pMsg.tFlag = 0;
                pMsg.Target = 0;
                pMsg.Source = lItem->PosX + lItem->PosY * 8;
            }
        }
        else
        {
            float v1 = 0;
            if (gInterface.CheckWindow(Character))
                v1 = *(float*)(0x00D24E88);
            if ((pCursorX > 460 - v1))
            {
                pMsg.sFlag = 0;
                pMsg.tFlag = 0;
                pMsg.Source = lItem->PosX + lItem->PosY * 8 + 12;

            }
            else if (gInterface.CheckWindow(ExpandInventory) && pCursorX > 260 - v1)
            {
                pMsg.sFlag = 0;
                pMsg.tFlag = 0;
                pMsg.Source = lItem->PosX + lItem->PosY * 8 + 12 + 64;
                if (pCursorY > 130)
                    pMsg.Source += 32;
            }
            pMsg.Target = 0;
        }

        DataSend((BYTE*)&pMsg, pMsg.h.size);
        gDakosmuPI.last_tickcount_moveitem_ = GetTickCount();
    }
}

void* DakosmuPItem::AddItem(void* item_data)
{
    LinkNode* item = new ItemPost(item_data);
    gDakosmuPI.list_.Append(item);

    if (gDakosmuPI.list_counter_ >= MAX_CHAT_MESSAGE)
    {
        LinkNode* node = gDakosmuPI.list_.head();
        node->Free();
    }
    else
    {
        gDakosmuPI.list_counter_++;
    }

    return item;
}

void __declspec (naked) DakosmuPItem::BuildChatDataLong()
{
    static void* chat_data_pointer = nullptr;
    static DWORD mem = 0;
    _asm
    {
        MOV chat_data_pointer, ECX;
        MOV mem, 0x0078BFE0; //1.04D-> 0x0078BE90;
        CALL mem;
    }
    BuildChatData(chat_data_pointer);
    _asm
    {
        MOV mem, 0x007897CC; //1.04D-> 0x0078967C;
        JMP mem;
    }
}

void __declspec (naked) DakosmuPItem::BuildChatDataShort()
{
    static void* chat_data_pointer = nullptr;
    static DWORD mem = 0;
    _asm
    {
        MOV chat_data_pointer, ECX;
        MOV mem, 0x0078BFE0; //1.04D-> 0x0078BE90;
        CALL mem;
    }

    BuildChatData(chat_data_pointer);
    _asm
    {
        MOV mem, 0x00789E17; //1.04D-> 0x00789CC7;
        JMP mem;
    }
}

void DakosmuPItem::BuildChatData(void* chat_data_pointer)
{
    MuObjectChatData* chat = (MuObjectChatData*)chat_data_pointer;

    if (!chat->is_external_message() || !gDakosmuPI.list_counter_)
    {
        return;
    }

    char* message = chat->message();
    unsigned long message_len = chat->message_len();

    if (message[message_len - 1 - 8 - 2] != '_' ||
        message[message_len - 1 - 8 - 1] != '[' ||
        message[message_len - 1] != ']')
    {
        return;
    }

    LinkNode* item_node = nullptr;
    sscanf_s(&message[message_len - 1 - 8], "%08X", (DWORD*)&item_node);

    bool found = false;

    for (int i = 0; i < 20; i++)
    {
        if (gDakosmuPI.eItemNode[i] && gDakosmuPI.eItemNode[i] == (DWORD)item_node)
            found = true;
    }
    if (!found)
        return;

    ItemPost* item_post = item_node->value();
    item_post->chat_ = chat;
    message[message_len - 1 - 8 - 2] = '\0';
    message[message_len - 1 - 8 + 0] = '_';
    message[message_len - 1 - 8 + 1] = '_';
    message[message_len - 1 - 8 + 6] = '_';
    message[message_len - 1 - 8 + 7] = '_';
    *(unsigned long*)&message[message_len - 1 - 8 + 2] = (unsigned long)item_node;
}

void DakosmuPItem::ClearSession()
{
    for (int i = 0; i < 20; i++)
    {
        this->eItemNode[i] = 0x0;
    }
}

void __declspec (naked) DakosmuPItem::ProcessCharacterHeadChatText()
{
    static DWORD mem = 0;
    static DWORD base_address;
    static DWORD chat_text;
    _asm {
        MOV mem, EAX;
        MOV EAX, DWORD PTR SS : [EBP + 0x08] ;
        MOV base_address, EAX;
        MOV EAX, DWORD PTR SS : [EBP + 0x0C] ;
        MOV chat_text, EAX;
        MOV EAX, mem;
    }

    DakosmuPItem::ProcessCharacterHeadChatTextImp((char*)base_address, (char*)chat_text);

    _asm
    {
        PUSH - 1;
        PUSH 0x00CD3143; //1.04D-> 0x00CD2FC3;
        MOV mem, 0x0059918A;
        JMP mem;
    }
}
// -----------------------------------------------------------------------------

void DakosmuPItem::ProcessCharacterHeadChatTextImp(char* base_address, char* chat_text)
{
    if (gDakosmuPI.draw_character_head_chat_text_)
    {
        unsigned long len = strlen(chat_text);

        if (chat_text[len - 1 - 8 - 2] != '_' ||
            chat_text[len - 1 - 8 - 1] != '[' ||
            chat_text[len - 1] != ']')
        {
        }
        else
        {
            gDakosmuPI.draw_character_head_chat_text_base_address_ = base_address;
        }
        gDakosmuPI.draw_character_head_chat_text_ = false;
    }
}
// -----------------------------------------------------------------------------
void __declspec (naked) DakosmuPItem::ViewDakosmuPItem() {

    static void* chat_data_pointer = nullptr;

    static DWORD mem = 0;

    _asm {
        MOV mem, 0x0078C020; //1.04D-> 0x0078BED0;
        CALL mem;
        MOV chat_data_pointer, EAX;
    }

    ViewDakosmuPItemImp(chat_data_pointer);
    _asm {
        MOV EAX, chat_data_pointer;
        MOV mem, 0x0078AAAB; //1.04D-> 0x0078A95B;
        JMP mem;
    }
}
// -----------------------------------------------------------------------------
#include "User.h"
void DakosmuPItem::ViewDakosmuPItemImp(void* chat_data_pointer) {
    MuObjectChatData* chat = (MuObjectChatData*)chat_data_pointer;

    if (!chat->is_external_message() || !gDakosmuPI.list_counter_)
    {
        *gDakosmuPI.current_item_post_ = nullptr;
        return;
    }

    char* message = chat->message();
    unsigned long message_len = chat->message_len();
    unsigned long real_len = strlen(message);

    if (message_len == real_len)
    {
        *gDakosmuPI.current_item_post_ = nullptr;
        return;
    }

    // _API__XXXX__API
    if (message[message_len - 1 - 8 - 2] != '\0' ||
        message[message_len - 1 - 8 - 1] != '[' ||
        message[message_len - 1] != ']')
    {
        *gDakosmuPI.current_item_post_ = nullptr;
        return;
    }

    LinkNode* item_node = (LinkNode *) * (unsigned long*)&message[message_len - 1 - 8 + 2];
    ItemPost* item_post = item_node->value();
    ObjectItem* item_data = (ObjectItem*)&item_post->item_;
    // set show item tool tip
    *gDakosmuPI.last_tickcount_view_ = GetTickCount();
    *gDakosmuPI.current_item_post_ = item_data;

    gObjUser.DakosmuPItemID = item_data->ItemID;
    gObjUser.DakosmuPItemLV = item_data->Level;
    gObjUser.DakosmuPItemExc = item_data->ExcellentOption;
    gObjUser.DakosmuPItemAcc = item_data->AncientOption;
    gObjUser.DakosmuPItem380 = item_data->Is380Item;
    gObjUser.DakosmuPItemHarmony = item_data->HarmonyValue;
    gObjUser.DakosmuPItemSocket = item_data->SocketOption;
    gObjUser.DakosmuPItemX = item_data->PosX;
    gObjUser.DakosmuPItemY = item_data->PosY;
}
// -----------------------------------------------------------------------------
//clic right
void __declspec (naked) DakosmuPItem::Equipments()
{
    static DWORD mem = 0;
    _asm {
        mov eax, dword ptr ds : [ebp - 04]
        mov mem, eax
    }
    RemoveEquipment((void*)mem);
    _asm {
        mov esp, ebp
        pop ebp
        ret 0004
    }
}

void DakosmuPItem::RemoveEquipment(void* item_data)
{
    // check window, not allow for shop, inventory, warehouse, etc
    if (gInterface.CheckWindow(Trade) ||
        gInterface.CheckWindow(Warehouse) ||
        gInterface.CheckWindow(Shop) ||
        gInterface.CheckWindow(Store) ||
        gInterface.CheckWindow(OtherStore) ||
        gInterface.CheckWindow(CashShop) ||
        gInterface.CheckWindow(ExpandWarehouse)) {
        return;
    }
    if (GetKeyState(VK_RBUTTON) & 0x8000 && GetTickCount() >= gDakosmuPI.last_tickcount_moveitem_ + 250) {

        ObjectItem* lItem = (ObjectItem*)item_data;

        if (lItem->ItemID < 0) { return; }

        PMSG_ITEM_MOVE_RECV pMsg = { 0 };

        pMsg.h.set(0x79, 0x01, sizeof(pMsg));

        pMsg.sFlag = 0;
        pMsg.tFlag = 0;
        pMsg.Source = lItem->PosX;
        pMsg.Target = 0;

        DataSend((BYTE*)&pMsg, pMsg.h.size);

        gDakosmuPI.last_tickcount_moveitem_ = GetTickCount();
    }
}

#endif


post_item.h


#pragma once


#include "item_post.h"
//████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
//█░░░░░░░░░░░░███░░░░░░░░░░░░░░█░░░░░░██░░░░░░░░█░░░░░░░░░░░░░░█░░░░░░░░░░░░░░█░░░░░░██████████░░░░░░█░░░░░░██░░░░░░█
//█░░▄▀▄▀▄▀▄▀░░░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██░░▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░░░░░░░░░░░░░▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░░░▄▀▄▀░░█░░▄▀░░░░░░▄▀░░█░░▄▀░░██░░▄▀░░░░█░░▄▀░░░░░░▄▀░░█░░▄▀░░░░░░░░░░█░░▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░███░░▄▀░░██░░▄▀░░█░░▄▀░░█████████░░▄▀░░░░░░▄▀░░░░░░▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░██░░▄▀░░█░░▄▀░░░░░░▄▀░░█░░▄▀░░░░░░▄▀░░███░░▄▀░░██░░▄▀░░█░░▄▀░░░░░░░░░░█░░▄▀░░██░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░██░░▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░███░░▄▀░░██░░▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░██░░▄▀░░█░░▄▀░░░░░░▄▀░░█░░▄▀░░░░░░▄▀░░███░░▄▀░░██░░▄▀░░█░░░░░░░░░░▄▀░░█░░▄▀░░██░░░░░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░███░░▄▀░░██░░▄▀░░█████████░░▄▀░░█░░▄▀░░██████████░░▄▀░░█░░▄▀░░██░░▄▀░░█
//█░░▄▀░░░░▄▀▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░░░█░░▄▀░░░░░░▄▀░░█░░░░░░░░░░▄▀░░█░░▄▀░░██████████░░▄▀░░█░░▄▀░░░░░░▄▀░░█
//█░░▄▀▄▀▄▀▄▀░░░░█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██████████░░▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█
//█░░░░░░░░░░░░███░░░░░░██░░░░░░█░░░░░░██░░░░░░░░█░░░░░░░░░░░░░░█░░░░░░░░░░░░░░█░░░░░░██████████░░░░░░█░░░░░░░░░░░░░░█
//████████████████████████████████████████████████████████████████████████████████████████████████████████████████████


class DakosmuPItem {
public:
    DakosmuPItem();
    virtual ~DakosmuPItem();

    void Hook();


    static void DakosmuPItemToWorldChatChannel();
    static void DakosmuPItemToWorldChatChannelImp(void* item_data);
    static void* AddItem(void* item_data);
    static void BuildChatDataLong();  // long message
    static void BuildChatDataShort();  // short message
    static void BuildChatData(void* chat_data_pointer);
    static void ProcessCharacterHeadChatText();
    static void ProcessCharacterHeadChatTextImp(char* base_address, char* chat_text);
    static void ViewDakosmuPItem();
    static void ViewDakosmuPItemImp(void* chat_data_pointer);
#if Post_Item
    void ClearSession();
#endif
#if clic_right
    //Right click

    static void Equipments();
    static void RemoveEquipment(void* item_data);
#endif
    int DakosmuPItemColor;
    DWORD eItemNode[20];
public:
    LinkedList list_;
    unsigned long list_counter_;

    DWORD last_tickcount_post_;

    void** current_item_post_;
    DWORD* last_tickcount_view_;

    bool draw_character_head_chat_text_;
    char* draw_character_head_chat_text_base_address_;
#if clic_right
    //Right Click
    DWORD last_tickcount_moveitem_;
    void* item_post_;
#endif
}; extern DakosmuPItem gDakosmuPI;
Bon Dia

Dakosmu

#2
stdafx.h

#define Post_Item                  1 //Post_Item
#define clic_right                  1 //clic_right


Interface.cpp



#if Post_Item
#include "post_item.h"
#endif



Buscar this->BindObject


Agregar


#if Post_Item
    SetOp((LPVOID)oLoadSomeForm_Call, this->LoadImages, ASM::CALL);
    SetOp((LPVOID)oDrawInterface2_Call, this->Work2, ASM::CALL);
    SetOp((LPVOID)oDrawInterface_Call, this->Work, ASM::CALL);
    this->item_post_ = nullptr;
#endif


Este codigo lo agregas al final del interface.cpp


#if Post_Item
void testfunc()
{
    glMatrixMode(0x1700u);
    glPopMatrix();
    glMatrixMode(0x1701u);
    glPopMatrix();
}

#define sub_636720_Addr ((int(*)())0x636720)
#define sub_6363D0_Addr ((void(__cdecl*)(GLint x, int a2, GLsizei width, GLsizei height)) 0x6363D0)
#define sub_6358A0_Addr ((int(__cdecl*)(float a1, float a2, float a3, float a4)) 0x6358A0)
#define sub_635830_Addr ((void(__cdecl*)(LPVOID a1)) 0x635830)
#define sub_635DE0_Addr ((void(*)()) 0x635DE0)
#define sub_635E40_Addr ((void(*)()) 0x635E40)
#define sub_637770_Addr ((void(*)()) 0x637770)

void Interface::DrawItemIMG(float PosX, float PosY, float Width, float Height, int ItemID, int Level, int Excl, int Anc, bool OnMouse) // code hien thi item
{
    float x = PosX;
    float y = PosY;

    if (ItemID >= ITEM(0, 0) && ItemID < ITEM(1, 0))
    {
        x = PosX - 5;
        if (ItemID == ITEM(0, 16) || ItemID == ITEM(0, 19)) { y = PosY + 30; }
        else if ((ItemID >= ITEM(0, 32) && ItemID <= ITEM(0, 35)) || gCustomGloves.CheckGloves(ItemID) == true) { y = PosY + 15; }
        else if (ItemID >= ITEM(0, 15) && ItemID < ITEM(0, 32)) { y = PosY + 25; }
        else if (ItemID > ITEM(0, 35)) { y = PosY + 20; }
        else if (ItemID == ITEM(0, 0)) { y = PosY + 30; }
        else { y = PosY + 20; }
    }
    else if (ItemID >= ITEM(3, 0) && ItemID < ITEM(4, 0))
    {
        y = PosY + 30;
    }
    else if (ItemID >= ITEM(7, 0) && ItemID < ITEM(8, 0)) { y = PosY + 25; }
    else if (ItemID >= ITEM(8, 0) && ItemID < ITEM(9, 0))
    {
        if ((ItemID >= ITEM(8, 2) && ItemID <= ITEM(8, 4))
            || ItemID == ITEM(8, 7) || ItemID == ITEM(8, 8)
            || ItemID == ITEM(8, 15))
        {
            y = PosY + 20;
        }
        else if (ItemID == ITEM(8, 34) || ItemID == ITEM(8, 35)) { y = PosY + 25; }
        else if (ItemID <= ITEM(8, 73)) { y = PosY + 25; }
        else if (ItemID > ITEM(8, 73)) { y = PosY + 35; }
    }
    else if (ItemID >= ITEM(9, 0) && ItemID < ITEM(12, 0)) { y = PosY + 25; }
    else if (ItemID >= 2048)
    {
        y = PosY + 25;

        if (ItemID == ITEM(12, 40)) { y = PosY + 10; }
    }
    else { y = PosY + 20; }

    glMatrixMode(0x1701);
    glPushMatrix();
    glLoadIdentity();

    sub_6363D0_Addr(0, 0, *(GLsizei*)MAIN_RESOLUTION_X, *(GLsizei*)MAIN_RESOLUTION_Y);
    float v2 = *(float*)MAIN_RESOLUTION_X / *(float*)MAIN_RESOLUTION_Y;

    sub_6358A0_Addr(1.0, v2, *(float*)0xE61E38, *(float*)0xE61E3C);
    glMatrixMode(0x1700);
    glPushMatrix();
    glLoadIdentity();
    sub_635830_Addr((LPVOID)0x87933A0);
    sub_635DE0_Addr();
    sub_635E40_Addr();
    pDrawItemModel(x, y, Width, Height, ItemID, Level, Excl, Anc, OnMouse);
    glMatrixMode(0x1700u);
    glPopMatrix();
    glMatrixMode(0x1701u);
    glPopMatrix();
    glColor4f((GLfloat)1.0, (GLfloat)1.0, (GLfloat)1.0, (GLfloat)1.0);
    pSetBlend(false);
}
void Interface::Work2() {


    if (gInterface.item_post_ && pCursorX < 150)
    {
        glColor4f(0.0, 0.0, 0.0, 0.8);
        pDrawBarForm((float)(+300), (float)(+150), 80.0f, 110.0f, 0.0f, 0); //pCursorY->Len Xuong // pCursorX->Trai Phai
        DrawItemIMG(+340.0f, +210.0f, gObjUser.DakosmuPItemX, gObjUser.DakosmuPItemY, gObjUser.DakosmuPItemID, gObjUser.DakosmuPItemLV, gObjUser.DakosmuPItemExc, 0, 0);



        gInterface.DrawItemToolTipText(gInterface.item_post_, pCursorX + 80, pCursorY - 80);
        if (gInterface.last_tickcount_view_ + 100 < GetTickCount())
        {
            gInterface.item_post_ = nullptr;
        }
    }

    pDrawInterface2();
}
#include "post_item.h"
void Interface::DrawChat(int mode, char* character, char* message) {
    PBMSG_CHATPOSTITEM chat;
    memset(&chat.character_[0], 0, 10);
    memset(&chat.message_[0], 0, 89);
    memcpy(&chat.character_[0], &character[0], 10);
    memcpy(&chat.message_[0], &message[0], strlen(message));
    pHandlePacketChatData(&chat);

    if (mode >= 1 && mode <= 9 && ChatBoxMuObjectChatDataPtrArrayLength) {
        int index = ChatBoxMuObjectChatDataPtrArrayLength - 1;
        ChatBoxMuObjectChatDataPtrArray[index]->chat_type_ = mode;
    }
}

void Interface::DrawItemToolTipText(void* item, int x, int y) {
    static DWORD mem = 0;
    //static DWORD ItemToolTipAdress1 = 0x00861110; //1.04D-> 0x00860FC0
    //static DWORD ItemToolTipAdress2 = 0x00861AA0; //1.04D-> 0x00861950
    //static DWORD ItemToolTipAdress3 = 0x007E3E30; //1.04D-> 0x007E3CE0
    _asm {
        PUSH 0
        PUSH 0
        PUSH 0
        PUSH item
        PUSH y
        PUSH x
        MOV mem, 0x00861110
        CALL mem
        MOV ECX, EAX
        MOV mem, 0x00861AA0
        CALL mem
        MOV ECX, EAX
        MOV mem, 0x007E3E30
        CALL mem
    }

}


#endif


Interface.h


dentro de class Interface -

Buscas void        DrawMenu()

Agregas


#if Post_Item
    static void DrawItemIMG(float PosX, float PosY, float Width, float Height, int ItemID, int Level, int Excl, int Anc, bool OnMouse);
    static void Work2();
    static void DrawChat(int mode, char* character, char* message);
    static void DrawItemToolTipText(void* item, int x, int y);
    void* item_post_;
    DWORD last_tickcount_view_;
#endif


Protocol.cpp



#if Post_Item
#include "post_item.h"
#endif


Buscar case 0xA3:

Agregar



#if Post_Item
        case 0x78:
            RecvDakosmuPItem((PMSG_POSTITEM*)lpMsg);
            break;
#endif



Este codigo lo agregas al final de protocol.cpp


#if Post_Item
bool RecvDakosmuPItem(PMSG_POSTITEM* lpMsg) {

    void* item_post = DakosmuPItem::AddItem(&lpMsg->item_data[0]);

    if (item_post == nullptr) { return false; }

    char Name[11] = { '\0' };
    char Messase[61] = { '\0' };
    char Messase_API[70] = { '\0' };
    memcpy_s(&Name[0], 10, &lpMsg->chatid[0], 10);
    memcpy_s(&Messase[0], 60, &lpMsg->chatmsg[0], 60);
    int len = strlen(Messase);
    // ----
    // Cat text Excillent
    if ((BYTE)Messase[0] == 0xC4 &&
        (BYTE)Messase[1] == 0x90 &&
        (BYTE)Messase[2] == 0xE1 &&
        (BYTE)Messase[3] == 0xBB &&
        (BYTE)Messase[4] == 0x93 &&
        (BYTE)Messase[5] == 0x20 &&
        (BYTE)Messase[6] == 0x68 &&
        (BYTE)Messase[7] == 0x6F &&
        (BYTE)Messase[8] == 0xC3 &&
        (BYTE)Messase[9] == 0xA0 &&
        (BYTE)Messase[10] == 0x6E &&
        (BYTE)Messase[11] == 0x20 &&
        (BYTE)Messase[12] == 0x68 &&
        (BYTE)Messase[13] == 0xE1 &&
        (BYTE)Messase[14] == 0xBA &&
        (BYTE)Messase[15] == 0xA3 &&
        (BYTE)Messase[16] == 0x6F &&
        (BYTE)Messase[17] == 0x20) {
        strcpy_s(&Messase[0], 61, &Messase[18]);
    }
    // Cat bot ten neu qua dai
    if (len > 25) // 25
    {
        for (int i = 20; i < len; ++i)  // 20
        {
            if (isalpha(Messase[i]) || Messase[i] == ' ')
            {
                Messase[i] = '.';
                Messase[i + 1] = '.';
                Messase[i + 2] = '.';
                Messase[i + 3] = '\0';
            }
        }
    }
    //push this node to eItemNode
    for (int i = 0; i < 19; i++)
    {
        gDakosmuPI.eItemNode[i] = gDakosmuPI.eItemNode[i + 1];
    }
    gDakosmuPI.eItemNode[19] = (DWORD)item_post;
    //end eItemNode
    sprintf_s(Messase_API, "[SELL] %s_[%08X]", Messase, (DWORD)item_post);
    gDakosmuPI.draw_character_head_chat_text_ = true;
    Interface::DrawChat(gDakosmuPI.DakosmuPItemColor, &Name[0], &Messase_API[0]);
    // ----

    if (!gDakosmuPI.draw_character_head_chat_text_)
    { // da lay duoc base_address
        // xu ly doan chat tren dau nhan vat
        char message[256] = { 0 };
        char* chat_text_first = CharacterHeadChatTextFirst(gDakosmuPI.draw_character_head_chat_text_base_address_);
        char* chat_text_last = CharacterHeadChatTextLast(gDakosmuPI.draw_character_head_chat_text_base_address_);
        unsigned long msgfirst_len = strlen(chat_text_first);
        unsigned long msglast_len = strlen(chat_text_last);
        strcpy_s(message, sizeof(message), chat_text_first);
        strcat_s(message, chat_text_last);
        unsigned long message_len = strlen(message);

        if (message[message_len - 1 - 8 - 2] != '_' ||
            message[message_len - 1 - 8 - 1] != '[' ||
            message[message_len - 1] != ']')
        {
        }
        else
        {
            message[message_len - 1 - 8 - 2] = '\0';  // cat bo doan duoi

            // copy lai
            if (msgfirst_len)
            {
                memcpy_s(chat_text_first, 0x50, message, msgfirst_len);
                chat_text_first[msgfirst_len] = '\0';
            }

            if (msglast_len)
            {
                memcpy_s(chat_text_last, 0x50, &message[msgfirst_len], msglast_len);
                chat_text_last[msglast_len] = '\0';
            }
        }
    }
    return true;
}
#endif



Protocol.h


#if clic_right
struct PMSG_ITEM_MOVE_RECV
{
    PSBMSG_HEAD h;
    BYTE sFlag;
    BYTE tFlag;
    BYTE Source;
    BYTE Target;
};
#endif



#if Post_Item
struct PBMSG_CHATPOSTITEM {
    PBMSG_HEAD h;
    char character_[10];  //  3
    char message_[89];  //  D
};

struct PMSG_POSTITEM {
    PBMSG_HEAD h;
    char chatid[10];    //  3
    char chatmsg[60];  //  D
    char item_data[107];
};
#endif


Este codigo lo agregas al final de Protocol.h


#if Post_Item
bool RecvDakosmuPItem(PMSG_POSTITEM* lpMsg); //--post item
#endif



user.h


#if Post_Item
    int                DakosmuPItemID;
    int                DakosmuPItemLV;
    int                DakosmuPItemExc;
    int                DakosmuPItemX;
    int                DakosmuPItemY;
    int                DakosmuPItemAcc;
    int                DakosmuPItemHarmony;
    int                DakosmuPItem380;
    char* DakosmuPItemSocket;
#endif


Util.cpp


#if Post_Item
void SetJmp(DWORD offset, DWORD size, LPVOID function)
{
    MemorySet(offset, 0x90, size);
    SetCompleteHook(0xE9, offset, function);
}
#endif



Este codigo lo agregas al final de Util.cpp


#if Post_Item
void SetJmp(DWORD offset, DWORD size, LPVOID function);
#endif









Bon Dia

Dakosmu

#3
LADO GAMESERVER

stdafx.h


#define    Post_Item        1
Protocol.cpp


#if Post_Item
void GCPostItemProc(PMSG_POST_ITEM_RECV* lpMsg, int aIndex) //ok 
{
    LPOBJ lpObj = &gObj[aIndex];

    if (gObjIsConnectedGP(aIndex) == 0)
    {
        return;
    }

    char name[11] = { 0 };

    memcpy(name, lpMsg->chatid, sizeof(lpMsg->chatid));

    if (strcmp(name, lpObj->Name) != 0)
    {
        return;
    }

    lpMsg->chatmsg[(sizeof(lpMsg->chatmsg) - 1)] = 0;

    int slen = strlen(lpMsg->chatmsg);

    if (slen < 1 || slen >(MAX_CHAT_LEN - 1)) { return; }

    PMSG_POST_ITEM_SEND pMsg;

    pMsg.header.set(0x78, sizeof(pMsg));

    memcpy(pMsg.chatid, lpMsg->chatid, sizeof(pMsg.chatid));

    memcpy(pMsg.chatmsg, lpMsg->chatmsg, sizeof(pMsg.chatmsg));

    memcpy(pMsg.item_data, lpMsg->item_data, sizeof(pMsg.item_data));

    DataSendAll((BYTE*)&pMsg, pMsg.header.size);
}
#endif



#if Post_Item
        case 0x78:
            GCPostItemProc((PMSG_POST_ITEM_RECV*)lpMsg, aIndex); //post item
            break;
#endif

Protocol.h

#if Post_Item
#define MAX_CHAT_LEN 60

struct PMSG_POST_ITEM_RECV
{
    PBMSG_HEAD header;    //C1:78
    char chatid[10];
    char chatmsg[60];
    char item_data[107];
};

struct PMSG_POST_ITEM_SEND
{
    PBMSG_HEAD header;    //C1:78
    char chatid[10];
    char chatmsg[60];
    char item_data[107];
};
#endif

#if Post_Item
void GCPostItemProc(PMSG_POST_ITEM_RECV* lpMsg, int aIndex);
#endif













Bon Dia

Boquadangnhap


Dakosmu

Regístrate para ver el enlaceTks please addtack more image ?

Esta bien. Gracias

Voy a mejorar las guías con más imágenes.. Saludos
Bon Dia

ThedevI2025

Praise for sharing and God bless!
I wish those who share a lifetime of happiness!

🡱 🡳
Real Time Web Analytics