# Macros

# Description

A series of macro definitions provided in the SDK, used to simplify common operations such as hash calculation, color processing, etc.

# How to Use

// Use color macro to create RGBA color
int myColor = MAKE_COLOR(255, 0, 255, 255); // Create purple

// Extract channels from a color
int r = GetR(myColor);
int g = GetG(myColor);
int b = GetB(myColor);
int a = GetA(myColor);

// Use hash macros
uint32_t buffHash = HashName_Buff("someBuff");

# HashName_Buff

uint32_t HashName_Buff(const char* str)

Calculates the hash value of a Buff name, used for Buff-related operations.

Parameter Type Description
str const char* String to be hashed
uint32_t hash = HashName_Buff("myBuff");

# HashName_SpellData

uint32_t HashName_SpellData(const char* str)

Calculates the hash value of skill data, used for skill-related operations.

Parameter Type Description
str const char* String to be hashed
uint32_t hash = HashName_SpellData("Q");

# HashName_Skin

uint32_t HashName_Skin(const char* str)

Calculates the hash value of a skin name, used for skin-related operations.

Parameter Type Description
str const char* String to be hashed
uint32_t hash = HashName_Skin("DefaultSkin");

# MAKE_COLOR

int MAKE_COLOR(unsigned int R, unsigned int G, unsigned int B, unsigned int A)

Creates a color value in RGBA format.

Parameter Type Description
R unsigned int Red channel value (0-255)
G unsigned int Green channel value (0-255)
B unsigned int Blue channel value (0-255)
A unsigned int Alpha channel value (0-255)
int color = MAKE_COLOR(255, 0, 0, 255); // Create red

# GetR

int GetR(int color)

Gets the red channel value of a color.

Parameter Type Description
color int Color value in RGBA format
int red = GetR(color);

# GetG

int GetG(int color)

Gets the green channel value of a color.

Parameter Type Description
color int Color value in RGBA format
int green = GetG(color);

# GetB

int GetB(int color)

Gets the blue channel value of a color.

Parameter Type Description
color int Color value in RGBA format
int blue = GetB(color);

# GetA

int GetA(int color)

Gets the alpha channel value of a color.

Parameter Type Description
color int Color value in RGBA format
int alpha = GetA(color);

# GetRGB

int GetRGB(int color)

Gets the RGB part of a color (without alpha).

Parameter Type Description
color int Color value in RGBA format
int rgb = GetRGB(color);

# RGBA

int RGBA(unsigned int R, unsigned int G, unsigned int B, unsigned int A)

Creates a color value in RGBA format.

Parameter Type Description
R unsigned int Red channel value (0-255)
G unsigned int Green channel value (0-255)
B unsigned int Blue channel value (0-255)
A unsigned int Alpha channel value (0-255)
int color = RGBA(255, 0, 0, 255); // Create red

# RGBA

int RGBA(int RGB, unsigned int A)

Combines an RGB color value with an alpha channel value to form an RGBA format color value.

Parameter Type Description
RGB int Color value in RGB format
A unsigned int Alpha channel value (0-255)
int color = RGBA(existingRGB, 255);

# ExportFun

void ExportFun(Name, Key)

Exports a function to the SDK, making it callable by other plugins.

Parameter Type Description
Name identifier Namespace or class to which the exported function belongs
Key identifier Name of the exported function
ExportFun(MyNamespace, MyFunction);