database

package
v0.0.0-...-32e38c6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2020 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MONK                = 0x34
	MALE_BLADE          = 0x35
	FEMALE_BLADE        = 0x36
	AXE                 = 0x38
	FEMALE_ROD          = 0x39
	DUAL_BLADE          = 0x3B
	DIVINE_MONK         = 0x3E
	DIVINE_MALE_BLADE   = 0x3F
	DIVINE_FEMALE_BLADE = 0x40
	DIVINE_AXE          = 0x42
	DIVINE_FEMALE_ROD   = 0x43
	DIVINE_DUAL_BLADE   = 0x45
)
View Source
const (
	WEAPON_TYPE = iota
	ARMOR_TYPE
	HT_ARMOR_TYPE
	ACC_TYPE
	PENDENT_TYPE
	QUEST_TYPE
	PET_ITEM_TYPE
	SKILL_BOOK_TYPE
	PASSIVE_SKILL_BOOK_TYPE
	POTION_TYPE
	PET_TYPE
	PET_POTION_TYPE
	CHARM_OF_RETURN_TYPE
	FORTUNE_BOX_TYPE
	MARBLE_TYPE
	WRAPPER_BOX_TYPE
	NPC_SUMMONER_TYPE
	FIRE_SPIRIT
	WATER_SPIRIT
	HOLY_WATER_TYPE
	FILLER_POTION_TYPE
	SCALE_TYPE
	BAG_EXPANSION_TYPE
	MOVEMENT_SCROLL_TYPE
	SOCKET_TYPE
	INGREDIENTS_TYPE
	DEAD_SPIRIT_INCENSE_TYPE
	AFFLICTION_TYPE
	RESET_ART_TYPE
	RESET_ARTS_TYPE
	FORM_TYPE
	UNKNOWN_TYPE
)
View Source
const (
	SERVER_COUNT = 4
)

Variables

View Source
var (
	AIs      = make(map[int]*AI)
	AIsByMap []map[int16][]*AI

	MOB_MOVEMENT    = utils.Packet{0xAA, 0x55, 0x21, 0x00, 0x33, 0x00, 0xBC, 0xDB, 0x9F, 0x41, 0x52, 0x70, 0xA2, 0x41, 0x00, 0x55, 0xAA}
	MOB_ATTACK      = utils.Packet{0xAA, 0x55, 0x0C, 0x00, 0x41, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x55, 0xAA}
	MOB_SKILL       = utils.Packet{0xAA, 0x55, 0x1B, 0x00, 0x42, 0x0A, 0x00, 0xDF, 0x28, 0xFA, 0xBE, 0x01, 0x01, 0x55, 0xAA}
	MOB_DEAL_DAMAGE = utils.Packet{0xAA, 0x55, 0x28, 0x00, 0x16, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x27, 0x00, 0x00, 0x55, 0xAA}

	ITEM_DROPPED = utils.Packet{0xAA, 0x55, 0x42, 0x00, 0x67, 0x02, 0x01, 0x01, 0x7A, 0xFB, 0x7B, 0xBF, 0x00, 0xA2, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x55, 0xAA}

	MOB_APPEARED = utils.Packet{0xAA, 0x55, 0x54, 0x00, 0x31, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0x09, 0x57, 0x69, 0x6C, 0x64, 0x20, 0x42, 0x6F, 0x61, 0x72, 0x01, 0x01,
		0x8E, 0xE5, 0x38, 0xC0, 0xD9, 0xB8, 0x05, 0xC0, 0x00, 0x00, 0x00, 0x40, 0xFF, 0xFF, 0x00, 0xFC, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0x00, 0x55, 0xAA}

	DROP_DISAPPEARED = utils.Packet{0xAA, 0x55, 0x04, 0x00, 0x67, 0x04, 0x55, 0xAA}
)
View Source
var (
	GenerateID    func(*Character) error
	GeneratePetID func(*Character, *PetSlot)

	DEAL_DAMAGE       = utils.Packet{0xAA, 0x55, 0x18, 0x00, 0x16, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xAA}
	BAG_EXPANDED      = utils.Packet{0xAA, 0x55, 0x17, 0x00, 0xA3, 0x02, 0x01, 0x32, 0x30, 0x32, 0x30, 0x2D, 0x30, 0x33, 0x2D, 0x31, 0x37, 0x20, 0x31, 0x31, 0x3A, 0x32, 0x32, 0x3A, 0x30, 0x31, 0x00, 0x55, 0xAA}
	BANK_ITEMS        = utils.Packet{0xAA, 0x55, 0x00, 0x00, 0x57, 0x05, 0x01, 0x02, 0x55, 0xAA}
	CHARACTER_DIED    = utils.Packet{0xAA, 0x55, 0x02, 0x00, 0x12, 0x01, 0x55, 0xAA}
	CHARACTER_SPAWNED = utils.Packet{0xAA, 0x55, 0x00, 0x00, 0x21, 0x01, 0xD7, 0xEF, 0xE6, 0x00, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0xC9, 0x00, 0x00, 0x00,
		0x49, 0x2A, 0xFE, 0x00, 0x20, 0x1C, 0x00, 0x00, 0x02, 0xD2, 0x7E, 0x7F, 0xBF, 0xCD, 0x1A, 0x86, 0x3D, 0x33, 0x33, 0x6B, 0x41, 0xFF, 0xFF, 0x10, 0x27,
		0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xC4, 0x0E, 0x00, 0x00, 0xC8, 0xBB, 0x30, 0x00, 0x00, 0x03, 0xF3, 0x03, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
		0x00, 0x10, 0x27, 0x00, 0x00, 0x49, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x55, 0xAA}

	EXP_SKILL_PT_CHANGED = utils.Packet{0xAA, 0x55, 0x0D, 0x00, 0x13, 0x55, 0xAA}

	HP_CHI = utils.Packet{0xAA, 0x55, 0x28, 0x00, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x27, 0x00, 0x00, 0x55, 0xAA}

	RESPAWN_COUNTER = utils.Packet{0xAA, 0x55, 0x05, 0x00, 0x12, 0x02, 0x01, 0x00, 0x00, 0x55, 0xAA}
	SHOW_ITEMS      = utils.Packet{0xAA, 0x55, 0x00, 0x00, 0x59, 0x05, 0x0A, 0x00, 0x00, 0x00, 0x55, 0xAA}

	TELEPORT_PLAYER  = utils.Packet{0xAA, 0x55, 0x09, 0x00, 0x24, 0x55, 0xAA}
	ITEM_COUNT       = utils.Packet{0xAA, 0x55, 0x0C, 0x00, 0x59, 0x04, 0x0A, 0x00, 0x55, 0xAA}
	GREEN_ITEM_COUNT = utils.Packet{0xAA, 0x55, 0x0A, 0x00, 0x59, 0x19, 0x0A, 0x00, 0x55, 0xAA}
	ITEM_EXPIRED     = utils.Packet{0xAA, 0x55, 0x06, 0x00, 0x69, 0x03, 0x55, 0xAA}
	ITEM_ADDED       = utils.Packet{0xAA, 0x55, 0x1E, 0x00, 0x58, 0x01, 0x0A, 0x00, 0x00, 0xA1, 0x00, 0x00, 0x00, 0x00, 0x20, 0x1C, 0x00, 0x00, 0x55, 0xAA}
	ITEM_LOOTED      = utils.Packet{0xAA, 0x55, 0x33, 0x00, 0x59, 0x01, 0x0A, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x11, 0x55, 0xAA}

	PTS_CHANGED = utils.Packet{0xAA, 0x55, 0x06, 0x00, 0xA2, 0x04, 0x55, 0xAA}
	GOLD_LOOTED = utils.Packet{0xAA, 0x55, 0x0D, 0x00, 0x59, 0x01, 0x0A, 0x00, 0x02, 0x55, 0xAA}
	GET_GOLD    = utils.Packet{0xAA, 0x55, 0x12, 0x00, 0x63, 0x01, 0x55, 0xAA}

	MAP_CHANGED = utils.Packet{0xAA, 0x55, 0x02, 0x00, 0x2B, 0x01, 0x55, 0xAA, 0xAA, 0x55, 0x0E, 0x00, 0x73, 0x00, 0x00, 0x00, 0x7A, 0x44, 0x55, 0xAA,
		0xAA, 0x55, 0x07, 0x00, 0x01, 0xB9, 0x0A, 0x00, 0x00, 0x01, 0x00, 0x55, 0xAA, 0xAA, 0x55, 0x09, 0x00, 0x24, 0x55, 0xAA,
		0xAA, 0x55, 0x03, 0x00, 0xA6, 0x00, 0x00, 0x55, 0xAA, 0xAA, 0x55, 0x02, 0x00, 0xAD, 0x01, 0x55, 0xAA}

	ITEM_REMOVED = utils.Packet{0xAA, 0x55, 0x0B, 0x00, 0x59, 0x02, 0x0A, 0x00, 0x01, 0x55, 0xAA}
	SELL_ITEM    = utils.Packet{0xAA, 0x55, 0x16, 0x00, 0x58, 0x02, 0x0A, 0x00, 0x20, 0x1C, 0x00, 0x00, 0x55, 0xAA}

	GET_STATS = utils.Packet{}/* 126 elements not displayed */

	ITEM_REPLACEMENT   = utils.Packet{0xAA, 0x55, 0x0C, 0x00, 0x59, 0x03, 0x0A, 0x00, 0x55, 0xAA}
	ITEM_SWAP          = utils.Packet{0xAA, 0x55, 0x15, 0x00, 0x59, 0x07, 0x0A, 0x00, 0x00, 0x55, 0xAA}
	HT_UPG_FAILED      = utils.Packet{0xAA, 0x55, 0x31, 0x00, 0x54, 0x02, 0xA7, 0x0F, 0x01, 0x00, 0xA3, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xAA}
	UPG_FAILED         = utils.Packet{0xAA, 0x55, 0x09, 0x00, 0x54, 0x02, 0xA2, 0x0F, 0x00, 0x55, 0xAA}
	PRODUCTION_SUCCESS = utils.Packet{0xAA, 0x55, 0x05, 0x00, 0x54, 0x04, 0x08, 0x10, 0x01, 0x55, 0xAA}
	PRODUCTION_FAILED  = utils.Packet{0xAA, 0x55, 0x05, 0x00, 0x54, 0x04, 0x09, 0x10, 0x00, 0x55, 0xAA}
	FUSION_SUCCESS     = utils.Packet{0xAA, 0x55, 0x05, 0x00, 0x54, 0x09, 0x08, 0x10, 0x01, 0x55, 0xAA}
	FUSION_FAILED      = utils.Packet{0xAA, 0x55, 0x05, 0x00, 0x54, 0x09, 0x09, 0x10, 0x00, 0x55, 0xAA}
	DISMANTLE_SUCCESS  = utils.Packet{0xAA, 0x55, 0x00, 0x00, 0x54, 0x05, 0x68, 0x10, 0x01, 0x00, 0x55, 0xAA}
	EXTRACTION_SUCCESS = utils.Packet{0xAA, 0x55, 0xB7, 0x00, 0x54, 0x06, 0xCC, 0x10, 0x01, 0x00, 0xA2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xAA}
	HOLYWATER_FAILED   = utils.Packet{0xAA, 0x55, 0x05, 0x00, 0x54, 0x10, 0x32, 0x11, 0x00, 0x55, 0xAA}
	HOLYWATER_SUCCESS  = utils.Packet{0xAA, 0x55, 0x05, 0x00, 0x54, 0x10, 0x31, 0x11, 0x01, 0x55, 0xAA}
	ITEM_REGISTERED    = utils.Packet{0xAA, 0x55, 0x43, 0x00, 0x3D, 0x01, 0x0A, 0x00, 0x00, 0x80, 0x1A, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0x00,
		0x00, 0x00, 0x63, 0x99, 0xEA, 0x00, 0x00, 0xA1, 0x00, 0x00, 0x00, 0x00, 0x55, 0xAA}
	CLAIM_MENU              = utils.Packet{0xAA, 0x55, 0x00, 0x00, 0x3D, 0x03, 0x0A, 0x00, 0x55, 0xAA}
	CONSIGMENT_ITEM_BOUGHT  = utils.Packet{0xAA, 0x55, 0x08, 0x00, 0x3D, 0x02, 0x0A, 0x00, 0x55, 0xAA}
	CONSIGMENT_ITEM_SOLD    = utils.Packet{0xAA, 0x55, 0x02, 0x00, 0x3F, 0x00, 0x55, 0xAA}
	CONSIGMENT_ITEM_CLAIMED = utils.Packet{0xAA, 0x55, 0x0A, 0x00, 0x3D, 0x04, 0x0A, 0x00, 0x01, 0x00, 0x55, 0xAA}
	SKILL_UPGRADED          = utils.Packet{0xAA, 0x55, 0x0B, 0x00, 0x81, 0x02, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x55, 0xAA}
	SKILL_DOWNGRADED        = utils.Packet{0xAA, 0x55, 0x0E, 0x00, 0x81, 0x03, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x55, 0xAA}
	SKILL_REMOVED           = utils.Packet{0xAA, 0x55, 0x09, 0x00, 0x81, 0x06, 0x0A, 0x00, 0x00, 0x55, 0xAA}
	PASSIVE_SKILL_UGRADED   = utils.Packet{0xAA, 0x55, 0x06, 0x00, 0x82, 0x02, 0x0A, 0x00, 0x00, 0x00, 0x55, 0xAA}
	PASSIVE_SKILL_REMOVED   = utils.Packet{0xAA, 0x55, 0x09, 0x00, 0x82, 0x04, 0x0A, 0x00, 0x00, 0x55, 0xAA}
	SKILL_CASTED            = utils.Packet{0xAA, 0x55, 0x1D, 0x00, 0x42, 0x0A, 0x00, 0x00, 0x00, 0x01, 0x01, 0x55, 0xAA}
	TRADE_CANCELLED         = utils.Packet{0xAA, 0x55, 0x06, 0x00, 0x53, 0x03, 0xD5, 0x07, 0x7E, 0x02, 0x55, 0xAA}
	SKILL_BOOK_EXISTS       = utils.Packet{0xAA, 0x55, 0x04, 0x00, 0x59, 0x04, 0xFA, 0x03, 0x55, 0xAA}
	INVALID_CHARACTER_TYPE  = utils.Packet{0xAA, 0x55, 0x04, 0x00, 0x59, 0x04, 0xF2, 0x03, 0x55, 0xAA}
	NO_SLOTS_FOR_SKILL_BOOK = utils.Packet{0xAA, 0x55, 0x04, 0x00, 0x59, 0x04, 0xF3, 0x03, 0x55, 0xAA}
	OPEN_SALE               = utils.Packet{0xAA, 0x55, 0x04, 0x00, 0x55, 0x01, 0x0A, 0x00, 0x55, 0xAA}
	GET_SALE_ITEMS          = utils.Packet{0xAA, 0x55, 0x00, 0x00, 0x55, 0x03, 0x0A, 0x00, 0x00, 0x55, 0xAA}
	CLOSE_SALE              = utils.Packet{0xAA, 0x55, 0x04, 0x00, 0x55, 0x02, 0x0A, 0x00, 0x55, 0xAA}
	BOUGHT_SALE_ITEM        = utils.Packet{0xAA, 0x55, 0x39, 0x00, 0x53, 0x10, 0x0A, 0x00, 0x01, 0x00, 0xA2, 0x00, 0x00, 0x00, 0x00, 0x55, 0xAA}
	SOLD_SALE_ITEM          = utils.Packet{0xAA, 0x55, 0x10, 0x00, 0x55, 0x07, 0x0A, 0x00, 0x55, 0xAA}
	BUFF_INFECTION          = utils.Packet{0xAA, 0x55, 0x0C, 0x00, 0x4D, 0x02, 0x0A, 0x01, 0x55, 0xAA}
	BUFF_EXPIRED            = utils.Packet{0xAA, 0x55, 0x06, 0x00, 0x4D, 0x03, 0x55, 0xAA}

	SPLIT_ITEM = utils.Packet{0xAA, 0x55, 0x5C, 0x00, 0x59, 0x09, 0x0A, 0x00, 0x00, 0xA1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA1, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xAA}

	RELIC_DROP       = utils.Packet{0xAA, 0x55, 0x00, 0x00, 0x71, 0x10, 0x00, 0x55, 0xAA}
	PVP_FINISHED     = utils.Packet{0xAA, 0x55, 0x02, 0x00, 0x2A, 0x05, 0x55, 0xAA}
	FORM_ACTIVATED   = utils.Packet{0xAA, 0x55, 0x05, 0x00, 0x37, 0x55, 0xAA}
	FORM_DEACTIVATED = utils.Packet{0xAA, 0x55, 0x01, 0x00, 0x38, 0x55, 0xAA}
)
View Source
var (
	Guilds = make(map[int]*Guild)

	GUILD_INFO = utils.Packet{0xAA, 0x55, 0x00, 0x00, 0x83, 0x09, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xAA}

	GUILD_DATA = utils.Packet{0xAA, 0x55, 0x00, 0x00, 0x83, 0x0A, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xAA}

	GUILD_MEMBER_INFO = utils.Packet{0xAA, 0x55, 0x00, 0x00, 0x83, 0x08, 0x00, 0x00, 0x10, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x49,
		0x2A, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x32, 0x30, 0x31, 0x38, 0x2D,
		0x30, 0x38, 0x2D, 0x32, 0x36, 0x00, 0x55, 0xAA}
)
View Source
var (
	DROP_LIFETIME = time.Duration(30) * time.Second
	DROP_RATE     = utils.ParseFloat(os.Getenv("DROP_RATE"))
	EXP_RATE      = utils.ParseFloat(os.Getenv("EXP_RATE"))
)
View Source
var (
	Init                    = make(chan bool, 1)
	GetFromRegister         func(int, int16, uint16) interface{}
	RemoveFromRegister      func(*Character)
	RemovePetFromRegister   func(c *Character)
	FindCharacterByPseudoID func(server int, ID uint16) *Character

	AccUpgrades    []byte
	ArmorUpgrades  []byte
	WeaponUpgrades []byte
)
View Source
var (
	DropRegister = make([]map[int16]map[uint16]*Drop, SERVER_COUNT+1)

	ITEM_SLOT = utils.Packet{0xAA, 0x55, 0x2E, 0x00, 0x57, 0x0A, 0x00, 0xA1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xAA}
	ITEM_UPGRADED   = utils.Packet{0xAA, 0x55, 0x31, 0x00, 0x54, 0x02, 0xA1, 0x0F, 0x01, 0x00, 0xA2, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xAA}
	SOCKET_OPENED   = utils.Packet{0xAA, 0x55, 0x30, 0x00, 0x54, 0x16, 0x0A, 0x00, 0x00, 0xA2, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xAA}
	SOCKET_UPGRADED = utils.Packet{0xAA, 0x55, 0x30, 0x00, 0x54, 0x16, 0x0A, 0x00, 0x00, 0xA2, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xAA}
	PET_STATS       = utils.Packet{0xAA, 0x55, 0x12, 0x00, 0x51, 0x08, 0x0A, 0x00, 0x55, 0xAA}
	SHOW_PET_BUTTON = utils.Packet{0xAA, 0x55, 0x04, 0x00, 0x57, 0x05, 0x0A, 0x00, 0x55, 0xAA}
	DISMISS_PET     = utils.Packet{0xAA, 0x55, 0x04, 0x00, 0x51, 0x02, 0x0A, 0x00, 0x55, 0xAA}
)
View Source
var (
	Items    = make(map[int64]*Item)
	STRRates = []int{400, 350, 300, 250, 200, 175, 150, 125, 100, 75, 50, 40, 30, 20, 15}
)
View Source
var (
	DKMaps = map[int16][]int16{
		18: {18, 193, 200}, 19: {19, 194, 201}, 25: {25, 195, 202}, 26: {26, 196, 203}, 27: {27, 197, 204}, 29: {29, 198, 205}, 30: {30, 199, 206},
		193: {18, 193, 200}, 194: {19, 194, 201}, 195: {25, 195, 202}, 196: {26, 196, 203}, 197: {27, 197, 204}, 198: {29, 198, 205}, 199: {30, 199, 206},
		200: {18, 193, 200}, 201: {19, 194, 201}, 202: {25, 195, 202}, 203: {26, 196, 203}, 204: {27, 197, 204}, 205: {29, 198, 205}, 206: {30, 199, 206},
	}

	PvPZones = []int16{12, 17, 28, 108, 109, 110, 111, 112}
)
View Source
var (
	PARTY_DATA      = utils.Packet{0xAA, 0x55, 0x00, 0x00, 0x52, 0x04, 0x0A, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x04, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0x55, 0xAA}
	PARTY_STATUS    = utils.Packet{0xAA, 0x55, 0x2A, 0x00, 0x52, 0x07, 0x01, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x55, 0xAA}
	LEFT_PARTY      = utils.Packet{0xAA, 0x55, 0x09, 0x00, 0x52, 0x03, 0x0A, 0x00, 0x00, 0x55, 0xAA}
	PARTY_DISBANDED = utils.Packet{0xAA, 0x55, 0x02, 0x00, 0x52, 0x05, 0x55, 0xAA}
)
View Source
var (
	SkillInfos       = make(map[int]*SkillInfo)
	SkillInfosByBook = make(map[int64][]*SkillInfo)
	SkillPoints      = make([]uint64, 12000)
)
View Source
var (
	SkillPTS = map[string]map[int]int{
		"fjp": map[int]int{0: 1, 1: 1, 2: 1, 3: 2, 4: 3, 5: 4, 6: 6, 7: 9, 8: 14, 9: 21, 10: 31, 11: 47},
		"wd":  map[int]int{0: 3, 1: 2, 2: 3, 3: 4, 4: 6, 5: 9, 6: 14, 7: 21, 8: 31, 9: 47, 10: 70, 11: 105},
		"sjp": map[int]int{
			0: 1, 1: 2, 2: 3, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 10,
			10: 12, 11: 14, 12: 17, 13: 21, 14: 25, 15: 30, 16: 36, 17: 43, 18: 52, 19: 62,
			20: 62, 21: 62, 22: 62, 23: 62, 24: 62, 25: 62, 26: 62, 27: 62, 28: 62, 29: 62,
			30: 94, 31: 94, 32: 94, 33: 94, 34: 94, 35: 94, 36: 94, 37: 94, 38: 94, 39: 94,
			40: 116, 41: 116, 42: 116, 43: 116, 44: 116, 45: 116, 46: 116, 47: 116, 48: 116, 49: 116,
		},
	}

	COMBAT_SKILL_BOOK  = utils.Packet{0xAA, 0x55, 0x00, 0x00, 0x81, 0x01, 0x00, 0x00, 0x00, 0x00, 0x55, 0xAA}
	PASSIVE_SKILL_BOOK = utils.Packet{0xAA, 0x55, 0x07, 0x00, 0x82, 0x01, 0x00, 0x55, 0xAA}
)
View Source
var (
	Handler func(*Socket, []byte, uint16) ([]byte, error)
	Sockets = make(map[string]*Socket)
)
View Source
var (
	BuffIcons = make(map[int]*BuffIcon)
)
View Source
var (
	BuffInfections = make(map[int]*BuffInfection)
)
View Source
var (
	CLOCK = utils.Packet{0xAA, 0x55, 0x1E, 0x00, 0x72, 0x01, 0x00, 0x00, 0x03, 0x08, 0x00, 0x16, 0x00, 0x24, 0x00, 0x00, 0x00, 0x55, 0xAA}
)
View Source
var (
	Drops = make(map[int]*DropInfo)
)
View Source
var (
	EXPs = make(map[int16]*ExpInfo)
)
View Source
var (
	Fusions = make(map[int64]*Fusion)
)
View Source
var (
	GamblingItems = make(map[int]*Gambling)
)
View Source
var (
	Gates = make(map[int]*Gate)
)
View Source
var (
	HTItems = make(map[int]*HtItem)
)
View Source
var (
	HaxCodes = make(map[int]*HaxCode)
)
View Source
var (
	InventoryItems utils.SMap
)
View Source
var (
	JobPassives = make(map[int8]*JobPassive)
)
View Source
var (
	Meltings = make(map[int]*ItemMelting)
)
View Source
var (
	NPCPos []*NpcPosition
)
View Source
var (
	NPCScripts = make(map[int]*NPCScript)
)
View Source
var (
	NPCs map[int]*NPC
)
View Source
var (
	Parties = make(map[string]*Party)
)
View Source
var (
	PetExps = make(map[int16]*PetExpInfo)
)
View Source
var (
	Pets = make(map[int64]*Pet)
)
View Source
var (
	Productions = make(map[int]*Production)
)
View Source
var (
	Relics = make(map[int]*Relic)
)
View Source
var (
	Sales = make(map[uint16]*Sale)
)
View Source
var (
	SavePoints = make(map[uint8]*SavePoint)
)
View Source
var (
	ShopItems = make(map[int]*ShopItem)
)
View Source
var (
	Shops = make(map[int]*Shop)
)
View Source
var (
	Stackables = make(map[int]*Stackable)
)
View Source
var (
	Trades = make(map[string]*Trade)
)

Functions

func ConvertPointToLocation

func ConvertPointToLocation(point string) *utils.Location

func CountConsignmentItems

func CountConsignmentItems(category, minUpgLevel, maxUpgLevel int, minPrice, maxPrice uint64, itemName string) (int64, error)

func DeleteCharacterFromCache

func DeleteCharacterFromCache(id int)

func DeleteStatFromCache

func DeleteStatFromCache(id int)

func DeleteUserFromCache

func DeleteUserFromCache(id string)

func DoesSlotAffectStats

func DoesSlotAffectStats(slotNo int16) bool

func FindCharactersInServer

func FindCharactersInServer(server int) (map[int]*Character, error)

func FindOnlineCharacters

func FindOnlineCharacters() (map[int]*Character, error)

func GeneratePoint

func GeneratePoint(location *utils.Location) utils.Location

func GetAllAI

func GetAllAI() error

func GetAllNPCs

func GetAllNPCs() (map[int]*NPC, error)

func GetAllPetExps

func GetAllPetExps() error

func GetAllPets

func GetAllPets() error

func GetPartyMemberData

func GetPartyMemberData(c *Character) []byte

func InitDB

func InitDB() error

func IsValidUsername

func IsValidUsername(name string) (bool, error)

func RefreshAIDs

func RefreshAIDs() error

func RemoveFromDropRegister

func RemoveFromDropRegister(server int, mapID int16, dropID uint16)

func UnbanUsers

func UnbanUsers()

Types

type AI

type AI struct {
	ID           int     `db:"id" json:"id"`
	PosID        int     `db:"pos_id" json:"pos_id"`
	Server       int     `db:"server" json:"server"`
	Faction      int     `db:"faction" json:"faction"`
	Map          int16   `db:"map" json:"map"`
	Coordinate   string  `db:"coordinate" json:"coordinate"`
	WalkingSpeed float64 `db:"walking_speed" json:"walking_speed"`
	RunningSpeed float64 `db:"running_speed" json:"running_speed"`

	DamageDealers  utils.SMap          `db:"-"`
	TargetLocation utils.Location      `db:"-"`
	PseudoID       uint16              `db:"-"`
	CHI            int                 `db:"-" json:"chi"`
	HP             int                 `db:"-" json:"hp"`
	IsDead         bool                `db:"-" json:"is_dead"`
	IsMoving       bool                `db:"-" json:"is_moving"`
	MovementToken  int64               `db:"-" json:"-"`
	OnSightPlayers map[int]interface{} `db:"-" json:"players"`
	PlayersMutex   sync.RWMutex        `db:"-"`
	TargetPlayerID int                 `db:"-" json:"target_player"`
	TargetPetID    int                 `db:"-" json:"target_pet"`
	Handler        func()              `db:"-" json:"-"`
	Once           bool                `db:"-"`
}

func FindAIByID

func FindAIByID(ID int) *AI

func (*AI) AIHandler

func (ai *AI) AIHandler()

func (*AI) Attack

func (ai *AI) Attack() []byte

func (*AI) AttackPet

func (ai *AI) AttackPet() []byte

func (*AI) CastSkill

func (ai *AI) CastSkill() []byte

func (*AI) CastSkillToPet

func (ai *AI) CastSkillToPet() []byte

func (*AI) Create

func (ai *AI) Create() error

func (*AI) DealDamage

func (ai *AI) DealDamage(damage int) []byte

func (*AI) DealDamageToPet

func (ai *AI) DealDamageToPet(damage int) []byte

func (*AI) DropHandler

func (ai *AI) DropHandler(claimer *Character)

func (*AI) FindClaimer

func (ai *AI) FindClaimer() (*Character, error)

func (*AI) FindTargetCharacterID

func (ai *AI) FindTargetCharacterID() (int, error)

func (*AI) FindTargetPetID

func (ai *AI) FindTargetPetID(characterID int) (*InventorySlot, error)

func (*AI) Move

func (ai *AI) Move(targetLocation utils.Location, runningMode byte) []byte

func (*AI) MovementHandler

func (ai *AI) MovementHandler(token int64, start, end *utils.Location, speed float64)

func (*AI) RemoveDrop

func (ai *AI) RemoveDrop(server int, mapID int16, dropID uint16)

func (*AI) SetCoordinate

func (ai *AI) SetCoordinate(coordinate *utils.Location)

func (*AI) ShouldGoBack

func (ai *AI) ShouldGoBack() bool

type Buff

type Buff struct {
	ID              int     `db:"id" json:"id"`
	CharacterID     int     `db:"character_id" json:"character_id"`
	Name            string  `db:"name" json:"name"`
	ATK             int     `db:"atk" json:"atk"`
	ATKRate         int     `db:"atk_rate" json:"atk_rate"`
	ArtsATK         int     `db:"arts_atk" json:"arts_atk"`
	ArtsATKRate     int     `db:"arts_atk_rate" json:"arts_atk_rate"`
	PoisonDEF       int     `db:"poison_def" json:"poison_def"`
	ParalysisDEF    int     `db:"paralysis_def" json:"paralysis_def"`
	ConfusionDEF    int     `db:"confusion_def" json:"confusion_def"`
	DEF             int     `db:"def" json:"def"`
	DEFRate         int     `db:"def_rate" json:"def_rate"`
	ArtsDEF         int     `db:"arts_def" json:"arts_def"`
	ArtsDEFRate     int     `db:"arts_def_rate" json:"arts_def_rate"`
	Accuracy        int     `db:"accuracy" json:"accuracy"`
	Dodge           int     `db:"dodge" json:"dodge"`
	MaxHP           int     `db:"max_hp" json:"max_hp"`
	HPRecoveryRate  int     `db:"hp_recovery_rate" json:"hp_recovery_rate"`
	MaxCHI          int     `db:"max_chi" json:"max_chi"`
	CHIRecoveryRate int     `db:"chi_recovery_rate" json:"chi_recovery_rate"`
	STR             int     `db:"str" json:"str"`
	DEX             int     `db:"dex" json:"dex"`
	INT             int     `db:"int" json:"int"`
	EXPMultiplier   int     `db:"exp_multiplier" json:"exp_multiplier"`
	DropMultiplier  int     `db:"drop_multiplier" json:"drop_multiplier"`
	RunningSpeed    float64 `db:"running_speed" json:"running_speed"`
	StartedAt       int64   `db:"started_at" json:"started_at"`
	Duration        int64   `db:"duration" json:"duration"`
	BagExpansion    bool    `db:"bag_expansion" json:"bag_expansion"`
}

func FindBuffByID

func FindBuffByID(buffID, characterID int) (*Buff, error)

func FindBuffsByCharacterID

func FindBuffsByCharacterID(characterID int) ([]*Buff, error)

func (*Buff) Create

func (b *Buff) Create() error

func (*Buff) CreateWithTransaction

func (b *Buff) CreateWithTransaction(tr *gorp.Transaction) error

func (*Buff) Delete

func (b *Buff) Delete() error

func (*Buff) Update

func (b *Buff) Update() error

type BuffIcon

type BuffIcon struct {
	SkillID int `db:"skill_id"`
	IconID  int `db:"icon_id"`
}

func (*BuffIcon) Create

func (e *BuffIcon) Create() error

func (*BuffIcon) CreateWithTransaction

func (e *BuffIcon) CreateWithTransaction(tr *gorp.Transaction) error

func (*BuffIcon) Delete

func (e *BuffIcon) Delete() error

type BuffInfection

type BuffInfection struct {
	ID                int    `db:"id"`
	Name              string `db:"name"`
	PoisonDef         int    `db:"poison_def"`
	ParalysisDef      int    `db:"paralysis_def"`
	ConfusionDef      int    `db:"confusion_def"`
	BaseDef           int    `db:"base_def"`
	AdditionalDEF     int    `db:"additional_def"`
	ArtsDEF           int    `db:"arts_def"`
	AdditionalArtsDEF int    `db:"additional_arts_def"`
	MaxHP             int    `db:"max_hp"`
	HPRecoveryRate    int    `db:"hp_recovery_rate"`
	STR               int    `db:"str"`
	DEX               int    `db:"dex"`
	INT               int    `db:"int"`
	BaseHP            int    `db:"base_hp"`
	AdditionalHP      int    `db:"additional_hp"`
	BaseATK           int    `db:"base_atk"`
	AdditionalATK     int    `db:"additional_atk"`
	BaseArtsATK       int    `db:"base_arts_atk"`
	AdditionalArtsATK int    `db:"additional_arts_atk"`
}

func (*BuffInfection) Create

func (e *BuffInfection) Create() error

func (*BuffInfection) CreateWithTransaction

func (e *BuffInfection) CreateWithTransaction(tr *gorp.Transaction) error

func (*BuffInfection) Delete

func (e *BuffInfection) Delete() error

func (*BuffInfection) Update

func (e *BuffInfection) Update() error

type Character

type Character struct {
	ID                       int       `db:"id" json:"id"`
	UserID                   string    `db:"user_id" json:"user_id"`
	Name                     string    `db:"name" json:"name"`
	Epoch                    int64     `db:"epoch" json:"epoch"`
	Type                     int       `db:"type" json:"type"`
	Faction                  int       `db:"faction" json:"faction"`
	Height                   int       `db:"height" json:"height"`
	Level                    int       `db:"level" json:"level"`
	Class                    int       `db:"class" json:"class"`
	IsOnline                 bool      `db:"is_online" json:"is_online"`
	IsActive                 bool      `db:"is_active" json:"is_active"`
	Gold                     uint64    `db:"gold" json:"gold"`
	Coordinate               string    `db:"coordinate" json:"coordinate"`
	Map                      int16     `db:"map" json:"map"`
	Exp                      int64     `db:"exp" json:"exp"`
	HTVisibility             int       `db:"ht_visibility" json:"ht_visibility"`
	WeaponSlot               int       `db:"weapon_slot" json:"weapon_slot"`
	RunningSpeed             float64   `db:"running_speed" json:"running_speed"`
	GuildID                  int       `db:"guild_id" json:"guild_id"`
	ExpMultiplier            float64   `db:"exp_multiplier" json:"exp_multiplier"`
	DropMultiplier           float64   `db:"drop_multiplier" json:"drop_multiplier"`
	Slotbar                  []byte    `db:"slotbar" json:"slotbar"`
	CreatedAt                null.Time `db:"created_at" json:"created_at"`
	AdditionalExpMultiplier  float64   `db:"additional_exp_multiplier" json:"additional_exp_multiplier"`
	AdditionalDropMultiplier float64   `db:"additional_drop_multiplier" json:"additional_drop_multiplier"`
	AidMode                  bool      `db:"aid_mode" json:"aid_mode"`
	AidTime                  uint32    `db:"aid_time" json:"aid_time"`

	AddingExp              sync.Mutex `db:"-" json:"-"`
	AddingGold             sync.Mutex `db:"-" json:"-"`
	Looting                sync.Mutex `db:"-" json:"-"`
	AdditionalRunningSpeed float64    `db:"-" json:"-"`
	InvMutex               sync.Mutex `db:"-"`
	Socket                 *Socket    `db:"-" json:"-"`
	ExploreWorld           func()     `db:"-" json:"-"`
	HasLot                 bool       `db:"-" json:"-"`
	LastRoar               time.Time  `db:"-" json:"-"`
	Meditating             bool       `db:"-"`
	MovementToken          int64      `db:"-" json:"-"`
	PseudoID               uint16     `db:"-" json:"pseudo_id"`
	PTS                    int        `db:"-" json:"pts"`
	OnSight                struct {
		Drops       map[int]interface{} `db:"-" json:"drops"`
		DropsMutex  sync.RWMutex
		Mobs        map[int]interface{} `db:"-" json:"mobs"`
		MobMutex    sync.RWMutex        `db:"-"`
		NPCs        map[int]interface{} `db:"-" json:"npcs"`
		NpcMutex    sync.RWMutex        `db:"-"`
		Pets        map[int]interface{} `db:"-" json:"pets"`
		PetsMutex   sync.RWMutex        `db:"-"`
		Players     map[int]interface{} `db:"-" json:"players"`
		PlayerMutex sync.RWMutex        `db:"-"`
	} `db:"-" json:"on_sight"`
	PartyID       string          `db:"-"`
	Selection     int             `db:"-" json:"selection"`
	Targets       []*Target       `db:"-" json:"target"`
	TamingAI      *AI             `db:"-" json:"-"`
	PlayerTargets []*PlayerTarget `db:"-" json:"player_targets"`
	TradeID       string          `db:"-" json:"trade_id"`
	Invisible     bool            `db:"-" json:"-"`
	DetectionMode bool            `db:"-" json:"-"`
	VisitedSaleID uint16          `db:"-" json:"-"`
	DuelID        int             `db:"-" json:"-"`
	DuelStarted   bool            `db:"-" json:"-"`
	Respawning    bool            `db:"-" json:"-"`
	SkillHistory  utils.SMap      `db:"-" json:"-"`
	Morphed       bool            `db:"-" json:"-"`

	HandlerCB    func() `db:"-"`
	PetHandlerCB func() `db:"-"`
	// contains filtered or unexported fields
}

func FindCharacterByID

func FindCharacterByID(id int) (*Character, error)

func FindCharacterByName

func FindCharacterByName(name string) (*Character, error)

func FindCharactersByUserID

func FindCharactersByUserID(userID string) ([]*Character, error)

func FindOnlineCharacterByUserID

func FindOnlineCharacterByUserID(userID string) (*Character, error)

func FindSaleVisitors

func FindSaleVisitors(saleID uint16) []*Character

func (*Character) ActivityStatus

func (c *Character) ActivityStatus(remainingTime int)

func (*Character) AddExp

func (c *Character) AddExp(amount int64) ([]byte, bool)

func (*Character) AddItem

func (c *Character) AddItem(itemToAdd *InventorySlot, slotID int16, lootingDrop bool) (*utils.Packet, int16, error)

func (*Character) AdvancedFusion

func (c *Character) AdvancedFusion(items []*InventorySlot, special *InventorySlot, prodSlot int16) ([]byte, bool, error)

func (*Character) AidStatus

func (c *Character) AidStatus() []byte

func (*Character) BSProduction

func (c *Character) BSProduction(book *InventorySlot, materials []*InventorySlot, special *InventorySlot, prodSlot int16, bookSlot, specialSlot int16, materialSlots []int16, materialCounts []uint) ([]byte, error)

func (*Character) BSUpgrade

func (c *Character) BSUpgrade(slotID int64, stones []*InventorySlot, luck, protection *InventorySlot, stoneSlots []int64, luckSlot, protectionSlot int64) ([]byte, error)

func (*Character) BankItems

func (c *Character) BankItems() []byte

func (*Character) BuffEffects

func (c *Character) BuffEffects(stat *Stat) error

func (*Character) BuyConsignmentItem

func (c *Character) BuyConsignmentItem(consignmentID int) ([]byte, error)

func (*Character) BuySaleItem

func (c *Character) BuySaleItem(saleID uint16, saleSlotID, inventorySlotID int16) ([]byte, error)

func (*Character) CalculateDamage

func (c *Character) CalculateDamage(ai *AI, isSkill bool) (int, error)

func (*Character) CalculateDamageToPlayer

func (c *Character) CalculateDamageToPlayer(enemy *Character, isSkill bool) (int, error)

func (*Character) CanAttack

func (c *Character) CanAttack(enemy *Character) bool

func (*Character) CanUse

func (c *Character) CanUse(t int) bool

func (*Character) CancelTrade

func (c *Character) CancelTrade()

func (*Character) CastSkill

func (c *Character) CastSkill(attackCounter, skillID, targetID int, cX, cY, cZ float64) ([]byte, error)

func (*Character) ChangeMap

func (c *Character) ChangeMap(mapID int16, coordinate *utils.Location, args ...interface{}) ([]byte, error)

func (*Character) ClaimConsignmentItem

func (c *Character) ClaimConsignmentItem(consignmentID int, isCancel bool) ([]byte, error)

func (*Character) ClaimMenu

func (c *Character) ClaimMenu() ([]byte, error)

func (*Character) CloseSale

func (c *Character) CloseSale() ([]byte, error)

func (*Character) CombineItems

func (c *Character) CombineItems(where, to int16) (int64, int16, error)

func (*Character) CopyInventorySlots

func (t *Character) CopyInventorySlots() []*InventorySlot

func (*Character) Create

func (t *Character) Create() error

func (*Character) CreateSocket

func (c *Character) CreateSocket(item, special *InventorySlot, itemSlot, specialSlot int16) ([]byte, error)

func (*Character) CreateWithTransaction

func (t *Character) CreateWithTransaction(tr *gorp.Transaction) error

func (*Character) DealDamage

func (c *Character) DealDamage(ai *AI, dmg int)

func (*Character) DecrementItem

func (c *Character) DecrementItem(slotID int16, amount uint) *utils.Packet

func (*Character) Delete

func (t *Character) Delete() error

func (*Character) Dismantle

func (c *Character) Dismantle(item, special *InventorySlot) ([]byte, bool, error)

func (*Character) DoesInventoryExpanded

func (c *Character) DoesInventoryExpanded() bool

func (*Character) DowngradePassiveSkill

func (c *Character) DowngradePassiveSkill(slotIndex, skillIndex byte) ([]byte, error)

func (*Character) DowngradeSkill

func (c *Character) DowngradeSkill(slotIndex, skillIndex byte) ([]byte, error)

func (*Character) EndPvP

func (c *Character) EndPvP()

func (*Character) Extraction

func (c *Character) Extraction(item, special *InventorySlot, itemSlot int16) ([]byte, bool, error)

func (*Character) FindFreeSlot

func (c *Character) FindFreeSlot() (int16, error)

func (*Character) FindFreeSlots

func (c *Character) FindFreeSlots(count int) ([]int16, error)

func (*Character) FindItemInInventory

func (c *Character) FindItemInInventory(callback func(*InventorySlot) bool, itemIDs ...int64) (int16, *InventorySlot, error)

func (*Character) GetAppearingItemSlots

func (c *Character) GetAppearingItemSlots() []int

func (*Character) GetExpAndSkillPts

func (c *Character) GetExpAndSkillPts() []byte

func (*Character) GetGold

func (c *Character) GetGold() []byte

func (*Character) GetGuildData

func (c *Character) GetGuildData() ([]byte, error)

func (*Character) GetHPandChi

func (c *Character) GetHPandChi() []byte

func (*Character) GetLevelText

func (c *Character) GetLevelText() string

func (*Character) GetNearbyAIIDs

func (c *Character) GetNearbyAIIDs() ([]int, error)

func (*Character) GetNearbyCharacters

func (c *Character) GetNearbyCharacters() ([]*Character, error)

func (*Character) GetNearbyDrops

func (c *Character) GetNearbyDrops() ([]int, error)

func (*Character) GetNearbyNPCIDs

func (c *Character) GetNearbyNPCIDs() ([]int, error)

func (*Character) GetPTS

func (c *Character) GetPTS() []byte

func (*Character) GetPetStats

func (c *Character) GetPetStats() []byte

func (*Character) GetStats

func (c *Character) GetStats() ([]byte, error)

func (*Character) HandleBuffs

func (c *Character) HandleBuffs()

func (*Character) HandleLimitedItems

func (c *Character) HandleLimitedItems()

func (*Character) Handler

func (c *Character) Handler()

func (*Character) HasAidBuff

func (c *Character) HasAidBuff() bool

func (*Character) HolyWaterUpgrade

func (c *Character) HolyWaterUpgrade(item, holyWater *InventorySlot, itemSlot, holyWaterSlot int16) ([]byte, error)

func (*Character) InventorySlots

func (t *Character) InventorySlots() ([]*InventorySlot, error)

func (*Character) ItemEffects

func (c *Character) ItemEffects(st *Stat, start, end int16) error

func (*Character) JobPassives

func (c *Character) JobPassives(stat *Stat) error

func (*Character) LeaveParty

func (c *Character) LeaveParty()

func (*Character) Logout

func (c *Character) Logout()

func (*Character) LootGold

func (c *Character) LootGold(amount uint64) []byte

func (*Character) OnDuelStarted

func (c *Character) OnDuelStarted() []byte

func (*Character) OpenSale

func (c *Character) OpenSale(name string, slotIDs []int16, prices []uint64) ([]byte, error)

func (*Character) PetHandler

func (c *Character) PetHandler()

func (*Character) PickaxeActivated

func (c *Character) PickaxeActivated() bool

func (*Character) PreInsert

func (t *Character) PreInsert(s gorp.SqlExecutor) error

func (*Character) PreUpdate

func (t *Character) PreUpdate(s gorp.SqlExecutor) error

func (*Character) RegisterItem

func (c *Character) RegisterItem(item *InventorySlot, price uint64, itemSlot int16) ([]byte, error)

func (*Character) RelicDrop

func (c *Character) RelicDrop(itemID int64) []byte

func (*Character) RemoveItem

func (c *Character) RemoveItem(slotID int16) ([]byte, error)

func (*Character) RemovePassiveSkill

func (c *Character) RemovePassiveSkill(slotIndex, skillIndex byte, bookID int64) ([]byte, error)

func (*Character) RemoveSkill

func (c *Character) RemoveSkill(slotIndex byte, bookID int64) ([]byte, error)

func (*Character) ReplaceItem

func (c *Character) ReplaceItem(itemID int, where, to int16) ([]byte, error)

func (*Character) RespawnCounter

func (c *Character) RespawnCounter(seconds byte)

func (*Character) SellItem

func (c *Character) SellItem(itemID, slot, quantity int, unitPrice uint64) ([]byte, error)

func (*Character) SetCoordinate

func (t *Character) SetCoordinate(coordinate *utils.Location)

func (*Character) SetInventorySlots

func (t *Character) SetInventorySlots(slots []*InventorySlot)

func (*Character) ShowItems

func (c *Character) ShowItems() ([]byte, error)

func (*Character) SpawnCharacter

func (c *Character) SpawnCharacter() ([]byte, error)

func (*Character) SplitItem

func (c *Character) SplitItem(where, to, quantity uint16) ([]byte, error)

func (*Character) StartPvP

func (c *Character) StartPvP(timeLeft int)

func (*Character) SwapItems

func (c *Character) SwapItems(where, to int16) ([]byte, error)

func (*Character) Teleport

func (c *Character) Teleport(coordinate *utils.Location) []byte

func (*Character) TogglePet

func (c *Character) TogglePet() []byte

func (*Character) Update

func (t *Character) Update() error

func (*Character) UpdatePartyStatus

func (c *Character) UpdatePartyStatus()

func (*Character) UpgradePassiveSkill

func (c *Character) UpgradePassiveSkill(slotIndex, skillIndex byte) ([]byte, error)

func (*Character) UpgradeSkill

func (c *Character) UpgradeSkill(slotIndex, skillIndex byte) ([]byte, error)

func (*Character) UpgradeSocket

func (c *Character) UpgradeSocket(item, socket, special, edit *InventorySlot, itemSlot, socketSlot, specialSlot, editSlot int16, locks []bool) ([]byte, error)

func (*Character) UseConsumable

func (c *Character) UseConsumable(item *InventorySlot, slotID int16) ([]byte, error)

type ConsignmentItem

type ConsignmentItem struct {
	ID        int       `db:"id" json:"id"`
	SellerID  int       `db:"seller_id" json:"seller_id"`
	ItemName  string    `db:"item_name" json:"item_name"`
	Quantity  int       `db:"quantity" json:"quantity"`
	Price     uint64    `db:"price" json:"price"`
	IsSold    bool      `db:"is_sold" json:"is_sold"`
	ExpiresAt null.Time `db:"expires_at" json:"expires_at"`
}

func FindConsignmentItemByID

func FindConsignmentItemByID(id int) (*ConsignmentItem, error)

func FindConsignmentItemsBySellerID

func FindConsignmentItemsBySellerID(sellerID int) ([]*ConsignmentItem, error)

func GetConsignmentItems

func GetConsignmentItems(page, category, minUpgLevel, maxUpgLevel, orderBy int, minPrice, maxPrice uint64, itemName string) ([]*ConsignmentItem, int64, error)

func (*ConsignmentItem) Create

func (e *ConsignmentItem) Create() error

func (*ConsignmentItem) Delete

func (e *ConsignmentItem) Delete() error

func (*ConsignmentItem) PreInsert

func (e *ConsignmentItem) PreInsert(s gorp.SqlExecutor) error

func (*ConsignmentItem) Update

func (e *ConsignmentItem) Update() error

type Damage

type Damage struct {
	DealerID int
	Damage   int
}

type Drop

type Drop struct {
	ID       int
	Server   int
	Map      int16
	Location utils.Location
	Item     *InventorySlot
	Claimer  *Character
}

func GetDrop

func GetDrop(server int, mapID int16, dropID uint16) *Drop

func GetDropsInMap

func GetDropsInMap(server int, mapID int16) []*Drop

func (*Drop) GenerateIDForDrop

func (drop *Drop) GenerateIDForDrop(server int, mapID int16)

type DropInfo

type DropInfo struct {
	ID            int    `db:"id"`
	Items         string `db:"items"`
	Probabilities string `db:"probabilities"`
}

func (*DropInfo) Create

func (e *DropInfo) Create() error

func (*DropInfo) CreateWithTransaction

func (e *DropInfo) CreateWithTransaction(tr *gorp.Transaction) error

func (*DropInfo) Delete

func (e *DropInfo) Delete() error

func (*DropInfo) GetItems

func (e *DropInfo) GetItems() []int

func (*DropInfo) GetProbabilities

func (e *DropInfo) GetProbabilities() []int

func (*DropInfo) New

func (e *DropInfo) New(id int, items, probabilities []int)

func (*DropInfo) Update

func (e *DropInfo) Update() error

type Duel

type Duel struct {
	EnemyID    int
	Coordinate utils.Location
	Started    bool
}

type ExpInfo

type ExpInfo struct {
	Level       int16 `db:"level"`
	Exp         int64 `db:"exp"`
	SkillPoints int   `db:"skill_points"`
}

func (*ExpInfo) Create

func (e *ExpInfo) Create() error

func (*ExpInfo) CreateWithTransaction

func (e *ExpInfo) CreateWithTransaction(tr *gorp.Transaction) error

func (*ExpInfo) Delete

func (e *ExpInfo) Delete() error

func (*ExpInfo) Update

func (e *ExpInfo) Update() error

type Fusion

type Fusion struct {
	Item1            int64 `db:"item1"`
	Item2            int64 `db:"item2"`
	Count2           int16 `db:"count2"`
	Item3            int64 `db:"item3"`
	Count3           int16 `db:"count3"`
	SpecialItem      int64 `db:"special_item"`
	SpecialItemCount int16 `db:"special_item_count"`
	Probability      int   `db:"probability"`
	Cost             int64 `db:"cost"`
	Production       int64 `db:"production"`
	DestroyOnFail    bool  `db:"destroy_on_fail"`
}

func (*Fusion) Create

func (e *Fusion) Create() error

func (*Fusion) CreateWithTransaction

func (e *Fusion) CreateWithTransaction(tr *gorp.Transaction) error

func (*Fusion) Delete

func (e *Fusion) Delete() error

func (*Fusion) Update

func (e *Fusion) Update() error

type Gambling

type Gambling struct {
	ID     int    `db:"id"`
	Cost   uint64 `db:"cost"`
	DropID int    `db:"drop_id"`
}

func (*Gambling) Create

func (e *Gambling) Create() error

func (*Gambling) CreateWithTransaction

func (e *Gambling) CreateWithTransaction(tr *gorp.Transaction) error

func (*Gambling) Delete

func (e *Gambling) Delete() error

type Gate

type Gate struct {
	ID        int    `db:"id"`
	TargetMap uint8  `db:"target_map"`
	Point     string `db:"point"`
}

func (*Gate) Create

func (e *Gate) Create() error

func (*Gate) CreateWithTransaction

func (e *Gate) CreateWithTransaction(tr *gorp.Transaction) error

func (*Gate) Delete

func (e *Gate) Delete() error

func (*Gate) SetPoint

func (e *Gate) SetPoint(point *utils.Location)

type Guild

type Guild struct {
	ID            int             `db:"id" json:"id"`
	LeaderID      int             `db:"leader_id" json:"leader_id"`
	Name          string          `db:"name" json:"name"`
	MemberCount   int16           `db:"member_count" json:"member_count"`
	Members       json.RawMessage `db:"members" json:"members"`
	Description   string          `db:"description" json:"description"`
	Announcement  string          `db:"announcement" json:"announcement"`
	Faction       int16           `db:"faction" json:"faction"`
	GoldDonation  uint64          `db:"gold_donation" json:"gold_donation"`
	HonorDonation uint64          `db:"honor_donation" json:"honor_donation"`
	Recognition   uint64          `db:"recognition" json:"recognition"`
	// contains filtered or unexported fields
}

func FindGuildByID

func FindGuildByID(id int) (*Guild, error)

func FindGuildByName

func FindGuildByName(name string) (*Guild, error)

func (*Guild) AddMember

func (g *Guild) AddMember(member *GuildMember) error

func (*Guild) Create

func (g *Guild) Create() error

func (*Guild) CreateWithTransaction

func (g *Guild) CreateWithTransaction(tr *gorp.Transaction) error

func (*Guild) Delete

func (g *Guild) Delete() error

func (*Guild) GetData

func (g *Guild) GetData(issuer *Character) ([]byte, error)

func (*Guild) GetInfo

func (g *Guild) GetInfo() []byte

func (*Guild) GetMember

func (g *Guild) GetMember(id int) (*GuildMember, error)

func (*Guild) GetMemberInfo

func (g *Guild) GetMemberInfo(member *Character) []byte

func (*Guild) GetMembers

func (g *Guild) GetMembers() ([]*GuildMember, error)

func (*Guild) InformMembers

func (g *Guild) InformMembers(m *Character)

func (*Guild) RemoveMember

func (g *Guild) RemoveMember(id int) error

func (*Guild) SetMember

func (g *Guild) SetMember(member *GuildMember) error

func (*Guild) SetMembers

func (g *Guild) SetMembers(members []*GuildMember) error

func (*Guild) Update

func (g *Guild) Update() error

type GuildMember

type GuildMember struct {
	ID   int       `json:"id"`
	Role GuildRole `json:"role"`
}

type GuildRole

type GuildRole byte
const (
	GROLE_MEMBER GuildRole = iota + 1
	GROLE_BODYGUARD
	GROLE_SAGE
	GROLE_SOLDIER
	GROLE_LEADER
)

type HaxCode

type HaxCode struct {
	ID                   int    `db:"id"`
	Code                 string `db:"code"`
	SaleMultiplier       int    `db:"sale_multiplier"`
	ExtractionMultiplier int    `db:"extraction_multiplier"`
	ExtractedItem        int    `db:"extracted_item"`
}

func (*HaxCode) Create

func (e *HaxCode) Create() error

func (*HaxCode) CreateWithTransaction

func (e *HaxCode) CreateWithTransaction(tr *gorp.Transaction) error

func (*HaxCode) Delete

func (e *HaxCode) Delete() error

type HtItem

type HtItem struct {
	ID        int  `db:"id"`
	HTID      int  `db:"ht_id"`
	Cash      int  `db:"cash"`
	IsActive  bool `db:"is_active"`
	IsNew     bool `db:"is_new"`
	IsPopular bool `db:"is_popular"`
}

func (*HtItem) Create

func (e *HtItem) Create() error

func (*HtItem) CreateWithTransaction

func (e *HtItem) CreateWithTransaction(tr *gorp.Transaction) error

func (*HtItem) Delete

func (e *HtItem) Delete() error

func (*HtItem) Update

func (e *HtItem) Update() error

type InventorySlot

type InventorySlot struct {
	ID          int             `db:"id"`
	UserID      null.String     `db:"user_id"`
	CharacterID null.Int        `db:"character_id"`
	ItemID      int64           `db:"item_id"`
	SlotID      int16           `db:"slot_id"`
	Quantity    uint            `db:"quantity"`
	Plus        uint8           `db:"plus"`
	UpgradeArr  string          `db:"upgrades"`
	SocketCount int8            `db:"socket_count"`
	SocketArr   string          `db:"sockets"`
	Activated   bool            `db:"activated"`
	InUse       bool            `db:"in_use"`
	PetInfo     json.RawMessage `db:"pet_info"`
	UpdatedAt   null.Time       `db:"updated_at"`
	Consignment bool            `db:"consignment"`

	Pet *PetSlot    `db:"-" json:"-"`
	RFU interface{} `db:"-" json:"-"`
}

func FindBankSlotsByUserID

func FindBankSlotsByUserID(userID string) ([]*InventorySlot, error)

func FindInventorySlotByID

func FindInventorySlotByID(id int) (*InventorySlot, error)

func FindInventorySlotsByCharacterID

func FindInventorySlotsByCharacterID(characterID int) ([]*InventorySlot, error)

func NewSlot

func NewSlot() *InventorySlot

func (*InventorySlot) CreateSocket

func (slot *InventorySlot) CreateSocket(slotID int16, count int8) []byte

func (*InventorySlot) Delete

func (slot *InventorySlot) Delete() error

func (*InventorySlot) GetData

func (slot *InventorySlot) GetData(slotID int16) []byte

func (*InventorySlot) GetPetStats

func (slot *InventorySlot) GetPetStats(c *Character) []byte

func (*InventorySlot) GetSockets

func (slot *InventorySlot) GetSockets() []byte

func (*InventorySlot) GetUpgrades

func (slot *InventorySlot) GetUpgrades() []byte

func (*InventorySlot) Insert

func (slot *InventorySlot) Insert() error

func (*InventorySlot) SetSocket

func (slot *InventorySlot) SetSocket(i int, code byte)

func (*InventorySlot) SetSockets

func (slot *InventorySlot) SetSockets(socks []byte)

func (*InventorySlot) SetUpgrade

func (slot *InventorySlot) SetUpgrade(i int, code byte)

func (*InventorySlot) SetUpgrades

func (slot *InventorySlot) SetUpgrades(upgs []byte)

func (*InventorySlot) Update

func (slot *InventorySlot) Update() error

func (*InventorySlot) Upgrade

func (slot *InventorySlot) Upgrade(slotID int16, codes ...byte) []byte

func (*InventorySlot) UpgradeSocket

func (slot *InventorySlot) UpgradeSocket(slotID int16, codes []byte) []byte

type Item

type Item struct {
	ID              int64   `db:"id"`
	Name            string  `db:"name"`
	UIF             string  `db:"uif"`
	Type            int16   `db:"type"`
	HtType          int16   `db:"ht_type"`
	TimerType       int16   `db:"timer_type"`
	Timer           int     `db:"timer"`
	BuyPrice        int64   `db:"buy_price"`
	SellPrice       int64   `db:"sell_price"`
	Slot            int     `db:"slot"`
	MinLevel        int     `db:"min_level"`
	MaxLevel        int     `db:"max_level"`
	BaseDef1        int     `db:"base_def1"`
	BaseDef2        int     `db:"base_def2"`
	BaseDef3        int     `db:"base_def3"`
	BaseMinAtk      int     `db:"base_min_atk"`
	BaseMaxAtk      int     `db:"base_max_atk"`
	STR             int     `db:"str"`
	DEX             int     `db:"dex"`
	INT             int     `db:"int"`
	Wind            int     `db:"wind"`
	Water           int     `db:"water"`
	Fire            int     `db:"fire"`
	MaxHp           int     `db:"max_hp"`
	MaxChi          int     `db:"max_chi"`
	MinAtk          int     `db:"min_atk"`
	MaxAtk          int     `db:"max_atk"`
	AtkRate         int     `db:"atk_rate"`
	MinArtsAtk      int     `db:"min_arts_atk"`
	MaxArtsAtk      int     `db:"max_arts_atk"`
	ArtsAtkRate     int     `db:"arts_atk_rate"`
	Def             int     `db:"def"`
	DefRate         int     `db:"def_rate"`
	ArtsDef         int     `db:"arts_def"`
	ArtsDefRate     int     `db:"arts_def_rate"`
	Accuracy        int     `db:"accuracy"`
	Dodge           int     `db:"dodge"`
	HpRecovery      int     `db:"hp_recovery"`
	ChiRecovery     int     `db:"chi_recovery"`
	HolyWaterUpg1   int     `db:"holy_water_upg1"`
	HolyWaterUpg2   int     `db:"holy_water_upg2"`
	HolyWaterUpg3   int     `db:"holy_water_upg3"`
	HolyWaterRate1  int     `db:"holy_water_rate1"`
	HolyWaterRate2  int     `db:"holy_water_rate2"`
	HolyWaterRate3  int     `db:"holy_water_rate3"`
	CharacterType   int     `db:"character_type"`
	ExpRate         float64 `db:"exp_rate"`
	DropRate        float64 `db:"drop_rate"`
	Tradable        bool    `db:"tradable"`
	MinUpgradeLevel int16   `db:"min_upgrade_level"`
	NPCID           int     `db:"npc_id"`
	RunningSpeed    float64 `db:"running_speed"`
}

func (*Item) CanUse

func (item *Item) CanUse(t byte) bool

Determines if a weapon item can use an action with specified type

func (*Item) Create

func (item *Item) Create() error

func (*Item) CreateWithTransaction

func (item *Item) CreateWithTransaction(tr *gorp.Transaction) error

func (*Item) Delete

func (item *Item) Delete() error

func (*Item) GetType

func (item *Item) GetType() int

func (*Item) Update

func (item *Item) Update() error

type ItemMelting

type ItemMelting struct {
	ID                 int     `db:"id"`
	MeltedItems        string  `db:"melted_items"`
	ItemCounts         string  `db:"item_counts"`
	ProfitMultiplier   float64 `db:"profit_multiplier"`
	Probability        int     `db:"probability"`
	Cost               int64   `db:"cost"`
	SpecialItem        int     `db:"special_item"`
	SpecialProbability int     `db:"special_probability"`
	// contains filtered or unexported fields
}

func (*ItemMelting) Create

func (e *ItemMelting) Create() error

func (*ItemMelting) CreateWithTransaction

func (e *ItemMelting) CreateWithTransaction(tr *gorp.Transaction) error

func (*ItemMelting) Delete

func (e *ItemMelting) Delete() error

func (*ItemMelting) GetItemCounts

func (e *ItemMelting) GetItemCounts() ([]int, error)

func (*ItemMelting) GetMeltedItems

func (e *ItemMelting) GetMeltedItems() ([]int, error)

type JobPassive

type JobPassive struct {
	ID       int8 `db:"id"`
	MaxHp    int  `db:"max_hp"`
	MaxChi   int  `db:"max_chi"`
	ATK      int  `db:"atk"`
	ArtsATK  int  `db:"arts_atk"`
	DEF      int  `db:"def"`
	ArtsDef  int  `db:"arts_def"`
	Accuracy int  `db:"accuracy"`
	Dodge    int  `db:"dodge"`
}

func (*JobPassive) Create

func (p *JobPassive) Create() error

func (*JobPassive) CreateWithTransaction

func (p *JobPassive) CreateWithTransaction(tr *gorp.Transaction) error

func (*JobPassive) Delete

func (p *JobPassive) Delete() error

func (*JobPassive) Update

func (p *JobPassive) Update() error

type NPC

type NPC struct {
	ID          int    `db:"id"`
	Name        string `db:"name"`
	Level       int16  `db:"level"`
	Exp         int64  `db:"exp"`
	DivineExp   int64  `db:"divine_exp"`
	DarknessExp int64  `db:"darkness_exp"`
	GoldDrop    int    `db:"gold_drop"`
	DEF         int    `db:"def"`
	MaxHp       int    `db:"max_hp"`
	MinATK      int    `db:"min_atk"`
	MaxATK      int    `db:"max_atk"`
	MinArtsATK  int    `db:"min_arts_atk"`
	MaxArtsATK  int    `db:"max_arts_atk"`
	ArtsDEF     int    `db:"arts_def"`
	DropID      int    `db:"drop_id"`
	SkillID     int    `db:"skill_id"`
}

func FindNPCByID

func FindNPCByID(id int) (*NPC, error)

func (*NPC) Create

func (e *NPC) Create() error

func (*NPC) CreateWithTransaction

func (e *NPC) CreateWithTransaction(tr *gorp.Transaction) error

func (*NPC) Delete

func (e *NPC) Delete() error

func (*NPC) Update

func (e *NPC) Update() error

type NPCScript

type NPCScript struct {
	ID     int    `db:"id"`
	Script []byte `db:"script"`
}

func (*NPCScript) Create

func (e *NPCScript) Create() error

func (*NPCScript) CreateWithTransaction

func (e *NPCScript) CreateWithTransaction(tr *gorp.Transaction) error

func (*NPCScript) Delete

func (e *NPCScript) Delete() error

func (*NPCScript) Update

func (e *NPCScript) Update() error

type NpcPosition

type NpcPosition struct {
	ID          int     `db:"id"`
	NPCID       int     `db:"npc_id"`
	MapID       int16   `db:"map"`
	Rotation    float64 `db:"rotation"`
	MinLocation string  `db:"min_location"`
	MaxLocation string  `db:"max_location"`
	Count       int16   `db:"count"`
	RespawnTime int     `db:"respawn_time"`
	IsNPC       bool    `db:"is_npc"`
	Attackable  bool    `db:"attackable"`

	PseudoID uint16 `db:"-"`
}

func FindNPCPosByID

func FindNPCPosByID(id int) (*NpcPosition, error)

func FindNPCPosInMap

func FindNPCPosInMap(mapID int16) ([]*NpcPosition, error)

func GetAllNPCPos

func GetAllNPCPos() ([]*NpcPosition, error)

func (*NpcPosition) Create

func (e *NpcPosition) Create() error

func (*NpcPosition) CreateWithTransaction

func (e *NpcPosition) CreateWithTransaction(tr *gorp.Transaction) error

func (*NpcPosition) Delete

func (e *NpcPosition) Delete() error

func (*NpcPosition) SetLocations

func (e *NpcPosition) SetLocations(min, max *utils.Location)

func (*NpcPosition) Update

func (e *NpcPosition) Update() error

type Party

type Party struct {
	Leader  *Character
	Members map[int]*PartyMember
	// contains filtered or unexported fields
}

func FindParty

func FindParty(c *Character) *Party

func (*Party) AddMember

func (p *Party) AddMember(m *PartyMember)

func (*Party) Create

func (p *Party) Create()

func (*Party) Delete

func (p *Party) Delete()

func (*Party) GetMember

func (p *Party) GetMember(id int) *PartyMember

func (*Party) GetMembers

func (p *Party) GetMembers() []*PartyMember

func (*Party) RemoveMember

func (p *Party) RemoveMember(m *PartyMember)

func (*Party) WelcomeMember

func (p *Party) WelcomeMember(c *Character)

type PartyMember

type PartyMember struct {
	*Character
	Accepted bool
}

type Pet

type Pet struct {
	ID            int64  `db:"id"`
	Name          string `db:"name"`
	Evolution     int16  `db:"evolution"`
	Level         int16  `db:"level"`
	TargetLevel   int16  `db:"target_level"`
	EvolvedID     int64  `db:"evolved_id"`
	BaseSTR       int    `db:"base_str"`
	AdditionalSTR int    `db:"additional_str"`
	BaseDEX       int    `db:"base_dex"`
	AdditionalDEX int    `db:"additional_dex"`
	BaseINT       int    `db:"base_int"`
	AdditionalINT int    `db:"additional_int"`
	BaseHP        int    `db:"base_hp"`
	AdditionalHP  int    `db:"additional_hp"`
	BaseChi       int    `db:"base_chi"`
	AdditionalChi int    `db:"additional_chi"`
	SkillID       int    `db:"skill_id"`
	Combat        bool   `db:"combat"`
}

func (*Pet) Create

func (e *Pet) Create() error

func (*Pet) CreateWithTransaction

func (e *Pet) CreateWithTransaction(tr *gorp.Transaction) error

func (*Pet) Delete

func (e *Pet) Delete() error

func (*Pet) Update

func (e *Pet) Update() error

type PetExpInfo

type PetExpInfo struct {
	Level         int16 `db:"level"`
	ReqExpEvo1    int   `db:"req_exp_evo1"`
	ReqExpEvo2    int   `db:"req_exp_evo2"`
	ReqExpEvo3    int   `db:"req_exp_evo3"`
	ReqExpHt      int   `db:"req_exp_ht"`
	ReqExpDivEvo1 int   `db:"req_exp_div_evo1"`
	ReqExpDivEvo2 int   `db:"req_exp_div_evo2"`
	ReqExpDivEvo3 int   `db:"req_exp_div_evo3"`
}

func (*PetExpInfo) Create

func (p *PetExpInfo) Create() error

func (*PetExpInfo) CreateWithTransaction

func (p *PetExpInfo) CreateWithTransaction(tr *gorp.Transaction) error

func (*PetExpInfo) Delete

func (p *PetExpInfo) Delete() error

func (*PetExpInfo) Update

func (p *PetExpInfo) Update() error

type PetSlot

type PetSlot struct {
	Name     string `db:"name" json:"name"`
	Level    byte   `db:"level" json:"level"`
	Loyalty  byte   `db:"loyalty" json:"loyalty"`
	Fullness byte   `db:"fullness" json:"fullness"`
	HP       int    `db:"hp" json:"hp"`
	MaxHP    int    `db:"max_hp" json:"max_hp"`
	CHI      int    `db:"chi" json:"chi"`
	MaxCHI   int    `db:"max_chi" json:"max_chi"`
	Exp      uint64 `db:"exp" json:"exp"`
	STR      int    `db:"str" json:"str"`
	DEX      int    `db:"dex" json:"dex"`
	INT      int    `db:"int" json:"int"`
	MinATK   int    `db:"min_atk" json:"min_atk"`
	MaxATK   int    `db:"max_atk" json:"max_atk"`
	DEF      int    `db:"def" json:"def"`
	ArtsDEF  int    `db:"arts_def" json:"arts_def"`

	Casting        bool           `db:"-" json:"-"`
	Coordinate     utils.Location `db:"-" json:"-"`
	IsOnline       bool           `db:"-" json:"-"`
	IsMoving       bool           `db:"-" json:"-"`
	LastHit        int            `db:"-" json:"-"`
	MovementToken  int64          `db:"-" json:"-"`
	PseudoID       int            `db:"-" json:"-"`
	RefreshStats   bool           `db:"-" json:"-"`
	Target         int            `db:"-" json:"-"`
	TargetLocation utils.Location `db:"-" json:"-"`
}

func (*PetSlot) AddExp

func (pet *PetSlot) AddExp(owner *Character)

func (*PetSlot) Attack

func (pet *PetSlot) Attack(owner *Character) []byte

func (*PetSlot) CastSkill

func (pet *PetSlot) CastSkill(owner *Character) []byte

func (*PetSlot) FindTargetMobID

func (pet *PetSlot) FindTargetMobID(owner *Character) (int, error)

func (*PetSlot) Move

func (pet *PetSlot) Move(targetLocation utils.Location, runningMode byte) []byte

func (*PetSlot) MovementHandler

func (pet *PetSlot) MovementHandler(token int64, start, end *utils.Location, speed float64)

type PlayerTarget

type PlayerTarget struct {
	Damage int        `db:"-" json:"damage"`
	Enemy  *Character `db:"-" json:"ai"`
}

type Production

type Production struct {
	ID          int    `db:"id"`
	Materials   []byte `db:"materials"`
	Probability int    `db:"probability"`
	Cost        int64  `db:"cost"`
	Production  int    `db:"production"`
	// contains filtered or unexported fields
}

func (*Production) Create

func (e *Production) Create() error

func (*Production) CreateWithTransaction

func (e *Production) CreateWithTransaction(tr *gorp.Transaction) error

func (*Production) Delete

func (e *Production) Delete() error

func (*Production) GetMaterials

func (e *Production) GetMaterials() ([]*ProductionMaterial, error)

type ProductionMaterial

type ProductionMaterial struct {
	ID    int  `json:"ID"`
	Count byte `json:"Count"`
}

type Relic

type Relic struct {
	ID            int    `db:"id"`
	Count         int    `db:"count"`
	Limit         int    `db:"limit"`
	Tradable      bool   `db:"tradable"`
	RequiredItems string `db:"required_items"`
}

func (*Relic) Create

func (e *Relic) Create() error

func (*Relic) CreateWithTransaction

func (e *Relic) CreateWithTransaction(tr *gorp.Transaction) error

func (*Relic) Delete

func (e *Relic) Delete() error

type Sale

type Sale struct {
	ID     uint16
	Seller *Character
	Name   string
	Items  []*SaleItem
	Data   []byte
}

func FindSale

func FindSale(id uint16) *Sale

func (*Sale) Create

func (s *Sale) Create()

func (*Sale) Delete

func (s *Sale) Delete()

func (*Sale) SaleData

func (s *Sale) SaleData() ([]byte, error)

type SaleItem

type SaleItem struct {
	SlotID int16
	Price  uint64
	IsSold bool
}

type SavePoint

type SavePoint struct {
	ID    uint8  `db:"id"`
	Point string `db:"point"`
}

func (*SavePoint) Create

func (e *SavePoint) Create() error

func (*SavePoint) CreateWithTransaction

func (e *SavePoint) CreateWithTransaction(tr *gorp.Transaction) error

func (*SavePoint) Delete

func (e *SavePoint) Delete() error

func (*SavePoint) SetPoint

func (e *SavePoint) SetPoint(point *utils.Location)

type Server

type Server struct {
	ID       int    `db:"id" json:"id"`
	Name     string `db:"name" json:"name"`
	MaxUsers int    `db:"max_users" json:"max_users"`
}

func (*Server) Create

func (t *Server) Create() error

func (*Server) CreateWithTransaction

func (t *Server) CreateWithTransaction(tr *gorp.Transaction) error

func (*Server) Delete

func (t *Server) Delete() error

func (*Server) Update

func (t *Server) Update() error

type ServerItem

type ServerItem struct {
	Server
	ConnectedUsers int `json:"conn_users"`
}

func GetServerByID

func GetServerByID(id string) (*ServerItem, error)

func GetServers

func GetServers() ([]*ServerItem, error)

type Shop

type Shop struct {
	ID    int    `db:"id"`
	Name  string `db:"name"`
	Types string `db:"types"`
}

func (*Shop) Create

func (e *Shop) Create() error

func (*Shop) GetTypes

func (e *Shop) GetTypes() []int

func (*Shop) IsPurchasable

func (e *Shop) IsPurchasable(itemID int) bool

func (*Shop) New

func (e *Shop) New(id int, name string, types []int)

type ShopItem

type ShopItem struct {
	Type  int    `db:"type"`
	Items string `db:"items"`
}

func (*ShopItem) Create

func (e *ShopItem) Create() error

func (*ShopItem) GetItems

func (e *ShopItem) GetItems() []int

func (*ShopItem) New

func (e *ShopItem) New(t int, items []int)

type SkillInfo

type SkillInfo struct {
	ID                      int     `db:"id"`
	BookID                  int64   `db:"book_id"`
	Name                    string  `db:"name"`
	Target                  int8    `db:"target"`
	PassiveType             uint8   `db:"passive_type"`
	Type                    uint8   `db:"type"`
	MaxPlus                 int8    `db:"max_plus"`
	Slot                    int     `db:"slot"`
	BaseTime                int     `db:"base_duration"`
	AdditionalTime          int     `db:"additional_duration"`
	CastTime                float64 `db:"cast_time"`
	BaseChi                 int     `db:"base_chi"`
	AdditionalChi           int     `db:"additional_chi"`
	BaseMinMultiplier       int     `db:"base_min_multiplier"`
	AdditionalMinMultiplier int     `db:"additional_min_multiplier"`
	BaseMaxMultiplier       int     `db:"base_max_multiplier"`
	AdditionalMaxMultiplier int     `db:"additional_max_multiplier"`
	BaseRadius              float64 `db:"base_radius"`
	AdditionalRadius        float64 `db:"additional_radius"`
	Passive                 bool    `db:"passive"`
	BasePassive             int     `db:"base_passive"`
	AdditionalPassive       int     `db:"additional_passive"`
	InfectionID             int     `db:"infection_id"`
	AreaCenter              int     `db:"area_center"`
	Cooldown                float64 `db:"cooldown"`
}

func (*SkillInfo) Create

func (e *SkillInfo) Create() error

func (*SkillInfo) CreateWithTransaction

func (e *SkillInfo) CreateWithTransaction(tr *gorp.Transaction) error

func (*SkillInfo) Delete

func (e *SkillInfo) Delete() error

func (*SkillInfo) Update

func (e *SkillInfo) Update() error

type SkillSet

type SkillSet struct {
	BookID int64         `json:"book"`
	Skills []*SkillTuple `json:"skills"`
}

type SkillSlots

type SkillSlots struct {
	Slots []*SkillSet `json:"slots"`
}

type SkillTuple

type SkillTuple struct {
	SkillID int `json:"skill_id"`
	Plus    int `json:"plus"`
}

type Skills

type Skills struct {
	ID          int             `db:"id" json:"id"`
	SkillPoints int             `db:"skill_points" json:"skill_points"`
	Skills      json.RawMessage `db:"skills" json:"skill"`
}

func FindSkillsByID

func FindSkillsByID(id int) (*Skills, error)

func (*Skills) Create

func (e *Skills) Create(c *Character) error

func (*Skills) CreateWithTransaction

func (e *Skills) CreateWithTransaction(tr *gorp.Transaction) error

func (*Skills) Delete

func (e *Skills) Delete() error

func (*Skills) GetPlus

func (s *Skills) GetPlus(skillID int) (byte, error)

func (*Skills) GetSkills

func (e *Skills) GetSkills() (*SkillSlots, error)

func (*Skills) GetSkillsData

func (s *Skills) GetSkillsData() ([]byte, error)

func (*Skills) SetSkills

func (e *Skills) SetSkills(slots *SkillSlots) error

func (*Skills) Update

func (e *Skills) Update() error

type Socket

type Socket struct {
	Conn       net.Conn
	ClientAddr string
	User       *User
	Character  *Character
	Stats      *Stat
	Skills     *Skills
	HoustonSub *nats.Subscription
	// contains filtered or unexported fields
}

func GetSocket

func GetSocket(id string) *Socket

func (*Socket) Add

func (s *Socket) Add(id string)

func (*Socket) OnClose

func (s *Socket) OnClose()

func (*Socket) ParseHeader

func (s *Socket) ParseHeader(header []byte)

func (*Socket) Read

func (s *Socket) Read()

func (*Socket) Remove

func (s *Socket) Remove(id string)

func (*Socket) SetPingDuration

func (s *Socket) SetPingDuration(duration time.Duration)

func (*Socket) SetPingHandler

func (s *Socket) SetPingHandler(handler func() error)

func (*Socket) Write

func (s *Socket) Write(data []byte) error

type Stackable

type Stackable struct {
	ID  int    `db:"id"`
	UIF string `db:"uif"`
}

func FindStackableByUIF

func FindStackableByUIF(uif string) *Stackable

func (*Stackable) Create

func (e *Stackable) Create() error

func (*Stackable) CreateWithTransaction

func (e *Stackable) CreateWithTransaction(tr *gorp.Transaction) error

func (*Stackable) Delete

func (e *Stackable) Delete() error

type Stat

type Stat struct {
	ID              int `db:"id"`
	HP              int `db:"hp"`
	MaxHP           int `db:"max_hp"`
	HPRecoveryRate  int `db:"hp_recovery_rate"`
	CHI             int `db:"chi"`
	MaxCHI          int `db:"max_chi"`
	CHIRecoveryRate int `db:"chi_recovery_rate"`
	STR             int `db:"str"`
	DEX             int `db:"dex"`
	INT             int `db:"int"`
	STRBuff         int `db:"str_buff"`
	DEXBuff         int `db:"dex_buff"`
	INTBuff         int `db:"int_buff"`
	StatPoints      int `db:"stat_points"`
	Honor           int `db:"honor"`
	MinATK          int `db:"min_atk"`
	MaxATK          int `db:"max_atk"`
	ATKRate         int `db:"atk_rate"`
	MinArtsATK      int `db:"min_arts_atk"`
	MaxArtsATK      int `db:"max_arts_atk"`
	ArtsATKRate     int `db:"arts_atk_rate"`
	DEF             int `db:"def"`
	DefRate         int `db:"def_rate"`
	ArtsDEF         int `db:"arts_def"`
	ArtsDEFRate     int `db:"arts_def_rate"`
	Accuracy        int `db:"accuracy"`
	Dodge           int `db:"dodge"`
	PoisonATK       int `db:"poison_atk"`
	ParalysisATK    int `db:"paralysis_atk"`
	ConfusionATK    int `db:"confusion_atk"`
	PoisonDEF       int `db:"poison_def"`
	ParalysisDEF    int `db:"paralysis_def"`
	ConfusionDEF    int `db:"confusion_def"`
	Wind            int `db:"wind"`
	WindBuff        int `db:"wind_buff"`
	Water           int `db:"water"`
	WaterBuff       int `db:"water_buff"`
	Fire            int `db:"fire"`
	FireBuff        int `db:"fire_buff"`
}

func FindStatByID

func FindStatByID(id int) (*Stat, error)

func (*Stat) Calculate

func (t *Stat) Calculate() error

func (*Stat) Create

func (t *Stat) Create(c *Character) error

func (*Stat) CreateWithTransaction

func (t *Stat) CreateWithTransaction(tr *gorp.Transaction) error

func (*Stat) Delete

func (t *Stat) Delete() error

func (*Stat) Reset

func (t *Stat) Reset() error

func (*Stat) Update

func (t *Stat) Update() error

type Target

type Target struct {
	Damage int `db:"-" json:"damage"`
	AI     *AI `db:"-" json:"ai"`
}

type Trade

type Trade struct {
	Sender     *Trader
	Receiver   *Trader
	Completing bool
}

func FindTrade

func FindTrade(c *Character) *Trade

func (*Trade) Delete

func (t *Trade) Delete()

func (*Trade) New

func (t *Trade) New(sender, receiver *Character)

type Trader

type Trader struct {
	Character *Character
	Slots     map[int16]int16
	Gold      uint64
	Accepted  bool
}

type User

type User struct {
	ID              string    `db:"id" json:"ID"`
	Username        string    `db:"user_name" json:"Username"`
	Password        string    `db:"password" json:"Password"`
	UserType        int8      `db:"user_type" json:"UserType"`
	ConnectedIP     string    `db:"ip" json:"ConnectedIP"`
	ConnectedServer int       `db:"server" json:"ConnectedServer"`
	NCash           uint64    `db:"ncash" json:"NCash"`
	BankGold        uint64    `db:"bank_gold" json:"BankGold"`
	Mail            string    `db:"mail" json:"Mail"`
	CreatedAt       null.Time `db:"created_at" json:"createdAt"`
	DisabledUntil   null.Time `db:"disabled_until" json:"disabledUntil"`

	ConnectingIP string `db:"-"`
	ConnectingTo int    `db:"-"`
	// contains filtered or unexported fields
}

func AllUsers

func AllUsers() []*User

func FindUserByID

func FindUserByID(id string) (*User, error)

func FindUserByIP

func FindUserByIP(ip string) (*User, error)

func FindUserByMail

func FindUserByMail(mail string) (*User, error)

func FindUserByName

func FindUserByName(name string) (*User, error)

func FindUsersInServer

func FindUsersInServer(server int) ([]*User, error)

func (*User) Create

func (u *User) Create() error

func (*User) CreateWithTransaction

func (u *User) CreateWithTransaction(tr *gorp.Transaction) error

func (*User) Delete

func (u *User) Delete() error

func (*User) GetTime

func (u *User) GetTime() []byte

func (*User) Logout

func (u *User) Logout()

func (*User) PreInsert

func (u *User) PreInsert(s gorp.SqlExecutor) error

func (*User) Update

func (u *User) Update() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL