Converted item database to YAML (#4335)

* Combines item_avail, item_buyingstore, item_delay, item_flag, item_nouse, item_stack, and item_trade databases into one.
* General cleanups and optimizations.
* Includes CSV2YAML conversion tool.
* Includes YAML2SQL conversion tool.
* Adjusts dummy_item from being created by malloc and now creates it by make_shared.
* Item combos are now stored as a STL.
Thanks to @Lemongrass3110, @Atemo, and @cydh!
Co-authored-by: Lemongrass3110 <lemongrass@kstp.at>
This commit is contained in:
Aleos 2020-10-21 19:02:11 -04:00 committed by GitHub
parent 323db7e661
commit 04cfe17b2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
96 changed files with 293974 additions and 56096 deletions

1
.gitattributes vendored
View File

@ -12,3 +12,4 @@ configure.in text eol=lf
Makefile text eol=lf
Makefile.in text eol=lf
*.sh text eol=lf
*.sql text eol=lf

2
.gitignore vendored
View File

@ -41,6 +41,7 @@ Thumbs.db
/map-server
/mapcache
/nbproject
/yaml2sql
# /3rdparty/libconfig/
/3rdparty/libconfig/Makefile
@ -119,6 +120,7 @@ Thumbs.db
/mapserv.bat
/runserver.bat
/serv.bat
/yaml2sql.bat
# dlls
/libmysql.dll

View File

@ -58,8 +58,7 @@ ignore_items_gender: yes
// On map change it will check for items not tagged as "available" and
// auto-delete them from inventory/cart/storage.
// NOTE: An item is not available if it was not loaded from the item_db or
// specified as unavailable in db/item_avail.txt
// NOTE: An item is not available if it was not loaded from the item_db.
// 0x1: Inventory
// 0x2: Cart
// 0x4: Storage
@ -103,7 +102,7 @@ item_enabled_npc: yes
// Default: yes
item_flooritem_check: yes
// Set default bound type for item_flag &8 (see db/[pre-]re/item_flag.txt
// Set default bound type when item with BindOnEquip flag is equipped (see db/[pre-]re/item_db.yml)
// 0 - None
// 1 - Account
// 2 - Guild

View File

@ -197,7 +197,7 @@ char_del_restriction: 3
// Uncomment to customize the restriction
//allowed_job_flag: 3
// What folder the DB files are in (item_db.txt, etc.)
// Folder that contains the database files.
db_path: db
//===================================

View File

@ -1,12 +0,0 @@
// Item Availability and Alias Database
//
// Structure of Database:
// ItemID,SpriteID
//
// 01. ItemID Item ID to change.
// 02. SpriteID Item ID which will be sent to the client instead of ItemID.
// If 0, the item becomes unavailable for use. If item_check is enabled and a player owns such an item, it will be removed upon next login/teleport.
//
// NOTE: Replaces an item client-side while keeping them separate server-side.
// Think of it as a way to disguise items.
// Don't sell the item in same shop with the source. Example, don't put 2240 & 2241 in same place!

View File

@ -1,10 +0,0 @@
// Buying Store Item List
// List of items that can be sold to buying stores.
//
// Structure of Database:
// ItemID
//
// Note:
// Items are in same order as data\buyingstoreitemlist.txt, which
// must be edited as well for the client to accept added items.

View File

@ -1,68 +0,0 @@
// Items Additional Database
//
// Structure of Database:
// ID,Name,Name,Type,Price,Sell,Weight,ATK[:MATK],DEF,Range,Slot,Job,Class,Gender,Loc,wLV,eLV[:maxLevel],Refineable,View,{ Script },{ OnEquip_Script },{ OnUnequip_Script }
//
// THQ Quest Items
//=============================================================
//7950,THG_Membership,THG Membership,3,,10,10,,,,,,,,,,,,,{},{},{}
//7951,Token_Bag,Token Bag,3,,10,10,,,,,,,,,,,,,{},{},{}
//1998,Jeramiah's_Jur,Jeramiah's Jur,3,,10,10,,,,,,,,,,,,,{},{},{}
//1999,Zed's_Staff,Zed's Staff,3,,10,10,,,,,,,,,,,,,{},{},{}
// Official Event Items that had their Effects removed after the event was completed
//585,Wurst,Brusti,11,2,,40,,,,,0xFFFFFFFF,63,2,,,,,,{ itemheal rand(15,20),0; itemskill "PR_MAGNIFICAT",3; },{},{}
//679,Gold_Pill,Pilule,0,5000,,300,,,,,0xFFFFFFFF,63,2,,,,,,{ percentheal 50,50; },{},{}
//2681,Republic_Ring,Republic Anniversary Ring,4,20,,100,,0,,0,0xFFFFFFFF,63,2,136,,0,0,0,{ bonus bAllStats,3; },{},{}
//5134,Pumpkin_Hat,Pumpkin-Head,4,20,,200,,2,,0,0xFFFFFFFF,63,2,256,,0,1,206,{ bonus2 bSubRace,RC_Demon,5; },{},{}
//5136,Santa's_Hat_,Louise's Santa Hat,4,20,,100,,3,,0,0xFFFFFFFF,63,2,256,,0,1,20,{ bonus bMdef,1; bonus bLuk,1; bonus3 bAutoSpellWhenHit,"AL_HEAL",3,50; bonus3 bAutoSpellWhenHit,"AL_BLESSING",10,50; },{},{}
//5145,Carnival_Joker_Jester,Carnival Jester,4,10,,100,,0,,0,0xFFFFFFFF,63,2,256,,0,1,89,{ bonus bAllStats,3; },{},{}
//5147,Baseball_Cap,Baseball Cap,4,0,,200,,3,,0,0xFFFFFFFF,63,2,256,,0,1,216,{ bonus2 bExpAddRace,RC_Boss,50; bonus2 bExpAddRace,RC_NonBoss,50; },{},{}
//5201,Party_Hat_B,2nd Anniversary Party Hat,4,20,,300,,3,,0,0xFFFFFFFF,63,2,256,,0,1,144,{ bonus bAllStats,3; },{},{}
//5202,Pumpkin_Hat_,Pumpkin Hat,4,20,,200,,2,,0,0xFFFFFFFF,63,2,256,,0,1,206,{ bonus bAllStats,2; bonus2 bSubRace,RC_Demon,5; bonus3 bAddMonsterDropItem,529,RC_DemiHuman,1500; },{},{}
//5204,Event_Pierrot_Nose,Rudolf's Red Nose,4,20,,100,,0,,0,0xFFFFFFFF,63,2,1,,0,0,49,{ bonus2 bResEff,Eff_Blind,3000; bonus2 bAddMonsterDropItem,12130,30; },{},{}
//5264,Aussie_Flag_Hat,Australian Flag Hat,4,20,,500,,4,,0,0xFFFFFFFF,63,2,256,,0,1,304,{ bonus bAllStats,2; },{},{}
//5356,Pumpkin_Hat_H,Pumpkin Hat,4,20,,200,,2,,0,0xFFFFFFFF,63,2,256,,0,1,206,{ bonus bAllStats,2; bonus2 bSubRace,RC_Demon,5; bonus2 bMagicAddRace,RC_Demon,5; },{},{}
//5384,Santa_Hat_1,Twin Pompom By JB,4,20,,200,,2,,1,0xFFFFFFFF,63,2,256,,20,1,390,{ bonus bLuk,3; bonus2 bResEff,Eff_Curse,2000; bonus bVariableCastrate,-2; bonus bAspdRate,4; bonus2 bAddMonsterDropItem,539,100; bonus2 bAddMonsterDropItem,529,200; bonus2 bAddMonsterDropItem,530,200; autobonus "{ bonus bCritical,10; }",10,5000; },{},{}
//5811,Santa_Beard,Santa Beard,4,20,,100,,5,,0,0xFFFFFFFF,63,2,1,,0,0,25,{ bonus2 bSubRace,RC_Brute,5; bonus2 bSubRace,RC_Player_Doram,5; },{},{}
//11702,Moon_Cookie,Moon Cookie,11,0,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ sc_end SC_POISON; sc_end SC_SILENCE; sc_end SC_BLIND; sc_end SC_CONFUSION; sc_end SC_CURSE; sc_end SC_HALLUCINATION; itemskill "AL_BLESSING",7; },{},{}
//12131,Lucky_Potion,Lucky Potion,0,2,,100,,,,,0xFFFFFFFF,63,2,,,,,,{ sc_start SC_LUKFOOD,180000,15; },{},{}
//12143,Red_Can,Red Can,2,50000,,300,,,,,0xFFFFFFFF,63,2,,,,,,{ percentheal 25,25; },{},{}
//Event effect: Summon monster? Probably Rice_Cake. x_x
//12199,Rice_Scroll,Rice Scroll,2,0,,0,,,,,0xFFFFFFFF,63,2,,,,,,{},{},{}
//12200,Event_Cake,Event Cake,2,20,,50,,,,,0xFFFFFFFF,63,2,,,,,,{ itemskill "PR_MAGNIFICAT",3; },{},{}
//12238,New_Year_Rice_Cake_1,New Year Rice Cake,0,20,,100,,,,,0xFFFFFFFF,63,2,,,,,,{ percentheal 20,15; sc_start SC_STRFOOD,1200000,3; sc_start SC_INTFOOD,1200000,3; sc_start SC_LUKFOOD,1200000,3; sc_start SC_SPEEDUP1,5000,0; },{},{}
//12239,New_Year_Rice_Cake_2,New Year Rice Cake,0,20,,100,,,,,0xFFFFFFFF,63,2,,,,,,{ percentheal 20,15; sc_start SC_DEXFOOD,1200000,3; sc_start SC_AGIFOOD,1200000,3; sc_start SC_VITFOOD,1200000,3; sc_start SC_SPEEDUP1,5000,0; },{},{}
// iRO St. Patrick's Day Event 2008
//=============================================================
//12715,Black_Treasure_Chest,Black Treasure Chest,2,0,,200,,,,,0xFFFFFFFF,63,2,,,,,,{ callfunc "F_08stpattyseventbox"; },{},{}
// iRO Valentine's Day Event 2009
//=============================================================
//12742,Valentine_Gift_Box_M,Valentine Gift Box,2,10,,0,,,,,0xFFFFFFFF,63,2,,,,,,{ getitem 7946,1; },{},{}
//12743,Valentine_Gift_Box_F,Valentine Gift Box,2,10,,0,,,,,0xFFFFFFFF,63,2,,,,,,{ getitem 7947,1; },{},{}
//12744,Chocolate_Box,Chocolate Box,2,10,,0,,,,,0xFFFFFFFF,63,2,,,,,,{ getitem 558,1; },{},{}
//14466,Valentine's_Emblem_Box,Valentine's Emblem Box,2,10,,0,,,,,0xFFFFFFFF,63,2,,,,,,{ getitem 5817,1; },{},{}
//7946,Gold_Ring_Of_Valentine,Gold Ring Of Valentine,3,10,,0,,,,,,,,,,,,,{},{},{}
//7947,Silver_Ring_Of_Valentine,Silver Ring Of Valentine,3,10,,0,,,,,,,,,,,,,{},{},{}
//7948,Box,Box,3,10,,10,,,,,,,,,,,,,{},{},{}
//5817,Valentine's_Emblem,Valentine's Emblem,4,10,,0,,3,,0,0xFFFFFFFF,63,2,136,,0,0,0,{ bonus bAtkRate,3; bonus bMatkRate,3; bonus bAllStats,2; bonus bFlee,10; bonus bAspd,1; bonus bMdef,3; bonus2 bSkillAtk,"AL_HEAL",10; bonus2 bSkillHeal,"AL_HEAL",10; bonus2 bSkillHeal,"AM_POTIONPITCHER",10; bonus2 bAddItemGroupHealRate,IG_Potion,10; },{},{}
// iRO Halloween Event 2009
//=============================================================
//5668,Weird_Pumpkin_Hat,Weird Pumpkin Hat,4,20,,0,,5,,0,0xFFFFFFFF,63,2,256,,0,1,206,{ bonus bMdef,5; bonus2 bAddMonsterDropItem,12192,2500; },{},{}
//6298,Crushed_Pumpkin,Crushed Pumpkin,3,0,,0,,,,,,,,,,,,,{},{},{}
//6299,Worn_Fabric,Worn Fabric,3,0,,0,,,,,,,,,,,,,{},{},{}
// Old Tuxedo and Wedding Dress, will display the outfit when worn.
//==================================================================
//2338,Wedding_Dress,Wedding Dress,4,43000,,500,,0,,0,0xFFFFFFFE,63,0,16,,0,1,0,{},{ sc_start SC_WEDDING,INFINITE_TICK,0; },{ sc_end SC_WEDDING; }
//7170,Tuxedo,Tuxedo,4,43000,,10,,0,,0,0xFFFFFFFE,63,1,16,,0,1,0,{},{ sc_start SC_WEDDING,INFINITE_TICK,0; },{ sc_end SC_WEDDING; }
// Non-kRO Eden Group Mark effect
//=============================================================
//22508,Para_Team_Mark_,Eden Group Mark,11,0,,0,,,,0,0xFFFFFFFF,63,2,,,,,,{ unitskilluseid getcharid(3),"AL_TELEPORT",3; },{},{}

492
db/import-tmpl/item_db.yml Normal file
View File

@ -0,0 +1,492 @@
# This file is a part of rAthena.
# Copyright(C) 2019 rAthena Development Team
# https://rathena.org - https://github.com/rathena
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
###########################################################################
# Item Database
###########################################################################
#
# Item Settings
#
###########################################################################
# - Id Item ID.
# AegisName Server name to reference the item in scripts and lookups, should use no spaces.
# Name Name in English for displaying as output.
# Type Item type. (Default: Etc)
# SubType Weapon or Ammo type. (Default: 0)
# Buy Buying price. When not specified, becomes double the sell price. (Default: 0)
# Sell Selling price. When not specified, becomes half the buy price. (Default: 0)
# Weight Item weight. Each 10 is 1 weight. (Default: 0)
# Attack Weapon's attack. (Default: 0)
# MagicAttack Weapon's magic attack. (Default: 0)
# Defense Armor's defense. (Default: 0)
# Range Weapon's attack range. (Default: 0)
# Slots Available slots in item. (Default: 0)
# Jobs Jobs that can equip the item. (Map default is 'All: true')
# Classes Upper class types that can equip the item. (Map default is 'All: true')
# Gender Gender that can equip the item. (Default: Both)
# Locations Equipment's placement. (Default: None)
# WeaponLevel Weapon level. (Default: 0)
# EquipLevelMin Minimum required level to equip. (Default: 0)
# EquipLevelMax Maximum level that can equip. (Default: 0)
# Refineable If the item can be refined. (Default: false)
# View View sprite of an item. (Default: 0)
# AliasName Another item's AegisName that will be sent to the client instead of this item's AegisName. (Default: null)
# Flags: Item flags. (Default: null)
# BuyingStore If the item is available for Buyingstores. (Default: false)
# DeadBranch If the item is a Dead Branch. (Default: false)
# Container If the item is part of a container. (Default: false)
# UniqueId If the item is a unique stack. (Default: false)
# BindOnEquip If the item is bound to the character upon equipping. (Default: false)
# DropAnnounce If the item has a special announcement to self on drop. (Default: false)
# NoConsume If the item is consumed on use. (Default: false)
# DropEffect If the item has a special effect when on the ground. (Default: None)
# Delay: Item use delay. (Default: null)
# Duration Duration of delay in seconds.
# Status Status Change used to track delay. (Default: None)
# Stack: Item stack amount. (Default: null)
# Amount Maximum amount that can be stacked.
# Inventory If the stack is applied to player's inventory. (Default: true)
# Cart If the stack is applied to the player's cart. (Default: false)
# Storage If the stack is applied to the player's storage. (Default: false)
# GuildStorage If the stack is applied to the player's guild storage. (Default: false)
# NoUse: Conditions when the item is unusable. (Default: null)
# Override Group level to override these conditions.
# Sitting If the item can not be used while sitting. (Default: false)
# Trade: Trade restrictions. (Default: null)
# Override Group level to override these conditions.
# NoDrop If the item can not be dropped. (Default: false)
# NoTrade If the item can not be traded. (Default: false)
# TradePartner If the item can not be traded to the player's partner. (Default: false)
# NoSell If the item can not be sold. (Default: false)
# NoCart If the item can not be put in a cart. (Default: false)
# NoStorage If the item can not be put in a storage. (Default: false)
# NoGuildStorage If the item can not be put in a guild storage. (Default: false)
# NoMail If the item can not be put in a mail. (Default: false)
# NoAuction If the item can not be put in an auction. (Default: false)
# Script Script to execute when the item is used/equipped. (Default: null)
# EquipScript Script to execute when the item is equipped. (Default: null)
# UnEquipScript Script to execute when the item is unequipped or when a rental item expires. (Default: null)
###########################################################################
Header:
Type: ITEM_DB
Version: 1
#Body:
# THQ Quest Items
#=============================================================
# - Id: 1998
# AegisName: Jeramiah's_Jur
# Name: Jeramiah's Jur
# Type: Etc
# Sell: 10
# Weight: 10
# AliasName: Jur
# - Id: 1999
# AegisName: Zed's_Staff
# Name: Zed's Staff
# Type: Etc
# Sell: 10
# Weight: 10
# AliasName: Staff_Of_Soul
# - Id: 7950
# AegisName: THG_Membership
# Name: THG Membership
# Type: Etc
# Sell: 10
# Weight: 10
# AliasName: Foolishness_Of_Blind
# - Id: 7951
# AegisName: Token_Bag
# Name: Token Bag
# Type: Etc
# Sell: 10
# Weight: 10
# AliasName: Leather_Bag_Of_Infinity
# Official Event Items that had their Effects removed after the event was completed
#=============================================================
# - Id: 585
# AegisName: Wurst
# Name: Brusti
# Type: Delayconsume
# Buy: 2
# Weight: 40
# Script: |
# itemheal rand(15,20),0; itemskill "PR_MAGNIFICAT",3;
# - Id: 679
# AegisName: Gold_Pill
# Name: Pilule
# Type: Healing
# Buy: 5000
# Weight: 300
# Script: |
# percentheal 50,50;
# - Id: 2681
# AegisName: Republic_Ring
# Name: Republic Anniversary Ring
# Type: Armor
# Buy: 20
# Weight: 100
# Locations:
# Right_Accessory: true
# Left_Accessory: true
# Script: |
# bonus bAllStats,3;
# - Id: 5134
# AegisName: Pumpkin_Hat
# Name: Pumpkin-Head
# Type: Armor
# Buy: 20
# Weight: 200
# Defense: 2
# Locations:
# Head_Top: true
# Refineable: true
# View: 206
# Script: |
# bonus2 bSubRace,RC_Demon,5;
# - Id: 5136
# AegisName: Santa's_Hat_
# Name: Louise's Santa Hat
# Type: Armor
# Buy: 20
# Weight: 100
# Defense: 3
# Locations:
# Head_Top: true
# Refineable: true
# View: 20
# Script: |
# bonus bMdef,1; bonus bLuk,1; bonus3 bAutoSpellWhenHit,"AL_HEAL",3,50; bonus3 bAutoSpellWhenHit,"AL_BLESSING",10,50;
# - Id: 5145
# AegisName: Carnival_Joker_Jester
# Name: Carnival Jester
# Type: Armor
# Buy: 10
# Weight: 100
# Locations:
# Head_Top: true
# Refineable: true
# View: 89
# Script: |
# bonus bAllStats,3;
# - Id: 5147
# AegisName: Baseball_Cap
# Name: Baseball Cap
# Type: Armor
# Weight: 200
# Defense: 3
# Locations:
# Head_Top: true
# Refineable: true
# View: 216
# Script: |
# bonus2 bExpAddRace,RC_Boss,50; bonus2 bExpAddRace,RC_NonBoss,50;
# - Id: 5201
# AegisName: Party_Hat_B
# Name: 2nd Anniversary Party Hat
# Type: Armor
# Buy: 20
# Weight: 300
# Defense: 3
# Locations:
# Head_Top: true
# Refineable: true
# View: 144
# Script: |
# bonus bAllStats,3;
# - Id: 5202
# AegisName: Pumpkin_Hat_
# Name: Pumpkin Hat
# Type: Armor
# Buy: 20
# Weight: 200
# Defense: 2
# Locations:
# Head_Top: true
# Refineable: true
# View: 206
# Script: |
# bonus bAllStats,2; bonus2 bSubRace,RC_Demon,5; bonus3 bAddMonsterDropItem,529,RC_DemiHuman,1500;
# - Id: 5204
# AegisName: Event_Pierrot_Nose
# Name: Rudolf's Red Nose
# Type: Armor
# Buy: 20
# Weight: 100
# Locations:
# Head_Low: true
# View: 49
# Script: |
# bonus2 bResEff,Eff_Blind,3000; bonus2 bAddMonsterDropItem,12130,30;
# - Id: 5264
# AegisName: Aussie_Flag_Hat
# Name: Australian Flag Hat
# Type: Armor
# Buy: 20
# Weight: 500
# Defense: 4
# Locations:
# Head_Top: true
# Refineable: true
# View: 304
# Script: |
# bonus bAllStats,2;
# - Id: 5356
# AegisName: Pumpkin_Hat_H
# Name: Pumpkin Hat
# Type: Armor
# Buy: 20
# Weight: 200
# Defense: 2
# Locations:
# Head_Top: true
# Refineable: true
# View: 206
# Script: |
# bonus bAllStats,2; bonus2 bSubRace,RC_Demon,5; bonus2 bMagicAddRace,RC_Demon,5;
# - Id: 5384
# AegisName: Santa_Hat_1
# Name: Twin Pompom By JB
# Type: Armor
# Buy: 20
# Weight: 200
# Defense: 2
# Slots: 1
# Locations:
# Head_Top: true
# EquipLevelMin: 20
# Refineable: true
# View: 390
# Script: |
# bonus bLuk,3; bonus2 bResEff,Eff_Curse,2000; bonus bVariableCastrate,-2; bonus bAspdRate,4; bonus2 bAddMonsterDropItem,539,100; bonus2 bAddMonsterDropItem,529,200; bonus2 bAddMonsterDropItem,530,200; autobonus "{ bonus bCritical,10; }",10,5000;
# - Id: 5811
# AegisName: Santa_Beard
# Name: Santa Beard
# Type: Armor
# Buy: 20
# Weight: 100
# Defense: 5
# Locations:
# Head_Low: true
# View: 25
# Script: |
# bonus2 bSubRace,RC_Brute,5; bonus2 bSubRace,RC_Player_Doram,5;
# - Id: 11702
# AegisName: Moon_Cookie
# Name: Moon Cookie
# Type: Delayconsume
# Weight: 10
# Script: |
# sc_end SC_POISON; sc_end SC_SILENCE; sc_end SC_BLIND; sc_end SC_CONFUSION; sc_end SC_CURSE; sc_end SC_HALLUCINATION; itemskill "AL_BLESSING",7;
# - Id: 12131
# AegisName: Lucky_Potion
# Name: Lucky Potion
# Type: Healing
# Buy: 2
# Weight: 100
# Script: |
# sc_start SC_LUKFOOD,180000,15;
# - Id: 12143
# AegisName: Red_Can
# Name: Red Can
# Type: Usable
# Buy: 50000
# Weight: 300
# Script: |
# percentheal 25,25;
# Event effect: Summon monster? Probably Rice_Cake. x_x
#=============================================================
# - Id: 12199
# AegisName: Rice_Scroll
# Name: Rice Scroll
# Type: Usable
# - Id: 12200
# AegisName: Event_Cake
# Name: Event Cake
# Type: Usable
# Buy: 20
# Weight: 50
# Script: |
# itemskill "PR_MAGNIFICAT",3;
# - Id: 12238
# AegisName: New_Year_Rice_Cake_1
# Name: New Year Rice Cake
# Type: Healing
# Buy: 20
# Weight: 100
# Script: |
# percentheal 20,15; sc_start SC_STRFOOD,1200000,3; sc_start SC_INTFOOD,1200000,3; sc_start SC_LUKFOOD,1200000,3; sc_start SC_SPEEDUP1,5000,0;
# - Id: 12239
# AegisName: New_Year_Rice_Cake_2
# Name: New Year Rice Cake
# Type: Healing
# Buy: 20
# Weight: 100
# Script: |
# percentheal 20,15; sc_start SC_DEXFOOD,1200000,3; sc_start SC_AGIFOOD,1200000,3; sc_start SC_VITFOOD,1200000,3; sc_start SC_SPEEDUP1,5000,0;
# iRO St. Patrick's Day Event 2008
#=============================================================
# - Id: 7915
# AegisName: Copper_Coin_
# Name: Bronze Coin
# Type: Etc
# Weight: 10
# AliasName: Copper_Coin
# - Id: 7916
# AegisName: Silver_Coin_
# Name: Silver Coin
# Type: Etc
# Weight: 10
# AliasName: Silver_Coin
# - Id: 12715
# AegisName: Black_Treasure_Chest
# Name: Black Treasure Chest
# Type: Usable
# Weight: 200
# AliasName: Treasure_Box_
# Script: |
# callfunc "F_08stpattyseventbox";
# iRO Valentine's Day Event 2009
#=============================================================
# - Id: 5817
# AegisName: Valentine's_Emblem
# Name: Valentine's Emblem
# Type: Armor
# Buy: 10
# Defense: 3
# Locations:
# Right_Accessory: true
# Left_Accessory: true
# Script: |
# bonus bAtkRate,3; bonus bMatkRate,3; bonus bAllStats,2; bonus bFlee,10; bonus bAspd,1; bonus bMdef,3; bonus2 bSkillAtk,"AL_HEAL",10; bonus2 bSkillHeal,"AL_HEAL",10; bonus2 bSkillHeal,"AM_POTIONPITCHER",10; bonus2 bAddItemGroupHealRate,IG_Potion,10;
# - Id: 7946
# AegisName: Gold_Ring_Of_Valentine
# Name: Gold Ring Of Valentine
# Type: Etc
# Buy: 10
# - Id: 7947
# AegisName: Silver_Ring_Of_Valentine
# Name: Silver Ring Of Valentine
# Type: Etc
# Buy: 10
# - Id: 7948
# AegisName: Box
# Name: Box
# Type: Etc
# Buy: 10
# Weight: 10
# - Id: 12742
# AegisName: Valentine_Gift_Box_M
# Name: Valentine Gift Box
# Type: Usable
# Buy: 10
# Script: |
# getitem 7946,1;
# - Id: 12743
# AegisName: Valentine_Gift_Box_F
# Name: Valentine Gift Box
# Type: Usable
# Buy: 10
# Script: |
# getitem 7947,1;
# - Id: 12744
# AegisName: Chocolate_Box
# Name: Chocolate Box
# Type: Usable
# Buy: 10
# Script: |
# getitem 558,1;
# - Id: 14466
# AegisName: Valentine's_Emblem_Box
# Name: Valentine's Emblem Box
# Type: Usable
# Buy: 10
# Script: |
# getitem 5817,1;
# iRO Halloween Event 2009
#=============================================================
# - Id: 5668
# AegisName: Weird_Pumpkin_Hat
# Name: Weird Pumpkin Hat
# Type: Armor
# Buy: 20
# Defense: 5
# Locations:
# Head_Top: true
# Refineable: true
# View: 206
# Script: |
# bonus bMdef,5; bonus2 bAddMonsterDropItem,12192,2500;
# - Id: 6298
# AegisName: Crushed_Pumpkin
# Name: Crushed Pumpkin
# Type: Etc
# - Id: 6299
# AegisName: Worn_Fabric
# Name: Worn Fabric
# Type: Etc
# Old Tuxedo and Wedding Dress, will display the outfit when worn.
#==================================================================
# - Id: 2338
# AegisName: Wedding_Dress
# Name: Wedding Dress
# Type: Armor
# Buy: 43000
# Weight: 500
# Jobs:
# All: true
# Novice: false
# Locations:
# Armor: true
# Refineable: true
# EquipScript: |
# sc_start SC_WEDDING,INFINITE_TICK,0;
# UnEquipScript: |
# sc_end SC_WEDDING;
# - Id: 7170
# AegisName: Tuxedo
# Name: Tuxedo
# Type: Armor
# Buy: 43000
# Weight: 10
# Jobs:
# All: true
# Novice: false
# Gender: Male
# Locations:
# Armor: true
# Refineable: true
# EquipScript: |
# sc_start SC_WEDDING,INFINITE_TICK,0;
# UnEquipScript: |
# sc_end SC_WEDDING;
# Non-kRO Eden Group Mark effect
#=============================================================
# - Id: 22508
# AegisName: Para_Team_Mark_
# Name: Eden Group Mark
# Type: Delayconsume
# Script: |
# unitskilluseid getcharid(3),"AL_TELEPORT",3;

View File

@ -1,8 +0,0 @@
// Item Delay Database
//
// Structure of Database:
// Item ID,Delay in Milliseconds
//
// NOTE:
// There is a max concurrent number of entries set in src/map/itemdb.h as MAX_ITEMDELAYS.

View File

@ -1,17 +0,0 @@
// Flagged Items
// <ItemID>,<Flag>
//
// <Flag>:
// 1 - As Dead Branch item (will be logged at `branchlog` table and cannot be used at 'nobranch' mapflag)
// 2 - As item group container, check player's inventory and weight before consumed
// 4 - GUID item, cannot be stacked even same or stackable item
// 8 - Item will be bound item when equipped
// 16 - Special Broadcast: When item dropped by monster and player loot it, will be broadcasted!
// 32 - Item will not be removed on consumption. Also supports 'itemskill'
// 64 - Item will be displayed with a client side defined drop
// 128 - Item will be displayed with a white pillar drop effect
// 256 - Item will be displayed with a blue pillar drop effect
// 512 - Item will be displayed with a yellow pillar drop effect
// 1024 - Item will be displayed with a purple pillar drop effect
// 2048 - Item will be displayed with a orange pillar drop effect
// NOTE: For removing flag by import file, use "-" to remove the flag. Example, 604,-1 will removes flag 1 from Branch_Of_Dead_Tree

View File

@ -1,13 +0,0 @@
// Item Usage Restriction Configuration File
// Defines if an item cannot be used under special circumstances.
//
// Structure of Database:
// ItemID,Flag,Group ID Override
//
// Flag:
// 1 = Cannot use item while sitting
// ... [more to come]
//
// Group ID Override:
// Group ID necessary to override this setting.

View File

@ -1,19 +0,0 @@
// Item Stacking Restriction File
// Prevents an item to be stacked more than x times in given
// inventory types. Generally used by 3rd class related skill items.
//
// Structure of Database:
// ItemID,MaxStackAmount,Type
//
// MaxStackAmount:
// Stack limit for the item. Use 0 to disable a restriction.
//
// Type mask values:
// &1: Character inventory restriction
// &2: Character cart restriction
// &4: Account storage restriction
// &8: Guild storage restriction
//
// Example:
// 512,4,12 // Will not allow more than 4 Apples in storages.

View File

@ -1,22 +0,0 @@
// Item Trade Restrictions Database
// Defines special trade rules for individual items.
//
// Structure of Database:
// Item ID, TradeMask,Group Level Override
//
// Legend for 'TradeMask' field (bitmask):
// 1 - item can't be dropped
// 2 - item can't be traded (nor vended)
// 4 - wedded partner can override restriction 2
// 8 - item can't be sold to npcs
// 16 - item can't be placed in the cart
// 32 - item can't be placed in the storage
// 64 - item can't be placed in the guild storage
// 128 - item can't be attached to mail
// 256 - item can't be auctioned
//
// Example:
// 1161,67,50
// Balmung cannot be dropped, traded, or placed in Guild Storage (1+2+64).
// Only groups of group-level 50 and up can override this setting.

View File

@ -1,27 +0,0 @@
// Item Availability and Alias Database
//
// Structure of Database:
// ItemID,SpriteID
//
// 01. ItemID Item ID to change.
// 02. SpriteID Item ID which will be sent to the client instead of ItemID.
// If 0, the item becomes unavailable for use. If item_check is enabled and a player owns such an item, it will be removed upon next login/teleport.
//
// NOTE: Replaces an item client-side while keeping them separate server-side.
// Think of it as a way to disguise items.
// Don't sell the item in same shop with the source. Example, don't put 2240 & 2241 in same place!
//2240,2241 //Beard - Grampa Beard
//Treasure Hunters Quest Items
//use these aliases if your game client doesn't support them normally
//7950,7021
//7951,7042
//1998,1250
//1999,1472
//St. Patric's Day Quest (2008) Items
//Enable if you plan to use the quest.
//12715,7721
//7915,673
//7916,675

95
db/item_db.yml Normal file
View File

@ -0,0 +1,95 @@
# This file is a part of rAthena.
# Copyright(C) 2019 rAthena Development Team
# https://rathena.org - https://github.com/rathena
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
###########################################################################
# Item Database
###########################################################################
#
# Item Settings
#
###########################################################################
# - Id Item ID.
# AegisName Server name to reference the item in scripts and lookups, should use no spaces.
# Name Name in English for displaying as output.
# Type Item type. (Default: Etc)
# SubType Weapon or Ammo type. (Default: 0)
# Buy Buying price. When not specified, becomes double the sell price. (Default: 0)
# Sell Selling price. When not specified, becomes half the buy price. (Default: 0)
# Weight Item weight. Each 10 is 1 weight. (Default: 0)
# Attack Weapon's attack. (Default: 0)
# MagicAttack Weapon's magic attack. (Default: 0)
# Defense Armor's defense. (Default: 0)
# Range Weapon's attack range. (Default: 0)
# Slots Available slots in item. (Default: 0)
# Jobs Jobs that can equip the item. (Map default is 'All: true')
# Classes Upper class types that can equip the item. (Map default is 'All: true')
# Gender Gender that can equip the item. (Default: Both)
# Locations Equipment's placement. (Default: None)
# WeaponLevel Weapon level. (Default: 0)
# EquipLevelMin Minimum required level to equip. (Default: 0)
# EquipLevelMax Maximum level that can equip. (Default: 0)
# Refineable If the item can be refined. (Default: false)
# View View sprite of an item. (Default: 0)
# AliasName Another item's AegisName that will be sent to the client instead of this item's AegisName. (Default: null)
# Flags: Item flags. (Default: null)
# BuyingStore If the item is available for Buyingstores. (Default: false)
# DeadBranch If the item is a Dead Branch. (Default: false)
# Container If the item is part of a container. (Default: false)
# UniqueId If the item is a unique stack. (Default: false)
# BindOnEquip If the item is bound to the character upon equipping. (Default: false)
# DropAnnounce If the item has a special announcement to self on drop. (Default: false)
# NoConsume If the item is consumed on use. (Default: false)
# DropEffect If the item has a special effect when on the ground. (Default: None)
# Delay: Item use delay. (Default: null)
# Duration Duration of delay in seconds.
# Status Status Change used to track delay. (Default: None)
# Stack: Item stack amount. (Default: null)
# Amount Maximum amount that can be stacked.
# Inventory If the stack is applied to player's inventory. (Default: true)
# Cart If the stack is applied to the player's cart. (Default: false)
# Storage If the stack is applied to the player's storage. (Default: false)
# GuildStorage If the stack is applied to the player's guild storage. (Default: false)
# NoUse: Conditions when the item is unusable. (Default: null)
# Override Group level to override these conditions.
# Sitting If the item can not be used while sitting. (Default: false)
# Trade: Trade restrictions. (Default: null)
# Override Group level to override these conditions.
# NoDrop If the item can not be dropped. (Default: false)
# NoTrade If the item can not be traded. (Default: false)
# TradePartner If the item can not be traded to the player's partner. (Default: false)
# NoSell If the item can not be sold. (Default: false)
# NoCart If the item can not be put in a cart. (Default: false)
# NoStorage If the item can not be put in a storage. (Default: false)
# NoGuildStorage If the item can not be put in a guild storage. (Default: false)
# NoMail If the item can not be put in a mail. (Default: false)
# NoAuction If the item can not be put in an auction. (Default: false)
# Script Script to execute when the item is used/equipped. (Default: null)
# EquipScript Script to execute when the item is equipped. (Default: null)
# UnEquipScript Script to execute when the item is unequipped or when a rental item expires. (Default: null)
###########################################################################
Header:
Type: ITEM_DB
Version: 1
Footer:
Imports:
- Path: db/pre-re/item_db.yml
Mode: Prerenewal
- Path: db/re/item_db.yml
Mode: Renewal
- Path: db/import/item_db.yml

View File

@ -1,138 +0,0 @@
// Item Usage Restriction Configuration File
// Defines if an item cannot be used under special circumstances.
//
// Structure of Database:
// ItemID,Flag,Group ID Override
//
// Flag:
// 1 = Cannot use item while sitting
// ... [more to come]
//
// Group ID Override:
// Group ID necessary to override this setting.
606,1,100 // Aloebera
619,1,100 // Unripe_Apple
620,1,100 // Orange_Juice
621,1,100 // Bitter_Herb
622,1,100 // Rainbow_Carrot
623,1,100 // Earthworm_The_Dude
624,1,100 // Rotten_Fish
625,1,100 // Lusty_Iron
626,1,100 // Monster_Juice
627,1,100 // Sweet_Milk
628,1,100 // Well_Dried_Bone
629,1,100 // Singing_Flower
630,1,100 // Dew_Laden_Moss
631,1,100 // Deadly_Noxious_Herb
632,1,100 // Fatty_Chubby_Earthworm
633,1,100 // Baked_Yam
634,1,100 // Tropical_Banana
635,1,100 // Horror_Of_Tribe
636,1,100 // No_Recipient
637,1,100 // Old_Broom
638,1,100 // Silver_Knife_Of_Chaste
639,1,100 // Armlet_Of_Obedience
640,1,100 // Shining_Stone
641,1,100 // Contracts_In_Shadow
642,1,100 // Book_Of_Devil
659,1,100 // Heart_Of_Her
660,1,100 // Prohibition_Red_Candle
661,1,100 // Sway_Apron
686,1,100 // Earth_Scroll_1_3
687,1,100 // Earth_Scroll_1_5
688,1,100 // Cold_Scroll_1_3
689,1,100 // Cold_Scroll_1_5
690,1,100 // Fire_Scroll_1_3
691,1,100 // Fire_Scroll_1_5
692,1,100 // Wind_Scroll_1_3
693,1,100 // Wind_Scroll_1_5
694,1,100 // Ghost_Scroll_1_3
695,1,100 // Ghost_Scroll_1_5
696,1,100 // Fire_Scroll_2_1
697,1,100 // Fire_Scroll_2_5
698,1,100 // Fire_Scroll_3_1
699,1,100 // Fire_Scroll_3_5
700,1,100 // Cold_Scroll_2_1
11702,1,100 // Moon_Cookie
12000,1,100 // Cold_Scroll_2_5
12001,1,100 // Holy_Scroll_1_3
12002,1,100 // Holy_Scroll_1_5
12027,1,100 // Giggling_Box
12028,1,100 // Box_Of_Thunder
12029,1,100 // Gloomy_Box
12030,1,100 // Box_Of_Grudge
12031,1,100 // Sleepy_Box
12032,1,100 // Box_Of_Storm
12033,1,100 // Box_Of_Sunlight
12034,1,100 // Painting_Box
12215,1,100 // Blessing_10_Scroll
12216,1,100 // Inc_Agi_10_Scroll
12217,1,100 // Aspersio_5_Scroll
12218,1,100 // Assumptio_5_Scroll
12219,1,100 // Wind_Walk_10_Scroll
12220,1,100 // Adrenaline_Scroll
12225,1,100 // Sweet_Candy_Striper
12235,1,100 // Strawberry_Choco
12236,1,100 // Choco_Tart
12237,1,100 // Choco_Lump
12290,1,100 // Mysterious_Can
12291,1,100 // Mysterious_PET_Bottle
12310,1,100 // Spray_Of_Flowers
12311,1,100 // Large_Spray_Of_Flowers
12313,1,100 // Protection_Of_Angel
12323,1,100 // N_Fly_Wing
12324,1,100 // N_Butterfly_Wing
12325,1,100 // N_Magnifier
12340,1,100 // Mysterious_Rice_Powder
12347,1,100 // Acorn_Jelly
12350,1,100 // Angeling_Potion
12358,1,100 // Fan_Of_Wind
12359,1,100 // Very_Soft_Plant
12360,1,100 // Very_Red_Juice
12361,1,100 // Delicious_Shaved_Ice
12362,1,100 // Kuloren
12363,1,100 // Fit_Pipe
12364,1,100 // Staff_Of_Leader
12365,1,100 // Charming_Lotus
12366,1,100 // Gril_Doll
12367,1,100 // Luxury_Whisky_Bottle
12368,1,100 // Splendid_Mirror
12369,1,100 // Oilpalm_Coconut
12370,1,100 // Gril's_Naivety
12371,1,100 // Magical_Lithography
12372,1,100 // Hell_Contract
12373,1,100 // Boy's_Naivety
12374,1,100 // Flaming_Ice
12376,1,100 // Mysterious_Can2
12377,1,100 // Mysterious_PET_Bottle2
12388,1,100 // Runstone_Crush
12389,1,100 // Runstone_Storm
12390,1,100 // Runstone_Millennium
12396,1,100 // Fools_Day_Box
12397,1,100 // Fools_Day_Box2
12415,1,100 // Siege_Teleport_Scroll2
12473,1,100 // RWC_Parti_Box
12474,1,100 // RWC_Final_Comp_Box
12706,1,100 // Lucky_Cookie01
12707,1,100 // Lucky_Cookie02
12708,1,100 // Lucky_Cookie03
12725,1,100 // Runstone_Nosiege
12726,1,100 // Runstone_Rhydo
12727,1,100 // Runstone_Verkana
12728,1,100 // Runstone_Isia
12729,1,100 // Runstone_Asir
12730,1,100 // Runstone_Urj
12731,1,100 // Runstone_Turisus
12732,1,100 // Runstone_Pertz
12733,1,100 // Runstone_Hagalas
14521,1,100 // Repair_Scroll
14529,1,100 // Greed_Scroll
14532,1,100 // Battle_Manual25
14587,1,100 // Repair_Scroll_
14591,1,100 // Siege_Teleport_Scroll
14592,1,100 // Job_Manual50
14593,1,100 // Magic_Power_Scroll
14594,1,100 // Quagmire_Scroll
14599,1,100 // Greed_Scroll_C
14606,1,100 // Job_Manual25

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

93
db/pre-re/item_db.yml Normal file
View File

@ -0,0 +1,93 @@
# This file is a part of rAthena.
# Copyright(C) 2019 rAthena Development Team
# https://rathena.org - https://github.com/rathena
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
###########################################################################
# Item Database
###########################################################################
#
# Item Settings
#
###########################################################################
# - Id Item ID.
# AegisName Server name to reference the item in scripts and lookups, should use no spaces.
# Name Name in English for displaying as output.
# Type Item type. (Default: Etc)
# SubType Weapon or Ammo type. (Default: 0)
# Buy Buying price. When not specified, becomes double the sell price. (Default: 0)
# Sell Selling price. When not specified, becomes half the buy price. (Default: 0)
# Weight Item weight. Each 10 is 1 weight. (Default: 0)
# Attack Weapon's attack. (Default: 0)
# MagicAttack Weapon's magic attack. (Default: 0)
# Defense Armor's defense. (Default: 0)
# Range Weapon's attack range. (Default: 0)
# Slots Available slots in item. (Default: 0)
# Jobs Jobs that can equip the item. (Map default is 'All: true')
# Classes Upper class types that can equip the item. (Map default is 'All: true')
# Gender Gender that can equip the item. (Default: Both)
# Locations Equipment's placement. (Default: None)
# WeaponLevel Weapon level. (Default: 0)
# EquipLevelMin Minimum required level to equip. (Default: 0)
# EquipLevelMax Maximum level that can equip. (Default: 0)
# Refineable If the item can be refined. (Default: false)
# View View sprite of an item. (Default: 0)
# AliasName Another item's AegisName that will be sent to the client instead of this item's AegisName. (Default: null)
# Flags: Item flags. (Default: null)
# BuyingStore If the item is available for Buyingstores. (Default: false)
# DeadBranch If the item is a Dead Branch. (Default: false)
# Container If the item is part of a container. (Default: false)
# UniqueId If the item is a unique stack. (Default: false)
# BindOnEquip If the item is bound to the character upon equipping. (Default: false)
# DropAnnounce If the item has a special announcement to self on drop. (Default: false)
# NoConsume If the item is consumed on use. (Default: false)
# DropEffect If the item has a special effect when on the ground. (Default: None)
# Delay: Item use delay. (Default: null)
# Duration Duration of delay in seconds.
# Status Status Change used to track delay. (Default: None)
# Stack: Item stack amount. (Default: null)
# Amount Maximum amount that can be stacked.
# Inventory If the stack is applied to player's inventory. (Default: true)
# Cart If the stack is applied to the player's cart. (Default: false)
# Storage If the stack is applied to the player's storage. (Default: false)
# GuildStorage If the stack is applied to the player's guild storage. (Default: false)
# NoUse: Conditions when the item is unusable. (Default: null)
# Override Group level to override these conditions.
# Sitting If the item can not be used while sitting. (Default: false)
# Trade: Trade restrictions. (Default: null)
# Override Group level to override these conditions.
# NoDrop If the item can not be dropped. (Default: false)
# NoTrade If the item can not be traded. (Default: false)
# TradePartner If the item can not be traded to the player's partner. (Default: false)
# NoSell If the item can not be sold. (Default: false)
# NoCart If the item can not be put in a cart. (Default: false)
# NoStorage If the item can not be put in a storage. (Default: false)
# NoGuildStorage If the item can not be put in a guild storage. (Default: false)
# NoMail If the item can not be put in a mail. (Default: false)
# NoAuction If the item can not be put in an auction. (Default: false)
# Script Script to execute when the item is used/equipped. (Default: null)
# EquipScript Script to execute when the item is equipped. (Default: null)
# UnEquipScript Script to execute when the item is unequipped or when a rental item expires. (Default: null)
###########################################################################
Header:
Type: ITEM_DB
Version: 1
Footer:
Imports:
- Path: db/pre-re/item_db_usable.yml
- Path: db/pre-re/item_db_equip.yml
- Path: db/pre-re/item_db_etc.yml

38181
db/pre-re/item_db_equip.yml Normal file

File diff suppressed because it is too large Load Diff

21020
db/pre-re/item_db_etc.yml Normal file

File diff suppressed because it is too large Load Diff

22303
db/pre-re/item_db_usable.yml Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,58 +0,0 @@
// Item Delay Database
//
// Structure of Database:
// <ItemID>,<Delay>{,<SC_GroupID>}
//
// <ItemID>
// ID of item that will has reuse delay.
// <Delay>
// Re-use delay in milliseconds.
// <SC_GroupID>
// SC (status change) group for the item.
// Example for SC_REUSE_LIMIT_MTF
// 12658,10000,SC_REUSE_LIMIT_MTF // Transformation Scroll(Deviruchi)
// 12659,10000,SC_REUSE_LIMIT_MTF // Transformation Scroll(Raydric)
// -> 12658 has reuse delay for 10 seconds, and also,
// 12659 cannot be used when this delay is active.
// Since this is optional, default is -1 will ignores the
// delay group and the delay will be stored in character's
// data that has limit set in src/map/itemdb.hpp as MAX_ITEMDELAYS.
// SC_REUSE_LIMIT_A
14538,300000,SC_REUSE_LIMIT_A //Glass_Of_Illusion
// SC_REUSE_LIMIT_B
14586,180000,SC_REUSE_LIMIT_B //Spark_Candy
// SC_REUSE_LIMIT_C
12208,60000,SC_REUSE_LIMIT_C //Battle_Manual
// SC_REUSE_LIMIT_D
12210,60000,SC_REUSE_LIMIT_D //Bubble_Gum
// SC_REUSE_LIMIT_E
11522,1000,SC_REUSE_LIMIT_E //Red_Raffle_Sap
11523,2000,SC_REUSE_LIMIT_E //Yellow_Raffle_Sap
11524,3000,SC_REUSE_LIMIT_E //White_Raffle_Sap
// SC_REUSE_LIMIT_F
607,5000,SC_REUSE_LIMIT_F //Yggdrasil_Berry
// SC_REUSE_LIMIT_G
608,3000,SC_REUSE_LIMIT_G //Yggdrasil_Seed
// SC_REUSE_LIMIT_H
11525,5000,SC_REUSE_LIMIT_H //Mora_Hip_Tea
// SC_REUSE_LIMIT_RECALL
12968,300000,SC_REUSE_LIMIT_RECALL //Emergency_Scroll1
12969,300000,SC_REUSE_LIMIT_RECALL //Emergency_Scroll2
12970,300000,SC_REUSE_LIMIT_RECALL //Emergency_Scroll3
// Misc
//12202,60000 //Str_Dish10_
//12203,60000 //Agi_Dish10_
//12204,60000 //Int_Dish10_
//12205,60000 //Dex_Dish10_
//12206,60000 //Luk_Dish10_
//12207,60000 //Vit_Dish10_

View File

@ -1,63 +0,0 @@
// Flagged Items
// <ItemID>,<Flag>
//
// <Flag>:
// 1 - As Dead Branch item (will be logged at `branchlog` table and cannot be used at 'nobranch' mapflag)
// 2 - As item group container, check player's inventory and weight before consumed
// 4 - GUID Item: When this item is obtained, will generates GUID that cannot be stacked even same or stackable item
// 8 - Item will be bound item when equipped
// 16 - Special Broadcast: When item dropped by monster and player loot it, will be broadcasted!
// 32 - Item will not be removed on consumption. Also supports 'itemskill'
// 64 - Item will be displayed with a client side defined drop
// 128 - Item will be displayed with a white pillar drop effect
// 256 - Item will be displayed with a blue pillar drop effect
// 512 - Item will be displayed with a yellow pillar drop effect
// 1024 - Item will be displayed with a purple pillar drop effect
// 2048 - Item will be displayed with a orange pillar drop effect
// NOTE: For removing flag by import file, use "-" to remove the flag. Example, 604,-1 will removes flag 1 from Branch_Of_Dead_Tree
// Logged as Dead Branch item
604,1 //Branch_Of_Dead_Tree
12103,1 //Bloody_Dead_Branch
12109,1 //Poring_Box
12024,1 //Red_Pouch_Of_Surprise
// Item group container
603,2 //Old_Blue_Box
616,2 //Old_Card_Album
617,2 //Old_Violet_Box
618,2 //Worn_Out_Scroll
644,2 //Gift_Box
664,2 //Gift_Box_1
665,2 //Gift_Box_2
666,2 //Gift_Box_3
667,2 //Gift_Box_4
12023,2 //Giftbox_China
12025,2 //Egg_Boy
12026,2 //Egg_Girl
12038,2 //Lotto_Box04
12104,2 //Random_Quiver
12105,2 //Set_Of_Taiming_Item
12106,2 //Accessory_Box
12107,2 //Wrapped_Mask
12108,2 //Bundle_Of_Magic_Scroll
12110,2 //First_Aid_Kit
12111,2 //Food_Package
12130,2 //Cookie_Bag
12186,2 //Red_Box
12187,2 //Green_Box
12189,2 //Red_Box_
12194,2 //Hometown_Gift
12240,2 //Old_Yellow_Box
12244,2 //Old_Gift_Box
12246,2 //Magic_Card_Album
12248,2 //Masquerade_Ball_Box
12281,2 //Tresure_Box_WoE
12286,2 //Masquerade_Ball_Box2
12334,2 //Cherish_Box
12339,2 //Cherish_Box_Ori
12355,2 //Xmas_Gift
12356,2 //Louise_Costume_Box
12702,2 //Old_Bleu_Box
12714,2 //Easter_Scroll
14596,2 //Pierre_Treasurebox

View File

@ -1,29 +0,0 @@
// Item Stacking Restriction File
// Prevents an item to be stacked more than x times in given
// inventory types. Generally used by 3rd class related skill items.
//
// Structure of Database:
// ItemID,MaxStackAmount,Type
//
// MaxStackAmount:
// Stack limit for the item. Use 0 to disable a restriction.
//
// Type mask values:
// &1: Character inventory restriction
// &2: Character cart restriction
// &4: Account storage restriction
// &8: Guild storage restriction
//
// Example:
// 512,4,12 // Will not allow more than 4 Apples in storages.
// Rune Knight
12725,60,1 // Nauthiz Rune
12726,60,1 // Raido Rune
12727,60,1 // Berkana Rune
12728,60,1 // Isa Rune
12730,60,1 // Uruz Rune
12733,60,1 // Hagalaz Rune
// Arch Bishop
12333,3,1 // Ancilla

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

93
db/re/item_db.yml Normal file
View File

@ -0,0 +1,93 @@
# This file is a part of rAthena.
# Copyright(C) 2019 rAthena Development Team
# https://rathena.org - https://github.com/rathena
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
###########################################################################
# Item Database
###########################################################################
#
# Item Settings
#
###########################################################################
# - Id Item ID.
# AegisName Server name to reference the item in scripts and lookups, should use no spaces.
# Name Name in English for displaying as output.
# Type Item type. (Default: Etc)
# SubType Weapon or Ammo type. (Default: 0)
# Buy Buying price. When not specified, becomes double the sell price. (Default: 0)
# Sell Selling price. When not specified, becomes half the buy price. (Default: 0)
# Weight Item weight. Each 10 is 1 weight. (Default: 0)
# Attack Weapon's attack. (Default: 0)
# MagicAttack Weapon's magic attack. (Default: 0)
# Defense Armor's defense. (Default: 0)
# Range Weapon's attack range. (Default: 0)
# Slots Available slots in item. (Default: 0)
# Jobs Jobs that can equip the item. (Map default is 'All: true')
# Classes Upper class types that can equip the item. (Map default is 'All: true')
# Gender Gender that can equip the item. (Default: Both)
# Locations Equipment's placement. (Default: None)
# WeaponLevel Weapon level. (Default: 0)
# EquipLevelMin Minimum required level to equip. (Default: 0)
# EquipLevelMax Maximum level that can equip. (Default: 0)
# Refineable If the item can be refined. (Default: false)
# View View sprite of an item. (Default: 0)
# AliasName Another item's AegisName that will be sent to the client instead of this item's AegisName. (Default: null)
# Flags: Item flags. (Default: null)
# BuyingStore If the item is available for Buyingstores. (Default: false)
# DeadBranch If the item is a Dead Branch. (Default: false)
# Container If the item is part of a container. (Default: false)
# UniqueId If the item is a unique stack. (Default: false)
# BindOnEquip If the item is bound to the character upon equipping. (Default: false)
# DropAnnounce If the item has a special announcement to self on drop. (Default: false)
# NoConsume If the item is consumed on use. (Default: false)
# DropEffect If the item has a special effect when on the ground. (Default: None)
# Delay: Item use delay. (Default: null)
# Duration Duration of delay in seconds.
# Status Status Change used to track delay. (Default: None)
# Stack: Item stack amount. (Default: null)
# Amount Maximum amount that can be stacked.
# Inventory If the stack is applied to player's inventory. (Default: true)
# Cart If the stack is applied to the player's cart. (Default: false)
# Storage If the stack is applied to the player's storage. (Default: false)
# GuildStorage If the stack is applied to the player's guild storage. (Default: false)
# NoUse: Conditions when the item is unusable. (Default: null)
# Override Group level to override these conditions.
# Sitting If the item can not be used while sitting. (Default: false)
# Trade: Trade restrictions. (Default: null)
# Override Group level to override these conditions.
# NoDrop If the item can not be dropped. (Default: false)
# NoTrade If the item can not be traded. (Default: false)
# TradePartner If the item can not be traded to the player's partner. (Default: false)
# NoSell If the item can not be sold. (Default: false)
# NoCart If the item can not be put in a cart. (Default: false)
# NoStorage If the item can not be put in a storage. (Default: false)
# NoGuildStorage If the item can not be put in a guild storage. (Default: false)
# NoMail If the item can not be put in a mail. (Default: false)
# NoAuction If the item can not be put in an auction. (Default: false)
# Script Script to execute when the item is used/equipped. (Default: null)
# EquipScript Script to execute when the item is equipped. (Default: null)
# UnEquipScript Script to execute when the item is unequipped or when a rental item expires. (Default: null)
###########################################################################
Header:
Type: ITEM_DB
Version: 1
Footer:
Imports:
- Path: db/re/item_db_usable.yml
- Path: db/re/item_db_equip.yml
- Path: db/re/item_db_etc.yml

101770
db/re/item_db_equip.yml Normal file

File diff suppressed because it is too large Load Diff

37402
db/re/item_db_etc.yml Normal file

File diff suppressed because it is too large Load Diff

46650
db/re/item_db_usable.yml Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,108 +0,0 @@
// Item Delay Database
//
// Structure of Database:
// <ItemID>,<Delay>{,<SC_GroupID>}
//
// <ItemID>
// ID of item that will has reuse delay.
// <Delay>
// Re-use delay in milliseconds.
// <SC_GroupID>
// SC (status change) group for the item.
// Example for SC_REUSE_LIMIT_MTF
// 12658,10000,SC_REUSE_LIMIT_MTF // Transformation Scroll(Deviruchi)
// 12659,10000,SC_REUSE_LIMIT_MTF // Transformation Scroll(Raydric)
// -> 12658 has reuse delay for 10 seconds, and also,
// 12659 cannot be used when this delay is active.
// Since this is optional, default is -1 will ignores the
// delay group and the delay will be stored in character's
// data that has limit set in src/map/itemdb.hpp as MAX_ITEMDELAYS.
// SC_REUSE_REFRESH
12725,120000,SC_REUSE_REFRESH //Runstone_Nosiege
// SC_REUSE_LIMIT_A
14538,300000,SC_REUSE_LIMIT_A //Glass_Of_Illusion
// SC_REUSE_LIMIT_B
12596,180000,SC_REUSE_LIMIT_B //Magic_Candy
14586,180000,SC_REUSE_LIMIT_B //Spark_Candy
// SC_REUSE_LIMIT_C
12208,60000,SC_REUSE_LIMIT_C //Battle_Manual
// SC_REUSE_LIMIT_D
12210,60000,SC_REUSE_LIMIT_D //Bubble_Gum
// SC_REUSE_LIMIT_E
11522,1000,SC_REUSE_LIMIT_E //Red_Raffle_Sap
11523,2000,SC_REUSE_LIMIT_E //Yellow_Raffle_Sap
11524,3000,SC_REUSE_LIMIT_E //White_Raffle_Sap
// SC_REUSE_LIMIT_F
607,5000,SC_REUSE_LIMIT_F //Yggdrasil_Berry
// SC_REUSE_LIMIT_G
608,3000,SC_REUSE_LIMIT_G //Yggdrasil_Seed
22559,3000,SC_REUSE_LIMIT_G //Mock_Strawberry
23042,3000,SC_REUSE_LIMIT_G //S_Seed_Of_Yggdrasil
// SC_REUSE_LIMIT_H
11525,5000,SC_REUSE_LIMIT_H //Mora_Hip_Tea
// SC_REUSE_LIMIT_MTF
12658,10000,SC_REUSE_LIMIT_MTF //Transformation Scroll(Deviruchi)
12659,10000,SC_REUSE_LIMIT_MTF //Transformation Scroll(Raydric)
12660,10000,SC_REUSE_LIMIT_MTF //Transformation Scroll(Mavka)
12661,10000,SC_REUSE_LIMIT_MTF //Transformation Scroll(Marduk)
12662,10000,SC_REUSE_LIMIT_MTF //Transformation Scroll(Banshee)
12663,10000,SC_REUSE_LIMIT_MTF //Transformation Scroll(Poring)
12664,10000,SC_REUSE_LIMIT_MTF //Transformation Scroll(Golem)
// SC_REUSE_LIMIT_ASPD_POTION
12684,900000,SC_REUSE_LIMIT_ASPD_POTION //ASPD_Potion
// SC_REUSE_MILLENNIUMSHIELD
12727,60000,SC_REUSE_MILLENNIUMSHIELD //Runstone_Verkana
// SC_REUSE_CRUSHSTRIKE
12726,30000,SC_REUSE_CRUSHSTRIKE //Runstone_Rhydo
// SC_REUSE_STORMBLAST
12732,1000,SC_REUSE_STORMBLAST //Runstone_Pertz
// SC_ALL_RIDING_REUSE_LIMIT
12622,3000,SC_ALL_RIDING_REUSE_LIMIT //Boarding_Halter
// SC_REUSE_LIMIT_ECL
12812,5000,SC_REUSE_LIMIT_ECL //Snow_Flip
12813,5000,SC_REUSE_LIMIT_ECL //Peony_Mommy
12814,5000,SC_REUSE_LIMIT_ECL //Slapping_Herb
12815,5000,SC_REUSE_LIMIT_ECL //Yggdrasil_Dust
// SC_REUSE_LIMIT_RECALL
12968,300000,SC_REUSE_LIMIT_RECALL //Emergency_Scroll1
12969,300000,SC_REUSE_LIMIT_RECALL //Emergency_Scroll2
12970,300000,SC_REUSE_LIMIT_RECALL //Emergency_Scroll3
// Misc
11621,1000 //Red_Syrup
11622,1000 //Yellow_Syrup
11623,1000 //White_Syrup
11624,10000 //Blue_Syrup
12135,3000 //Green_Ale
//12202,60000 //Str_Dish10_
//12203,60000 //Agi_Dish10_
//12204,60000 //Int_Dish10_
//12205,60000 //Dex_Dish10_
//12206,60000 //Luk_Dish10_
//12207,60000 //Vit_Dish10_
22508,1200000 //Para_Team_Mark_
22540,5000,SC_REUSE_LIMIT_LUXANIMA //Runstone_Lux
// Bed of Honor
22687,5000,SC_REUSE_LIMIT_F // Pieces_Of_Sentiment
23277,180000 //Mado_Box

File diff suppressed because it is too large Load Diff

View File

@ -1,21 +0,0 @@
// Item Stacking Restriction File
// Prevents an item to be stacked more than x times in given
// inventory types. Generally used by 3rd class related skill items.
//
// Structure of Database:
// ItemID,MaxStackAmount,Type
//
// MaxStackAmount:
// Stack limit for the item. Use 0 to disable a restriction.
//
// Type mask values:
// &1: Character inventory restriction
// &2: Character cart restriction
// &4: Account storage restriction
// &8: Guild storage restriction
//
// Example:
// 512,4,12 // Will not allow more than 4 Apples in storages.
// Arch Bishop
12333,3,1 // Ancilla

File diff suppressed because it is too large Load Diff

View File

@ -1368,7 +1368,7 @@ Affected files:
-- atcommand: atcommand_athena.conf, groups.conf
-- battleconf: battle_athena.conf, battle_conf.txt
-- instancedb: instance_db.txt
-- itemdb: item_db.txt, item_group_db.txt, item_trade.txt, item_noequip.txt, item_nouse.txt, item_combo_db.txt, item_avail.txt, item_stack.txt, item_delay.txt, item_buyingstore.txt, item_flag.txt, item_randomopt_db.txt, item_randomopt_group.txt
-- itemdb: item_db.yml, item_group_db.txt, item_noequip.txt, item_combo_db.txt, item_randomopt_db.txt, item_randomopt_group.txt
-- mobdb: mob_db.txt, mob_item_ratio.txt, mob_chat_db.txt, mob_avail.txt, mob_race2_db.txt, mob_branch.txt, mob_poring.txt, mob_boss.txt, mob_pouch.txt, mob_classchange.txt, pet_db.yml, homunculus_db.txt, homun_skill_tree.txt, exp_homun.txt, mercenary_db.txt, mercenary_skill_db.txt, elemental_db.txt, elemental_skill_db.txt
-- motd: motd.txt
-- msgconf: atcommand_athena.conf

View File

@ -67,9 +67,9 @@ This list contains all available constants referenced in the 'bonus' commands.
* Other values:
Skill (sk): see 'db/(pre-)re/skill_db.yml' (NOTE: Both skill IDs and names, in quotes, are supported.)
Monster id (mid): see 'db/(pre-)re/mob_db.txt'
Item id (iid): see 'db/(pre-)re/item_db.txt'
Item id (iid): see 'db/item_db.yml'
Item group (ig): see 'db/(pre-)re/item_group_db.txt' and the constants in 'db/const.txt', prefixed with IG_*
Weapon type (w): see 'doc/item_db.txt' -> View -> Weapons
Weapon type (w): see 'doc/item_db.txt' -> SubType
Bonuses

View File

@ -1,44 +1,82 @@
//===== rAthena Documentation ================================
//= Item Database
//= Item Database Structure
//===== By: ==================================================
//= rAthena Dev Team
//===== Last Updated: ========================================
//= 20160319
//= 20200602
//===== Description: =========================================
//= Explanation of the item_db.txt file and structure.
//= Explanation of the item_db.yml file and structure.
//============================================================
---------------------------------------
ID: Item id
Id: Item ID.
---------------------------------------
AegisName: Server name to reference the item in scripts and lookups,
should use no spaces.
AegisName: Server name to reference the item in scripts and lookups, should use no spaces.
---------------------------------------
Name: Name in English for displaying as output for @ and script commands.
Name: Name in English for displaying as output for atcommands and script commands.
---------------------------------------
Type:
0 Healing item.
2 Usable item.
3 Etc item
4 Armor/Garment/Boots/Headgear/Accessory
5 Weapon
6 Card
7 Pet egg
8 Pet equipment
10 Ammo (Arrows/Bullets/etc)
11 Usable with delayed consumption (intended for 'itemskill')
Items using the 'itemskill' script command are consumed after
selecting a target. Any other command will NOT consume the item.
12 Shadow Equipment
18 Another delayed consume that requires user confirmation before
using item.
Type: Item's type.
Healing - Healing item.
Usable - Usable item.
Etc - Etc item.
Armor - Armor/Garment/Boots/Headgear/Accessory item.
Weapon - Weapon item.
Card - Card item.
PetEgg - Pet egg item.
PetArmor - Pet equipment item.
Ammo - Ammo (Arrows/Bullets/etc) item.
DelayConsume - Usable with delayed consumption (intended for 'itemskill').
Items using the 'itemskill' script command are consumed after selecting a target. Any other command will NOT consume the item.
ShadowGear - Shadow Equipment item.
Cash - Another delayed consume that requires user confirmation before using the item.
---------------------------------------
SubType: Indicates the weapon-class of the item.
For weapons, the types are:
Fist
Dagger
1hSword
2hSword
1hSpear
2hSpear
1hAxe
2hAxe
Mace
Staff
Bow
Knuckle
Musical
Whip
Book
Katar
Revolver
Rifle
Gatling
Shotgun
Grenade
Huuma
2hStaff
For ammo, the types are:
Arrow
Dagger
Bullet
Shell
Grenade
Shuriken
Kunai
CannonBall
ThrowWeapon
---------------------------------------
@ -54,17 +92,19 @@ Weight: Item's weight. Each 10 is 1 weight.
---------------------------------------
ATK: Weapon's attack
MATK: Weapon's magic attack (Renewal only)
Attack: Weapon's attack.
---------------------------------------
DEF: Armor's defense
MagicAttack: Weapon's magic attack. (Renewal only)
---------------------------------------
Range: Weapon's attack range
Defense: Armor's defense.
---------------------------------------
Range: Weapon's attack range.
---------------------------------------
@ -72,146 +112,156 @@ Slots: Amount of slots the item possesses.
---------------------------------------
Job: Equippable jobs. Uses the following bitmask table:
(S.) Novice (2^00): 0x00000001
Swordman (2^01): 0x00000002
Magician (2^02): 0x00000004
Archer (2^03): 0x00000008
Acolyte (2^04): 0x00000010
Merchant (2^05): 0x00000020
Thief (2^06): 0x00000040
Knight (2^07): 0x00000080
Priest (2^08): 0x00000100
Wizard (2^09): 0x00000200
Blacksmith (2^10): 0x00000400
Hunter (2^11): 0x00000800
Assassin (2^12): 0x00001000
Unused (2^13): 0x00002000
Crusader (2^14): 0x00004000
Monk (2^15): 0x00008000
Sage (2^16): 0x00010000
Rogue (2^17): 0x00020000
Alchemist (2^18): 0x00040000
Bard/Dancer (2^19): 0x00080000
Unused (2^20): 0x00100000
Taekwon (2^21): 0x00200000
Star Gladiator (2^22): 0x00400000
Soul Linker (2^23): 0x00800000
Gunslinger (2^24): 0x01000000
Ninja (2^25): 0x02000000
Gangsi (2^26): 0x04000000
Death Knight (2^27): 0x08000000
Dark Collector (2^28): 0x10000000
Kagerou/Oboro (2^29): 0x20000000
Rebellion (2^30): 0x40000000
Summoner (2^31): 0x80000000
Jobs: Equippable jobs.
Novice + Swordman + Magician + Archer = 0x0000000F, why?
Because: 10 = A, 11 = B, 12 = C, 13 = D, 14 = E, and 15 = F
It's using hexadecimal.
All - Applies to all jobs listed below.
Acolyte
Alchemist
Archer
Assassin
BardDancer - Applies to Bard and Dancer.
Blacksmith
Crusader
Gunslinger
Hunter
KagerouOboro - Applies to Kagerou and Oboro.
Knight
Mage
Merchant
Monk
Ninja
Novice
Priest
Rebellion
Rogue
Sage
SoulLinker
StarGladiator
Summoner
SuperNovice
Swordman
Taekwon
Thief
Wizard
---------------------------------------
Class: Equippable upper-types. Uses the following bitmasks:
1: Normal classes (no Baby/Transcendent/Third classes)
2: Transcedent classes (no Transcedent-Third classes)
4: Baby classes (no Third-Baby classes)
8: Third classes (no Transcedent-Third or Third-Baby classes)
16: Transcedent-Third classes
32: Third-Baby classes
Classes: Equippable upper-types.
All - Applies to all classes.
Normal - Normal classes (no Baby/Transcendent/Third classes).
Upper - Transcedent classes (no Transcedent-Third classes).
Baby - Baby classes (no Third-Baby classes).
Third - Third classes (no Transcedent-Third or Third-Baby classes).
Third_Upper - Transcedent-Third classes.
Third_Baby - Third-Baby classes.
---------------------------------------
Gender: Gender restriction. 0 is female, 1 is male, 2 for both.
Gender: Gender restriction.
Female
Male
Both
---------------------------------------
Loc: Equipment's placement. Values are:
2^8 256 = Upper Headgear
2^9 512 = Middle Headgear
2^0 001 = Lower Headgear
2^4 016 = Armor
2^1 002 = Weapon
2^5 032 = Shield
2^2 004 = Garment
2^6 064 = Footgear
2^3 008 = Accessory Right
2^7 128 = Accessory Left
2^10 1024 = Costume Top Headgear
2^11 2048 = Costume Mid Headgear
2^12 4096 = Costume Low Headgear
2^13 8192 = Costume Garment/Robe
2^15 32768 = Ammo
2^16 65536 = Shadow Armor
2^17 131072 = Shadow Weapon
2^18 262144 = Shadow Shield
2^19 524288 = Shadow Shoes
2^20 1048576 = Shadow Accessory Right (Earring)
2^21 2097152 = Shadow Accessory Left (Pendant)
Locations: Equipment's placement.
Head_Top - Upper Headgear
Head_Mid - Middle Headgear
Head_Low - Lower Headgear
Armor - Armor
Right_Hand - Weapon
Left_Hand - Shield
Garment - Garment/Robe
Shoes - Shoes
Right_Accessory - Accessory Right
Left_Accessory - Accessory Left
Costume_Head_Top - Costume Top Headgear
Costume_Head_Mid - Costume Mid Headgear
Costume_Head_Low - Costume Low Headgear
Costume_Garment - Costume Garment/Robe
Ammo - Ammo
Shadow_Armor - Shadow Armor
Shadow_Weapon - Shadow Weapon
Shadow_Shield - Shadow Shield
Shadow_Shoes - Shadow Shoes
Shadow_Right_Accessory - Shadow Accessory Right (Earring)
Shadow_Left_Accessory - Shadow Accessory Left (Pendant)
---------------------------------------
wLV: Weapon level.
WeaponLevel: Weapon level. Used for refinement.
---------------------------------------
eLV: Base level required to be able to equip.
maxLevel: Only able to equip if base level is lower than this.
EquipLevelMin: Base level required to be able to equip.
---------------------------------------
Refineable: 1 if the item can be refined, 0 otherwise.
EquipLevelMax: Only able to equip if base level is lower than this.
---------------------------------------
View: For normal items, defines a replacement view-sprite for the item (eg:
Making apples look like apple juice). The special case are weapons
and ammo where this value indicates the weapon-class of the item.
Refineable: Defines if the item can be refined.
For weapons, the types are:
0: bare fist
1: Daggers
2: One-handed swords
3: Two-handed swords
4: One-handed spears
5: Two-handed spears
6: One-handed axes
7: Two-handed axes
8: Maces
9: Unused
10: Staves
11: Bows
12: Knuckles
13: Musical Instruments
14: Whips
15: Books
16: Katars
17: Revolvers
18: Rifles
19: Gatling guns
20: Shotguns
21: Grenade launchers
22: Fuuma Shurikens
23: Two-handed staves
24: Max Type
25: Dual-wield Daggers
26: Dual-wield Swords
27: Dual-wield Axes
28: Dagger + Sword
29: Dagger + Axe
30: Sword + Axe
---------------------------------------
For ammo, the types are:
1: Arrows
2: Throwable daggers
3: Bullets
4: Shells
5: Grenades
6: Shuriken
7: Kunai
8: Cannonballs
9: Throwable Items (Sling Item)
View: For normal items, defines a replacement view-sprite for the item.
---------------------------------------
AliasName: Use the AegisName of another item which will be sent to the client instead of this item.
This makes items visually appear as another without having to change the client data.
---------------------------------------
Flags: Different types of flags for an item.
BuyingStore - If the item is available to Buying Stores.
DeadBranch - If the item is a Dead Branch type.
Container - If the item is part of a Container.
UniqueId - If the item is a unique stack.
BindOnEquip - If the item is bound to the character upon equipping.
DropAnnounce - If the item has a special announcement to self on drop.
NoConsume - If the item is consumed on use.
DropEffect - If the item has a special effect when on the ground.
---------------------------------------
Delay: Item use delay.
Duration - Duration of delay in seconds.
Status - Status Change used to keep track of the delay.
---------------------------------------
Stack: Item stack amount.
Amount - Maximum amount that can be stacked.
Inventory - If the stack is applied to player's inventory.
Cart - If the stack is applied to the player's cart.
Storage - If the stack is applied to the player's storage.
GuildStorage - If the stack is applied to the player's guild storage.
---------------------------------------
NoUse: Conditions when the item is unusable.
Override - Group level to override these conditions.
Sitting - If the item can not be used while sitting.
---------------------------------------
Trade: Trade restrictions.
Override - Group level to override these conditions.
NoDrop - If the item can not be dropped.
NoTrade - If the item can not be traded.
TradePartner - If the item can not be traded to the player's partner.
NoSell - If the item can not be sold.
NoCart - If the item can not be put in a cart.
NoStorage - If the item can not be put in a storage.
NoGuildStorage - If the item can not be put in a guild storage.
NoMail - If the item can not be put in a mail.
NoAuction - If the item can not be put in an auction.
---------------------------------------
@ -224,8 +274,5 @@ OnEquip_Script: Script to execute when the item is equipped.
---------------------------------------
OnUnequip_Script: Script to execute when the item is unequipped
or when a rental item expires.
OnUnequip_Script: Script to execute when the item is unequipped or when a rental item expires.
Warning, not all item bonuses will work here as expected.
---------------------------------------

View File

@ -296,7 +296,7 @@ clicking) will cause a shop window to come up. No code whatsoever runs in shop
NPCs and you can't change the prices otherwise than by editing the script
itself.
The Item ID is the number of item in the 'item_db.txt' database. If Price is set
The Item ID is the number of item in the 'db/item_db.yml' database. If Price is set
to -1, the 'buy price' given in the item database will be used. Otherwise, the
price you gave will be used for this item, which is how you create differing
prices for items in different shops.
@ -1901,7 +1901,7 @@ Example 3:
Example 4:
mes "[Quest Person]";
if (countitem(512) < 1) { // 512 is the item ID for Apple, found in item_db
if (countitem(512) < 1) { // 512 is the item ID for Apple, found in db/item_db.yml
mes "Can you please bring me an apple?";
close;
}
@ -4596,7 +4596,7 @@ online, items will be created in their inventory instead. If they are not
online, nothing will happen.
In the first and most commonly used version of this command, items are
referred to by their database ID number found inside 'db/(pre-)re/item_db.txt'.
referred to by their database ID number found inside 'db/item_db.yml'.
getitem 502,10 // The person will receive 10 apples
getitem 617,1 // The person will receive 1 Old Violet Box
@ -4902,7 +4902,7 @@ the results array is limited to 10 items.
*delitem "<item name>",<amount>{,<account ID>};
This command will remove a specified amount of items from the invoking/target character.
Like all the item commands, it uses the item ID found inside 'db/(pre-)re/item_db.txt'.
Like all the item commands, it uses the item ID found inside 'db/item_db.yml'.
delitem 502,10; // The person will lose 10 apples
delitem 617,1; // The person will lose 1 Old Violet Box
@ -5239,7 +5239,7 @@ a rune and has the appropriate raw materials in their inventory.
*successremovecards <equipment slot>;
This command will remove all cards of the cards slots defined by item_db.txt
This command will remove all cards of the cards slots defined in db/item_db.yml
from the item found in the specified equipment slot of the invoking character,
create new card items and give them to the character.
If any cards were removed in this manner, it will also show a success effect.

66
doc/yaml/db/item_db.yml Normal file
View File

@ -0,0 +1,66 @@
###########################################################################
# Item Database
###########################################################################
#
# Item Settings
#
###########################################################################
# - Id Item ID.
# AegisName Server name to reference the item in scripts and lookups, should use no spaces.
# Name Name in English for displaying as output.
# Type Item type. (Default: Etc)
# SubType Weapon or Ammo type. (Default: 0)
# Buy Buying price. When not specified, becomes double the sell price. (Default: 0)
# Sell Selling price. When not specified, becomes half the buy price. (Default: 0)
# Weight Item weight. Each 10 is 1 weight. (Default: 0)
# Attack Weapon's attack. (Default: 0)
# MagicAttack Weapon's magic attack. (Default: 0)
# Defense Armor's defense. (Default: 0)
# Range Weapon's attack range. (Default: 0)
# Slots Available slots in item. (Default: 0)
# Jobs Jobs that can equip the item. (Map default is 'All: true')
# Classes Upper class types that can equip the item. (Map default is 'All: true')
# Gender Gender that can equip the item. (Default: Both)
# Locations Equipment's placement. (Default: None)
# WeaponLevel Weapon level. (Default: 0)
# EquipLevelMin Minimum required level to equip. (Default: 0)
# EquipLevelMax Maximum level that can equip. (Default: 0)
# Refineable If the item can be refined. (Default: false)
# View View sprite of an item. (Default: 0)
# AliasName Another item's AegisName that will be sent to the client instead of this item's AegisName. (Default: null)
# Flags: Item flags. (Default: null)
# BuyingStore If the item is available for Buyingstores. (Default: false)
# DeadBranch If the item is a Dead Branch. (Default: false)
# Container If the item is part of a container. (Default: false)
# UniqueId If the item is a unique stack. (Default: false)
# BindOnEquip If the item is bound to the character upon equipping. (Default: false)
# DropAnnounce If the item has a special announcement to self on drop. (Default: false)
# NoConsume If the item is consumed on use. (Default: false)
# DropEffect If the item has a special effect when on the ground. (Default: None)
# Delay: Item use delay. (Default: null)
# Duration Duration of delay in seconds.
# Status Status Change used to track delay. (Default: None)
# Stack: Item stack amount. (Default: null)
# Amount Maximum amount that can be stacked.
# Inventory If the stack is applied to player's inventory. (Default: true)
# Cart If the stack is applied to the player's cart. (Default: false)
# Storage If the stack is applied to the player's storage. (Default: false)
# GuildStorage If the stack is applied to the player's guild storage. (Default: false)
# NoUse: Conditions when the item is unusable. (Default: null)
# Override Group level to override these conditions.
# Sitting If the item can not be used while sitting. (Default: false)
# Trade: Trade restrictions. (Default: null)
# Override Group level to override these conditions.
# NoDrop If the item can not be dropped. (Default: false)
# NoTrade If the item can not be traded. (Default: false)
# TradePartner If the item can not be traded to the player's partner. (Default: false)
# NoSell If the item can not be sold. (Default: false)
# NoCart If the item can not be put in a cart. (Default: false)
# NoStorage If the item can not be put in a storage. (Default: false)
# NoGuildStorage If the item can not be put in a guild storage. (Default: false)
# NoMail If the item can not be put in a mail. (Default: false)
# NoAuction If the item can not be put in an auction. (Default: false)
# Script Script to execute when the item is used/equipped. (Default: null)
# EquipScript Script to execute when the item is equipped. (Default: null)
# UnEquipScript Script to execute when the item is unequipped or when a rental item expires. (Default: null)
###########################################################################

109
doc/yaml/sql/item_db.sql Normal file
View File

@ -0,0 +1,109 @@
#
# Table structure for table `item_db`
#
DROP TABLE IF EXISTS `item_db`;
CREATE TABLE `item_db` (
`id` int(10) unsigned NOT NULL DEFAULT '0',
`name_aegis` varchar(50) NOT NULL DEFAULT '',
`name_english` varchar(50) NOT NULL DEFAULT '',
`type` varchar(20) DEFAULT NULL,
`subtype` varchar(20) DEFAULT NULL,
`price_buy` mediumint(8) unsigned DEFAULT NULL,
`price_sell` mediumint(8) unsigned DEFAULT NULL,
`weight` smallint(5) unsigned DEFAULT NULL,
`attack` smallint(5) unsigned DEFAULT NULL,
`defense` smallint(5) unsigned DEFAULT NULL,
`range` tinyint(2) unsigned DEFAULT NULL,
`slots` tinyint(2) unsigned DEFAULT NULL,
`job_all` tinyint(1) unsigned DEFAULT NULL,
`job_acolyte` tinyint(1) unsigned DEFAULT NULL,
`job_alchemist` tinyint(1) unsigned DEFAULT NULL,
`job_archer` tinyint(1) unsigned DEFAULT NULL,
`job_assassin` tinyint(1) unsigned DEFAULT NULL,
`job_barddancer` tinyint(1) unsigned DEFAULT NULL,
`job_blacksmith` tinyint(1) unsigned DEFAULT NULL,
`job_crusader` tinyint(1) unsigned DEFAULT NULL,
`job_gunslinger` tinyint(1) unsigned DEFAULT NULL,
`job_hunter` tinyint(1) unsigned DEFAULT NULL,
`job_knight` tinyint(1) unsigned DEFAULT NULL,
`job_mage` tinyint(1) unsigned DEFAULT NULL,
`job_merchant` tinyint(1) unsigned DEFAULT NULL,
`job_monk` tinyint(1) unsigned DEFAULT NULL,
`job_ninja` tinyint(1) unsigned DEFAULT NULL,
`job_novice` tinyint(1) unsigned DEFAULT NULL,
`job_priest` tinyint(1) unsigned DEFAULT NULL,
`job_rogue` tinyint(1) unsigned DEFAULT NULL,
`job_sage` tinyint(1) unsigned DEFAULT NULL,
`job_soullinker` tinyint(1) unsigned DEFAULT NULL,
`job_stargladiator` tinyint(1) unsigned DEFAULT NULL,
`job_supernovice` tinyint(1) unsigned DEFAULT NULL,
`job_swordman` tinyint(1) unsigned DEFAULT NULL,
`job_taekwon` tinyint(1) unsigned DEFAULT NULL,
`job_thief` tinyint(1) unsigned DEFAULT NULL,
`job_wizard` tinyint(1) unsigned DEFAULT NULL,
`class_all` tinyint(1) unsigned DEFAULT NULL,
`class_normal` tinyint(1) unsigned DEFAULT NULL,
`class_upper` tinyint(1) unsigned DEFAULT NULL,
`class_baby` tinyint(1) unsigned DEFAULT NULL,
`gender` varchar(10) DEFAULT NULL,
`location_head_top` tinyint(1) unsigned DEFAULT NULL,
`location_head_mid` tinyint(1) unsigned DEFAULT NULL,
`location_head_low` tinyint(1) unsigned DEFAULT NULL,
`location_armor` tinyint(1) unsigned DEFAULT NULL,
`location_right_hand` tinyint(1) unsigned DEFAULT NULL,
`location_left_hand` tinyint(1) unsigned DEFAULT NULL,
`location_garment` tinyint(1) unsigned DEFAULT NULL,
`location_shoes` tinyint(1) unsigned DEFAULT NULL,
`location_right_accessory` tinyint(1) unsigned DEFAULT NULL,
`location_left_accessory` tinyint(1) unsigned DEFAULT NULL,
`location_costume_head_top` tinyint(1) unsigned DEFAULT NULL,
`location_costume_head_mid` tinyint(1) unsigned DEFAULT NULL,
`location_costume_head_low` tinyint(1) unsigned DEFAULT NULL,
`location_costume_garment` tinyint(1) unsigned DEFAULT NULL,
`location_ammo` tinyint(1) unsigned DEFAULT NULL,
`location_shadow_armor` tinyint(1) unsigned DEFAULT NULL,
`location_shadow_weapon` tinyint(1) unsigned DEFAULT NULL,
`location_shadow_shield` tinyint(1) unsigned DEFAULT NULL,
`location_shadow_shoes` tinyint(1) unsigned DEFAULT NULL,
`location_shadow_right_accessory` tinyint(1) unsigned DEFAULT NULL,
`location_shadow_left_accessory` tinyint(1) unsigned DEFAULT NULL,
`weapon_level` tinyint(1) unsigned DEFAULT NULL,
`equip_level_min` tinyint(3) unsigned DEFAULT NULL,
`equip_level_max` tinyint(3) unsigned DEFAULT NULL,
`refineable` tinyint(1) unsigned DEFAULT NULL,
`view` smallint(5) unsigned DEFAULT NULL,
`alias_name` varchar(50) DEFAULT NULL,
`flag_buyingstore` tinyint(1) unsigned DEFAULT NULL,
`flag_deadbranch` tinyint(1) unsigned DEFAULT NULL,
`flag_container` tinyint(1) unsigned DEFAULT NULL,
`flag_uniqueid` tinyint(1) unsigned DEFAULT NULL,
`flag_bindonequip` tinyint(1) unsigned DEFAULT NULL,
`flag_dropannounce` tinyint(1) unsigned DEFAULT NULL,
`flag_noconsume` tinyint(1) unsigned DEFAULT NULL,
`flag_dropeffect` varchar(20) DEFAULT NULL,
`delay_duration` bigint(20) unsigned DEFAULT NULL,
`delay_status` varchar(30) DEFAULT NULL,
`stack_amount` smallint(5) unsigned DEFAULT NULL,
`stack_inventory` tinyint(1) unsigned DEFAULT NULL,
`stack_cart` tinyint(1) unsigned DEFAULT NULL,
`stack_storage` tinyint(1) unsigned DEFAULT NULL,
`stack_guildstorage` tinyint(1) unsigned DEFAULT NULL,
`nouse_override` smallint(5) unsigned DEFAULT NULL,
`nouse_sitting` tinyint(1) unsigned DEFAULT NULL,
`trade_override` smallint(5) unsigned DEFAULT NULL,
`trade_nodrop` tinyint(1) unsigned DEFAULT NULL,
`trade_notrade` tinyint(1) unsigned DEFAULT NULL,
`trade_tradepartner` tinyint(1) unsigned DEFAULT NULL,
`trade_nosell` tinyint(1) unsigned DEFAULT NULL,
`trade_nocart` tinyint(1) unsigned DEFAULT NULL,
`trade_nostorage` tinyint(1) unsigned DEFAULT NULL,
`trade_noguildstorage` tinyint(1) unsigned DEFAULT NULL,
`trade_nomail` tinyint(1) unsigned DEFAULT NULL,
`trade_noauction` tinyint(1) unsigned DEFAULT NULL,
`script` text,
`equip_script` text,
`unequip_script` text,
PRIMARY KEY (`id`),
UNIQUE INDEX `UniqueAegisName` (`name_aegis`)
) ENGINE=MyISAM;

109
doc/yaml/sql/item_db2.sql Normal file
View File

@ -0,0 +1,109 @@
#
# Table structure for table `item_db2`
#
DROP TABLE IF EXISTS `item_db2`;
CREATE TABLE `item_db2` (
`id` int(10) unsigned NOT NULL DEFAULT '0',
`name_aegis` varchar(50) NOT NULL DEFAULT '',
`name_english` varchar(50) NOT NULL DEFAULT '',
`type` varchar(20) DEFAULT NULL,
`subtype` varchar(20) DEFAULT NULL,
`price_buy` mediumint(8) unsigned DEFAULT NULL,
`price_sell` mediumint(8) unsigned DEFAULT NULL,
`weight` smallint(5) unsigned DEFAULT NULL,
`attack` smallint(5) unsigned DEFAULT NULL,
`defense` smallint(5) unsigned DEFAULT NULL,
`range` tinyint(2) unsigned DEFAULT NULL,
`slots` tinyint(2) unsigned DEFAULT NULL,
`job_all` tinyint(1) unsigned DEFAULT NULL,
`job_acolyte` tinyint(1) unsigned DEFAULT NULL,
`job_alchemist` tinyint(1) unsigned DEFAULT NULL,
`job_archer` tinyint(1) unsigned DEFAULT NULL,
`job_assassin` tinyint(1) unsigned DEFAULT NULL,
`job_barddancer` tinyint(1) unsigned DEFAULT NULL,
`job_blacksmith` tinyint(1) unsigned DEFAULT NULL,
`job_crusader` tinyint(1) unsigned DEFAULT NULL,
`job_gunslinger` tinyint(1) unsigned DEFAULT NULL,
`job_hunter` tinyint(1) unsigned DEFAULT NULL,
`job_knight` tinyint(1) unsigned DEFAULT NULL,
`job_mage` tinyint(1) unsigned DEFAULT NULL,
`job_merchant` tinyint(1) unsigned DEFAULT NULL,
`job_monk` tinyint(1) unsigned DEFAULT NULL,
`job_ninja` tinyint(1) unsigned DEFAULT NULL,
`job_novice` tinyint(1) unsigned DEFAULT NULL,
`job_priest` tinyint(1) unsigned DEFAULT NULL,
`job_rogue` tinyint(1) unsigned DEFAULT NULL,
`job_sage` tinyint(1) unsigned DEFAULT NULL,
`job_soullinker` tinyint(1) unsigned DEFAULT NULL,
`job_stargladiator` tinyint(1) unsigned DEFAULT NULL,
`job_supernovice` tinyint(1) unsigned DEFAULT NULL,
`job_swordman` tinyint(1) unsigned DEFAULT NULL,
`job_taekwon` tinyint(1) unsigned DEFAULT NULL,
`job_thief` tinyint(1) unsigned DEFAULT NULL,
`job_wizard` tinyint(1) unsigned DEFAULT NULL,
`class_all` tinyint(1) unsigned DEFAULT NULL,
`class_normal` tinyint(1) unsigned DEFAULT NULL,
`class_upper` tinyint(1) unsigned DEFAULT NULL,
`class_baby` tinyint(1) unsigned DEFAULT NULL,
`gender` varchar(10) DEFAULT NULL,
`location_head_top` tinyint(1) unsigned DEFAULT NULL,
`location_head_mid` tinyint(1) unsigned DEFAULT NULL,
`location_head_low` tinyint(1) unsigned DEFAULT NULL,
`location_armor` tinyint(1) unsigned DEFAULT NULL,
`location_right_hand` tinyint(1) unsigned DEFAULT NULL,
`location_left_hand` tinyint(1) unsigned DEFAULT NULL,
`location_garment` tinyint(1) unsigned DEFAULT NULL,
`location_shoes` tinyint(1) unsigned DEFAULT NULL,
`location_right_accessory` tinyint(1) unsigned DEFAULT NULL,
`location_left_accessory` tinyint(1) unsigned DEFAULT NULL,
`location_costume_head_top` tinyint(1) unsigned DEFAULT NULL,
`location_costume_head_mid` tinyint(1) unsigned DEFAULT NULL,
`location_costume_head_low` tinyint(1) unsigned DEFAULT NULL,
`location_costume_garment` tinyint(1) unsigned DEFAULT NULL,
`location_ammo` tinyint(1) unsigned DEFAULT NULL,
`location_shadow_armor` tinyint(1) unsigned DEFAULT NULL,
`location_shadow_weapon` tinyint(1) unsigned DEFAULT NULL,
`location_shadow_shield` tinyint(1) unsigned DEFAULT NULL,
`location_shadow_shoes` tinyint(1) unsigned DEFAULT NULL,
`location_shadow_right_accessory` tinyint(1) unsigned DEFAULT NULL,
`location_shadow_left_accessory` tinyint(1) unsigned DEFAULT NULL,
`weapon_level` tinyint(1) unsigned DEFAULT NULL,
`equip_level_min` tinyint(3) unsigned DEFAULT NULL,
`equip_level_max` tinyint(3) unsigned DEFAULT NULL,
`refineable` tinyint(1) unsigned DEFAULT NULL,
`view` smallint(5) unsigned DEFAULT NULL,
`alias_name` varchar(50) DEFAULT NULL,
`flag_buyingstore` tinyint(1) unsigned DEFAULT NULL,
`flag_deadbranch` tinyint(1) unsigned DEFAULT NULL,
`flag_container` tinyint(1) unsigned DEFAULT NULL,
`flag_uniqueid` tinyint(1) unsigned DEFAULT NULL,
`flag_bindonequip` tinyint(1) unsigned DEFAULT NULL,
`flag_dropannounce` tinyint(1) unsigned DEFAULT NULL,
`flag_noconsume` tinyint(1) unsigned DEFAULT NULL,
`flag_dropeffect` varchar(20) DEFAULT NULL,
`delay_duration` bigint(20) unsigned DEFAULT NULL,
`delay_status` varchar(30) DEFAULT NULL,
`stack_amount` smallint(5) unsigned DEFAULT NULL,
`stack_inventory` tinyint(1) unsigned DEFAULT NULL,
`stack_cart` tinyint(1) unsigned DEFAULT NULL,
`stack_storage` tinyint(1) unsigned DEFAULT NULL,
`stack_guildstorage` tinyint(1) unsigned DEFAULT NULL,
`nouse_override` smallint(5) unsigned DEFAULT NULL,
`nouse_sitting` tinyint(1) unsigned DEFAULT NULL,
`trade_override` smallint(5) unsigned DEFAULT NULL,
`trade_nodrop` tinyint(1) unsigned DEFAULT NULL,
`trade_notrade` tinyint(1) unsigned DEFAULT NULL,
`trade_tradepartner` tinyint(1) unsigned DEFAULT NULL,
`trade_nosell` tinyint(1) unsigned DEFAULT NULL,
`trade_nocart` tinyint(1) unsigned DEFAULT NULL,
`trade_nostorage` tinyint(1) unsigned DEFAULT NULL,
`trade_noguildstorage` tinyint(1) unsigned DEFAULT NULL,
`trade_nomail` tinyint(1) unsigned DEFAULT NULL,
`trade_noauction` tinyint(1) unsigned DEFAULT NULL,
`script` text,
`equip_script` text,
`unequip_script` text,
PRIMARY KEY (`id`),
UNIQUE INDEX `UniqueAegisName` (`name_aegis`)
) ENGINE=MyISAM;

View File

@ -0,0 +1,116 @@
#
# Table structure for table `item_db2_re`
#
DROP TABLE IF EXISTS `item_db2_re`;
CREATE TABLE `item_db2_re` (
`id` int(10) unsigned NOT NULL DEFAULT '0',
`name_aegis` varchar(50) NOT NULL DEFAULT '',
`name_english` varchar(50) NOT NULL DEFAULT '',
`type` varchar(20) DEFAULT NULL,
`subtype` varchar(20) DEFAULT NULL,
`price_buy` mediumint(8) unsigned DEFAULT NULL,
`price_sell` mediumint(8) unsigned DEFAULT NULL,
`weight` smallint(5) unsigned DEFAULT NULL,
`attack` smallint(5) unsigned DEFAULT NULL,
`magic_attack` smallint(5) unsigned DEFAULT NULL,
`defense` smallint(5) unsigned DEFAULT NULL,
`range` tinyint(2) unsigned DEFAULT NULL,
`slots` tinyint(2) unsigned DEFAULT NULL,
`job_all` tinyint(1) unsigned DEFAULT NULL,
`job_acolyte` tinyint(1) unsigned DEFAULT NULL,
`job_alchemist` tinyint(1) unsigned DEFAULT NULL,
`job_archer` tinyint(1) unsigned DEFAULT NULL,
`job_assassin` tinyint(1) unsigned DEFAULT NULL,
`job_barddancer` tinyint(1) unsigned DEFAULT NULL,
`job_blacksmith` tinyint(1) unsigned DEFAULT NULL,
`job_crusader` tinyint(1) unsigned DEFAULT NULL,
`job_gunslinger` tinyint(1) unsigned DEFAULT NULL,
`job_hunter` tinyint(1) unsigned DEFAULT NULL,
`job_kagerouoboro` tinyint(1) unsigned DEFAULT NULL,
`job_knight` tinyint(1) unsigned DEFAULT NULL,
`job_mage` tinyint(1) unsigned DEFAULT NULL,
`job_merchant` tinyint(1) unsigned DEFAULT NULL,
`job_monk` tinyint(1) unsigned DEFAULT NULL,
`job_ninja` tinyint(1) unsigned DEFAULT NULL,
`job_novice` tinyint(1) unsigned DEFAULT NULL,
`job_priest` tinyint(1) unsigned DEFAULT NULL,
`job_rebellion` tinyint(1) unsigned DEFAULT NULL,
`job_rogue` tinyint(1) unsigned DEFAULT NULL,
`job_sage` tinyint(1) unsigned DEFAULT NULL,
`job_soullinker` tinyint(1) unsigned DEFAULT NULL,
`job_stargladiator` tinyint(1) unsigned DEFAULT NULL,
`job_summoner` tinyint(1) unsigned DEFAULT NULL,
`job_supernovice` tinyint(1) unsigned DEFAULT NULL,
`job_swordman` tinyint(1) unsigned DEFAULT NULL,
`job_taekwon` tinyint(1) unsigned DEFAULT NULL,
`job_thief` tinyint(1) unsigned DEFAULT NULL,
`job_wizard` tinyint(1) unsigned DEFAULT NULL,
`class_all` tinyint(1) unsigned DEFAULT NULL,
`class_normal` tinyint(1) unsigned DEFAULT NULL,
`class_upper` tinyint(1) unsigned DEFAULT NULL,
`class_baby` tinyint(1) unsigned DEFAULT NULL,
`class_third` tinyint(1) unsigned DEFAULT NULL,
`class_third_upper` tinyint(1) unsigned DEFAULT NULL,
`class_third_baby` tinyint(1) unsigned DEFAULT NULL,
`gender` varchar(10) DEFAULT NULL,
`location_head_top` tinyint(1) unsigned DEFAULT NULL,
`location_head_mid` tinyint(1) unsigned DEFAULT NULL,
`location_head_low` tinyint(1) unsigned DEFAULT NULL,
`location_armor` tinyint(1) unsigned DEFAULT NULL,
`location_right_hand` tinyint(1) unsigned DEFAULT NULL,
`location_left_hand` tinyint(1) unsigned DEFAULT NULL,
`location_garment` tinyint(1) unsigned DEFAULT NULL,
`location_shoes` tinyint(1) unsigned DEFAULT NULL,
`location_right_accessory` tinyint(1) unsigned DEFAULT NULL,
`location_left_accessory` tinyint(1) unsigned DEFAULT NULL,
`location_costume_head_top` tinyint(1) unsigned DEFAULT NULL,
`location_costume_head_mid` tinyint(1) unsigned DEFAULT NULL,
`location_costume_head_low` tinyint(1) unsigned DEFAULT NULL,
`location_costume_garment` tinyint(1) unsigned DEFAULT NULL,
`location_ammo` tinyint(1) unsigned DEFAULT NULL,
`location_shadow_armor` tinyint(1) unsigned DEFAULT NULL,
`location_shadow_weapon` tinyint(1) unsigned DEFAULT NULL,
`location_shadow_shield` tinyint(1) unsigned DEFAULT NULL,
`location_shadow_shoes` tinyint(1) unsigned DEFAULT NULL,
`location_shadow_right_accessory` tinyint(1) unsigned DEFAULT NULL,
`location_shadow_left_accessory` tinyint(1) unsigned DEFAULT NULL,
`weapon_level` tinyint(1) unsigned DEFAULT NULL,
`equip_level_min` tinyint(3) unsigned DEFAULT NULL,
`equip_level_max` tinyint(3) unsigned DEFAULT NULL,
`refineable` tinyint(1) unsigned DEFAULT NULL,
`view` smallint(5) unsigned DEFAULT NULL,
`alias_name` varchar(50) DEFAULT NULL,
`flag_buyingstore` tinyint(1) unsigned DEFAULT NULL,
`flag_deadbranch` tinyint(1) unsigned DEFAULT NULL,
`flag_container` tinyint(1) unsigned DEFAULT NULL,
`flag_uniqueid` tinyint(1) unsigned DEFAULT NULL,
`flag_bindonequip` tinyint(1) unsigned DEFAULT NULL,
`flag_dropannounce` tinyint(1) unsigned DEFAULT NULL,
`flag_noconsume` tinyint(1) unsigned DEFAULT NULL,
`flag_dropeffect` varchar(20) DEFAULT NULL,
`delay_duration` bigint(20) unsigned DEFAULT NULL,
`delay_status` varchar(30) DEFAULT NULL,
`stack_amount` smallint(5) unsigned DEFAULT NULL,
`stack_inventory` tinyint(1) unsigned DEFAULT NULL,
`stack_cart` tinyint(1) unsigned DEFAULT NULL,
`stack_storage` tinyint(1) unsigned DEFAULT NULL,
`stack_guildstorage` tinyint(1) unsigned DEFAULT NULL,
`nouse_override` smallint(5) unsigned DEFAULT NULL,
`nouse_sitting` tinyint(1) unsigned DEFAULT NULL,
`trade_override` smallint(5) unsigned DEFAULT NULL,
`trade_nodrop` tinyint(1) unsigned DEFAULT NULL,
`trade_notrade` tinyint(1) unsigned DEFAULT NULL,
`trade_tradepartner` tinyint(1) unsigned DEFAULT NULL,
`trade_nosell` tinyint(1) unsigned DEFAULT NULL,
`trade_nocart` tinyint(1) unsigned DEFAULT NULL,
`trade_nostorage` tinyint(1) unsigned DEFAULT NULL,
`trade_noguildstorage` tinyint(1) unsigned DEFAULT NULL,
`trade_nomail` tinyint(1) unsigned DEFAULT NULL,
`trade_noauction` tinyint(1) unsigned DEFAULT NULL,
`script` text,
`equip_script` text,
`unequip_script` text,
PRIMARY KEY (`id`),
UNIQUE INDEX `UniqueAegisName` (`name_aegis`)
) ENGINE=MyISAM;

116
doc/yaml/sql/item_db_re.sql Normal file
View File

@ -0,0 +1,116 @@
#
# Table structure for table `item_db_re`
#
DROP TABLE IF EXISTS `item_db_re`;
CREATE TABLE `item_db_re` (
`id` int(10) unsigned NOT NULL DEFAULT '0',
`name_aegis` varchar(50) NOT NULL DEFAULT '',
`name_english` varchar(50) NOT NULL DEFAULT '',
`type` varchar(20) DEFAULT NULL,
`subtype` varchar(20) DEFAULT NULL,
`price_buy` mediumint(8) unsigned DEFAULT NULL,
`price_sell` mediumint(8) unsigned DEFAULT NULL,
`weight` smallint(5) unsigned DEFAULT NULL,
`attack` smallint(5) unsigned DEFAULT NULL,
`magic_attack` smallint(5) unsigned DEFAULT NULL,
`defense` smallint(5) unsigned DEFAULT NULL,
`range` tinyint(2) unsigned DEFAULT NULL,
`slots` tinyint(2) unsigned DEFAULT NULL,
`job_all` tinyint(1) unsigned DEFAULT NULL,
`job_acolyte` tinyint(1) unsigned DEFAULT NULL,
`job_alchemist` tinyint(1) unsigned DEFAULT NULL,
`job_archer` tinyint(1) unsigned DEFAULT NULL,
`job_assassin` tinyint(1) unsigned DEFAULT NULL,
`job_barddancer` tinyint(1) unsigned DEFAULT NULL,
`job_blacksmith` tinyint(1) unsigned DEFAULT NULL,
`job_crusader` tinyint(1) unsigned DEFAULT NULL,
`job_gunslinger` tinyint(1) unsigned DEFAULT NULL,
`job_hunter` tinyint(1) unsigned DEFAULT NULL,
`job_kagerouoboro` tinyint(1) unsigned DEFAULT NULL,
`job_knight` tinyint(1) unsigned DEFAULT NULL,
`job_mage` tinyint(1) unsigned DEFAULT NULL,
`job_merchant` tinyint(1) unsigned DEFAULT NULL,
`job_monk` tinyint(1) unsigned DEFAULT NULL,
`job_ninja` tinyint(1) unsigned DEFAULT NULL,
`job_novice` tinyint(1) unsigned DEFAULT NULL,
`job_priest` tinyint(1) unsigned DEFAULT NULL,
`job_rebellion` tinyint(1) unsigned DEFAULT NULL,
`job_rogue` tinyint(1) unsigned DEFAULT NULL,
`job_sage` tinyint(1) unsigned DEFAULT NULL,
`job_soullinker` tinyint(1) unsigned DEFAULT NULL,
`job_stargladiator` tinyint(1) unsigned DEFAULT NULL,
`job_summoner` tinyint(1) unsigned DEFAULT NULL,
`job_supernovice` tinyint(1) unsigned DEFAULT NULL,
`job_swordman` tinyint(1) unsigned DEFAULT NULL,
`job_taekwon` tinyint(1) unsigned DEFAULT NULL,
`job_thief` tinyint(1) unsigned DEFAULT NULL,
`job_wizard` tinyint(1) unsigned DEFAULT NULL,
`class_all` tinyint(1) unsigned DEFAULT NULL,
`class_normal` tinyint(1) unsigned DEFAULT NULL,
`class_upper` tinyint(1) unsigned DEFAULT NULL,
`class_baby` tinyint(1) unsigned DEFAULT NULL,
`class_third` tinyint(1) unsigned DEFAULT NULL,
`class_third_upper` tinyint(1) unsigned DEFAULT NULL,
`class_third_baby` tinyint(1) unsigned DEFAULT NULL,
`gender` varchar(10) DEFAULT NULL,
`location_head_top` tinyint(1) unsigned DEFAULT NULL,
`location_head_mid` tinyint(1) unsigned DEFAULT NULL,
`location_head_low` tinyint(1) unsigned DEFAULT NULL,
`location_armor` tinyint(1) unsigned DEFAULT NULL,
`location_right_hand` tinyint(1) unsigned DEFAULT NULL,
`location_left_hand` tinyint(1) unsigned DEFAULT NULL,
`location_garment` tinyint(1) unsigned DEFAULT NULL,
`location_shoes` tinyint(1) unsigned DEFAULT NULL,
`location_right_accessory` tinyint(1) unsigned DEFAULT NULL,
`location_left_accessory` tinyint(1) unsigned DEFAULT NULL,
`location_costume_head_top` tinyint(1) unsigned DEFAULT NULL,
`location_costume_head_mid` tinyint(1) unsigned DEFAULT NULL,
`location_costume_head_low` tinyint(1) unsigned DEFAULT NULL,
`location_costume_garment` tinyint(1) unsigned DEFAULT NULL,
`location_ammo` tinyint(1) unsigned DEFAULT NULL,
`location_shadow_armor` tinyint(1) unsigned DEFAULT NULL,
`location_shadow_weapon` tinyint(1) unsigned DEFAULT NULL,
`location_shadow_shield` tinyint(1) unsigned DEFAULT NULL,
`location_shadow_shoes` tinyint(1) unsigned DEFAULT NULL,
`location_shadow_right_accessory` tinyint(1) unsigned DEFAULT NULL,
`location_shadow_left_accessory` tinyint(1) unsigned DEFAULT NULL,
`weapon_level` tinyint(1) unsigned DEFAULT NULL,
`equip_level_min` tinyint(3) unsigned DEFAULT NULL,
`equip_level_max` tinyint(3) unsigned DEFAULT NULL,
`refineable` tinyint(1) unsigned DEFAULT NULL,
`view` smallint(5) unsigned DEFAULT NULL,
`alias_name` varchar(50) DEFAULT NULL,
`flag_buyingstore` tinyint(1) unsigned DEFAULT NULL,
`flag_deadbranch` tinyint(1) unsigned DEFAULT NULL,
`flag_container` tinyint(1) unsigned DEFAULT NULL,
`flag_uniqueid` tinyint(1) unsigned DEFAULT NULL,
`flag_bindonequip` tinyint(1) unsigned DEFAULT NULL,
`flag_dropannounce` tinyint(1) unsigned DEFAULT NULL,
`flag_noconsume` tinyint(1) unsigned DEFAULT NULL,
`flag_dropeffect` varchar(20) DEFAULT NULL,
`delay_duration` bigint(20) unsigned DEFAULT NULL,
`delay_status` varchar(30) DEFAULT NULL,
`stack_amount` smallint(5) unsigned DEFAULT NULL,
`stack_inventory` tinyint(1) unsigned DEFAULT NULL,
`stack_cart` tinyint(1) unsigned DEFAULT NULL,
`stack_storage` tinyint(1) unsigned DEFAULT NULL,
`stack_guildstorage` tinyint(1) unsigned DEFAULT NULL,
`nouse_override` smallint(5) unsigned DEFAULT NULL,
`nouse_sitting` tinyint(1) unsigned DEFAULT NULL,
`trade_override` smallint(5) unsigned DEFAULT NULL,
`trade_nodrop` tinyint(1) unsigned DEFAULT NULL,
`trade_notrade` tinyint(1) unsigned DEFAULT NULL,
`trade_tradepartner` tinyint(1) unsigned DEFAULT NULL,
`trade_nosell` tinyint(1) unsigned DEFAULT NULL,
`trade_nocart` tinyint(1) unsigned DEFAULT NULL,
`trade_nostorage` tinyint(1) unsigned DEFAULT NULL,
`trade_noguildstorage` tinyint(1) unsigned DEFAULT NULL,
`trade_nomail` tinyint(1) unsigned DEFAULT NULL,
`trade_noauction` tinyint(1) unsigned DEFAULT NULL,
`script` text,
`equip_script` text,
`unequip_script` text,
PRIMARY KEY (`id`),
UNIQUE INDEX `UniqueAegisName` (`name_aegis`)
) ENGINE=MyISAM;

View File

@ -41,9 +41,9 @@ OnInit:
.@item_db$ = "item_db";
}
freeloop 1;
.@total = query_sql( "SELECT DISTINCT LEFT( `name_japanese`, 1 ) AS alphabets FROM `"+ .@item_db$ +"` WHERE `type` = " + IT_CARD + " AND `id` IN ( SELECT DISTINCT `dropcardid` FROM `"+ .@mob_db$ +"` WHERE ~(`MODE`) & " + MD_MVP + " ) ORDER BY alphabets;", .@alphabet$ );
.@total = query_sql( "SELECT DISTINCT LEFT( `name_english`, 1 ) AS alphabets FROM `"+ .@item_db$ +"` WHERE `type` = " + IT_CARD + " AND `id` IN ( SELECT DISTINCT `dropcardid` FROM `"+ .@mob_db$ +"` WHERE ~(`MODE`) & " + MD_MVP + " ) ORDER BY alphabets;", .@alphabet$ );
for ( .@i = 0; .@i < .@total; .@i++ ) {
.@nb = query_sql( "SELECT `"+ .@item_db$ +"`.`id` FROM `"+ .@item_db$ +"` WHERE `type` = " + IT_CARD + " AND LEFT( `name_japanese`, 1 ) = '"+ .@alphabet$[.@i] +"' AND `id` IN ( SELECT DISTINCT `dropcardid` FROM `"+ .@mob_db$ +"` WHERE ~(`MODE`) & " + MD_MVP + " ) ORDER BY `name_japanese` LIMIT 128;", .@id );
.@nb = query_sql( "SELECT `"+ .@item_db$ +"`.`id` FROM `"+ .@item_db$ +"` WHERE `type` = " + IT_CARD + " AND LEFT( `name_english`, 1 ) = '"+ .@alphabet$[.@i] +"' AND `id` IN ( SELECT DISTINCT `dropcardid` FROM `"+ .@mob_db$ +"` WHERE ~(`MODE`) & " + MD_MVP + " ) ORDER BY `name_english` LIMIT 128;", .@id );
if (.@nb > 0) {
.alphabet$[.@size_alphabet++] = .@alphabet$[.@i];
.alphabet_menu$ = .alphabet_menu$ + .@alphabet$[.@i] +" Cards:";

View File

@ -77,6 +77,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "csv2yaml", "src\tool\csv2ya
{352B45B3-FE88-4431-9D89-48CF811446DB} = {352B45B3-FE88-4431-9D89-48CF811446DB}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yaml2sql", "src\tool\yaml2sql.vcxproj", "{CDBBB260-B245-44EC-80FB-3F9421885E40}"
ProjectSection(ProjectDependencies) = postProject
{61D6A599-6BED-4154-A9FC-40553BD972E0} = {61D6A599-6BED-4154-A9FC-40553BD972E0}
{352B45B3-FE88-4431-9D89-48CF811446DB} = {352B45B3-FE88-4431-9D89-48CF811446DB}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@ -157,6 +163,14 @@ Global
{5A9059F2-4933-49A2-BEE6-CC67F66FA070}.Release|Win32.Build.0 = Release|Win32
{5A9059F2-4933-49A2-BEE6-CC67F66FA070}.Release|x64.ActiveCfg = Release|x64
{5A9059F2-4933-49A2-BEE6-CC67F66FA070}.Release|x64.Build.0 = Release|x64
{CDBBB260-B245-44EC-80FB-3F9421885E40}.Debug|Win32.ActiveCfg = Debug|Win32
{CDBBB260-B245-44EC-80FB-3F9421885E40}.Debug|Win32.Build.0 = Debug|Win32
{CDBBB260-B245-44EC-80FB-3F9421885E40}.Debug|x64.ActiveCfg = Debug|x64
{CDBBB260-B245-44EC-80FB-3F9421885E40}.Debug|x64.Build.0 = Debug|x64
{CDBBB260-B245-44EC-80FB-3F9421885E40}.Release|Win32.ActiveCfg = Release|Win32
{CDBBB260-B245-44EC-80FB-3F9421885E40}.Release|Win32.Build.0 = Release|Win32
{CDBBB260-B245-44EC-80FB-3F9421885E40}.Release|x64.ActiveCfg = Release|x64
{CDBBB260-B245-44EC-80FB-3F9421885E40}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -172,6 +186,7 @@ Global
{FC4C071B-2C26-4B03-948A-335C94A88B5E} = {9F328FE9-129D-4C0C-820B-BE4AA5996652}
{61D6A599-6BED-4154-A9FC-40553BD972E0} = {6ABA1767-6242-4CA0-BA22-A30972DC8918}
{5A9059F2-4933-49A2-BEE6-CC67F66FA070} = {9F328FE9-129D-4C0C-820B-BE4AA5996652}
{CDBBB260-B245-44EC-80FB-3F9421885E40} = {9F328FE9-129D-4C0C-820B-BE4AA5996652}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {026DA20F-820C-40AA-983E-0E231EA90AD5}

60
sql-files/README.md Normal file
View File

@ -0,0 +1,60 @@
# SQL Imports
## Explanation of SQL import files
The files in this directory are basic SQL table building scripts. The contained scripts are needed for initial installs as well as subsequent updates.
### New Install
---
For a new install, the following needs to be imported into the 'ragnarok' schema:
Note: The schema name is defined in `conf/inter_athena.conf::map_server_db`.
* main.sql - Contains tables for normal server usage.
* roulette_default_data.sql - Contains data for the client's roulette game.
For a new install, the following needs to be imported into the 'log' schema:
Note: The schema name is defined in `conf/inter_athena.conf::log_db_db`.
* logs.sql - Contains tables for logging of server events.
If your server is setup to read SQL database data, import the following:
Note: If `conf/inter_athena.conf::use_sql_db` is set to yes continue with these imports else these can be skipped. Not all files have to be imported, only the ones that apply to the same mode as the server being ran.
* item_cash_db.sql - Used for client's cash shop.
* item_cash_db2.sql - Used for client's cash shop (import).
* item_db.sql - Contains __pre-renewal__ item data.
* item_db2.sql - Contains __pre-renewal__ item data (import).
* item_db_re.sql - Contains __renewal__ item data.
* item_db2_re.sql - Contains __renewal__ item data (import).
* mob_db.sql - Contains __pre-renewal__ mob data.
* mob_db2.sql - Contains __pre-renewal__ mob data (import).
* mob_db_re.sql - Contains __renewal__ mob data.
* mob_db2_re.sql - Contains __renewal__ mob data (import).
* mob_skill_db.sql - Contains __pre-renewal__ mob skill data.
* mob_skill_db2.sql - Contains __pre-renewal__ mob skill data (import).
* mob_skill_db_re.sql - Contains __renewal__ mob skill data.
* mob_skill_db2_re.sql - Contains __renewal__ mob skill data (import).
### Updates
---
Over the course of time new features and optimizations will take place. This may require SQL changes to happen. In the `upgrades` folder will be upgrade files with an attached date.
These imports only have to executed if an update has occurred after the initial installation. Many times a SQL error will be displayed on the server console stating the format differs from what is required.
### Compatibility
---
The `compatibility` folder contains SQL views which are used with helping control panels or websites grab prevalent data for a table that may have changed structure.
These are optional imports but website data such as item databases will not work properly when using the new YAML format without these views:
* item_db_compat.sql - Creates a view for the item_db.
* item_db2_compat.sql - Creates a view for the item_db2 (import).
* item_db_re_compat.sql - Creates a view for the item_db_re.
* item_db2_re_compat.sql - Creates a view for the item_db2_re (import).
### Tools
---
The `tools` folder contains some simple adjustments if needed for an administrator's personal preferences.
* convert_engine_innodb.sql - Converts the SQL table engine setting to InnoDB.
* convert_engine_myiasm.sql - Converts the SQL table engine setting to MyISAM.
* convert_passwords.sql - Converts the login table's password value to MD5.

View File

@ -0,0 +1,200 @@
#
# View structure for view `item_db2_compat`
#
DROP VIEW IF EXISTS `item_db2_compat`;
CREATE VIEW `item_db2_compat` AS (
SELECT
`id`,
`name_aegis` AS `name_english`,
`name_english` AS `name_japanese`,
case
when `type` = 'Healing' then
0
when `type` = 'Usable' then
2
when `type` = 'Etc' then
3
when `type` = 'Armor' then
4
when `type` = 'Weapon' then
5
when `type` = 'Card' then
6
when `type` = 'Petegg' then
7
when `type` = 'Petarmor' then
8
when `type` = 'Ammo' then
10
when `type` = 'Delayconsume' then
11
when `type` = 'Shadowgear' then
12
when `type` = 'Cash' then
18
else
3 -- etc
end as `type`,
`price_buy`,
`price_sell`,
`weight`,
`attack`,
`defense` as `defence`,
`range`,
`slots`,
case
when `job_all` > 0 then
4294967295
else
IF(
IF( `job_acolyte` > 0, 16, 0 ) +
IF( `job_alchemist` > 0, 262144, 0 ) +
IF( `job_archer` > 0, 8, 0 ) +
IF( `job_assassin` > 0, 4096, 0 ) +
IF( `job_barddancer` > 0, 524288, 0 ) +
IF( `job_blacksmith` > 0, 1024, 0 ) +
IF( `job_crusader` > 0, 16384, 0 ) +
IF( `job_gunslinger` > 0, 16777216, 0 ) +
IF( `job_hunter` > 0, 2048, 0 ) +
IF( `job_knight` > 0, 128, 0 ) +
IF( `job_mage` > 0, 4, 0 ) +
IF( `job_merchant` > 0, 32, 0 ) +
IF( `job_monk` > 0, 32768, 0 ) +
IF( `job_ninja` > 0, 33554432, 0 ) +
IF( `job_novice` > 0 OR `job_supernovice` > 0, 1, 0 ) +
IF( `job_priest` > 0, 256, 0 ) +
IF( `job_rogue` > 0, 131072, 0 ) +
IF( `job_sage` > 0, 65536, 0 ) +
IF( `job_soullinker` > 0, 8388608, 0 ) +
IF( `job_stargladiator` > 0, 4194304, 0 ) +
IF( `job_swordman` > 0, 2, 0 ) +
IF( `job_taekwon` > 0, 2097152, 0 ) +
IF( `job_thief` > 0, 64, 0 ) +
IF( `job_wizard` > 0, 512, 0 ) > 0
,
IF( `job_acolyte` > 0, 16, 0 ) +
IF( `job_alchemist` > 0, 262144, 0 ) +
IF( `job_archer` > 0, 8, 0 ) +
IF( `job_assassin` > 0, 4096, 0 ) +
IF( `job_barddancer` > 0, 524288, 0 ) +
IF( `job_blacksmith` > 0, 1024, 0 ) +
IF( `job_crusader` > 0, 16384, 0 ) +
IF( `job_gunslinger` > 0, 16777216, 0 ) +
IF( `job_hunter` > 0, 2048, 0 ) +
IF( `job_knight` > 0, 128, 0 ) +
IF( `job_mage` > 0, 4, 0 ) +
IF( `job_merchant` > 0, 32, 0 ) +
IF( `job_monk` > 0, 32768, 0 ) +
IF( `job_ninja` > 0, 33554432, 0 ) +
IF( `job_novice` > 0 OR `job_supernovice` > 0, 1, 0 ) +
IF( `job_priest` > 0, 256, 0 ) +
IF( `job_rogue` > 0, 131072, 0 ) +
IF( `job_sage` > 0, 65536, 0 ) +
IF( `job_soullinker` > 0, 8388608, 0 ) +
IF( `job_stargladiator` > 0, 4194304, 0 ) +
IF( `job_swordman` > 0, 2, 0 ) +
IF( `job_taekwon` > 0, 2097152, 0 ) +
IF( `job_thief` > 0, 64, 0 ) +
IF( `job_wizard` > 0, 512, 0 )
,
null
)
end as `equip_jobs`,
case
when `class_all` > 0 then
7
else
IF(
IF( `class_normal` > 0, 1, 0 ) +
IF( `class_upper` > 0, 2, 0 ) +
IF( `class_baby` > 0, 4, 0 ) > 0
,
IF( `class_normal` > 0, 1, 0 ) +
IF( `class_upper` > 0, 2, 0 ) +
IF( `class_baby` > 0, 4, 0 )
,
null
)
end as `equip_upper`,
case
when `gender` = 'Female' then
0
when `gender` = 'Male' then
1
when `gender` = 'Both' then
2
else
null
end as `equip_genders`,
IF(
IF( `location_head_top` > 0, 256, 0 ) +
IF( `location_head_mid` > 0, 512, 0 ) +
IF( `location_head_low` > 0, 1, 0 ) +
IF( `location_armor` > 0, 16, 0 ) +
IF( `location_right_hand` > 0, 2, 0 ) +
IF( `location_left_hand` > 0, 32, 0 ) +
IF( `location_garment` > 0, 4, 0 ) +
IF( `location_shoes` > 0, 64, 0 ) +
IF( `location_right_accessory` > 0, 8, 0 ) +
IF( `location_left_accessory` > 0, 128, 0 ) +
IF( `location_costume_head_top` > 0, 1024, 0 ) +
IF( `location_costume_head_mid` > 0, 2048, 0 ) +
IF( `location_costume_head_low` > 0, 4096, 0 ) +
IF( `location_costume_garment` > 0, 8192, 0 ) +
IF( `location_ammo` > 0, 32768, 0 ) +
IF( `location_shadow_armor` > 0, 65536, 0 ) +
IF( `location_shadow_weapon` > 0, 131072, 0 ) +
IF( `location_shadow_shield` > 0, 262144, 0 ) +
IF( `location_shadow_shoes` > 0, 524288, 0 ) +
IF( `location_shadow_right_accessory` > 0, 1048576, 0 ) +
IF( `location_shadow_left_accessory` > 0, 2097152, 0 ) > 0
,
IF( `location_head_top` > 0, 256, 0 ) +
IF( `location_head_mid` > 0, 512, 0 ) +
IF( `location_head_low` > 0, 1, 0 ) +
IF( `location_armor` > 0, 16, 0 ) +
IF( `location_right_hand` > 0, 2, 0 ) +
IF( `location_left_hand` > 0, 32, 0 ) +
IF( `location_garment` > 0, 4, 0 ) +
IF( `location_shoes` > 0, 64, 0 ) +
IF( `location_right_accessory` > 0, 8, 0 ) +
IF( `location_left_accessory` > 0, 128, 0 ) +
IF( `location_costume_head_top` > 0, 1024, 0 ) +
IF( `location_costume_head_mid` > 0, 2048, 0 ) +
IF( `location_costume_head_low` > 0, 4096, 0 ) +
IF( `location_costume_garment` > 0, 8192, 0 ) +
IF( `location_ammo` > 0, 32768, 0 ) +
IF( `location_shadow_armor` > 0, 65536, 0 ) +
IF( `location_shadow_weapon` > 0, 131072, 0 ) +
IF( `location_shadow_shield` > 0, 262144, 0 ) +
IF( `location_shadow_shoes` > 0, 524288, 0 ) +
IF( `location_shadow_right_accessory` > 0, 1048576, 0 ) +
IF( `location_shadow_left_accessory` > 0, 2097152, 0 )
,
null
)
as `equip_locations`,
`weapon_level`,
case
when `equip_level_min` > 0 and `equip_level_max` > 0 then
CONCAT( `equip_level_min`, ':', `equip_level_max` )
when `equip_level_min` > 0 then
`equip_level_min`
when `equip_level_min` > 0 then
`equip_level_min`
else
null
end as `equip_level`,
`refineable`,
case
when `view` > 0 then
`view`
else
null
end as `view`,
`script`,
`equip_script`,
`unequip_script`
FROM `item_db2`
);

View File

@ -0,0 +1,221 @@
#
# View structure for view `item_db2_re_compat`
#
DROP VIEW IF EXISTS `item_db2_re_compat`;
CREATE VIEW `item_db2_re_compat` AS (
SELECT
`id`,
`name_aegis` AS `name_english`,
`name_english` AS `name_japanese`,
case
when `type` = 'Healing' then
0
when `type` = 'Usable' then
2
when `type` = 'Etc' then
3
when `type` = 'Armor' then
4
when `type` = 'Weapon' then
5
when `type` = 'Card' then
6
when `type` = 'Petegg' then
7
when `type` = 'Petarmor' then
8
when `type` = 'Ammo' then
10
when `type` = 'Delayconsume' then
11
when `type` = 'Shadowgear' then
12
when `type` = 'Cash' then
18
else
3 -- etc
end as `type`,
`price_buy`,
`price_sell`,
`weight`,
case
when `attack` > 0 and `magic_attack` > 0 then
CONCAT( `attack`, ':', `magic_attack` )
when `attack` > 0 then
`attack`
when `magic_attack` > 0 then
CONCAT( '0:', `magic_attack` )
else
null
end as `atk:matk`,
`defense` as `defence`,
`range`,
`slots`,
case
when `job_all` > 0 then
4294967295
else
IF(
IF( `job_acolyte` > 0, 16, 0 ) +
IF( `job_alchemist` > 0, 262144, 0 ) +
IF( `job_archer` > 0, 8, 0 ) +
IF( `job_assassin` > 0, 4096, 0 ) +
IF( `job_barddancer` > 0, 524288, 0 ) +
IF( `job_blacksmith` > 0, 1024, 0 ) +
IF( `job_crusader` > 0, 16384, 0 ) +
IF( `job_gunslinger` > 0, 16777216, 0 ) +
IF( `job_hunter` > 0, 2048, 0 ) +
IF( `job_kagerouoboro` > 0, 536870912, 0 ) +
IF( `job_knight` > 0, 128, 0 ) +
IF( `job_mage` > 0, 4, 0 ) +
IF( `job_merchant` > 0, 32, 0 ) +
IF( `job_monk` > 0, 32768, 0 ) +
IF( `job_ninja` > 0, 33554432, 0 ) +
IF( `job_novice` > 0 OR `job_supernovice` > 0, 1, 0 ) +
IF( `job_priest` > 0, 256, 0 ) +
IF( `job_rebellion` > 0, 1073741824, 0 ) +
IF( `job_rogue` > 0, 131072, 0 ) +
IF( `job_sage` > 0, 65536, 0 ) +
IF( `job_soullinker` > 0, 8388608, 0 ) +
IF( `job_stargladiator` > 0, 4194304, 0 ) +
IF( `job_summoner` > 0, 2147483648, 0 ) +
IF( `job_swordman` > 0, 2, 0 ) +
IF( `job_taekwon` > 0, 2097152, 0 ) +
IF( `job_thief` > 0, 64, 0 ) +
IF( `job_wizard` > 0, 512, 0 ) > 0
,
IF( `job_acolyte` > 0, 16, 0 ) +
IF( `job_alchemist` > 0, 262144, 0 ) +
IF( `job_archer` > 0, 8, 0 ) +
IF( `job_assassin` > 0, 4096, 0 ) +
IF( `job_barddancer` > 0, 524288, 0 ) +
IF( `job_blacksmith` > 0, 1024, 0 ) +
IF( `job_crusader` > 0, 16384, 0 ) +
IF( `job_gunslinger` > 0, 16777216, 0 ) +
IF( `job_hunter` > 0, 2048, 0 ) +
IF( `job_kagerouoboro` > 0, 536870912, 0 ) +
IF( `job_knight` > 0, 128, 0 ) +
IF( `job_mage` > 0, 4, 0 ) +
IF( `job_merchant` > 0, 32, 0 ) +
IF( `job_monk` > 0, 32768, 0 ) +
IF( `job_ninja` > 0, 33554432, 0 ) +
IF( `job_novice` > 0 OR `job_supernovice` > 0, 1, 0 ) +
IF( `job_priest` > 0, 256, 0 ) +
IF( `job_rebellion` > 0, 1073741824, 0 ) +
IF( `job_rogue` > 0, 131072, 0 ) +
IF( `job_sage` > 0, 65536, 0 ) +
IF( `job_soullinker` > 0, 8388608, 0 ) +
IF( `job_stargladiator` > 0, 4194304, 0 ) +
IF( `job_summoner` > 0, 2147483648, 0 ) +
IF( `job_swordman` > 0, 2, 0 ) +
IF( `job_taekwon` > 0, 2097152, 0 ) +
IF( `job_thief` > 0, 64, 0 ) +
IF( `job_wizard` > 0, 512, 0 )
,
null
)
end as `equip_jobs`,
case
when `class_all` > 0 then
63
else
IF(
IF( `class_normal` > 0, 1, 0 ) +
IF( `class_upper` > 0, 2, 0 ) +
IF( `class_baby` > 0, 4, 0 ) +
IF( `class_third` > 0, 8, 0 ) +
IF( `class_third_upper` > 0, 16, 0 ) +
IF( `class_third_baby` > 0, 32, 0 ) > 0
,
IF( `class_normal` > 0, 1, 0 ) +
IF( `class_upper` > 0, 2, 0 ) +
IF( `class_baby` > 0, 4, 0 ) +
IF( `class_third` > 0, 8, 0 ) +
IF( `class_third_upper` > 0, 16, 0 ) +
IF( `class_third_baby` > 0, 32, 0 )
,
null
)
end as `equip_upper`,
case
when `gender` = 'Female' then
0
when `gender` = 'Male' then
1
when `gender` = 'Both' then
2
else
null
end as `equip_genders`,
IF(
IF( `location_head_top` > 0, 256, 0 ) +
IF( `location_head_mid` > 0, 512, 0 ) +
IF( `location_head_low` > 0, 1, 0 ) +
IF( `location_armor` > 0, 16, 0 ) +
IF( `location_right_hand` > 0, 2, 0 ) +
IF( `location_left_hand` > 0, 32, 0 ) +
IF( `location_garment` > 0, 4, 0 ) +
IF( `location_shoes` > 0, 64, 0 ) +
IF( `location_right_accessory` > 0, 8, 0 ) +
IF( `location_left_accessory` > 0, 128, 0 ) +
IF( `location_costume_head_top` > 0, 1024, 0 ) +
IF( `location_costume_head_mid` > 0, 2048, 0 ) +
IF( `location_costume_head_low` > 0, 4096, 0 ) +
IF( `location_costume_garment` > 0, 8192, 0 ) +
IF( `location_ammo` > 0, 32768, 0 ) +
IF( `location_shadow_armor` > 0, 65536, 0 ) +
IF( `location_shadow_weapon` > 0, 131072, 0 ) +
IF( `location_shadow_shield` > 0, 262144, 0 ) +
IF( `location_shadow_shoes` > 0, 524288, 0 ) +
IF( `location_shadow_right_accessory` > 0, 1048576, 0 ) +
IF( `location_shadow_left_accessory` > 0, 2097152, 0 ) > 0
,
IF( `location_head_top` > 0, 256, 0 ) +
IF( `location_head_mid` > 0, 512, 0 ) +
IF( `location_head_low` > 0, 1, 0 ) +
IF( `location_armor` > 0, 16, 0 ) +
IF( `location_right_hand` > 0, 2, 0 ) +
IF( `location_left_hand` > 0, 32, 0 ) +
IF( `location_garment` > 0, 4, 0 ) +
IF( `location_shoes` > 0, 64, 0 ) +
IF( `location_right_accessory` > 0, 8, 0 ) +
IF( `location_left_accessory` > 0, 128, 0 ) +
IF( `location_costume_head_top` > 0, 1024, 0 ) +
IF( `location_costume_head_mid` > 0, 2048, 0 ) +
IF( `location_costume_head_low` > 0, 4096, 0 ) +
IF( `location_costume_garment` > 0, 8192, 0 ) +
IF( `location_ammo` > 0, 32768, 0 ) +
IF( `location_shadow_armor` > 0, 65536, 0 ) +
IF( `location_shadow_weapon` > 0, 131072, 0 ) +
IF( `location_shadow_shield` > 0, 262144, 0 ) +
IF( `location_shadow_shoes` > 0, 524288, 0 ) +
IF( `location_shadow_right_accessory` > 0, 1048576, 0 ) +
IF( `location_shadow_left_accessory` > 0, 2097152, 0 )
,
null
)
as `equip_locations`,
`weapon_level`,
case
when `equip_level_min` > 0 and `equip_level_max` > 0 then
CONCAT( `equip_level_min`, ':', `equip_level_max` )
when `equip_level_min` > 0 then
`equip_level_min`
when `equip_level_min` > 0 then
`equip_level_min`
else
null
end as `equip_level`,
`refineable`,
case
when `view` > 0 then
`view`
else
null
end as `view`,
`script`,
`equip_script`,
`unequip_script`
FROM `item_db2_re`
);

View File

@ -0,0 +1,200 @@
#
# View structure for view `item_db_compat`
#
DROP VIEW IF EXISTS `item_db_compat`;
CREATE VIEW `item_db_compat` AS (
SELECT
`id`,
`name_aegis` AS `name_english`,
`name_english` AS `name_japanese`,
case
when `type` = 'Healing' then
0
when `type` = 'Usable' then
2
when `type` = 'Etc' then
3
when `type` = 'Armor' then
4
when `type` = 'Weapon' then
5
when `type` = 'Card' then
6
when `type` = 'Petegg' then
7
when `type` = 'Petarmor' then
8
when `type` = 'Ammo' then
10
when `type` = 'Delayconsume' then
11
when `type` = 'Shadowgear' then
12
when `type` = 'Cash' then
18
else
3 -- etc
end as `type`,
`price_buy`,
`price_sell`,
`weight`,
`attack`,
`defense` as `defence`,
`range`,
`slots`,
case
when `job_all` > 0 then
4294967295
else
IF(
IF( `job_acolyte` > 0, 16, 0 ) +
IF( `job_alchemist` > 0, 262144, 0 ) +
IF( `job_archer` > 0, 8, 0 ) +
IF( `job_assassin` > 0, 4096, 0 ) +
IF( `job_barddancer` > 0, 524288, 0 ) +
IF( `job_blacksmith` > 0, 1024, 0 ) +
IF( `job_crusader` > 0, 16384, 0 ) +
IF( `job_gunslinger` > 0, 16777216, 0 ) +
IF( `job_hunter` > 0, 2048, 0 ) +
IF( `job_knight` > 0, 128, 0 ) +
IF( `job_mage` > 0, 4, 0 ) +
IF( `job_merchant` > 0, 32, 0 ) +
IF( `job_monk` > 0, 32768, 0 ) +
IF( `job_ninja` > 0, 33554432, 0 ) +
IF( `job_novice` > 0 OR `job_supernovice` > 0, 1, 0 ) +
IF( `job_priest` > 0, 256, 0 ) +
IF( `job_rogue` > 0, 131072, 0 ) +
IF( `job_sage` > 0, 65536, 0 ) +
IF( `job_soullinker` > 0, 8388608, 0 ) +
IF( `job_stargladiator` > 0, 4194304, 0 ) +
IF( `job_swordman` > 0, 2, 0 ) +
IF( `job_taekwon` > 0, 2097152, 0 ) +
IF( `job_thief` > 0, 64, 0 ) +
IF( `job_wizard` > 0, 512, 0 ) > 0
,
IF( `job_acolyte` > 0, 16, 0 ) +
IF( `job_alchemist` > 0, 262144, 0 ) +
IF( `job_archer` > 0, 8, 0 ) +
IF( `job_assassin` > 0, 4096, 0 ) +
IF( `job_barddancer` > 0, 524288, 0 ) +
IF( `job_blacksmith` > 0, 1024, 0 ) +
IF( `job_crusader` > 0, 16384, 0 ) +
IF( `job_gunslinger` > 0, 16777216, 0 ) +
IF( `job_hunter` > 0, 2048, 0 ) +
IF( `job_knight` > 0, 128, 0 ) +
IF( `job_mage` > 0, 4, 0 ) +
IF( `job_merchant` > 0, 32, 0 ) +
IF( `job_monk` > 0, 32768, 0 ) +
IF( `job_ninja` > 0, 33554432, 0 ) +
IF( `job_novice` > 0 OR `job_supernovice` > 0, 1, 0 ) +
IF( `job_priest` > 0, 256, 0 ) +
IF( `job_rogue` > 0, 131072, 0 ) +
IF( `job_sage` > 0, 65536, 0 ) +
IF( `job_soullinker` > 0, 8388608, 0 ) +
IF( `job_stargladiator` > 0, 4194304, 0 ) +
IF( `job_swordman` > 0, 2, 0 ) +
IF( `job_taekwon` > 0, 2097152, 0 ) +
IF( `job_thief` > 0, 64, 0 ) +
IF( `job_wizard` > 0, 512, 0 )
,
null
)
end as `equip_jobs`,
case
when `class_all` > 0 then
7
else
IF(
IF( `class_normal` > 0, 1, 0 ) +
IF( `class_upper` > 0, 2, 0 ) +
IF( `class_baby` > 0, 4, 0 ) > 0
,
IF( `class_normal` > 0, 1, 0 ) +
IF( `class_upper` > 0, 2, 0 ) +
IF( `class_baby` > 0, 4, 0 )
,
null
)
end as `equip_upper`,
case
when `gender` = 'Female' then
0
when `gender` = 'Male' then
1
when `gender` = 'Both' then
2
else
null
end as `equip_genders`,
IF(
IF( `location_head_top` > 0, 256, 0 ) +
IF( `location_head_mid` > 0, 512, 0 ) +
IF( `location_head_low` > 0, 1, 0 ) +
IF( `location_armor` > 0, 16, 0 ) +
IF( `location_right_hand` > 0, 2, 0 ) +
IF( `location_left_hand` > 0, 32, 0 ) +
IF( `location_garment` > 0, 4, 0 ) +
IF( `location_shoes` > 0, 64, 0 ) +
IF( `location_right_accessory` > 0, 8, 0 ) +
IF( `location_left_accessory` > 0, 128, 0 ) +
IF( `location_costume_head_top` > 0, 1024, 0 ) +
IF( `location_costume_head_mid` > 0, 2048, 0 ) +
IF( `location_costume_head_low` > 0, 4096, 0 ) +
IF( `location_costume_garment` > 0, 8192, 0 ) +
IF( `location_ammo` > 0, 32768, 0 ) +
IF( `location_shadow_armor` > 0, 65536, 0 ) +
IF( `location_shadow_weapon` > 0, 131072, 0 ) +
IF( `location_shadow_shield` > 0, 262144, 0 ) +
IF( `location_shadow_shoes` > 0, 524288, 0 ) +
IF( `location_shadow_right_accessory` > 0, 1048576, 0 ) +
IF( `location_shadow_left_accessory` > 0, 2097152, 0 ) > 0
,
IF( `location_head_top` > 0, 256, 0 ) +
IF( `location_head_mid` > 0, 512, 0 ) +
IF( `location_head_low` > 0, 1, 0 ) +
IF( `location_armor` > 0, 16, 0 ) +
IF( `location_right_hand` > 0, 2, 0 ) +
IF( `location_left_hand` > 0, 32, 0 ) +
IF( `location_garment` > 0, 4, 0 ) +
IF( `location_shoes` > 0, 64, 0 ) +
IF( `location_right_accessory` > 0, 8, 0 ) +
IF( `location_left_accessory` > 0, 128, 0 ) +
IF( `location_costume_head_top` > 0, 1024, 0 ) +
IF( `location_costume_head_mid` > 0, 2048, 0 ) +
IF( `location_costume_head_low` > 0, 4096, 0 ) +
IF( `location_costume_garment` > 0, 8192, 0 ) +
IF( `location_ammo` > 0, 32768, 0 ) +
IF( `location_shadow_armor` > 0, 65536, 0 ) +
IF( `location_shadow_weapon` > 0, 131072, 0 ) +
IF( `location_shadow_shield` > 0, 262144, 0 ) +
IF( `location_shadow_shoes` > 0, 524288, 0 ) +
IF( `location_shadow_right_accessory` > 0, 1048576, 0 ) +
IF( `location_shadow_left_accessory` > 0, 2097152, 0 )
,
null
)
as `equip_locations`,
`weapon_level`,
case
when `equip_level_min` > 0 and `equip_level_max` > 0 then
CONCAT( `equip_level_min`, ':', `equip_level_max` )
when `equip_level_min` > 0 then
`equip_level_min`
when `equip_level_min` > 0 then
`equip_level_min`
else
null
end as `equip_level`,
`refineable`,
case
when `view` > 0 then
`view`
else
null
end as `view`,
`script`,
`equip_script`,
`unequip_script`
FROM `item_db`
);

View File

@ -0,0 +1,221 @@
#
# View structure for view `item_db_re_compat`
#
DROP VIEW IF EXISTS `item_db_re_compat`;
CREATE VIEW `item_db_re_compat` AS (
SELECT
`id`,
`name_aegis` AS `name_english`,
`name_english` AS `name_japanese`,
case
when `type` = 'Healing' then
0
when `type` = 'Usable' then
2
when `type` = 'Etc' then
3
when `type` = 'Armor' then
4
when `type` = 'Weapon' then
5
when `type` = 'Card' then
6
when `type` = 'Petegg' then
7
when `type` = 'Petarmor' then
8
when `type` = 'Ammo' then
10
when `type` = 'Delayconsume' then
11
when `type` = 'Shadowgear' then
12
when `type` = 'Cash' then
18
else
3 -- etc
end as `type`,
`price_buy`,
`price_sell`,
`weight`,
case
when `attack` > 0 and `magic_attack` > 0 then
CONCAT( `attack`, ':', `magic_attack` )
when `attack` > 0 then
`attack`
when `magic_attack` > 0 then
CONCAT( '0:', `magic_attack` )
else
null
end as `atk:matk`,
`defense` as `defence`,
`range`,
`slots`,
case
when `job_all` > 0 then
4294967295
else
IF(
IF( `job_acolyte` > 0, 16, 0 ) +
IF( `job_alchemist` > 0, 262144, 0 ) +
IF( `job_archer` > 0, 8, 0 ) +
IF( `job_assassin` > 0, 4096, 0 ) +
IF( `job_barddancer` > 0, 524288, 0 ) +
IF( `job_blacksmith` > 0, 1024, 0 ) +
IF( `job_crusader` > 0, 16384, 0 ) +
IF( `job_gunslinger` > 0, 16777216, 0 ) +
IF( `job_hunter` > 0, 2048, 0 ) +
IF( `job_kagerouoboro` > 0, 536870912, 0 ) +
IF( `job_knight` > 0, 128, 0 ) +
IF( `job_mage` > 0, 4, 0 ) +
IF( `job_merchant` > 0, 32, 0 ) +
IF( `job_monk` > 0, 32768, 0 ) +
IF( `job_ninja` > 0, 33554432, 0 ) +
IF( `job_novice` > 0 OR `job_supernovice` > 0, 1, 0 ) +
IF( `job_priest` > 0, 256, 0 ) +
IF( `job_rebellion` > 0, 1073741824, 0 ) +
IF( `job_rogue` > 0, 131072, 0 ) +
IF( `job_sage` > 0, 65536, 0 ) +
IF( `job_soullinker` > 0, 8388608, 0 ) +
IF( `job_stargladiator` > 0, 4194304, 0 ) +
IF( `job_summoner` > 0, 2147483648, 0 ) +
IF( `job_swordman` > 0, 2, 0 ) +
IF( `job_taekwon` > 0, 2097152, 0 ) +
IF( `job_thief` > 0, 64, 0 ) +
IF( `job_wizard` > 0, 512, 0 ) > 0
,
IF( `job_acolyte` > 0, 16, 0 ) +
IF( `job_alchemist` > 0, 262144, 0 ) +
IF( `job_archer` > 0, 8, 0 ) +
IF( `job_assassin` > 0, 4096, 0 ) +
IF( `job_barddancer` > 0, 524288, 0 ) +
IF( `job_blacksmith` > 0, 1024, 0 ) +
IF( `job_crusader` > 0, 16384, 0 ) +
IF( `job_gunslinger` > 0, 16777216, 0 ) +
IF( `job_hunter` > 0, 2048, 0 ) +
IF( `job_kagerouoboro` > 0, 536870912, 0 ) +
IF( `job_knight` > 0, 128, 0 ) +
IF( `job_mage` > 0, 4, 0 ) +
IF( `job_merchant` > 0, 32, 0 ) +
IF( `job_monk` > 0, 32768, 0 ) +
IF( `job_ninja` > 0, 33554432, 0 ) +
IF( `job_novice` > 0 OR `job_supernovice` > 0, 1, 0 ) +
IF( `job_priest` > 0, 256, 0 ) +
IF( `job_rebellion` > 0, 1073741824, 0 ) +
IF( `job_rogue` > 0, 131072, 0 ) +
IF( `job_sage` > 0, 65536, 0 ) +
IF( `job_soullinker` > 0, 8388608, 0 ) +
IF( `job_stargladiator` > 0, 4194304, 0 ) +
IF( `job_summoner` > 0, 2147483648, 0 ) +
IF( `job_swordman` > 0, 2, 0 ) +
IF( `job_taekwon` > 0, 2097152, 0 ) +
IF( `job_thief` > 0, 64, 0 ) +
IF( `job_wizard` > 0, 512, 0 )
,
null
)
end as `equip_jobs`,
case
when `class_all` > 0 then
63
else
IF(
IF( `class_normal` > 0, 1, 0 ) +
IF( `class_upper` > 0, 2, 0 ) +
IF( `class_baby` > 0, 4, 0 ) +
IF( `class_third` > 0, 8, 0 ) +
IF( `class_third_upper` > 0, 16, 0 ) +
IF( `class_third_baby` > 0, 32, 0 ) > 0
,
IF( `class_normal` > 0, 1, 0 ) +
IF( `class_upper` > 0, 2, 0 ) +
IF( `class_baby` > 0, 4, 0 ) +
IF( `class_third` > 0, 8, 0 ) +
IF( `class_third_upper` > 0, 16, 0 ) +
IF( `class_third_baby` > 0, 32, 0 )
,
null
)
end as `equip_upper`,
case
when `gender` = 'Female' then
0
when `gender` = 'Male' then
1
when `gender` = 'Both' then
2
else
null
end as `equip_genders`,
IF(
IF( `location_head_top` > 0, 256, 0 ) +
IF( `location_head_mid` > 0, 512, 0 ) +
IF( `location_head_low` > 0, 1, 0 ) +
IF( `location_armor` > 0, 16, 0 ) +
IF( `location_right_hand` > 0, 2, 0 ) +
IF( `location_left_hand` > 0, 32, 0 ) +
IF( `location_garment` > 0, 4, 0 ) +
IF( `location_shoes` > 0, 64, 0 ) +
IF( `location_right_accessory` > 0, 8, 0 ) +
IF( `location_left_accessory` > 0, 128, 0 ) +
IF( `location_costume_head_top` > 0, 1024, 0 ) +
IF( `location_costume_head_mid` > 0, 2048, 0 ) +
IF( `location_costume_head_low` > 0, 4096, 0 ) +
IF( `location_costume_garment` > 0, 8192, 0 ) +
IF( `location_ammo` > 0, 32768, 0 ) +
IF( `location_shadow_armor` > 0, 65536, 0 ) +
IF( `location_shadow_weapon` > 0, 131072, 0 ) +
IF( `location_shadow_shield` > 0, 262144, 0 ) +
IF( `location_shadow_shoes` > 0, 524288, 0 ) +
IF( `location_shadow_right_accessory` > 0, 1048576, 0 ) +
IF( `location_shadow_left_accessory` > 0, 2097152, 0 ) > 0
,
IF( `location_head_top` > 0, 256, 0 ) +
IF( `location_head_mid` > 0, 512, 0 ) +
IF( `location_head_low` > 0, 1, 0 ) +
IF( `location_armor` > 0, 16, 0 ) +
IF( `location_right_hand` > 0, 2, 0 ) +
IF( `location_left_hand` > 0, 32, 0 ) +
IF( `location_garment` > 0, 4, 0 ) +
IF( `location_shoes` > 0, 64, 0 ) +
IF( `location_right_accessory` > 0, 8, 0 ) +
IF( `location_left_accessory` > 0, 128, 0 ) +
IF( `location_costume_head_top` > 0, 1024, 0 ) +
IF( `location_costume_head_mid` > 0, 2048, 0 ) +
IF( `location_costume_head_low` > 0, 4096, 0 ) +
IF( `location_costume_garment` > 0, 8192, 0 ) +
IF( `location_ammo` > 0, 32768, 0 ) +
IF( `location_shadow_armor` > 0, 65536, 0 ) +
IF( `location_shadow_weapon` > 0, 131072, 0 ) +
IF( `location_shadow_shield` > 0, 262144, 0 ) +
IF( `location_shadow_shoes` > 0, 524288, 0 ) +
IF( `location_shadow_right_accessory` > 0, 1048576, 0 ) +
IF( `location_shadow_left_accessory` > 0, 2097152, 0 )
,
null
)
as `equip_locations`,
`weapon_level`,
case
when `equip_level_min` > 0 and `equip_level_max` > 0 then
CONCAT( `equip_level_min`, ':', `equip_level_max` )
when `equip_level_min` > 0 then
`equip_level_min`
when `equip_level_min` > 0 then
`equip_level_min`
else
null
end as `equip_level`,
`refineable`,
case
when `view` > 0 then
`view`
else
null
end as `view`,
`script`,
`equip_script`,
`unequip_script`
FROM `item_db_re`
);

File diff suppressed because it is too large Load Diff

View File

@ -5,92 +5,171 @@
DROP TABLE IF EXISTS `item_db2`;
CREATE TABLE `item_db2` (
`id` int(10) unsigned NOT NULL DEFAULT '0',
`name_aegis` varchar(50) NOT NULL DEFAULT '',
`name_english` varchar(50) NOT NULL DEFAULT '',
`name_japanese` varchar(50) NOT NULL DEFAULT '',
`type` tinyint(2) unsigned NOT NULL DEFAULT '0',
`type` varchar(20) DEFAULT NULL,
`subtype` varchar(20) DEFAULT NULL,
`price_buy` mediumint(8) unsigned DEFAULT NULL,
`price_sell` mediumint(8) unsigned DEFAULT NULL,
`weight` smallint(5) unsigned NOT NULL DEFAULT '0',
`weight` smallint(5) unsigned DEFAULT NULL,
`attack` smallint(5) unsigned DEFAULT NULL,
`defence` smallint(5) unsigned DEFAULT NULL,
`defense` smallint(5) unsigned DEFAULT NULL,
`range` tinyint(2) unsigned DEFAULT NULL,
`slots` tinyint(2) unsigned DEFAULT NULL,
`equip_jobs` bigint(20) unsigned DEFAULT NULL,
`equip_upper` tinyint(2) unsigned DEFAULT NULL,
`equip_genders` tinyint(1) unsigned DEFAULT NULL,
`equip_locations` mediumint(7) unsigned DEFAULT NULL,
`job_all` tinyint(1) unsigned DEFAULT NULL,
`job_acolyte` tinyint(1) unsigned DEFAULT NULL,
`job_alchemist` tinyint(1) unsigned DEFAULT NULL,
`job_archer` tinyint(1) unsigned DEFAULT NULL,
`job_assassin` tinyint(1) unsigned DEFAULT NULL,
`job_barddancer` tinyint(1) unsigned DEFAULT NULL,
`job_blacksmith` tinyint(1) unsigned DEFAULT NULL,
`job_crusader` tinyint(1) unsigned DEFAULT NULL,
`job_gunslinger` tinyint(1) unsigned DEFAULT NULL,
`job_hunter` tinyint(1) unsigned DEFAULT NULL,
`job_knight` tinyint(1) unsigned DEFAULT NULL,
`job_mage` tinyint(1) unsigned DEFAULT NULL,
`job_merchant` tinyint(1) unsigned DEFAULT NULL,
`job_monk` tinyint(1) unsigned DEFAULT NULL,
`job_ninja` tinyint(1) unsigned DEFAULT NULL,
`job_novice` tinyint(1) unsigned DEFAULT NULL,
`job_priest` tinyint(1) unsigned DEFAULT NULL,
`job_rogue` tinyint(1) unsigned DEFAULT NULL,
`job_sage` tinyint(1) unsigned DEFAULT NULL,
`job_soullinker` tinyint(1) unsigned DEFAULT NULL,
`job_stargladiator` tinyint(1) unsigned DEFAULT NULL,
`job_supernovice` tinyint(1) unsigned DEFAULT NULL,
`job_swordman` tinyint(1) unsigned DEFAULT NULL,
`job_taekwon` tinyint(1) unsigned DEFAULT NULL,
`job_thief` tinyint(1) unsigned DEFAULT NULL,
`job_wizard` tinyint(1) unsigned DEFAULT NULL,
`class_all` tinyint(1) unsigned DEFAULT NULL,
`class_normal` tinyint(1) unsigned DEFAULT NULL,
`class_upper` tinyint(1) unsigned DEFAULT NULL,
`class_baby` tinyint(1) unsigned DEFAULT NULL,
`gender` varchar(10) DEFAULT NULL,
`location_head_top` tinyint(1) unsigned DEFAULT NULL,
`location_head_mid` tinyint(1) unsigned DEFAULT NULL,
`location_head_low` tinyint(1) unsigned DEFAULT NULL,
`location_armor` tinyint(1) unsigned DEFAULT NULL,
`location_right_hand` tinyint(1) unsigned DEFAULT NULL,
`location_left_hand` tinyint(1) unsigned DEFAULT NULL,
`location_garment` tinyint(1) unsigned DEFAULT NULL,
`location_shoes` tinyint(1) unsigned DEFAULT NULL,
`location_right_accessory` tinyint(1) unsigned DEFAULT NULL,
`location_left_accessory` tinyint(1) unsigned DEFAULT NULL,
`location_costume_head_top` tinyint(1) unsigned DEFAULT NULL,
`location_costume_head_mid` tinyint(1) unsigned DEFAULT NULL,
`location_costume_head_low` tinyint(1) unsigned DEFAULT NULL,
`location_costume_garment` tinyint(1) unsigned DEFAULT NULL,
`location_ammo` tinyint(1) unsigned DEFAULT NULL,
`location_shadow_armor` tinyint(1) unsigned DEFAULT NULL,
`location_shadow_weapon` tinyint(1) unsigned DEFAULT NULL,
`location_shadow_shield` tinyint(1) unsigned DEFAULT NULL,
`location_shadow_shoes` tinyint(1) unsigned DEFAULT NULL,
`location_shadow_right_accessory` tinyint(1) unsigned DEFAULT NULL,
`location_shadow_left_accessory` tinyint(1) unsigned DEFAULT NULL,
`weapon_level` tinyint(1) unsigned DEFAULT NULL,
`equip_level` tinyint(3) unsigned DEFAULT NULL,
`equip_level_min` tinyint(3) unsigned DEFAULT NULL,
`equip_level_max` tinyint(3) unsigned DEFAULT NULL,
`refineable` tinyint(1) unsigned DEFAULT NULL,
`view` smallint(5) unsigned DEFAULT NULL,
`alias_name` varchar(50) DEFAULT NULL,
`flag_buyingstore` tinyint(1) unsigned DEFAULT NULL,
`flag_deadbranch` tinyint(1) unsigned DEFAULT NULL,
`flag_container` tinyint(1) unsigned DEFAULT NULL,
`flag_uniqueid` tinyint(1) unsigned DEFAULT NULL,
`flag_bindonequip` tinyint(1) unsigned DEFAULT NULL,
`flag_dropannounce` tinyint(1) unsigned DEFAULT NULL,
`flag_noconsume` tinyint(1) unsigned DEFAULT NULL,
`flag_dropeffect` varchar(20) DEFAULT NULL,
`delay_duration` bigint(20) unsigned DEFAULT NULL,
`delay_status` varchar(30) DEFAULT NULL,
`stack_amount` smallint(5) unsigned DEFAULT NULL,
`stack_inventory` tinyint(1) unsigned DEFAULT NULL,
`stack_cart` tinyint(1) unsigned DEFAULT NULL,
`stack_storage` tinyint(1) unsigned DEFAULT NULL,
`stack_guildstorage` tinyint(1) unsigned DEFAULT NULL,
`nouse_override` smallint(5) unsigned DEFAULT NULL,
`nouse_sitting` tinyint(1) unsigned DEFAULT NULL,
`trade_override` smallint(5) unsigned DEFAULT NULL,
`trade_nodrop` tinyint(1) unsigned DEFAULT NULL,
`trade_notrade` tinyint(1) unsigned DEFAULT NULL,
`trade_tradepartner` tinyint(1) unsigned DEFAULT NULL,
`trade_nosell` tinyint(1) unsigned DEFAULT NULL,
`trade_nocart` tinyint(1) unsigned DEFAULT NULL,
`trade_nostorage` tinyint(1) unsigned DEFAULT NULL,
`trade_noguildstorage` tinyint(1) unsigned DEFAULT NULL,
`trade_nomail` tinyint(1) unsigned DEFAULT NULL,
`trade_noauction` tinyint(1) unsigned DEFAULT NULL,
`script` text,
`equip_script` text,
`unequip_script` text,
PRIMARY KEY (`id`),
UNIQUE INDEX `UniqueAegisName` (`name_english`)
UNIQUE INDEX `UniqueAegisName` (`name_aegis`)
) ENGINE=MyISAM;
# Items Additional Database
#
# Structure of Database:
#REPLACE INTO `item_db2` VALUES ( ID,'AegisName','Name',Type,Buy,Sell,Weight,ATK,DEF,Range,Slots,Job,Class,Gender,Loc,wLV,eLV,Refineable,View,'Script','OnEquip_Script','OnUnequip_Script');
#
# THQ Quest Items
#=============================================================
#REPLACE INTO `item_db2` VALUES (7950,'THG_Membership','THG Membership',3,NULL,10,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
#REPLACE INTO `item_db2` VALUES (7951,'Token_Bag','Token Bag',3,NULL,10,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
#REPLACE INTO `item_db2` VALUES (1998,'Jeramiah\'s_Jur','Jeramiah\'s Jur',3,NULL,10,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
#REPLACE INTO `item_db2` VALUES (1999,'Zed\'s_Staff','Zed\'s Staff',3,NULL,10,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db2` (`id`,`name_aegis`,`name_english`,`type`,`price_sell`,`weight`,`alias_name`) VALUES (1998,'Jeramiah\'s_Jur','Jeramiah\'s Jur','Etc',10,10,'Jur');
REPLACE INTO `item_db2` (`id`,`name_aegis`,`name_english`,`type`,`price_sell`,`weight`,`alias_name`) VALUES (1999,'Zed\'s_Staff','Zed\'s Staff','Etc',10,10,'Staff_Of_Soul');
REPLACE INTO `item_db2` (`id`,`name_aegis`,`name_english`,`type`,`price_sell`,`weight`,`alias_name`) VALUES (7950,'THG_Membership','THG Membership','Etc',10,10,'Foolishness_Of_Blind');
REPLACE INTO `item_db2` (`id`,`name_aegis`,`name_english`,`type`,`price_sell`,`weight`,`alias_name`) VALUES (7951,'Token_Bag','Token Bag','Etc',10,10,'Leather_Bag_Of_Infinity');
# Official Event Items that had their Effects removed after the event was completed
#REPLACE INTO `item_db2` VALUES (585,'Wurst','Brusti',11,2,NULL,40,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'itemheal rand(15,20),0; itemskill "PR_MAGNIFICAT",3;',NULL,NULL);
#REPLACE INTO `item_db2` VALUES (679,'Gold_Pill','Pilule',0,5000,NULL,300,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'percentheal 50,50;',NULL,NULL);
#=============================================================
REPLACE INTO `item_db2` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`weight`,`script`) VALUES (585,'Wurst','Brusti','Delayconsume',2,40,'itemheal rand(15,20),0; itemskill "PR_MAGNIFICAT",3;');
REPLACE INTO `item_db2` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`weight`,`script`) VALUES (679,'Gold_Pill','Pilule','Healing',5000,300,'percentheal 50,50;');
REPLACE INTO `item_db2` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`weight`,`location_right_accessory`,`location_left_accessory`,`script`) VALUES (2681,'Republic_Ring','Republic Anniversary Ring','Armor',20,100,true,true,'bonus bAllStats,3;');
REPLACE INTO `item_db2` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`weight`,`defense`,`location_head_top`,`refineable`,`view`,`script`) VALUES (5134,'Pumpkin_Hat','Pumpkin-Head','Armor',20,200,2,true,true,206,'bonus2 bSubRace,RC_Demon,5;');
REPLACE INTO `item_db2` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`weight`,`defense`,`location_head_top`,`refineable`,`view`,`script`) VALUES (5136,'Santa\'s_Hat_','Louise\'s Santa Hat','Armor',20,100,3,true,true,20,'bonus bMdef,1; bonus bLuk,1; bonus3 bAutoSpellWhenHit,"AL_HEAL",3,50; bonus3 bAutoSpellWhenHit,"AL_BLESSING",10,50;');
REPLACE INTO `item_db2` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`weight`,`location_head_top`,`refineable`,`view`,`script`) VALUES (5145,'Carnival_Joker_Jester','Carnival Jester','Armor',10,100,true,true,89,'bonus bAllStats,3;');
REPLACE INTO `item_db2` (`id`,`name_aegis`,`name_english`,`type`,`weight`,`defense`,`location_head_top`,`refineable`,`view`,`script`) VALUES (5147,'Baseball_Cap','Baseball Cap','Armor',200,3,true,true,216,'bonus2 bExpAddRace,RC_Boss,50; bonus2 bExpAddRace,RC_NonBoss,50;');
REPLACE INTO `item_db2` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`weight`,`defense`,`location_head_top`,`refineable`,`view`,`script`) VALUES (5201,'Party_Hat_B','2nd Anniversary Party Hat','Armor',20,300,3,true,true,144,'bonus bAllStats,3;');
REPLACE INTO `item_db2` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`weight`,`defense`,`location_head_top`,`refineable`,`view`,`script`) VALUES (5202,'Pumpkin_Hat_','Pumpkin Hat','Armor',20,200,2,true,true,206,'bonus bAllStats,2; bonus2 bSubRace,RC_Demon,5; bonus3 bAddMonsterDropItem,529,RC_DemiHuman,1500;');
REPLACE INTO `item_db2` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`weight`,`location_head_low`,`view`,`script`) VALUES (5204,'Event_Pierrot_Nose','Rudolf\'s Red Nose','Armor',20,100,true,49,'bonus2 bResEff,Eff_Blind,3000; bonus2 bAddMonsterDropItem,12130,30;');
REPLACE INTO `item_db2` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`weight`,`defense`,`location_head_top`,`refineable`,`view`,`script`) VALUES (5264,'Aussie_Flag_Hat','Australian Flag Hat','Armor',20,500,4,true,true,304,'bonus bAllStats,2;');
REPLACE INTO `item_db2` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`weight`,`defense`,`location_head_top`,`refineable`,`view`,`script`) VALUES (5356,'Pumpkin_Hat_H','Pumpkin Hat','Armor',20,200,2,true,true,206,'bonus bAllStats,2; bonus2 bSubRace,RC_Demon,5; bonus2 bMagicAddRace,RC_Demon,5;');
REPLACE INTO `item_db2` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`weight`,`defense`,`slots`,`location_head_top`,`equip_level_min`,`refineable`,`view`,`script`) VALUES (5384,'Santa_Hat_1','Twin Pompom By JB','Armor',20,200,2,1,true,20,true,390,'bonus bLuk,3; bonus2 bResEff,Eff_Curse,2000; bonus bVariableCastrate,-2; bonus bAspdRate,4; bonus2 bAddMonsterDropItem,539,100; bonus2 bAddMonsterDropItem,529,200; bonus2 bAddMonsterDropItem,530,200; autobonus "{ bonus bCritical,10; }",10,5000;');
REPLACE INTO `item_db2` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`weight`,`defense`,`location_head_low`,`view`,`script`) VALUES (5811,'Santa_Beard','Santa Beard','Armor',20,100,5,true,25,'bonus2 bSubRace,RC_Brute,5; bonus2 bSubRace,RC_Player_Doram,5;');
REPLACE INTO `item_db2` (`id`,`name_aegis`,`name_english`,`type`,`weight`,`script`) VALUES (11702,'Moon_Cookie','Moon Cookie','Delayconsume',10,'sc_end SC_POISON; sc_end SC_SILENCE; sc_end SC_BLIND; sc_end SC_CONFUSION; sc_end SC_CURSE; sc_end SC_HALLUCINATION; itemskill "AL_BLESSING",7;');
REPLACE INTO `item_db2` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`weight`,`script`) VALUES (12131,'Lucky_Potion','Lucky Potion','Healing',2,100,'sc_start SC_LUKFOOD,180000,15;');
REPLACE INTO `item_db2` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`weight`,`script`) VALUES (12143,'Red_Can','Red Can','Usable',50000,300,'percentheal 25,25;');
#REPLACE INTO `item_db2` VALUES (2681,'Republic_Ring','Republic Anniversary Ring',4,20,NULL,100,NULL,0,NULL,0,0xFFFFFFFF,7,2,136,NULL,0,0,0,'bonus bAllStats,3;',NULL,NULL);
#REPLACE INTO `item_db2` VALUES (5134,'Pumpkin_Hat','Pumpkin-Head',4,20,NULL,200,NULL,2,NULL,0,0xFFFFFFFF,7,2,256,NULL,0,1,206,'bonus2 bSubRace,RC_Demon,5;',NULL,NULL);
#REPLACE INTO `item_db2` VALUES (5136,'Santa\'s_Hat_','Louise\'s Santa Hat',4,20,NULL,100,NULL,3,NULL,0,0xFFFFFFFF,7,2,256,NULL,0,1,20,'bonus bMdef,1; bonus bLuk,1; bonus3 bAutoSpellWhenHit,"AL_HEAL",3,50; bonus3 bAutoSpellWhenHit,"AL_BLESSING",10,50;',NULL,NULL);
#REPLACE INTO `item_db2` VALUES (5145,'Carnival_Joker_Jester','Carnival Jester',4,10,NULL,100,NULL,0,NULL,0,0xFFFFFFFF,7,2,256,NULL,0,1,89,'bonus bAllStats,3;',NULL,NULL);
#REPLACE INTO `item_db2` VALUES (5147,'Baseball_Cap','Baseball Cap',4,0,NULL,200,NULL,3,NULL,0,0xFFFFFFFF,7,2,256,NULL,0,1,216,'bonus2 bExpAddRace,RC_Boss,50; bonus2 bExpAddRace,RC_NonBoss,50;',NULL,NULL);
#REPLACE INTO `item_db2` VALUES (5201,'Party_Hat_B','2nd Anniversary Party Hat',4,20,NULL,300,NULL,3,NULL,0,0xFFFFFFFF,7,2,256,NULL,0,1,144,'bonus bAllStats,3;',NULL,NULL);
#REPLACE INTO `item_db2` VALUES (5202,'Pumpkin_Hat_','Pumpkin Hat',4,20,NULL,200,NULL,2,NULL,0,0xFFFFFFFF,7,2,256,NULL,0,1,206,'bonus bAllStats,2; bonus2 bSubRace,RC_Demon,5; bonus3 bAddMonsterDropItem,529,RC_DemiHuman,1500;',NULL,NULL);
#REPLACE INTO `item_db2` VALUES (5204,'Event_Pierrot_Nose','Rudolf\'s Red Nose',4,20,NULL,100,NULL,0,NULL,0,0xFFFFFFFF,7,2,1,NULL,0,0,49,'bonus2 bResEff,Eff_Blind,3000; bonus2 bAddMonsterDropItem,12130,30;',NULL,NULL);
#REPLACE INTO `item_db2` VALUES (5264,'Aussie_Flag_Hat','Australian Flag Hat',4,20,NULL,500,NULL,4,NULL,0,0xFFFFFFFF,7,2,256,NULL,0,1,304,'bonus bAllStats,2;',NULL,NULL);
#REPLACE INTO `item_db2` VALUES (5356,'Pumpkin_Hat_H','Pumpkin Hat',4,20,NULL,200,NULL,2,NULL,0,0xFFFFFFFF,7,2,256,NULL,0,1,206,'bonus bAllStats,2; bonus2 bSubRace,RC_Demon,5; bonus2 bMagicAddRace,RC_Demon,5;',NULL,NULL);
#REPLACE INTO `item_db2` VALUES (5811,'Santa_Beard','Santa Beard',4,20,NULL,100,NULL,5,NULL,0,0xFFFFFFFF,7,2,1,NULL,0,0,25,'bonus2 bSubRace,RC_Brute,5;',NULL,NULL);
#REPLACE INTO `item_db2` VALUES (11702,'Moon_Cookie','Moon Cookie',11,0,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'sc_end SC_Poison; sc_end SC_Silence; sc_end SC_Blind; sc_end SC_Confusion; sc_end SC_Curse; sc_end SC_Hallucination; itemskill "AL_BLESSING",7;',NULL,NULL);
#REPLACE INTO `item_db2` VALUES (12131,'Lucky_Potion','Lucky Potion',0,2,NULL,100,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'sc_start SC_LUKFood,180000,15;',NULL,NULL);
#REPLACE INTO `item_db2` VALUES (12143,'Red_Can','Red Can',2,50000,NULL,300,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'percentheal 25,25;',NULL,NULL);
#Event effect: Summon monster? Probably Rice_Cake. x_x
#REPLACE INTO `item_db2` VALUES (12199,'Rice_Scroll','Rice Scroll',2,0,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
#REPLACE INTO `item_db2` VALUES (12200,'Event_Cake','Event Cake',2,20,NULL,50,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'itemskill "PR_MAGNIFICAT",3;',NULL,NULL);
#REPLACE INTO `item_db2` VALUES (12238,'New_Year_Rice_Cake_1','New Year Rice Cake',0,20,NULL,100,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'percentheal 20,15; sc_start SC_STRFood,1200000,3; sc_start SC_INTFood,1200000,3; sc_start SC_LUKFood,1200000,3; sc_start SC_SpeedUp1,5000,0;',NULL,NULL);
#REPLACE INTO `item_db2` VALUES (12239,'New_Year_Rice_Cake_2','New Year Rice Cake',0,20,NULL,100,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'percentheal 20,15; sc_start SC_DEXFood,1200000,3; sc_start SC_AGIFood,1200000,3; sc_start SC_VITFood,1200000,3; sc_start SC_SpeedUp1,5000,0;',NULL,NULL);
# Event effect: Summon monster? Probably Rice_Cake. x_x
#=============================================================
REPLACE INTO `item_db2` (`id`,`name_aegis`,`name_english`,`type`) VALUES (12199,'Rice_Scroll','Rice Scroll','Usable');
REPLACE INTO `item_db2` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`weight`,`script`) VALUES (12200,'Event_Cake','Event Cake','Usable',20,50,'itemskill "PR_MAGNIFICAT",3;');
REPLACE INTO `item_db2` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`weight`,`script`) VALUES (12238,'New_Year_Rice_Cake_1','New Year Rice Cake','Healing',20,100,'percentheal 20,15; sc_start SC_STRFOOD,1200000,3; sc_start SC_INTFOOD,1200000,3; sc_start SC_LUKFOOD,1200000,3; sc_start SC_SPEEDUP1,5000,0;');
REPLACE INTO `item_db2` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`weight`,`script`) VALUES (12239,'New_Year_Rice_Cake_2','New Year Rice Cake','Healing',20,100,'percentheal 20,15; sc_start SC_DEXFOOD,1200000,3; sc_start SC_AGIFOOD,1200000,3; sc_start SC_VITFOOD,1200000,3; sc_start SC_SPEEDUP1,5000,0;');
# iRO St. Patrick's Day Event 2008
#=============================================================
#REPLACE INTO `item_db2` VALUES (12715,'Black_Treasure_Chest','Black Treasure Chest',2,0,NULL,200,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'callfunc "F_08stpattyseventbox";',NULL,NULL);
REPLACE INTO `item_db2` (`id`,`name_aegis`,`name_english`,`type`,`weight`,`alias_name`) VALUES (7915,'Copper_Coin_','Bronze Coin','Etc',10,'Copper_Coin');
# iRO Valentine's Day Event 2009
#=============================================================
#REPLACE INTO `item_db2` VALUES (12742,'Valentine_Gift_Box_M','Valentine Gift Box',2,10,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'getitem 7946,1;',NULL,NULL);
#REPLACE INTO `item_db2` VALUES (12743,'Valentine_Gift_Box_F','Valentine Gift Box',2,10,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'getitem 7947,1;',NULL,NULL);
#REPLACE INTO `item_db2` VALUES (12744,'Chocolate_Box','Chocolate Box',2,10,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'getitem 558,1;',NULL,NULL);
#REPLACE INTO `item_db2` VALUES (14466,'Valentine\'s_Emblem_Box','Valentine\'s Emblem Box',2,10,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'getitem 5817,1;',NULL,NULL);
#REPLACE INTO `item_db2` VALUES (7946,'Gold_Ring_Of_Valentine','Gold Ring Of Valentine',3,10,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
#REPLACE INTO `item_db2` VALUES (7947,'Silver_Ring_Of_Valentine','Silver Ring Of Valentine',3,10,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
#REPLACE INTO `item_db2` VALUES (7948,'Box','Box',3,10,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
#REPLACE INTO `item_db2` VALUES (5817,'Valentine\'s_Emblem','Valentine\'s Emblem',4,10,NULL,0,NULL,3,NULL,0,0xFFFFFFFF,7,2,136,NULL,0,0,0,'bonus bAtkRate,3; bonus bMatkRate,3; bonus bAllStats,2; bonus bFlee,10; bonus bAspd,1; bonus bMdef,3; bonus2 bSkillAtk,"AL_HEAL",10; bonus2 bSkillHeal,"AL_HEAL",10; bonus2 bSkillHeal,"AM_POTIONPITCHER",10; bonus2 bAddItemHealRate,IG_Potion,10;',NULL,NULL);
REPLACE INTO `item_db2` (`id`,`name_aegis`,`name_english`,`type`,`weight`,`alias_name`) VALUES (7916,'Silver_Coin_','Silver Coin','Etc',10,'Silver_Coin');
REPLACE INTO `item_db2` (`id`,`name_aegis`,`name_english`,`type`,`weight`,`alias_name`,`script`) VALUES (12715,'Black_Treasure_Chest','Black Treasure Chest','Usable',200,'Treasure_Box_','callfunc "F_08stpattyseventbox";');
REPLACE INTO `item_db2` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`defense`,`location_right_accessory`,`location_left_accessory`,`script`) VALUES (5817,'Valentine\'s_Emblem','Valentine\'s Emblem','Armor',10,3,true,true,'bonus bAtkRate,3; bonus bMatkRate,3; bonus bAllStats,2; bonus bFlee,10; bonus bAspd,1; bonus bMdef,3; bonus2 bSkillAtk,"AL_HEAL",10; bonus2 bSkillHeal,"AL_HEAL",10; bonus2 bSkillHeal,"AM_POTIONPITCHER",10; bonus2 bAddItemGroupHealRate,IG_Potion,10;');
REPLACE INTO `item_db2` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`) VALUES (7946,'Gold_Ring_Of_Valentine','Gold Ring Of Valentine','Etc',10);
REPLACE INTO `item_db2` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`) VALUES (7947,'Silver_Ring_Of_Valentine','Silver Ring Of Valentine','Etc',10);
REPLACE INTO `item_db2` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`weight`) VALUES (7948,'Box','Box','Etc',10,10);
REPLACE INTO `item_db2` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`script`) VALUES (12742,'Valentine_Gift_Box_M','Valentine Gift Box','Usable',10,'getitem 7946,1;');
REPLACE INTO `item_db2` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`script`) VALUES (12743,'Valentine_Gift_Box_F','Valentine Gift Box','Usable',10,'getitem 7947,1;');
REPLACE INTO `item_db2` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`script`) VALUES (12744,'Chocolate_Box','Chocolate Box','Usable',10,'getitem 558,1;');
REPLACE INTO `item_db2` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`script`) VALUES (14466,'Valentine\'s_Emblem_Box','Valentine\'s Emblem Box','Usable',10,'getitem 5817,1;');
# iRO Halloween Event 2009
#=============================================================
#REPLACE INTO `item_db2` VALUES (5668,'Weird_Pumpkin_Hat','Weird Pumpkin Hat',4,20,NULL,0,NULL,5,NULL,0,0xFFFFFFFF,7,2,256,NULL,0,1,206,'bonus bMdef,5; bonus2 bAddMonsterDropItem,12192,2500;',NULL,NULL);
#REPLACE INTO `item_db2` VALUES (6298,'Crushed_Pumpkin','Crushed Pumpkin',3,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
#REPLACE INTO `item_db2` VALUES (6299,'Worn_Fabric','Worn Fabric',3,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db2` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`defense`,`location_head_top`,`refineable`,`view`,`script`) VALUES (5668,'Weird_Pumpkin_Hat','Weird Pumpkin Hat','Armor',20,5,true,true,206,'bonus bMdef,5; bonus2 bAddMonsterDropItem,12192,2500;');
REPLACE INTO `item_db2` (`id`,`name_aegis`,`name_english`,`type`) VALUES (6298,'Crushed_Pumpkin','Crushed Pumpkin','Etc');
REPLACE INTO `item_db2` (`id`,`name_aegis`,`name_english`,`type`) VALUES (6299,'Worn_Fabric','Worn Fabric','Etc');
# Old Tuxedo and Wedding Dress, will display the outfit when worn.
#==================================================================
#REPLACE INTO `item_db2` VALUES (2338,'Wedding_Dress','Wedding Dress',4,43000,NULL,500,NULL,0,NULL,0,0xFFFFFFFE,7,0,16,NULL,0,1,0,NULL,'setoption Option_Wedding,1;','setoption Option_Wedding,0;');
#REPLACE INTO `item_db2` VALUES (7170,'Tuxedo','Tuxedo',4,43000,NULL,10,NULL,0,NULL,0,0xFFFFFFFE,7,1,16,NULL,0,1,0,NULL,'setoption Option_Wedding,1;','setoption Option_Wedding,0;');
#=============================================================
REPLACE INTO `item_db2` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`weight`,`job_all`,`job_novice`,`location_armor`,`refineable`,`equip_script`,`unequip_script`) VALUES (2338,'Wedding_Dress','Wedding Dress','Armor',43000,500,true,false,true,true,'sc_start SC_WEDDING,INFINITE_TICK,0;','sc_end SC_WEDDING;');
REPLACE INTO `item_db2` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`weight`,`job_all`,`job_novice`,`gender`,`location_armor`,`refineable`,`equip_script`,`unequip_script`) VALUES (7170,'Tuxedo','Tuxedo','Armor',43000,10,true,false,'Male',true,true,'sc_start SC_WEDDING,INFINITE_TICK,0;','sc_end SC_WEDDING;');
# Non-kRO Eden Group Mark effect
#=============================================================
REPLACE INTO `item_db2` (`id`,`name_aegis`,`name_english`,`type`,`script`) VALUES (22508,'Para_Team_Mark_','Eden Group Mark','Delayconsume','unitskilluseid getcharid(3),"AL_TELEPORT",3;');

View File

@ -5,92 +5,178 @@
DROP TABLE IF EXISTS `item_db2_re`;
CREATE TABLE `item_db2_re` (
`id` int(10) unsigned NOT NULL DEFAULT '0',
`name_aegis` varchar(50) NOT NULL DEFAULT '',
`name_english` varchar(50) NOT NULL DEFAULT '',
`name_japanese` varchar(50) NOT NULL DEFAULT '',
`type` tinyint(2) unsigned NOT NULL DEFAULT '0',
`type` varchar(20) DEFAULT NULL,
`subtype` varchar(20) DEFAULT NULL,
`price_buy` mediumint(8) unsigned DEFAULT NULL,
`price_sell` mediumint(8) unsigned DEFAULT NULL,
`weight` smallint(5) unsigned NOT NULL DEFAULT '0',
`atk:matk` varchar(11) DEFAULT NULL,
`defence` smallint(5) unsigned DEFAULT NULL,
`weight` smallint(5) unsigned DEFAULT NULL,
`attack` smallint(5) unsigned DEFAULT NULL,
`magic_attack` smallint(5) unsigned DEFAULT NULL,
`defense` smallint(5) unsigned DEFAULT NULL,
`range` tinyint(2) unsigned DEFAULT NULL,
`slots` tinyint(2) unsigned DEFAULT NULL,
`equip_jobs` bigint(20) unsigned DEFAULT NULL,
`equip_upper` tinyint(2) unsigned DEFAULT NULL,
`equip_genders` tinyint(1) unsigned DEFAULT NULL,
`equip_locations` mediumint(7) unsigned DEFAULT NULL,
`job_all` tinyint(1) unsigned DEFAULT NULL,
`job_acolyte` tinyint(1) unsigned DEFAULT NULL,
`job_alchemist` tinyint(1) unsigned DEFAULT NULL,
`job_archer` tinyint(1) unsigned DEFAULT NULL,
`job_assassin` tinyint(1) unsigned DEFAULT NULL,
`job_barddancer` tinyint(1) unsigned DEFAULT NULL,
`job_blacksmith` tinyint(1) unsigned DEFAULT NULL,
`job_crusader` tinyint(1) unsigned DEFAULT NULL,
`job_gunslinger` tinyint(1) unsigned DEFAULT NULL,
`job_hunter` tinyint(1) unsigned DEFAULT NULL,
`job_kagerouoboro` tinyint(1) unsigned DEFAULT NULL,
`job_knight` tinyint(1) unsigned DEFAULT NULL,
`job_mage` tinyint(1) unsigned DEFAULT NULL,
`job_merchant` tinyint(1) unsigned DEFAULT NULL,
`job_monk` tinyint(1) unsigned DEFAULT NULL,
`job_ninja` tinyint(1) unsigned DEFAULT NULL,
`job_novice` tinyint(1) unsigned DEFAULT NULL,
`job_priest` tinyint(1) unsigned DEFAULT NULL,
`job_rebellion` tinyint(1) unsigned DEFAULT NULL,
`job_rogue` tinyint(1) unsigned DEFAULT NULL,
`job_sage` tinyint(1) unsigned DEFAULT NULL,
`job_soullinker` tinyint(1) unsigned DEFAULT NULL,
`job_stargladiator` tinyint(1) unsigned DEFAULT NULL,
`job_summoner` tinyint(1) unsigned DEFAULT NULL,
`job_supernovice` tinyint(1) unsigned DEFAULT NULL,
`job_swordman` tinyint(1) unsigned DEFAULT NULL,
`job_taekwon` tinyint(1) unsigned DEFAULT NULL,
`job_thief` tinyint(1) unsigned DEFAULT NULL,
`job_wizard` tinyint(1) unsigned DEFAULT NULL,
`class_all` tinyint(1) unsigned DEFAULT NULL,
`class_normal` tinyint(1) unsigned DEFAULT NULL,
`class_upper` tinyint(1) unsigned DEFAULT NULL,
`class_baby` tinyint(1) unsigned DEFAULT NULL,
`class_third` tinyint(1) unsigned DEFAULT NULL,
`class_third_upper` tinyint(1) unsigned DEFAULT NULL,
`class_third_baby` tinyint(1) unsigned DEFAULT NULL,
`gender` varchar(10) DEFAULT NULL,
`location_head_top` tinyint(1) unsigned DEFAULT NULL,
`location_head_mid` tinyint(1) unsigned DEFAULT NULL,
`location_head_low` tinyint(1) unsigned DEFAULT NULL,
`location_armor` tinyint(1) unsigned DEFAULT NULL,
`location_right_hand` tinyint(1) unsigned DEFAULT NULL,
`location_left_hand` tinyint(1) unsigned DEFAULT NULL,
`location_garment` tinyint(1) unsigned DEFAULT NULL,
`location_shoes` tinyint(1) unsigned DEFAULT NULL,
`location_right_accessory` tinyint(1) unsigned DEFAULT NULL,
`location_left_accessory` tinyint(1) unsigned DEFAULT NULL,
`location_costume_head_top` tinyint(1) unsigned DEFAULT NULL,
`location_costume_head_mid` tinyint(1) unsigned DEFAULT NULL,
`location_costume_head_low` tinyint(1) unsigned DEFAULT NULL,
`location_costume_garment` tinyint(1) unsigned DEFAULT NULL,
`location_ammo` tinyint(1) unsigned DEFAULT NULL,
`location_shadow_armor` tinyint(1) unsigned DEFAULT NULL,
`location_shadow_weapon` tinyint(1) unsigned DEFAULT NULL,
`location_shadow_shield` tinyint(1) unsigned DEFAULT NULL,
`location_shadow_shoes` tinyint(1) unsigned DEFAULT NULL,
`location_shadow_right_accessory` tinyint(1) unsigned DEFAULT NULL,
`location_shadow_left_accessory` tinyint(1) unsigned DEFAULT NULL,
`weapon_level` tinyint(1) unsigned DEFAULT NULL,
`equip_level` varchar(10) DEFAULT NULL,
`equip_level_min` tinyint(3) unsigned DEFAULT NULL,
`equip_level_max` tinyint(3) unsigned DEFAULT NULL,
`refineable` tinyint(1) unsigned DEFAULT NULL,
`view` smallint(5) unsigned DEFAULT NULL,
`alias_name` varchar(50) DEFAULT NULL,
`flag_buyingstore` tinyint(1) unsigned DEFAULT NULL,
`flag_deadbranch` tinyint(1) unsigned DEFAULT NULL,
`flag_container` tinyint(1) unsigned DEFAULT NULL,
`flag_uniqueid` tinyint(1) unsigned DEFAULT NULL,
`flag_bindonequip` tinyint(1) unsigned DEFAULT NULL,
`flag_dropannounce` tinyint(1) unsigned DEFAULT NULL,
`flag_noconsume` tinyint(1) unsigned DEFAULT NULL,
`flag_dropeffect` varchar(20) DEFAULT NULL,
`delay_duration` bigint(20) unsigned DEFAULT NULL,
`delay_status` varchar(30) DEFAULT NULL,
`stack_amount` smallint(5) unsigned DEFAULT NULL,
`stack_inventory` tinyint(1) unsigned DEFAULT NULL,
`stack_cart` tinyint(1) unsigned DEFAULT NULL,
`stack_storage` tinyint(1) unsigned DEFAULT NULL,
`stack_guildstorage` tinyint(1) unsigned DEFAULT NULL,
`nouse_override` smallint(5) unsigned DEFAULT NULL,
`nouse_sitting` tinyint(1) unsigned DEFAULT NULL,
`trade_override` smallint(5) unsigned DEFAULT NULL,
`trade_nodrop` tinyint(1) unsigned DEFAULT NULL,
`trade_notrade` tinyint(1) unsigned DEFAULT NULL,
`trade_tradepartner` tinyint(1) unsigned DEFAULT NULL,
`trade_nosell` tinyint(1) unsigned DEFAULT NULL,
`trade_nocart` tinyint(1) unsigned DEFAULT NULL,
`trade_nostorage` tinyint(1) unsigned DEFAULT NULL,
`trade_noguildstorage` tinyint(1) unsigned DEFAULT NULL,
`trade_nomail` tinyint(1) unsigned DEFAULT NULL,
`trade_noauction` tinyint(1) unsigned DEFAULT NULL,
`script` text,
`equip_script` text,
`unequip_script` text,
PRIMARY KEY (`id`),
UNIQUE INDEX `UniqueAegisName` (`name_english`)
UNIQUE INDEX `UniqueAegisName` (`name_aegis`)
) ENGINE=MyISAM;
# Items Additional Database
#
# Structure of Database:
#REPLACE INTO `item_db2_re` VALUES ( ID,'AegisName','Name',Type,Buy,Sell,Weight,'ATK[:MATK]',DEF,Range,Slots,Job,Class,Gender,Loc,wLV,'eLV[:maxLevel]',Refineable,View,'Script','OnEquip_Script','OnUnequip_Script');
#
# THQ Quest Items
#=============================================================
#REPLACE INTO `item_db2_re` VALUES (7950,'THG_Membership','THG Membership',3,NULL,10,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
#REPLACE INTO `item_db2_re` VALUES (7951,'Token_Bag','Token Bag',3,NULL,10,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
#REPLACE INTO `item_db2_re` VALUES (1998,'Jeramiah\'s_Jur','Jeramiah\'s Jur',3,NULL,10,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
#REPLACE INTO `item_db2_re` VALUES (1999,'Zed\'s_Staff','Zed\'s Staff',3,NULL,10,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db2_re` (`id`,`name_aegis`,`name_english`,`type`,`price_sell`,`weight`,`alias_name`) VALUES (1998,'Jeramiah\'s_Jur','Jeramiah\'s Jur','Etc',10,10,'Jur');
REPLACE INTO `item_db2_re` (`id`,`name_aegis`,`name_english`,`type`,`price_sell`,`weight`,`alias_name`) VALUES (1999,'Zed\'s_Staff','Zed\'s Staff','Etc',10,10,'Staff_Of_Soul');
REPLACE INTO `item_db2_re` (`id`,`name_aegis`,`name_english`,`type`,`price_sell`,`weight`,`alias_name`) VALUES (7950,'THG_Membership','THG Membership','Etc',10,10,'Foolishness_Of_Blind');
REPLACE INTO `item_db2_re` (`id`,`name_aegis`,`name_english`,`type`,`price_sell`,`weight`,`alias_name`) VALUES (7951,'Token_Bag','Token Bag','Etc',10,10,'Leather_Bag_Of_Infinity');
# Official Event Items that had their Effects removed after the event was completed
#REPLACE INTO `item_db2_re` VALUES (585,'Wurst','Brusti',11,2,NULL,40,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'itemheal rand(15,20),0; itemskill "PR_MAGNIFICAT",3;',NULL,NULL);
#REPLACE INTO `item_db2_re` VALUES (679,'Gold_Pill','Pilule',0,5000,NULL,300,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'percentheal 50,50;',NULL,NULL);
#=============================================================
REPLACE INTO `item_db2_re` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`weight`,`script`) VALUES (585,'Wurst','Brusti','Delayconsume',2,40,'itemheal rand(15,20),0; itemskill "PR_MAGNIFICAT",3;');
REPLACE INTO `item_db2_re` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`weight`,`script`) VALUES (679,'Gold_Pill','Pilule','Healing',5000,300,'percentheal 50,50;');
REPLACE INTO `item_db2_re` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`weight`,`location_right_accessory`,`location_left_accessory`,`script`) VALUES (2681,'Republic_Ring','Republic Anniversary Ring','Armor',20,100,true,true,'bonus bAllStats,3;');
REPLACE INTO `item_db2_re` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`weight`,`defense`,`location_head_top`,`refineable`,`view`,`script`) VALUES (5134,'Pumpkin_Hat','Pumpkin-Head','Armor',20,200,2,true,true,206,'bonus2 bSubRace,RC_Demon,5;');
REPLACE INTO `item_db2_re` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`weight`,`defense`,`location_head_top`,`refineable`,`view`,`script`) VALUES (5136,'Santa\'s_Hat_','Louise\'s Santa Hat','Armor',20,100,3,true,true,20,'bonus bMdef,1; bonus bLuk,1; bonus3 bAutoSpellWhenHit,"AL_HEAL",3,50; bonus3 bAutoSpellWhenHit,"AL_BLESSING",10,50;');
REPLACE INTO `item_db2_re` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`weight`,`location_head_top`,`refineable`,`view`,`script`) VALUES (5145,'Carnival_Joker_Jester','Carnival Jester','Armor',10,100,true,true,89,'bonus bAllStats,3;');
REPLACE INTO `item_db2_re` (`id`,`name_aegis`,`name_english`,`type`,`weight`,`defense`,`location_head_top`,`refineable`,`view`,`script`) VALUES (5147,'Baseball_Cap','Baseball Cap','Armor',200,3,true,true,216,'bonus2 bExpAddRace,RC_Boss,50; bonus2 bExpAddRace,RC_NonBoss,50;');
REPLACE INTO `item_db2_re` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`weight`,`defense`,`location_head_top`,`refineable`,`view`,`script`) VALUES (5201,'Party_Hat_B','2nd Anniversary Party Hat','Armor',20,300,3,true,true,144,'bonus bAllStats,3;');
REPLACE INTO `item_db2_re` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`weight`,`defense`,`location_head_top`,`refineable`,`view`,`script`) VALUES (5202,'Pumpkin_Hat_','Pumpkin Hat','Armor',20,200,2,true,true,206,'bonus bAllStats,2; bonus2 bSubRace,RC_Demon,5; bonus3 bAddMonsterDropItem,529,RC_DemiHuman,1500;');
REPLACE INTO `item_db2_re` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`weight`,`location_head_low`,`view`,`script`) VALUES (5204,'Event_Pierrot_Nose','Rudolf\'s Red Nose','Armor',20,100,true,49,'bonus2 bResEff,Eff_Blind,3000; bonus2 bAddMonsterDropItem,12130,30;');
REPLACE INTO `item_db2_re` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`weight`,`defense`,`location_head_top`,`refineable`,`view`,`script`) VALUES (5264,'Aussie_Flag_Hat','Australian Flag Hat','Armor',20,500,4,true,true,304,'bonus bAllStats,2;');
REPLACE INTO `item_db2_re` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`weight`,`defense`,`location_head_top`,`refineable`,`view`,`script`) VALUES (5356,'Pumpkin_Hat_H','Pumpkin Hat','Armor',20,200,2,true,true,206,'bonus bAllStats,2; bonus2 bSubRace,RC_Demon,5; bonus2 bMagicAddRace,RC_Demon,5;');
REPLACE INTO `item_db2_re` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`weight`,`defense`,`slots`,`location_head_top`,`equip_level_min`,`refineable`,`view`,`script`) VALUES (5384,'Santa_Hat_1','Twin Pompom By JB','Armor',20,200,2,1,true,20,true,390,'bonus bLuk,3; bonus2 bResEff,Eff_Curse,2000; bonus bVariableCastrate,-2; bonus bAspdRate,4; bonus2 bAddMonsterDropItem,539,100; bonus2 bAddMonsterDropItem,529,200; bonus2 bAddMonsterDropItem,530,200; autobonus "{ bonus bCritical,10; }",10,5000;');
REPLACE INTO `item_db2_re` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`weight`,`defense`,`location_head_low`,`view`,`script`) VALUES (5811,'Santa_Beard','Santa Beard','Armor',20,100,5,true,25,'bonus2 bSubRace,RC_Brute,5; bonus2 bSubRace,RC_Player_Doram,5;');
REPLACE INTO `item_db2_re` (`id`,`name_aegis`,`name_english`,`type`,`weight`,`script`) VALUES (11702,'Moon_Cookie','Moon Cookie','Delayconsume',10,'sc_end SC_POISON; sc_end SC_SILENCE; sc_end SC_BLIND; sc_end SC_CONFUSION; sc_end SC_CURSE; sc_end SC_HALLUCINATION; itemskill "AL_BLESSING",7;');
REPLACE INTO `item_db2_re` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`weight`,`script`) VALUES (12131,'Lucky_Potion','Lucky Potion','Healing',2,100,'sc_start SC_LUKFOOD,180000,15;');
REPLACE INTO `item_db2_re` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`weight`,`script`) VALUES (12143,'Red_Can','Red Can','Usable',50000,300,'percentheal 25,25;');
#REPLACE INTO `item_db2_re` VALUES (2681,'Republic_Ring','Republic Anniversary Ring',4,20,NULL,100,NULL,0,NULL,0,0xFFFFFFFF,7,2,136,NULL,0,0,0,'bonus bAllStats,3;',NULL,NULL);
#REPLACE INTO `item_db2_re` VALUES (5134,'Pumpkin_Hat','Pumpkin-Head',4,20,NULL,200,NULL,2,NULL,0,0xFFFFFFFF,7,2,256,NULL,0,1,206,'bonus2 bSubRace,RC_Demon,5;',NULL,NULL);
#REPLACE INTO `item_db2_re` VALUES (5136,'Santa\'s_Hat_','Louise\'s Santa Hat',4,20,NULL,100,NULL,3,NULL,0,0xFFFFFFFF,7,2,256,NULL,0,1,20,'bonus bMdef,1; bonus bLuk,1; bonus3 bAutoSpellWhenHit,"AL_HEAL",3,50; bonus3 bAutoSpellWhenHit,"AL_BLESSING",10,50;',NULL,NULL);
#REPLACE INTO `item_db2_re` VALUES (5145,'Carnival_Joker_Jester','Carnival Jester',4,10,NULL,100,NULL,0,NULL,0,0xFFFFFFFF,7,2,256,NULL,0,1,89,'bonus bAllStats,3;',NULL,NULL);
#REPLACE INTO `item_db2_re` VALUES (5147,'Baseball_Cap','Baseball Cap',4,0,NULL,200,NULL,3,NULL,0,0xFFFFFFFF,7,2,256,NULL,0,1,216,'bonus2 bExpAddRace,RC_Boss,50; bonus2 bExpAddRace,RC_NonBoss,50;',NULL,NULL);
#REPLACE INTO `item_db2_re` VALUES (5201,'Party_Hat_B','2nd Anniversary Party Hat',4,20,NULL,300,NULL,3,NULL,0,0xFFFFFFFF,7,2,256,NULL,0,1,144,'bonus bAllStats,3;',NULL,NULL);
#REPLACE INTO `item_db2_re` VALUES (5202,'Pumpkin_Hat_','Pumpkin Hat',4,20,NULL,200,NULL,2,NULL,0,0xFFFFFFFF,7,2,256,NULL,0,1,206,'bonus bAllStats,2; bonus2 bSubRace,RC_Demon,5; bonus3 bAddMonsterDropItem,529,RC_DemiHuman,1500;',NULL,NULL);
#REPLACE INTO `item_db2_re` VALUES (5204,'Event_Pierrot_Nose','Rudolf\'s Red Nose',4,20,NULL,100,NULL,0,NULL,0,0xFFFFFFFF,7,2,1,NULL,0,0,49,'bonus2 bResEff,Eff_Blind,3000; bonus2 bAddMonsterDropItem,12130,30;',NULL,NULL);
#REPLACE INTO `item_db2_re` VALUES (5264,'Aussie_Flag_Hat','Australian Flag Hat',4,20,NULL,500,NULL,4,NULL,0,0xFFFFFFFF,7,2,256,NULL,0,1,304,'bonus bAllStats,2;',NULL,NULL);
#REPLACE INTO `item_db2_re` VALUES (5356,'Pumpkin_Hat_H','Pumpkin Hat',4,20,NULL,200,NULL,2,NULL,0,0xFFFFFFFF,7,2,256,NULL,0,1,206,'bonus bAllStats,2; bonus2 bSubRace,RC_Demon,5; bonus2 bMagicAddRace,RC_Demon,5;',NULL,NULL);
#REPLACE INTO `item_db2_re` VALUES (5811,'Santa_Beard','Santa Beard',4,20,NULL,100,NULL,5,NULL,0,0xFFFFFFFF,7,2,1,NULL,0,0,25,'bonus2 bSubRace,RC_Brute,5;',NULL,NULL);
#REPLACE INTO `item_db2_re` VALUES (11702,'Moon_Cookie','Moon Cookie',11,0,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'sc_end SC_Poison; sc_end SC_Silence; sc_end SC_Blind; sc_end SC_Confusion; sc_end SC_Curse; sc_end SC_Hallucination; itemskill "AL_BLESSING",7;',NULL,NULL);
#REPLACE INTO `item_db2_re` VALUES (12131,'Lucky_Potion','Lucky Potion',0,2,NULL,100,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'sc_start SC_LUKFood,180000,15;',NULL,NULL);
#REPLACE INTO `item_db2_re` VALUES (12143,'Red_Can','Red Can',2,50000,NULL,300,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'percentheal 25,25;',NULL,NULL);
#Event effect: Summon monster? Probably Rice_Cake. x_x
#REPLACE INTO `item_db2_re` VALUES (12199,'Rice_Scroll','Rice Scroll',2,0,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
#REPLACE INTO `item_db2_re` VALUES (12200,'Event_Cake','Event Cake',2,20,NULL,50,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'itemskill "PR_MAGNIFICAT",3;',NULL,NULL);
#REPLACE INTO `item_db2_re` VALUES (12238,'New_Year_Rice_Cake_1','New Year Rice Cake',0,20,NULL,100,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'percentheal 20,15; sc_start SC_STRFood,1200000,3; sc_start SC_INTFood,1200000,3; sc_start SC_LUKFood,1200000,3; sc_start SC_SpeedUp1,5000,0;',NULL,NULL);
#REPLACE INTO `item_db2_re` VALUES (12239,'New_Year_Rice_Cake_2','New Year Rice Cake',0,20,NULL,100,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'percentheal 20,15; sc_start SC_DEXFood,1200000,3; sc_start SC_AGIFood,1200000,3; sc_start SC_VITFood,1200000,3; sc_start SC_SpeedUp1,5000,0;',NULL,NULL);
# Event effect: Summon monster? Probably Rice_Cake. x_x
#=============================================================
REPLACE INTO `item_db2_re` (`id`,`name_aegis`,`name_english`,`type`) VALUES (12199,'Rice_Scroll','Rice Scroll','Usable');
REPLACE INTO `item_db2_re` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`weight`,`script`) VALUES (12200,'Event_Cake','Event Cake','Usable',20,50,'itemskill "PR_MAGNIFICAT",3;');
REPLACE INTO `item_db2_re` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`weight`,`script`) VALUES (12238,'New_Year_Rice_Cake_1','New Year Rice Cake','Healing',20,100,'percentheal 20,15; sc_start SC_STRFOOD,1200000,3; sc_start SC_INTFOOD,1200000,3; sc_start SC_LUKFOOD,1200000,3; sc_start SC_SPEEDUP1,5000,0;');
REPLACE INTO `item_db2_re` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`weight`,`script`) VALUES (12239,'New_Year_Rice_Cake_2','New Year Rice Cake','Healing',20,100,'percentheal 20,15; sc_start SC_DEXFOOD,1200000,3; sc_start SC_AGIFOOD,1200000,3; sc_start SC_VITFOOD,1200000,3; sc_start SC_SPEEDUP1,5000,0;');
# iRO St. Patrick's Day Event 2008
#=============================================================
#REPLACE INTO `item_db2_re` VALUES (12715,'Black_Treasure_Chest','Black Treasure Chest',2,0,NULL,200,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'callfunc "F_08stpattyseventbox";',NULL,NULL);
REPLACE INTO `item_db2_re` (`id`,`name_aegis`,`name_english`,`type`,`weight`,`alias_name`) VALUES (7915,'Copper_Coin_','Bronze Coin','Etc',10,'Copper_Coin');
# iRO Valentine's Day Event 2009
#=============================================================
#REPLACE INTO `item_db2_re` VALUES (12742,'Valentine_Gift_Box_M','Valentine Gift Box',2,10,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'getitem 7946,1;',NULL,NULL);
#REPLACE INTO `item_db2_re` VALUES (12743,'Valentine_Gift_Box_F','Valentine Gift Box',2,10,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'getitem 7947,1;',NULL,NULL);
#REPLACE INTO `item_db2_re` VALUES (12744,'Chocolate_Box','Chocolate Box',2,10,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'getitem 558,1;',NULL,NULL);
#REPLACE INTO `item_db2_re` VALUES (14466,'Valentine\'s_Emblem_Box','Valentine\'s Emblem Box',2,10,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,7,2,NULL,NULL,NULL,NULL,NULL,'getitem 5817,1;',NULL,NULL);
#REPLACE INTO `item_db2_re` VALUES (7946,'Gold_Ring_Of_Valentine','Gold Ring Of Valentine',3,10,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
#REPLACE INTO `item_db2_re` VALUES (7947,'Silver_Ring_Of_Valentine','Silver Ring Of Valentine',3,10,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
#REPLACE INTO `item_db2_re` VALUES (7948,'Box','Box',3,10,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
#REPLACE INTO `item_db2_re` VALUES (5817,'Valentine\'s_Emblem','Valentine\'s Emblem',4,10,NULL,0,NULL,3,NULL,0,0xFFFFFFFF,7,2,136,NULL,0,0,0,'bonus bAtkRate,3; bonus bMatkRate,3; bonus bAllStats,2; bonus bFlee,10; bonus bAspd,1; bonus bMdef,3; bonus2 bSkillAtk,"AL_HEAL",10; bonus2 bSkillHeal,"AL_HEAL",10; bonus2 bSkillHeal,"AM_POTIONPITCHER",10; bonus2 bAddItemHealRate,IG_Potion,10;',NULL,NULL);
REPLACE INTO `item_db2_re` (`id`,`name_aegis`,`name_english`,`type`,`weight`,`alias_name`) VALUES (7916,'Silver_Coin_','Silver Coin','Etc',10,'Silver_Coin');
REPLACE INTO `item_db2_re` (`id`,`name_aegis`,`name_english`,`type`,`weight`,`alias_name`,`script`) VALUES (12715,'Black_Treasure_Chest','Black Treasure Chest','Usable',200,'Treasure_Box_','callfunc "F_08stpattyseventbox";');
REPLACE INTO `item_db2_re` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`defense`,`location_right_accessory`,`location_left_accessory`,`script`) VALUES (5817,'Valentine\'s_Emblem','Valentine\'s Emblem','Armor',10,3,true,true,'bonus bAtkRate,3; bonus bMatkRate,3; bonus bAllStats,2; bonus bFlee,10; bonus bAspd,1; bonus bMdef,3; bonus2 bSkillAtk,"AL_HEAL",10; bonus2 bSkillHeal,"AL_HEAL",10; bonus2 bSkillHeal,"AM_POTIONPITCHER",10; bonus2 bAddItemGroupHealRate,IG_Potion,10;');
REPLACE INTO `item_db2_re` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`) VALUES (7946,'Gold_Ring_Of_Valentine','Gold Ring Of Valentine','Etc',10);
REPLACE INTO `item_db2_re` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`) VALUES (7947,'Silver_Ring_Of_Valentine','Silver Ring Of Valentine','Etc',10);
REPLACE INTO `item_db2_re` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`weight`) VALUES (7948,'Box','Box','Etc',10,10);
REPLACE INTO `item_db2_re` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`script`) VALUES (12742,'Valentine_Gift_Box_M','Valentine Gift Box','Usable',10,'getitem 7946,1;');
REPLACE INTO `item_db2_re` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`script`) VALUES (12743,'Valentine_Gift_Box_F','Valentine Gift Box','Usable',10,'getitem 7947,1;');
REPLACE INTO `item_db2_re` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`script`) VALUES (12744,'Chocolate_Box','Chocolate Box','Usable',10,'getitem 558,1;');
REPLACE INTO `item_db2_re` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`script`) VALUES (14466,'Valentine\'s_Emblem_Box','Valentine\'s Emblem Box','Usable',10,'getitem 5817,1;');
# iRO Halloween Event 2009
#=============================================================
#REPLACE INTO `item_db2_re` VALUES (5668,'Weird_Pumpkin_Hat','Weird Pumpkin Hat',4,20,NULL,0,NULL,5,NULL,0,0xFFFFFFFF,7,2,256,NULL,0,1,206,'bonus bMdef,5; bonus2 bAddMonsterDropItem,12192,2500;',NULL,NULL);
#REPLACE INTO `item_db2_re` VALUES (6298,'Crushed_Pumpkin','Crushed Pumpkin',3,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
#REPLACE INTO `item_db2_re` VALUES (6299,'Worn_Fabric','Worn Fabric',3,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
REPLACE INTO `item_db2_re` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`defense`,`location_head_top`,`refineable`,`view`,`script`) VALUES (5668,'Weird_Pumpkin_Hat','Weird Pumpkin Hat','Armor',20,5,true,true,206,'bonus bMdef,5; bonus2 bAddMonsterDropItem,12192,2500;');
REPLACE INTO `item_db2_re` (`id`,`name_aegis`,`name_english`,`type`) VALUES (6298,'Crushed_Pumpkin','Crushed Pumpkin','Etc');
REPLACE INTO `item_db2_re` (`id`,`name_aegis`,`name_english`,`type`) VALUES (6299,'Worn_Fabric','Worn Fabric','Etc');
# Old Tuxedo and Wedding Dress, will display the outfit when worn.
#==================================================================
#REPLACE INTO `item_db2_re` VALUES (2338,'Wedding_Dress','Wedding Dress',4,43000,NULL,500,NULL,0,NULL,0,0xFFFFFFFE,7,0,16,NULL,0,1,0,NULL,'setoption Option_Wedding,1;','setoption Option_Wedding,0;');
#REPLACE INTO `item_db2_re` VALUES (7170,'Tuxedo','Tuxedo',4,43000,NULL,10,NULL,0,NULL,0,0xFFFFFFFE,7,1,16,NULL,0,1,0,NULL,'setoption Option_Wedding,1;','setoption Option_Wedding,0;');
#=============================================================
REPLACE INTO `item_db2_re` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`weight`,`job_all`,`job_novice`,`location_armor`,`refineable`,`equip_script`,`unequip_script`) VALUES (2338,'Wedding_Dress','Wedding Dress','Armor',43000,500,true,false,true,true,'sc_start SC_WEDDING,INFINITE_TICK,0;','sc_end SC_WEDDING;');
REPLACE INTO `item_db2_re` (`id`,`name_aegis`,`name_english`,`type`,`price_buy`,`weight`,`job_all`,`job_novice`,`gender`,`location_armor`,`refineable`,`equip_script`,`unequip_script`) VALUES (7170,'Tuxedo','Tuxedo','Armor',43000,10,true,false,'Male',true,true,'sc_start SC_WEDDING,INFINITE_TICK,0;','sc_end SC_WEDDING;');
# Non-kRO Eden Group Mark effect
#=============================================================
REPLACE INTO `item_db2_re` (`id`,`name_aegis`,`name_english`,`type`,`script`) VALUES (22508,'Para_Team_Mark_','Eden Group Mark','Delayconsume','unitskilluseid getcharid(3),"AL_TELEPORT",3;');

2128
sql-files/item_db_equip.sql Normal file

File diff suppressed because it is too large Load Diff

2357
sql-files/item_db_etc.sql Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

4038
sql-files/item_db_re_etc.sql Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

2015
sql-files/item_db_usable.sql Normal file

File diff suppressed because it is too large Load Diff

View File

@ -291,6 +291,9 @@ void YamlDatabase::invalidWarning( const YAML::Node &node, const char* fmt, ...
va_start(ap, fmt);
// Remove any remaining garbage of a previous loading line
ShowMessage( CL_CLL );
// Print the actual error
_vShowMessage( MSG_ERROR, fmt, ap );
va_end(ap);

View File

@ -266,7 +266,7 @@ struct item {
};
//Equip position constants
enum equip_pos {
enum equip_pos : uint32 {
EQP_HEAD_LOW = 0x000001,
EQP_HEAD_MID = 0x000200, // 512
EQP_HEAD_TOP = 0x000100, // 256
@ -972,9 +972,10 @@ enum e_job {
JOB_MAX,
};
enum e_sex {
enum e_sex : uint8 {
SEX_FEMALE = 0,
SEX_MALE,
SEX_BOTH,
SEX_SERVER
};

View File

@ -2422,7 +2422,7 @@ ACMD_FUNC(produce)
if ((flag = pc_additem(sd, &tmp_item, 1, LOG_TYPE_COMMAND)))
clif_additem(sd, 0, 0, flag);
} else {
sprintf(atcmd_output, msg_txt(sd,169), item_id, item_data->name); // The item (%u: '%s') is not equipable.
sprintf(atcmd_output, msg_txt(sd,169), item_id, item_data->name.c_str()); // The item (%u: '%s') is not equipable.
clif_displaymessage(fd, atcmd_output);
return -1;
}
@ -3734,7 +3734,7 @@ ACMD_FUNC(idsearch)
clif_displaymessage(fd, atcmd_output);
}
for(i = 0; i < match; i++) {
sprintf(atcmd_output, msg_txt(sd,78), item_array[i]->jname, item_array[i]->nameid); // %s: %u
sprintf(atcmd_output, msg_txt(sd,78), item_array[i]->ename.c_str(), item_array[i]->nameid); // %s: %u
clif_displaymessage(fd, atcmd_output);
}
sprintf(atcmd_output, msg_txt(sd,79), match); // It is %d affair above.
@ -6335,7 +6335,7 @@ ACMD_FUNC(autolootitem)
return -1;
}
sd->state.autolootid[i] = item_data->nameid; // Autoloot Activated
sprintf(atcmd_output, msg_txt(sd,1192), item_data->name, item_data->jname, item_data->nameid); // Autolooting item: '%s'/'%s' {%u}
sprintf(atcmd_output, msg_txt(sd,1192), item_data->name.c_str(), item_data->ename.c_str(), item_data->nameid); // Autolooting item: '%s'/'%s' {%u}
clif_displaymessage(fd, atcmd_output);
sd->state.autolooting = 1;
break;
@ -6346,7 +6346,7 @@ ACMD_FUNC(autolootitem)
return -1;
}
sd->state.autolootid[i] = 0;
sprintf(atcmd_output, msg_txt(sd,1194), item_data->name, item_data->jname, item_data->nameid); // Removed item: '%s'/'%s' {%u} from your autolootitem list.
sprintf(atcmd_output, msg_txt(sd,1194), item_data->name.c_str(), item_data->ename.c_str(), item_data->nameid); // Removed item: '%s'/'%s' {%u} from your autolootitem list.
clif_displaymessage(fd, atcmd_output);
ARR_FIND(0, AUTOLOOTITEM_SIZE, i, sd->state.autolootid[i] != 0);
if (i == AUTOLOOTITEM_SIZE) {
@ -6371,7 +6371,7 @@ ACMD_FUNC(autolootitem)
ShowDebug("Non-existant item %d on autolootitem list (account_id: %d, char_id: %d)", sd->state.autolootid[i], sd->status.account_id, sd->status.char_id);
continue;
}
sprintf(atcmd_output, "'%s'/'%s' {%u}", item_data->name, item_data->jname, item_data->nameid);
sprintf(atcmd_output, "'%s'/'%s' {%u}", item_data->name.c_str(), item_data->ename.c_str(), item_data->nameid);
clif_displaymessage(fd, atcmd_output);
}
}
@ -7424,10 +7424,10 @@ ACMD_FUNC(mobinfo)
#endif
if (pc_isvip(sd)) // Display drop rate increase for VIP
droprate += (droprate * battle_config.vip_drop_increase) / 100;
if (item_data->slot)
sprintf(atcmd_output2, " - %s[%d] %02.02f%%", item_data->jname, item_data->slot, (float)droprate / 100);
if (item_data->slots)
sprintf(atcmd_output2, " - %s[%d] %02.02f%%", item_data->ename.c_str(), item_data->slots, (float)droprate / 100);
else
sprintf(atcmd_output2, " - %s %02.02f%%", item_data->jname, (float)droprate / 100);
sprintf(atcmd_output2, " - %s %02.02f%%", item_data->ename.c_str(), (float)droprate / 100);
strcat(atcmd_output, atcmd_output2);
if (++j % 3 == 0) {
clif_displaymessage(fd, atcmd_output);
@ -7457,15 +7457,15 @@ ACMD_FUNC(mobinfo)
if (mvppercent > 0) {
j++;
if (j == 1) {
if (item_data->slot)
sprintf(atcmd_output2, " %s[%d] %02.02f%%", item_data->jname, item_data->slot, mvppercent);
if (item_data->slots)
sprintf(atcmd_output2, " %s[%d] %02.02f%%", item_data->ename.c_str(), item_data->slots, mvppercent);
else
sprintf(atcmd_output2, " %s %02.02f%%", item_data->jname, mvppercent);
sprintf(atcmd_output2, " %s %02.02f%%", item_data->ename.c_str(), mvppercent);
} else {
if (item_data->slot)
sprintf(atcmd_output2, " - %s[%d] %02.02f%%", item_data->jname, item_data->slot, mvppercent);
if (item_data->slots)
sprintf(atcmd_output2, " - %s[%d] %02.02f%%", item_data->ename.c_str(), item_data->slots, mvppercent);
else
sprintf(atcmd_output2, " - %s %02.02f%%", item_data->jname, mvppercent);
sprintf(atcmd_output2, " - %s %02.02f%%", item_data->ename.c_str(), mvppercent);
}
strcat(atcmd_output, atcmd_output2);
}
@ -7890,8 +7890,8 @@ ACMD_FUNC(iteminfo)
for (i = 0; i < count; i++) {
struct item_data * item_data = item_array[i];
sprintf(atcmd_output, msg_txt(sd,1277), // Item: '%s'/'%s'[%d] (%u) Type: %s | Extra Effect: %s
item_data->name,item_data->jname,item_data->slot,item_data->nameid,
(item_data->type != IT_AMMO) ? itemdb_typename((enum item_types)item_data->type) : itemdb_typename_ammo((enum e_item_ammo)item_data->look),
item_data->name.c_str(),item_data->ename.c_str(),item_data->slots,item_data->nameid,
(item_data->type != IT_AMMO) ? itemdb_typename((enum item_types)item_data->type) : itemdb_typename_ammo((e_ammo_type)item_data->look),
(item_data->script==NULL)? msg_txt(sd,1278) : msg_txt(sd,1279) // None / With script
);
clif_displaymessage(fd, atcmd_output);
@ -7940,7 +7940,7 @@ ACMD_FUNC(whodrops)
}
for (i = 0; i < count; i++) {
item_data = item_array[i];
sprintf(atcmd_output, msg_txt(sd,1285), item_data->jname, item_data->slot, item_data->nameid); // Item: '%s'[%d] (ID: %u)
sprintf(atcmd_output, msg_txt(sd,1285), item_data->ename.c_str(), item_data->slots, item_data->nameid); // Item: '%s'[%d] (ID:%u)
clif_displaymessage(fd, atcmd_output);
if (item_data->mob[0].chance == 0) {
@ -8927,9 +8927,9 @@ ACMD_FUNC(itemlist)
}
if( it->refine )
StringBuf_Printf(&buf, "%d %s %+d (%s, id: %u)", it->amount, itd->jname, it->refine, itd->name, it->nameid);
StringBuf_Printf(&buf, "%d %s %+d (%s, id: %u)", it->amount, itd->ename.c_str(), it->refine, itd->name.c_str(), it->nameid);
else
StringBuf_Printf(&buf, "%d %s (%s, id: %u)", it->amount, itd->jname, itd->name, it->nameid);
StringBuf_Printf(&buf, "%d %s (%s, id: %u)", it->amount, itd->ename.c_str(), itd->name.c_str(), it->nameid);
if( it->equip ) {
char equipstr[CHAT_SIZE_MAX];
@ -9015,7 +9015,7 @@ ACMD_FUNC(itemlist)
} else { // normal item
int counter2 = 0;
for( j = 0; j < itd->slot; ++j ) {
for( j = 0; j < itd->slots; ++j ) {
struct item_data* card;
if( it->card[j] == 0 || (card = itemdb_exists(it->card[j])) == NULL )
@ -9029,7 +9029,7 @@ ACMD_FUNC(itemlist)
if( counter2 != 1 )
StringBuf_AppendStr(&buf, ", ");
StringBuf_Printf(&buf, "#%d %s (id: %u)", counter2, card->jname, card->nameid);
StringBuf_Printf(&buf, "#%d %s (id: %u)", counter2, card->ename.c_str(), card->nameid);
}
if( counter2 > 0 )

View File

@ -7587,7 +7587,7 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
if (sd->inventory_data[index]) {
switch (sd->status.weapon) {
case W_BOW:
if (sd->inventory_data[index]->look != A_ARROW) {
if (sd->inventory_data[index]->look != AMMO_ARROW) {
clif_arrow_fail(sd,0);
return ATK_NONE;
}
@ -7596,7 +7596,7 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
case W_RIFLE:
case W_GATLING:
case W_SHOTGUN:
if (sd->inventory_data[index]->look != A_BULLET) {
if (sd->inventory_data[index]->look != AMMO_BULLET) {
clif_skill_fail(sd,0,USESKILL_FAIL_NEED_MORE_BULLET,0);
return ATK_NONE;
}
@ -7604,9 +7604,9 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
case W_GRENADE:
if (sd->inventory_data[index]->look !=
#ifdef RENEWAL
A_BULLET) {
AMMO_BULLET) {
#else
A_GRENADE) {
AMMO_GRENADE) {
#endif
clif_skill_fail(sd,0,USESKILL_FAIL_NEED_MORE_BULLET,0);
return ATK_NONE;

View File

@ -671,7 +671,7 @@ void do_init_buyingstore_autotrade( void ) {
Sql_GetData(mmysql_handle, 0, &data, NULL); at->id = atoi(data);
Sql_GetData(mmysql_handle, 1, &data, NULL); at->account_id = atoi(data);
Sql_GetData(mmysql_handle, 2, &data, NULL); at->char_id = atoi(data);
Sql_GetData(mmysql_handle, 3, &data, NULL); at->sex = (data[0] == 'F') ? 0 : 1;
Sql_GetData(mmysql_handle, 3, &data, NULL); at->sex = (data[0] == 'F') ? SEX_FEMALE : SEX_MALE;
Sql_GetData(mmysql_handle, 4, &data, &len); safestrncpy(at->title, data, zmin(len + 1, MESSAGE_SIZE));
Sql_GetData(mmysql_handle, 5, &data, NULL); at->limit = atoi(data);
Sql_GetData(mmysql_handle, 6, &data, NULL); at->dir = atoi(data);

View File

@ -2643,7 +2643,7 @@ static void clif_addcards( struct EQUIPSLOTINFO* buf, struct item* item ){
int i = 0, j;
// Client only receives four cards.. so randomly send them a set of cards. [Skotlex]
if( MAX_SLOTS > 4 && ( j = itemdb_slot( item->nameid ) ) > 4 ){
if( MAX_SLOTS > 4 && ( j = itemdb_slots( item->nameid ) ) > 4 ){
i = rnd() % ( j - 3 ); //eg: 6 slots, possible i values: 0->3, 1->4, 2->5 => i = rnd()%3;
}
@ -6767,8 +6767,8 @@ void clif_use_card(struct map_session_data *sd,int idx)
if(sd->inventory_data[i]->type == IT_ARMOR && (ep & EQP_ACC) && ((ep & EQP_ACC) != EQP_ACC) && ((sd->inventory_data[i]->equip & EQP_ACC) != (ep & EQP_ACC)) ) // specific accessory-card can only be inserted to specific accessory.
continue;
ARR_FIND( 0, sd->inventory_data[i]->slot, j, sd->inventory.u.items_inventory[i].card[j] == 0 );
if( j == sd->inventory_data[i]->slot ) // No room
ARR_FIND( 0, sd->inventory_data[i]->slots, j, sd->inventory.u.items_inventory[i].card[j] == 0 );
if( j == sd->inventory_data[i]->slots ) // No room
continue;
if( sd->inventory.u.items_inventory[i].equip > 0 ) // Do not check items that are already equipped
@ -6965,7 +6965,7 @@ void clif_item_refine_list( struct map_session_data *sd ){
int count = 0;
for( int i = 0; i < MAX_INVENTORY; i++ ){
unsigned char wlv;
uint16 wlv;
if( sd->inventory.u.items_inventory[i].nameid > 0 && sd->inventory.u.items_inventory[i].refine < skill_lv &&
sd->inventory.u.items_inventory[i].identify && ( wlv = itemdb_wlv(sd->inventory.u.items_inventory[i].nameid ) ) >= 1 &&
@ -16538,7 +16538,7 @@ void clif_parse_Auction_register(int fd, struct map_session_data *sd)
return;
}
safestrncpy(auction.item_name, item->jname, sizeof(auction.item_name));
safestrncpy(auction.item_name, item->ename.c_str(), sizeof(auction.item_name));
auction.type = item->type;
memcpy(&auction.item, &sd->inventory.u.items_inventory[sd->auction.index], sizeof(struct item));
auction.item.amount = 1;

File diff suppressed because it is too large Load Diff

View File

@ -4,10 +4,17 @@
#ifndef ITEMDB_HPP
#define ITEMDB_HPP
#include <vector>
#include "../common/database.hpp"
#include "../common/db.hpp"
#include "../common/malloc.hpp"
#include "../common/mmo.hpp" // ITEM_NAME_LENGTH
#include "script.hpp"
#include "status.hpp"
enum e_ammo_type : uint8;
///Use apple for unknown items.
const t_itemid UNKNOWN_ITEM_ID = 512;
@ -207,36 +214,23 @@ enum poison_item_list : t_itemid
ITEMID_VENOMBLEED,
};
///Item No Use List
enum item_nouse_list
{
NOUSE_SITTING = 0x01,
};
///Item job
enum e_item_job
enum e_item_job : uint16
{
ITEMJ_NONE = 0x00,
ITEMJ_NORMAL = 0x01,
ITEMJ_UPPER = 0x02,
ITEMJ_BABY = 0x04,
ITEMJ_THIRD = 0x08,
ITEMJ_THIRD_TRANS = 0x10,
ITEMJ_THIRD_UPPER = 0x10,
ITEMJ_THIRD_BABY = 0x20,
};
ITEMJ_MAX = 0xFF,
enum e_item_ammo
{
AMMO_ARROW = 1,
AMMO_THROWABLE_DAGGER,
AMMO_BULLET,
AMMO_SHELL,
AMMO_GRENADE,
AMMO_SHURIKEN,
AMMO_KUNAI,
AMMO_CANNONBALL,
AMMO_THROWABLE_ITEM, ///Sling items
MAX_AMMO_TYPE,
#ifdef RENEWAL
ITEMJ_ALL = ITEMJ_NORMAL | ITEMJ_UPPER | ITEMJ_BABY | ITEMJ_THIRD | ITEMJ_THIRD_UPPER | ITEMJ_THIRD_BABY,
#else
ITEMJ_ALL = ITEMJ_NORMAL | ITEMJ_UPPER | ITEMJ_BABY,
#endif
};
#define AMMO_TYPE_ALL ((1<<MAX_AMMO_TYPE)-1)
@ -756,16 +750,40 @@ enum e_itemshop_restrictions {
ISR_BOUND_GUILDLEADER_ONLY = 0x8,
};
///Item combo struct
struct item_combo
{
struct script_code *script;
t_itemid *nameid;/* nameid array */
unsigned char count;
unsigned short id;/* id of this combo */
bool isRef;/* whether this struct is a reference or the master */
/// Enum for item drop effects
enum e_item_drop_effect : uint16 {
DROPEFFECT_NONE = 0,
DROPEFFECT_CLIENT,
DROPEFFECT_WHITE_PILLAR,
DROPEFFECT_BLUE_PILLAR,
DROPEFFECT_YELLOW_PILLAR,
DROPEFFECT_PURPLE_PILLAR,
DROPEFFECT_ORANGE_PILLAR,
DROPEFFECT_MAX
};
/// Enum for items with delayed consumption
enum e_delay_consume : uint8 {
DELAYCONSUME_NONE = 0x0,
DELAYCONSUME_TEMP = 0x1, // Items that are not consumed immediately upon double-click
DELAYCONSUME_NOCONSUME = 0x2, // Items that are not removed upon double-click
};
/// Item combo struct
struct s_item_combo {
std::vector<t_itemid> nameid;
script_code *script;
uint32 id;
~s_item_combo() {
if (this->script) {
script_free_code(this->script);
this->script = nullptr;
}
this->nameid.clear();
}
};
/// Struct of item group entry
struct s_item_group_entry
@ -808,34 +826,34 @@ extern struct s_roulette_db rd;
struct item_data
{
t_itemid nameid;
char name[ITEM_NAME_LENGTH],jname[ITEM_NAME_LENGTH];
std::string name, ename;
//Do not add stuff between value_buy and view_id (see how getiteminfo works)
int value_buy;
int value_sell;
int type;
uint32 value_buy;
uint32 value_sell;
item_types type;
uint8 subtype;
int maxchance; //For logs, for external game info, for scripts: Max drop chance of this item (e.g. 0.01% , etc.. if it = 0, then monsters don't drop it, -1 denotes items sold in shops only) [Lupus]
int sex;
int equip;
int weight;
int atk;
int def;
int range;
int slot;
int look;
int elv;
int wlv;
uint8 sex;
uint32 equip;
uint32 weight;
uint32 atk;
uint32 def;
uint16 range;
uint16 slots;
uint32 look;
uint16 elv;
uint16 wlv;
t_itemid view_id;
int elvmax; ///< Maximum level for this item
uint16 elvmax; ///< Maximum level for this item
#ifdef RENEWAL
int matk;
uint32 matk;
#endif
int delay;
//Lupus: I rearranged order of these fields due to compatibility with ITEMINFO script command
// some script commands should be revised as well...
uint64 class_base[3]; //Specifies if the base can wear this item (split in 3 indexes per type: 1-1, 2-1, 2-2)
unsigned class_upper : 6; //Specifies if the class-type can equip it (0x01: normal, 0x02: trans, 0x04: baby, 0x08:third, 0x10:trans-third, 0x20-third-baby)
uint16 class_upper; //Specifies if the class-type can equip it (See e_item_job)
struct {
int chance;
int id;
@ -847,33 +865,52 @@ struct item_data
unsigned available : 1;
uint32 no_equip;
unsigned no_refine : 1; // [celest]
unsigned delay_consume : 2; // 1 - Signifies items that are not consumed immediately upon double-click; 2 - Signifies items that are not removed on consumption [Skotlex]
unsigned trade_restriction : 9; //Item restrictions mask [Skotlex]
unsigned delay_consume; // [Skotlex]
struct {
bool drop, trade, trade_partner, sell, cart, storage, guild_storage, mail, auction;
} trade_restriction; //Item restrictions mask [Skotlex]
unsigned autoequip: 1;
unsigned buyingstore : 1;
unsigned dead_branch : 1; // As dead branch item. Logged at `branchlog` table and cannot be used at 'nobranch' mapflag [Cydh]
unsigned group : 1; // As item group container [Cydh]
bool buyingstore;
bool dead_branch; // As dead branch item. Logged at `branchlog` table and cannot be used at 'nobranch' mapflag [Cydh]
bool group; // As item group container [Cydh]
unsigned guid : 1; // This item always be attached with GUID and make it as bound item! [Cydh]
unsigned broadcast : 1; ///< Will be broadcasted if someone obtain the item [Cydh]
bool broadcast; ///< Will be broadcasted if someone obtain the item [Cydh]
bool bindOnEquip; ///< Set item as bound when equipped
uint8 dropEffect; ///< Drop Effect Mode
e_item_drop_effect dropEffect; ///< Drop Effect Mode
} flag;
struct {// item stacking limitation
unsigned short amount;
unsigned int inventory:1;
unsigned int cart:1;
unsigned int storage:1;
unsigned int guildstorage:1;
uint16 amount;
bool inventory, cart, storage, guild_storage;
} stack;
struct {// used by item_nouse.txt
unsigned int flag;
unsigned short override;
struct {
uint16 override;
bool sitting;
} item_usage;
short gm_lv_trade_override; //GM-level to override trade_restriction
/* bugreport:309 */
struct item_combo **combos;
unsigned char combos_count;
short delay_sc; ///< Use delay group if any instead using player's item_delay data [Cydh]
std::vector<std::shared_ptr<s_item_combo>> combos;
struct {
uint32 duration;
sc_type sc; ///< Use delay group if any instead using player's item_delay data [Cydh]
} delay;
~item_data() {
if (this->script){
script_free_code(this->script);
this->script = nullptr;
}
if (this->equip_script){
script_free_code(this->equip_script);
this->equip_script = nullptr;
}
if (this->unequip_script){
script_free_code(this->unequip_script);
this->unequip_script = nullptr;
}
this->combos.clear();
}
bool isStackable();
int inventorySlotNeeded(int quantity);
@ -904,14 +941,27 @@ struct s_random_opt_group {
uint16 total;
};
class ItemDatabase : public TypesafeCachedYamlDatabase<t_itemid, item_data> {
public:
ItemDatabase() : TypesafeCachedYamlDatabase("ITEM_DB", 1) {
}
const std::string getDefaultLocation();
uint64 parseBodyNode(const YAML::Node& node);
};
extern ItemDatabase item_db;
struct item_data* itemdb_searchname(const char *name);
struct item_data* itemdb_search_aegisname( const char *str );
int itemdb_searchname_array(struct item_data** data, int size, const char *str);
struct item_data* itemdb_search(t_itemid nameid);
struct item_data* itemdb_exists(t_itemid nameid);
#define itemdb_name(n) itemdb_search(n)->name
#define itemdb_jname(n) itemdb_search(n)->jname
#define itemdb_name(n) itemdb_search(n)->name.c_str()
#define itemdb_ename(n) itemdb_search(n)->ename.c_str()
#define itemdb_type(n) itemdb_search(n)->type
#define itemdb_subtype(n) itemdb_search(n)->subtype
#define itemdb_atk(n) itemdb_search(n)->atk
#define itemdb_def(n) itemdb_search(n)->def
#define itemdb_look(n) itemdb_search(n)->look
@ -921,14 +971,14 @@ struct item_data* itemdb_exists(t_itemid nameid);
#define itemdb_equipscript(n) itemdb_search(n)->script
#define itemdb_wlv(n) itemdb_search(n)->wlv
#define itemdb_range(n) itemdb_search(n)->range
#define itemdb_slot(n) itemdb_search(n)->slot
#define itemdb_slots(n) itemdb_search(n)->slots
#define itemdb_available(n) (itemdb_search(n)->flag.available)
#define itemdb_traderight(n) (itemdb_search(n)->flag.trade_restriction)
#define itemdb_viewid(n) (itemdb_search(n)->view_id)
#define itemdb_autoequip(n) (itemdb_search(n)->flag.autoequip)
#define itemdb_dropeffect(n) (itemdb_search(n)->flag.dropEffect)
const char* itemdb_typename(enum item_types type);
const char *itemdb_typename_ammo (enum e_item_ammo ammo);
const char *itemdb_typename_ammo (e_ammo_type ammo);
struct s_item_group_entry *itemdb_get_randgroupitem(uint16 group_id, uint8 sub_group);
t_itemid itemdb_searchrandomid(uint16 group_id, uint8 sub_group);
@ -965,7 +1015,7 @@ bool itemdb_isstackable2(struct item_data *id);
#define itemdb_isstackable(nameid) itemdb_isstackable2(itemdb_search(nameid))
bool itemdb_isNoEquip(struct item_data *id, uint16 m);
struct item_combo *itemdb_combo_exists(unsigned short combo_id);
s_item_combo *itemdb_combo_exists(uint32 combo_id);
struct s_item_group_db *itemdb_group_exists(unsigned short group_id);
bool itemdb_group_item_exists(unsigned short group_id, t_itemid nameid);

View File

@ -311,25 +311,18 @@
<Copy SourceFiles="$(SolutionDir)db\import-tmpl\homun_skill_tree.txt" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\homun_skill_tree.txt')" />
<Copy SourceFiles="$(SolutionDir)db\import-tmpl\homunculus_db.txt" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\homunculus_db.txt')" />
<Copy SourceFiles="$(SolutionDir)db\import-tmpl\instance_db.yml" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\instance_db.yml')" />
<Copy SourceFiles="$(SolutionDir)db\import-tmpl\item_avail.txt" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\item_avail.txt')" />
<Copy SourceFiles="$(SolutionDir)db\import-tmpl\item_bluebox.txt" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\item_bluebox.txt')" />
<Copy SourceFiles="$(SolutionDir)db\import-tmpl\item_buyingstore.txt" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\item_buyingstore.txt')" />
<Copy SourceFiles="$(SolutionDir)db\import-tmpl\item_cardalbum.txt" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\item_cardalbum.txt')" />
<Copy SourceFiles="$(SolutionDir)db\import-tmpl\item_cash_db.txt" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\item_cash_db.txt')" />
<Copy SourceFiles="$(SolutionDir)db\import-tmpl\item_combo_db.txt" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\item_combo_db.txt')" />
<Copy SourceFiles="$(SolutionDir)db\import-tmpl\item_db.txt" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\item_db.txt')" />
<Copy SourceFiles="$(SolutionDir)db\import-tmpl\item_delay.txt" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\item_delay.txt')" />
<Copy SourceFiles="$(SolutionDir)db\import-tmpl\item_flag.txt" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\item_flag.txt')" />
<Copy SourceFiles="$(SolutionDir)db\import-tmpl\item_db.yml" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\item_db.yml')" />
<Copy SourceFiles="$(SolutionDir)db\import-tmpl\item_giftbox.txt" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\item_giftbox.txt')" />
<Copy SourceFiles="$(SolutionDir)db\import-tmpl\item_group_db.txt" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\item_group_db.txt')" />
<Copy SourceFiles="$(SolutionDir)db\import-tmpl\item_misc.txt" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\item_misc.txt')" />
<Copy SourceFiles="$(SolutionDir)db\import-tmpl\item_noequip.txt" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\item_noequip.txt')" />
<Copy SourceFiles="$(SolutionDir)db\import-tmpl\item_nouse.txt" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\item_nouse.txt')" />
<Copy SourceFiles="$(SolutionDir)db\import-tmpl\item_package.txt" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\item_package.txt')" />
<Copy SourceFiles="$(SolutionDir)db\import-tmpl\item_randomopt_db.txt" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\item_randomopt_db.txt')" />
<Copy SourceFiles="$(SolutionDir)db\import-tmpl\item_randomopt_group.txt" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\item_randomopt_group.txt')" />
<Copy SourceFiles="$(SolutionDir)db\import-tmpl\item_stack.txt" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\item_stack.txt')" />
<Copy SourceFiles="$(SolutionDir)db\import-tmpl\item_trade.txt" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\item_trade.txt')" />
<Copy SourceFiles="$(SolutionDir)db\import-tmpl\item_violetbox.txt" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\item_violetbox.txt')" />
<Copy SourceFiles="$(SolutionDir)db\import-tmpl\job_basehpsp_db.txt" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\job_basehpsp_db.txt')" />
<Copy SourceFiles="$(SolutionDir)db\import-tmpl\job_db1.txt" DestinationFolder="$(SolutionDir)db\import\" ContinueOnError="true" Condition="!Exists('$(SolutionDir)db\import\job_db1.txt')" />

View File

@ -1841,7 +1841,7 @@ int map_addflooritem(struct item *item, int amount, int16 m, int16 x, int16 y, i
nullpo_ret(item);
if (!(flags&4) && battle_config.item_onfloor && (itemdb_traderight(item->nameid)&1))
if (!(flags&4) && battle_config.item_onfloor && (itemdb_traderight(item->nameid).trade))
return 0; //can't be dropped
if (!map_searchrandfreecell(m,&x,&y,flags&2?1:0))

View File

@ -73,6 +73,7 @@ void map_msg_reload(void);
#define MAPID_BASEMASK 0x00ff
#define MAPID_UPPERMASK 0x0fff
#define MAPID_THIRDMASK (JOBL_THIRD|MAPID_UPPERMASK)
#define MAPID_ALL 0xffff
//First Jobs
//Note the oddity of the novice:

View File

@ -2794,7 +2794,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
//A Rare Drop Global Announce by Lupus
if( mvp_sd && drop_rate <= battle_config.rare_drop_announce ) {
char message[128];
sprintf (message, msg_txt(NULL,541), mvp_sd->status.name, md->name, it->jname, (float)drop_rate/100);
sprintf (message, msg_txt(NULL,541), mvp_sd->status.name, md->name, it->ename.c_str(), (float)drop_rate/100);
//MSG: "'%s' won %s's %s (chance: %0.02f%%)"
intif_broadcast(message,strlen(message)+1,BC_DEFAULT);
}
@ -2948,7 +2948,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
//A Rare MVP Drop Global Announce by Lupus
if(temp<=battle_config.rare_drop_announce) {
char message[128];
sprintf (message, msg_txt(NULL,541), mvp_sd->status.name, md->name, i_data->jname, temp/100.);
sprintf (message, msg_txt(NULL,541), mvp_sd->status.name, md->name, i_data->ename.c_str(), temp/100.);
//MSG: "'%s' won %s's %s (chance: %0.02f%%)"
intif_broadcast(message,strlen(message)+1,BC_DEFAULT);
}
@ -4530,7 +4530,7 @@ uint64 MobAvailDatabase::parseBodyNode(const YAML::Node &node) {
if (!this->asString(node, "Weapon", weapon))
return 0;
struct item_data *item = itemdb_searchname(weapon.c_str());
struct item_data *item = itemdb_search_aegisname(weapon.c_str());
if (item == nullptr) {
this->invalidWarning(node["Weapon"], "Weapon %s is not a valid item.\n", weapon.c_str());
@ -4551,7 +4551,7 @@ uint64 MobAvailDatabase::parseBodyNode(const YAML::Node &node) {
if (!this->asString(node, "Shield", shield))
return 0;
struct item_data *item = itemdb_searchname(shield.c_str());
struct item_data *item = itemdb_search_aegisname(shield.c_str());
if (item == nullptr) {
this->invalidWarning(node["Shield"], "Shield %s is not a valid item.\n", shield.c_str());
@ -4574,7 +4574,7 @@ uint64 MobAvailDatabase::parseBodyNode(const YAML::Node &node) {
struct item_data *item;
if ((item = itemdb_searchname(head.c_str())) == nullptr) {
if ((item = itemdb_search_aegisname(head.c_str())) == nullptr) {
this->invalidWarning(node["HeadTop"], "HeadTop %s is not a valid item.\n", head.c_str());
return 0;
}
@ -4593,7 +4593,7 @@ uint64 MobAvailDatabase::parseBodyNode(const YAML::Node &node) {
if (!this->asString(node, "HeadMid", head))
return 0;
struct item_data *item = itemdb_searchname(head.c_str());
struct item_data *item = itemdb_search_aegisname(head.c_str());
if (item == nullptr) {
this->invalidWarning(node["HeadMid"], "HeadMid %s is not a valid item.\n", head.c_str());
@ -4614,7 +4614,7 @@ uint64 MobAvailDatabase::parseBodyNode(const YAML::Node &node) {
if (!this->asString(node, "HeadLow", head))
return 0;
struct item_data *item = itemdb_searchname(head.c_str());
struct item_data *item = itemdb_search_aegisname(head.c_str());
if (item == nullptr) {
this->invalidWarning(node["HeadLow"], "HeadLow %s is not a valid item.\n", head.c_str());
@ -4637,7 +4637,7 @@ uint64 MobAvailDatabase::parseBodyNode(const YAML::Node &node) {
if (!this->asString(node, "PetEquip", equipment))
return 0;
struct item_data *item = itemdb_searchname(equipment.c_str());
struct item_data *item = itemdb_search_aegisname(equipment.c_str());
if (item == nullptr) {
this->invalidWarning(node["PetEquip"], "PetEquip %s is not a valid item.\n", equipment.c_str());

View File

@ -1614,7 +1614,7 @@ static enum e_CASHSHOP_ACK npc_cashshop_process_payment(struct npc_data *nd, int
memset(output, '\0', sizeof(output));
sprintf(output, msg_txt(sd, 712), id->jname, id->nameid); // You do not have enough %s (%u).
sprintf(output, msg_txt(sd, 712), id->ename.c_str(), id->nameid); // You do not have enough %s (%u).
clif_messagecolor(&sd->bl, color_table[COLOR_RED], output, false, SELF);
return ERROR_TYPE_PURCHASE_FAIL;
}
@ -1797,7 +1797,7 @@ void npc_shop_currency_type(struct map_session_data *sd, struct npc_data *nd, in
memset(output, '\0', sizeof(output));
sprintf(output, msg_txt(sd, 714), id->jname, id->nameid); // Item Shop List: %s (%u)
sprintf(output, msg_txt(sd, 714), id->ename.c_str(), id->nameid); // Item Shop List: %s (%u)
clif_broadcast(&sd->bl, output, strlen(output) + 1, BC_BLUE,SELF);
}
@ -1886,7 +1886,7 @@ int npc_cashshop_buy(struct map_session_data *sd, t_itemid nameid, int amount, i
if( (double)nd->u.shop.shop_item[i].value * amount > INT_MAX )
{
ShowWarning("npc_cashshop_buy: Item '%s' (%u) price overflow attempt!\n", item->name, nameid);
ShowWarning("npc_cashshop_buy: Item '%s' (%u) price overflow attempt!\n", item->name.c_str(), nameid);
ShowDebug("(NPC:'%s' (%s,%d,%d), player:'%s' (%d/%d), value:%d, amount:%d)\n",
nd->exname, map_mapid2mapname(nd->bl.m), nd->bl.x, nd->bl.y, sd->status.name, sd->status.account_id, sd->status.char_id, nd->u.shop.shop_item[i].value, amount);
return ERROR_TYPE_ITEM_ID;
@ -3004,15 +3004,15 @@ static const char* npc_parse_shop(char* w1, char* w2, char* w3, char* w4, const
}
if (value == 0 && (type == NPCTYPE_SHOP || type == NPCTYPE_MARKETSHOP)) { // NPC selling items for free!
ShowWarning("npc_parse_shop: Item %s [%u] is being sold for FREE in file '%s', line '%d'.\n",
id->name, nameid2, filepath, strline(buffer,start-buffer));
id->name.c_str(), nameid2, filepath, strline(buffer,start-buffer));
}
if( type == NPCTYPE_SHOP && value*0.75 < id->value_sell*1.24 ) { // Exploit possible: you can buy and sell back with profit
ShowWarning("npc_parse_shop: Item %s [%u] discounted buying price (%d->%d) is less than overcharged selling price (%d->%d) at file '%s', line '%d'.\n",
id->name, nameid2, value, (int)(value*0.75), id->value_sell, (int)(id->value_sell*1.24), filepath, strline(buffer,start-buffer));
id->name.c_str(), nameid2, value, (int)(value*0.75), id->value_sell, (int)(id->value_sell*1.24), filepath, strline(buffer,start-buffer));
}
if (type == NPCTYPE_MARKETSHOP && (!qty || qty > UINT16_MAX)) {
ShowWarning("npc_parse_shop: Item %s [%u] is stocked with invalid value %d, changed to 1. File '%s', line '%d'.\n",
id->name, nameid2, qty, filepath, strline(buffer,start-buffer));
id->name.c_str(), nameid2, qty, filepath, strline(buffer,start-buffer));
qty = 1;
}
//for logs filters, atcommands and iteminfo script command

View File

@ -836,7 +836,7 @@ bool pc_can_sell_item(struct map_session_data *sd, struct item *item, enum npc_s
return true;
else if (!item->bound) {
struct item_data *itd = itemdb_search(item->nameid);
if (itd && itd->flag.trade_restriction&8 && battle_config.allow_bound_sell&ISR_SELLABLE)
if (itd && itd->flag.trade_restriction.sell && battle_config.allow_bound_sell&ISR_SELLABLE)
return true;
}
break;
@ -974,7 +974,7 @@ int pc_equippoint_sub(struct map_session_data *sd,struct item_data* id){
return 0; //Not equippable by players.
ep = id->equip;
if(id->look == W_DAGGER || id->look == W_1HSWORD || id->look == W_1HAXE) {
if(id->subtype == W_DAGGER || id->subtype == W_1HSWORD || id->subtype == W_1HAXE) {
if(pc_checkskill(sd,AS_LEFT) > 0 || (sd->class_&MAPID_UPPERMASK) == MAPID_ASSASSIN || (sd->class_&MAPID_UPPERMASK) == MAPID_KAGEROUOBORO) { //Kagerou and Oboro can dual wield daggers. [Rytech]
if (ep == EQP_WEAPON)
return EQP_ARMS;
@ -1084,14 +1084,14 @@ void pc_setequipindex(struct map_session_data *sd)
if (sd->inventory.u.items_inventory[i].equip & EQP_HAND_R) {
if (sd->inventory_data[i])
sd->weapontype1 = sd->inventory_data[i]->look;
sd->weapontype1 = sd->inventory_data[i]->subtype;
else
sd->weapontype1 = 0;
}
if( sd->inventory.u.items_inventory[i].equip & EQP_HAND_L ) {
if( sd->inventory_data[i] && sd->inventory_data[i]->type == IT_WEAPON )
sd->weapontype2 = sd->inventory_data[i]->look;
sd->weapontype2 = sd->inventory_data[i]->subtype;
else
sd->weapontype2 = 0;
}
@ -1148,7 +1148,7 @@ bool pc_isequipped(struct map_session_data *sd, t_itemid nameid)
continue;
if( sd->inventory_data[index]->nameid == nameid )
return true;
for( j = 0; j < sd->inventory_data[index]->slot; j++ ){
for( j = 0; j < sd->inventory_data[index]->slots; j++ ){
if( sd->inventory.u.items_inventory[index].card[j] == nameid )
return true;
}
@ -1271,6 +1271,29 @@ bool pc_adoption(struct map_session_data *p1_sd, struct map_session_data *p2_sd,
return false; // Job Change Fail
}
static bool pc_job_can_use_item( struct map_session_data* sd, struct item_data* item ){
nullpo_retr( false, sd );
nullpo_retr( false, item );
// Calculate the required bit to check
uint64 job = 1ULL << ( sd->class_ & MAPID_BASEMASK );
size_t index;
// 2-1
if( ( sd->class_ & JOBL_2_1 ) != 0 ){
index = 1;
// 2-2
}else if( ( sd->class_ & JOBL_2_2 ) != 0 ){
index = 2;
// Basejob
}else{
index = 0;
}
return ( item->class_base[index] & job ) != 0;
}
/*==========================================
* Check if player can use/equip selected item. Used by pc_isUseitem and pc_isequip
Returns:
@ -1294,7 +1317,7 @@ static bool pc_isItemClass (struct map_session_data *sd, struct item_data* item)
break;
//don't need to decide specific rules for third-classes?
//items for third classes can be used for all third classes
if (item->class_upper&(ITEMJ_THIRD|ITEMJ_THIRD_TRANS|ITEMJ_THIRD_BABY) && sd->class_&JOBL_THIRD)
if (item->class_upper&(ITEMJ_THIRD|ITEMJ_THIRD_UPPER|ITEMJ_THIRD_BABY) && sd->class_&JOBL_THIRD)
break;
#else
//trans. classes (exl. third-trans.)
@ -1307,7 +1330,7 @@ static bool pc_isItemClass (struct map_session_data *sd, struct item_data* item)
if (item->class_upper&ITEMJ_THIRD && sd->class_&JOBL_THIRD && !(sd->class_&(JOBL_UPPER|JOBL_BABY)))
break;
//trans-third classes
if (item->class_upper&ITEMJ_THIRD_TRANS && sd->class_&JOBL_THIRD && sd->class_&JOBL_UPPER)
if (item->class_upper&ITEMJ_THIRD_UPPER && sd->class_&JOBL_THIRD && sd->class_&JOBL_UPPER)
break;
//third-baby classes
if (item->class_upper&ITEMJ_THIRD_BABY && sd->class_&JOBL_THIRD && sd->class_&JOBL_BABY)
@ -1341,7 +1364,7 @@ uint8 pc_isequip(struct map_session_data *sd,int n)
return ITEM_EQUIP_ACK_FAILLEVEL;
if(item->elvmax && sd->status.base_level > (unsigned int)item->elvmax)
return ITEM_EQUIP_ACK_FAILLEVEL;
if(item->sex != 2 && sd->status.sex != item->sex)
if(item->sex != SEX_BOTH && sd->status.sex != item->sex)
return ITEM_EQUIP_ACK_FAIL;
//fail to equip if item is restricted
@ -1349,14 +1372,14 @@ uint8 pc_isequip(struct map_session_data *sd,int n)
return ITEM_EQUIP_ACK_FAIL;
if (item->equip&EQP_AMMO) {
switch (item->look) {
switch (item->subtype) {
case AMMO_ARROW:
if (battle_config.ammo_check_weapon && sd->status.weapon != W_BOW && sd->status.weapon != W_MUSICAL && sd->status.weapon != W_WHIP) {
clif_msg(sd, ITEM_NEED_BOW);
return ITEM_EQUIP_ACK_FAIL;
}
break;
case AMMO_THROWABLE_DAGGER:
case AMMO_DAGGER:
if (!pc_checkskill(sd, AS_VENOMKNIFE))
return ITEM_EQUIP_ACK_FAIL;
break;
@ -1428,7 +1451,7 @@ uint8 pc_isequip(struct map_session_data *sd,int n)
}
//Not equipable by class. [Skotlex]
if (!(1ULL << (sd->class_&MAPID_BASEMASK)&item->class_base[(sd->class_&JOBL_2_1) ? 1 : ((sd->class_&JOBL_2_2) ? 2 : 0)]))
if (!pc_job_can_use_item(sd,item))
return ITEM_EQUIP_ACK_FAIL;
if (!pc_isItemClass(sd, item))
@ -4653,8 +4676,8 @@ int pc_insert_card(struct map_session_data* sd, int idx_card, int idx_equip)
if( sd->inventory.u.items_inventory[idx_equip].equip != 0 )
return 0; // item must be unequipped
ARR_FIND( 0, item_eq->slot, i, sd->inventory.u.items_inventory[idx_equip].card[i] == 0 );
if( i == item_eq->slot )
ARR_FIND( 0, item_eq->slots, i, sd->inventory.u.items_inventory[idx_equip].card[i] == 0 );
if( i == item_eq->slots )
return 0; // no free slots
// remember the card id to insert
@ -5294,7 +5317,7 @@ bool pc_isUseitem(struct map_session_data *sd,int n)
)
return false;
if( (item->item_usage.flag&NOUSE_SITTING) && (pc_issit(sd) == 1) && (pc_get_group_level(sd) < item->item_usage.override) ) {
if( (item->item_usage.sitting) && (pc_issit(sd) == 1) && (pc_get_group_level(sd) < item->item_usage.override) ) {
clif_msg(sd,ITEM_NOUSE_SITTING);
return false; // You cannot use this item while sitting.
}
@ -5391,7 +5414,7 @@ bool pc_isUseitem(struct map_session_data *sd,int n)
}
//Gender check
if(item->sex != 2 && sd->status.sex != item->sex)
if(item->sex != SEX_BOTH && sd->status.sex != item->sex)
return false;
//Required level check
if(item->elv && sd->status.base_level < (unsigned int)item->elv)
@ -5400,10 +5423,7 @@ bool pc_isUseitem(struct map_session_data *sd,int n)
return false;
//Not equipable by class. [Skotlex]
if (!(
(1ULL<<(sd->class_&MAPID_BASEMASK)) &
(item->class_base[sd->class_&JOBL_2_1?1:(sd->class_&JOBL_2_2?2:0)])
))
if (!pc_job_can_use_item(sd,item))
return false;
if (sd->sc.count && (
@ -5481,7 +5501,7 @@ int pc_useitem(struct map_session_data *sd,int n)
return 0;
/* Items with delayed consume are not meant to work while in mounts except reins of mount(12622) */
if( id->flag.delay_consume ) {
if( id->flag.delay_consume > 0 ) {
if( nameid != ITEMID_REINS_OF_MOUNT && sd->sc.data[SC_ALL_RIDING] )
return 0;
else if( pc_issit(sd) )
@ -5491,16 +5511,16 @@ int pc_useitem(struct map_session_data *sd,int n)
//perform a skill-use check before going through. [Skotlex]
//resurrection was picked as testing skill, as a non-offensive, generic skill, it will do.
//FIXME: Is this really needed here? It'll be checked in unit.cpp after all and this prevents skill items using when silenced [Inkfish]
if( id->flag.delay_consume && ( sd->ud.skilltimer != INVALID_TIMER /*|| !status_check_skilluse(&sd->bl, &sd->bl, ALL_RESURRECTION, 0)*/ ) )
if( id->flag.delay_consume > 0 && ( sd->ud.skilltimer != INVALID_TIMER /*|| !status_check_skilluse(&sd->bl, &sd->bl, ALL_RESURRECTION, 0)*/ ) )
return 0;
if( id->delay > 0 && !pc_has_permission(sd,PC_PERM_ITEM_UNCONDITIONAL) && pc_itemcd_check(sd, id, tick, n))
if( id->delay.duration > 0 && !pc_has_permission(sd,PC_PERM_ITEM_UNCONDITIONAL) && pc_itemcd_check(sd, id, tick, n))
return 0;
/* on restricted maps the item is consumed but the effect is not used */
if (!pc_has_permission(sd,PC_PERM_ITEM_UNCONDITIONAL) && itemdb_isNoEquip(id,sd->bl.m)) {
clif_msg(sd,ITEM_CANT_USE_AREA); // This item cannot be used within this area
if( battle_config.allow_consume_restricted_item && !id->flag.delay_consume ) { //need confirmation for delayed consumption items
if( battle_config.allow_consume_restricted_item && id->flag.delay_consume > 0 ) { //need confirmation for delayed consumption items
clif_useitemack(sd,n,item.amount-1,true);
pc_delitem(sd,n,1,1,0,LOG_TYPE_CONSUME);
}
@ -5515,7 +5535,7 @@ int pc_useitem(struct map_session_data *sd,int n)
amount = item.amount;
script = id->script;
//Check if the item is to be consumed immediately [Skotlex]
if (id->flag.delay_consume)
if (id->flag.delay_consume > 0)
clif_useitemack(sd, n, amount, true);
else
{
@ -5759,7 +5779,7 @@ int pc_show_steal(struct block_list *bl,va_list ap)
if((item=itemdb_exists(itemid))==NULL)
sprintf(output,"%s stole an Unknown Item (id: %u).",sd->status.name, itemid);
else
sprintf(output,"%s stole %s.",sd->status.name,item->jname);
sprintf(output,"%s stole %s.",sd->status.name,item->ename.c_str());
clif_displaymessage( ((struct map_session_data *)bl)->fd, output);
return 0;
@ -5852,7 +5872,7 @@ bool pc_steal_item(struct map_session_data *sd,struct block_list *bl, uint16 ski
struct item_data *i_data;
char message[128];
i_data = itemdb_search(itemid);
sprintf (message, msg_txt(sd,542), (sd->status.name[0])?sd->status.name :"GM", md->db->jname, i_data->jname, (float)md->db->dropitem[i].p/100);
sprintf (message, msg_txt(sd,542), (sd->status.name[0])?sd->status.name :"GM", md->db->jname, i_data->ename.c_str(), (float)md->db->dropitem[i].p/100);
//MSG: "'%s' stole %s's %s (chance: %0.02f%%)"
intif_broadcast(message, strlen(message) + 1, BC_DEFAULT);
}
@ -10193,89 +10213,100 @@ void pc_cleareventtimer(struct map_session_data *sd)
}
/**
* Called when an item with combo is worn
* @param *sd
* @param *data struct item_data
* @return success numbers of succeed combo
*/
static int pc_checkcombo(struct map_session_data *sd, struct item_data *data) {
uint16 i;
* Called when an item with combo is worn
* @param sd: Player data
* @param data: Item data
* @return Number of succeeded combo(s)
*/
static int pc_checkcombo(struct map_session_data *sd, item_data *data) {
int success = 0;
for( i = 0; i < data->combos_count; i++ ) {
struct itemchk {
for (const auto &item_combo : data->combos) {
bool do_continue = false;
// Ensure this isn't a duplicate combo
for (const auto player_combo : sd->combos) {
if (player_combo->id == item_combo->id) {
do_continue = true;
break;
}
}
// Combo already equipped
if (do_continue)
continue;
size_t nb_itemCombo = item_combo->nameid.size();
if (nb_itemCombo < 2) // A combo with less then 2 item?
continue;
struct s_itemchk {
int idx;
t_itemid nameid;
t_itemid card[MAX_SLOTS];
} *combo_idx;
int idx, j;
int nb_itemCombo;
t_itemid nameid, card[MAX_SLOTS];
};
std::vector<s_itemchk> combo_idx;
size_t j;
unsigned int pos = 0;
/* ensure this isn't a duplicate combo */
if( sd->combos.bonus != NULL ) {
int x;
ARR_FIND( 0, sd->combos.count, x, sd->combos.id[x] == data->combos[i]->id );
/* found a match, skip this combo */
if( x < sd->combos.count )
continue;
combo_idx.reserve(nb_itemCombo);
// Zero out temporary combo array
for (auto &tmp_combo : combo_idx) {
tmp_combo = {};
}
nb_itemCombo = data->combos[i]->count;
if(nb_itemCombo<2) //a combo with less then 2 item ?? how that possible
continue;
CREATE(combo_idx,struct itemchk,nb_itemCombo);
for(j=0; j < nb_itemCombo; j++){
combo_idx[j].idx=-1;
combo_idx[j].nameid=-1;
for( int k = 0; k < MAX_SLOTS; k++ ){
combo_idx[j].card[k] = -1;
}
}
for( j = 0; j < nb_itemCombo; j++ ) {
t_itemid id = data->combos[i]->nameid[j];
uint16 k;
for (j = 0; j < nb_itemCombo; j++) {
t_itemid id = item_combo->nameid[j];
bool found = false;
for( k = 0; k < EQI_MAX; k++ ) {
for (int16 k = 0; k < EQI_MAX; k++) {
short index = sd->equip_index[k];
if( index < 0 )
if (index < 0)
continue;
if( pc_is_same_equip_index((enum equip_index)k, sd->equip_index, index) )
if (pc_is_same_equip_index((equip_index)k, sd->equip_index, index))
continue;
if (!sd->inventory_data[index] )
if (!sd->inventory_data[index])
continue;
if ( itemdb_type(id) != IT_CARD ) {
if ( sd->inventory_data[index]->nameid != id )
if (itemdb_type(id) != IT_CARD) {
if (sd->inventory_data[index]->nameid != id)
continue;
if(j>0){ //check if this item not already used
bool do_continue = false; //used to continue that specific loop with some check that also use some loop
uint8 z;
for (z = 0; z < nb_itemCombo-1; z++)
if(combo_idx[z].idx == index && combo_idx[z].nameid == id) //we already have that index recorded
do_continue=true;
if(do_continue)
if (j > 0) { // Check if this item not already used
do_continue = false;
for (size_t z = 0; z < nb_itemCombo - 1; z++) {
if (combo_idx[z].idx == index && combo_idx[z].nameid == id) { // Index already recorded
do_continue = true;
break;
}
}
if (do_continue)
continue;
}
combo_idx[j].nameid = id;
combo_idx[j].idx = index;
pos |= sd->inventory.u.items_inventory[index].equip;
found = true;
break;
} else { //Cards and enchants
uint16 z;
if ( itemdb_isspecial(sd->inventory.u.items_inventory[index].card[0]) )
} else { // Cards and enchants
if (itemdb_isspecial(sd->inventory.u.items_inventory[index].card[0]))
continue;
for (z = 0; z < MAX_SLOTS; z++) {
bool do_continue=false;
for (uint8 z = 0; z < MAX_SLOTS; z++) {
do_continue = false;
if (sd->inventory.u.items_inventory[index].card[z] != id)
continue;
if(j>0){
int c1, c2;
for (c1 = 0; c1 < nb_itemCombo-1; c1++){
if(combo_idx[c1].idx == index && combo_idx[c1].nameid == id){
for (c2 = 0; c2 < MAX_SLOTS; c2++){
if(combo_idx[c1].card[c2] == id){ //we already have that card recorded (at this same idx)
if (j > 0) {
for (size_t c1 = 0; c1 < nb_itemCombo - 1; c1++) {
if (combo_idx[c1].idx == index && combo_idx[c1].nameid == id) {
for (uint8 c2 = 0; c2 < MAX_SLOTS; c2++) {
if (combo_idx[c1].card[c2] == id) { // Card already recorded (at this same idx)
do_continue = true;
break;
}
@ -10283,8 +10314,10 @@ static int pc_checkcombo(struct map_session_data *sd, struct item_data *data) {
}
}
}
if(do_continue)
if (do_continue)
continue;
combo_idx[j].nameid = id;
combo_idx[j].idx = index;
combo_idx[j].card[z] = id;
@ -10294,86 +10327,68 @@ static int pc_checkcombo(struct map_session_data *sd, struct item_data *data) {
}
}
}
if( !found )
break;/* we haven't found all the ids for this combo, so we can return */
if (!found)
break; // Unable to found all the IDs for this combo, return
}
aFree(combo_idx);
/* means we broke out of the count loop w/o finding all ids, we can move to the next combo */
if( j < nb_itemCombo )
// Broke out of the count loop without finding all IDs, move to the next combo
if (j < nb_itemCombo)
continue;
/* we got here, means all items in the combo are matching */
idx = sd->combos.count;
if( sd->combos.bonus == NULL ) {
CREATE(sd->combos.bonus, struct script_code *, 1);
CREATE(sd->combos.id, unsigned short, 1);
CREATE(sd->combos.pos, unsigned int, 1);
sd->combos.count = 1;
} else {
RECREATE(sd->combos.bonus, struct script_code *, ++sd->combos.count);
RECREATE(sd->combos.id, unsigned short, sd->combos.count);
RECREATE(sd->combos.pos, unsigned int, sd->combos.count);
}
/* we simply copy the pointer */
sd->combos.bonus[idx] = data->combos[i]->script;
/* save this combo's id */
sd->combos.id[idx] = data->combos[i]->id;
/* save pos of combo*/
sd->combos.pos[idx] = pos;
// All items in the combo are matching
auto entry = std::make_shared<s_combos>();
entry->bonus = item_combo->script;
entry->id = item_combo->id;
entry->pos = pos;
sd->combos.push_back(entry);
combo_idx.clear();
success++;
}
return success;
}
/**
* Called when an item with combo is removed
* @param *sd
* @param *data struct item_data
* @return retval numbers of removed combo
*/
static int pc_removecombo(struct map_session_data *sd, struct item_data *data ) {
int i, retval = 0;
* Called when an item with combo is removed
* @param sd: Player data
* @param data: Item data
* @return Number of removed combo(s)
*/
static int pc_removecombo(struct map_session_data *sd, item_data *data ) {
if( sd->combos.bonus == NULL )
return 0;/* nothing to do here, player has no combos */
for( i = 0; i < data->combos_count; i++ ) {
/* check if this combo exists in this user */
int x = 0, cursor = 0, j;
ARR_FIND( 0, sd->combos.count, x, sd->combos.id[x] == data->combos[i]->id );
/* no match, skip this combo */
if(x >= sd->combos.count)
if (sd->combos.empty())
return 0; // Nothing to do here, player has no combos
int retval = 0;
for (const auto &item_combo : data->combos) {
std::shared_ptr<s_combos> del_combo = nullptr;
// Check if this combo exists on this player
for (const auto &player_combo : sd->combos) {
if (player_combo->id == item_combo->id) {
del_combo = player_combo;
break;
}
}
// No match, skip this combo
if (del_combo == nullptr)
continue;
sd->combos.bonus[x] = NULL;
sd->combos.id[x] = 0;
sd->combos.pos[x] = 0;
util::vector_erase_if_exists(sd->combos, del_combo);
retval++;
/* check if combo requirements still fit */
if( pc_checkcombo( sd, data ) )
// Check if combo requirements still fit
if (pc_checkcombo(sd, data))
continue;
/* move next value to empty slot */
for( j = 0, cursor = 0; j < sd->combos.count; j++ ) {
if( sd->combos.bonus[j] == NULL )
continue;
if( cursor != j ) {
sd->combos.bonus[cursor] = sd->combos.bonus[j];
sd->combos.id[cursor] = sd->combos.id[j];
sd->combos.pos[cursor] = sd->combos.pos[j];
}
cursor++;
}
/* it's empty, we can clear all the memory */
if( (sd->combos.count = cursor) == 0 ) {
aFree(sd->combos.bonus);
aFree(sd->combos.id);
aFree(sd->combos.pos);
sd->combos.bonus = NULL;
sd->combos.id = NULL;
sd->combos.pos = NULL;
return retval; /* we also can return at this point for we have no more combos to check */
// It's empty, clear all the memory
if (sd->combos.empty()) {
sd->combos.clear();
return retval; // Return at this point as there are no more combos to check
}
}
@ -10381,34 +10396,41 @@ static int pc_removecombo(struct map_session_data *sd, struct item_data *data )
}
/**
* Load combo data(s) of player
* @param *sd
* @return ret numbers of succeed combo
*/
* Load combo data(s) of player
* @param sd: Player data
* @return ret numbers of succeed combo
*/
int pc_load_combo(struct map_session_data *sd) {
int i, ret = 0;
for( i = 0; i < EQI_MAX; i++ ) {
struct item_data *id = NULL;
int ret = 0;
for (int16 i = 0; i < EQI_MAX; i++) {
item_data *id;
short idx = sd->equip_index[i];
if( idx < 0 || !(id = sd->inventory_data[idx] ) )
if (idx < 0 || !(id = sd->inventory_data[idx]))
continue;
if( id->combos_count )
ret += pc_checkcombo(sd,id);
if(!itemdb_isspecial(sd->inventory.u.items_inventory[idx].card[0])) {
struct item_data *data;
int j;
for( j = 0; j < MAX_SLOTS; j++ ) {
if (!id->combos.empty())
ret += pc_checkcombo(sd, id);
if (!itemdb_isspecial(sd->inventory.u.items_inventory[idx].card[0])) {
item_data *data;
for (uint8 j = 0; j < MAX_SLOTS; j++) {
if (!sd->inventory.u.items_inventory[idx].card[j])
continue;
if ( ( data = itemdb_exists(sd->inventory.u.items_inventory[idx].card[j]) ) != NULL ) {
if( data->combos_count )
ret += pc_checkcombo(sd,data);
if ((data = itemdb_exists(sd->inventory.u.items_inventory[idx].card[j])) != nullptr) {
if (!data->combos.empty())
ret += pc_checkcombo(sd, data);
}
}
}
}
return ret;
}
/*==========================================
* Equip item on player sd at req_pos from inventory index n
* return: false - fail; true - success
@ -10490,7 +10512,7 @@ bool pc_equipitem(struct map_session_data *sd,short n,int req_pos,bool equipswit
if (pos == EQP_ACC) //User specified both slots.
pos = equip_index[EQI_ACC_R] >= 0 ? EQP_ACC_L : EQP_ACC_R;
for (i = 0; i < sd->inventory_data[n]->slot; i++) { // Accessories that have cards that force equip location
for (i = 0; i < sd->inventory_data[n]->slots; i++) { // Accessories that have cards that force equip location
if (!sd->inventory.u.items_inventory[n].card[i])
continue;
@ -10627,19 +10649,21 @@ bool pc_equipitem(struct map_session_data *sd,short n,int req_pos,bool equipswit
pc_checkallowskill(sd); //Check if status changes should be halted.
iflag = sd->npc_item_flag;
/* check for combos (MUST be before status_calc_pc) */
if( id->combos_count )
pc_checkcombo(sd,id);
if(itemdb_isspecial(sd->inventory.u.items_inventory[n].card[0]))
; //No cards
// Check for combos (MUST be before status_calc_pc)
if (!id->combos.empty())
pc_checkcombo(sd, id);
if (itemdb_isspecial(sd->inventory.u.items_inventory[n].card[0]))
; // No cards
else {
for( i = 0; i < MAX_SLOTS; i++ ) {
struct item_data *data;
for (i = 0; i < MAX_SLOTS; i++) {
item_data *data;
if (!sd->inventory.u.items_inventory[n].card[i])
continue;
if ( ( data = itemdb_exists(sd->inventory.u.items_inventory[n].card[i]) ) != NULL ) {
if( data->combos_count )
pc_checkcombo(sd,data);
if ((data = itemdb_exists(sd->inventory.u.items_inventory[n].card[i])) != nullptr) {
if (!data->combos.empty())
pc_checkcombo(sd, data);
}
}
}
@ -10691,22 +10715,23 @@ static void pc_unequipitem_sub(struct map_session_data *sd, int n, int flag) {
pc_checkallowskill(sd);
iflag = sd->npc_item_flag;
/* check for combos (MUST be before status_calc_pc) */
// Check for combos (MUST be before status_calc_pc)
if (sd->inventory_data[n]) {
if (sd->inventory_data[n]->combos_count) {
if (!sd->inventory_data[n]->combos.empty()) {
if (pc_removecombo(sd, sd->inventory_data[n]))
status_calc = true;
}
if (itemdb_isspecial(sd->inventory.u.items_inventory[n].card[0]))
; //No cards
; // No cards
else {
for (i = 0; i < MAX_SLOTS; i++) {
struct item_data *data;
item_data *data;
if (!sd->inventory.u.items_inventory[n].card[i])
continue;
if ((data = itemdb_exists(sd->inventory.u.items_inventory[n].card[i])) != NULL) {
if (data->combos_count) {
if ((data = itemdb_exists(sd->inventory.u.items_inventory[n].card[i])) != nullptr) {
if (!data->combos.empty()) {
if (pc_removecombo(sd, data))
status_calc = true;
}
@ -12471,10 +12496,10 @@ uint8 pc_itemcd_add(struct map_session_data *sd, struct item_data *id, t_tick ti
char e_msg[CHAT_SIZE_MAX];
if( e_tick > 99 )
sprintf(e_msg,msg_txt(sd,379), // Item Failed. [%s] is cooling down. Wait %.1f minutes.
itemdb_jname(sd->item_delay[i].nameid), (double)e_tick / 60);
itemdb_ename(sd->item_delay[i].nameid), (double)e_tick / 60);
else
sprintf(e_msg,msg_txt(sd,380), // Item Failed. [%s] is cooling down. Wait %d seconds.
itemdb_jname(sd->item_delay[i].nameid), e_tick+1);
itemdb_ename(sd->item_delay[i].nameid), e_tick+1);
clif_messagecolor(&sd->bl,color_table[COLOR_YELLOW],e_msg,false,SELF);
return 1; // Delay has not expired yet
}
@ -12482,7 +12507,7 @@ uint8 pc_itemcd_add(struct map_session_data *sd, struct item_data *id, t_tick ti
sd->item_delay[i].nameid = id->nameid;
}
if( !(id->nameid == ITEMID_REINS_OF_MOUNT && sd->sc.option&(OPTION_WUGRIDER|OPTION_RIDING|OPTION_DRAGON|OPTION_MADOGEAR)) )
sd->item_delay[i].tick = tick + sd->inventory_data[n]->delay;
sd->item_delay[i].tick = tick + sd->inventory_data[n]->delay.duration;
} else {// should not happen
ShowError("pc_itemcd_add: Exceeded item delay array capacity! (nameid=%u, char_id=%d)\n", id->nameid, sd->status.char_id);
}
@ -12512,17 +12537,17 @@ uint8 pc_itemcd_check(struct map_session_data *sd, struct item_data *id, t_tick
nullpo_retr(0, id);
// Do normal delay assignment
if (id->delay_sc <= SC_NONE || id->delay_sc >= SC_MAX || !(sc = &sd->sc))
if (id->delay.sc <= SC_NONE || id->delay.sc >= SC_MAX || !(sc = &sd->sc))
return pc_itemcd_add(sd, id, tick, n);
// Send reply of delay remains
if (sc->data[id->delay_sc]) {
const struct TimerData *timer = get_timer(sc->data[id->delay_sc]->timer);
if (sc->data[id->delay.sc]) {
const struct TimerData *timer = get_timer(sc->data[id->delay.sc]->timer);
clif_msg_value(sd, ITEM_REUSE_LIMIT, (int)(timer ? DIFF_TICK(timer->tick, tick) / 1000 : 99));
return 1;
}
sc_start(&sd->bl, &sd->bl, (sc_type)id->delay_sc, 100, id->nameid, id->delay);
sc_start(&sd->bl, &sd->bl, id->delay.sc, 100, id->nameid, id->delay.duration);
return 0;
}

View File

@ -258,6 +258,18 @@ struct s_regen {
int tick;
};
/// Item combo struct
struct s_combos {
script_code *bonus;
uint32 id;
uint32 pos;
~s_combos() {
if (this->bonus)
script_free_code(this->bonus);
}
};
struct map_session_data {
struct block_list bl;
struct unit_data ud;
@ -699,12 +711,7 @@ struct map_session_data {
enum npc_timeout_type npc_idle_type;
#endif
struct s_combos {
struct script_code **bonus;/* the script */
unsigned short *id;/* array of combo ids */
unsigned int *pos;/* array of positions*/
unsigned char count;
} combos;
std::vector<std::shared_ptr<s_combos>> combos;
/**
* Guarantees your friend request is legit (for bugreport:4629)
@ -804,7 +811,7 @@ extern struct eri *str_reg_ers;
/* Global Expiration Timer ID */
extern int pc_expiration_tid;
enum weapon_type {
enum weapon_type : uint8 {
W_FIST, //Bare hands
W_DAGGER, //1
W_1HSWORD, //2
@ -842,16 +849,18 @@ enum weapon_type {
#define WEAPON_TYPE_ALL ((1<<MAX_WEAPON_TYPE)-1)
enum ammo_type {
A_ARROW = 1,
A_DAGGER, //2
A_BULLET, //3
A_SHELL, //4
A_GRENADE, //5
A_SHURIKEN, //6
A_KUNAI, //7
A_CANNONBALL, //8
A_THROWWEAPON //9
enum e_ammo_type : uint8 {
AMMO_NONE = 0,
AMMO_ARROW,
AMMO_DAGGER,
AMMO_BULLET,
AMMO_SHELL,
AMMO_GRENADE,
AMMO_SHURIKEN,
AMMO_KUNAI,
AMMO_CANNONBALL,
AMMO_THROWWEAPON,
MAX_AMMO_TYPE
};
enum idletime_option {

View File

@ -2483,7 +2483,6 @@ struct script_code* parse_script(const char *src,const char *file,int line,int o
const char *p,*tmpp;
int i;
struct script_code* code = NULL;
static bool first=true;
char end;
bool unresolved_names = false;
@ -2495,12 +2494,6 @@ struct script_code* parse_script(const char *src,const char *file,int line,int o
return NULL;// empty script
memset(&syntax,0,sizeof(syntax));
if(first){
add_buildin_func();
read_constdb();
script_hardcoded_constants();
first=false;
}
script_buf=(unsigned char *)aMalloc(SCRIPT_BLOCK_SIZE*sizeof(unsigned char));
script_pos=0;
@ -4841,6 +4834,9 @@ void do_init_script(void) {
next_id = 0;
mapreg_init();
add_buildin_func();
read_constdb();
script_hardcoded_constants();
}
void script_reload(void) {
@ -8959,7 +8955,7 @@ BUILDIN_FUNC(getequipname)
item = sd->inventory_data[i];
if( item != 0 )
script_pushstrcopy(st,item->jname);
script_pushstrcopy(st,item->ename.c_str());
else
script_pushconststr(st,"");
@ -13320,7 +13316,7 @@ BUILDIN_FUNC(getequipcardcnt)
}
count = 0;
for( j = 0; j < sd->inventory_data[i]->slot; j++ )
for( j = 0; j < sd->inventory_data[i]->slots; j++ )
if( sd->inventory.u.items_inventory[i].card[j] && itemdb_type(sd->inventory.u.items_inventory[i].card[j]) == IT_CARD )
count++;
@ -13352,7 +13348,7 @@ BUILDIN_FUNC(successremovecards) {
if(itemdb_isspecial(sd->inventory.u.items_inventory[i].card[0]))
return SCRIPT_CMD_SUCCESS;
for( c = sd->inventory_data[i]->slot - 1; c >= 0; --c ) {
for( c = sd->inventory_data[i]->slots - 1; c >= 0; --c ) {
if( sd->inventory.u.items_inventory[i].card[c] && itemdb_type(sd->inventory.u.items_inventory[i].card[c]) == IT_CARD ) {// extract this card from the item
unsigned char flag = 0;
struct item item_tmp;
@ -13369,7 +13365,7 @@ BUILDIN_FUNC(successremovecards) {
}
if(cardflag == 1) {//if card was remove remplace item with no card
unsigned char flag = 0, j;
unsigned char flag = 0;
struct item item_tmp;
memset(&item_tmp,0,sizeof(item_tmp));
@ -13380,10 +13376,10 @@ BUILDIN_FUNC(successremovecards) {
item_tmp.expire_time = sd->inventory.u.items_inventory[i].expire_time;
item_tmp.bound = sd->inventory.u.items_inventory[i].bound;
for (j = sd->inventory_data[i]->slot; j < MAX_SLOTS; j++)
for (int j = sd->inventory_data[i]->slots; j < MAX_SLOTS; j++)
item_tmp.card[j]=sd->inventory.u.items_inventory[i].card[j];
for (j = 0; j < MAX_ITEM_RDM_OPT; j++){
for (int j = 0; j < MAX_ITEM_RDM_OPT; j++){
item_tmp.option[j].id=sd->inventory.u.items_inventory[i].option[j].id;
item_tmp.option[j].value=sd->inventory.u.items_inventory[i].option[j].value;
item_tmp.option[j].param=sd->inventory.u.items_inventory[i].option[j].param;
@ -13428,7 +13424,7 @@ BUILDIN_FUNC(failedremovecards) {
if(itemdb_isspecial(sd->inventory.u.items_inventory[i].card[0]))
return SCRIPT_CMD_SUCCESS;
for( c = sd->inventory_data[i]->slot - 1; c >= 0; --c ) {
for( c = sd->inventory_data[i]->slots - 1; c >= 0; --c ) {
if( sd->inventory.u.items_inventory[i].card[c] && itemdb_type(sd->inventory.u.items_inventory[i].card[c]) == IT_CARD ) {
cardflag = 1;
@ -13453,7 +13449,7 @@ BUILDIN_FUNC(failedremovecards) {
if(typefail == 0 || typefail == 2){ // destroy the item
pc_delitem(sd,i,1,0,2,LOG_TYPE_SCRIPT);
}else if(typefail == 1){ // destroy the card
unsigned char flag = 0, j;
unsigned char flag = 0;
struct item item_tmp;
memset(&item_tmp,0,sizeof(item_tmp));
@ -13465,10 +13461,10 @@ BUILDIN_FUNC(failedremovecards) {
item_tmp.expire_time = sd->inventory.u.items_inventory[i].expire_time;
item_tmp.bound = sd->inventory.u.items_inventory[i].bound;
for (j = sd->inventory_data[i]->slot; j < MAX_SLOTS; j++)
for (int j = sd->inventory_data[i]->slots; j < MAX_SLOTS; j++)
item_tmp.card[j]=sd->inventory.u.items_inventory[i].card[j];
for (j = 0; j < MAX_ITEM_RDM_OPT; j++){
for (int j = 0; j < MAX_ITEM_RDM_OPT; j++){
item_tmp.option[j].id=sd->inventory.u.items_inventory[i].option[j].id;
item_tmp.option[j].value=sd->inventory.u.items_inventory[i].option[j].value;
item_tmp.option[j].param=sd->inventory.u.items_inventory[i].option[j].param;
@ -13912,7 +13908,7 @@ BUILDIN_FUNC(getitemname)
}
item_name=(char *)aMalloc(ITEM_NAME_LENGTH*sizeof(char));
memcpy(item_name, i_data->jname, ITEM_NAME_LENGTH);
memcpy(item_name, i_data->ename.c_str(), ITEM_NAME_LENGTH);
script_pushstr(st,item_name);
return SCRIPT_CMD_SUCCESS;
}
@ -13929,7 +13925,7 @@ BUILDIN_FUNC(getitemslots)
i_data = itemdb_exists(item_id);
if (i_data)
script_pushint(st,i_data->slot);
script_pushint(st,i_data->slots);
else
script_pushint(st,-1);
return SCRIPT_CMD_SUCCESS;
@ -15114,7 +15110,7 @@ BUILDIN_FUNC(checkequipedcard)
if(sd->inventory.u.items_inventory[i].nameid > 0 && sd->inventory.u.items_inventory[i].amount && sd->inventory_data[i]){
if (itemdb_isspecial(sd->inventory.u.items_inventory[i].card[0]))
continue;
for(n=0;n<sd->inventory_data[i]->slot;n++){
for(n=0;n<sd->inventory_data[i]->slots;n++){
if(sd->inventory.u.items_inventory[i].card[n] == c) {
script_pushint(st,1);
return SCRIPT_CMD_SUCCESS;
@ -15666,7 +15662,7 @@ BUILDIN_FUNC(isequippedcnt)
} else { //Count cards.
if (itemdb_isspecial(sd->inventory.u.items_inventory[index].card[0]))
continue; //No cards
for (short k = 0; k < sd->inventory_data[index]->slot; k++) {
for (short k = 0; k < sd->inventory_data[index]->slots; k++) {
if (sd->inventory.u.items_inventory[index].card[k] == id)
ret++; //[Lupus]
}
@ -15722,11 +15718,11 @@ BUILDIN_FUNC(isequipped)
break;
} else { //Cards
short k;
if (sd->inventory_data[index]->slot == 0 ||
if (sd->inventory_data[index]->slots == 0 ||
itemdb_isspecial(sd->inventory.u.items_inventory[index].card[0]))
continue;
for (k = 0; k < sd->inventory_data[index]->slot; k++)
for (k = 0; k < sd->inventory_data[index]->slots; k++)
{ //New hash system which should support up to 4 slots on any equipment. [Skotlex]
unsigned int hash = 0;
if (sd->inventory.u.items_inventory[index].card[k] != id)
@ -15796,7 +15792,7 @@ BUILDIN_FUNC(cardscnt)
} else {
if (itemdb_isspecial(sd->inventory.u.items_inventory[index].card[0]))
continue;
for(k=0; k<sd->inventory_data[index]->slot; k++) {
for(k=0; k<sd->inventory_data[index]->slots; k++) {
if (sd->inventory.u.items_inventory[index].card[k] == id)
ret++;
}

View File

@ -260,9 +260,11 @@
export_constant2("EAJ_BLACKSMITH",MAPID_BLACKSMITH);
export_constant2("EAJ_ASSASSIN",MAPID_ASSASSIN);
export_constant2("EAJ_STAR_GLADIATOR",MAPID_STAR_GLADIATOR);
export_constant2("EAJ_STARGLADIATOR",MAPID_STAR_GLADIATOR);
export_constant2("EAJ_REBELLION",MAPID_REBELLION);
export_constant2("EAJ_KAGEROUOBORO",MAPID_KAGEROUOBORO);
export_constant2("EAJ_DEATH_KNIGHT",MAPID_DEATH_KNIGHT);
export_constant2("EAJ_DEATHKNIGHT",MAPID_DEATH_KNIGHT);
export_constant2("EAJ_CRUSADER",MAPID_CRUSADER);
export_constant2("EAJ_SAGE",MAPID_SAGE);
@ -271,7 +273,9 @@
export_constant2("EAJ_ALCHEMIST",MAPID_ALCHEMIST);
export_constant2("EAJ_ROGUE",MAPID_ROGUE);
export_constant2("EAJ_SOUL_LINKER",MAPID_SOUL_LINKER);
export_constant2("EAJ_SOULLINKER",MAPID_SOUL_LINKER);
export_constant2("EAJ_DARK_COLLECTOR",MAPID_DARK_COLLECTOR);
export_constant2("EAJ_DARKCOLLECTOR",MAPID_DARK_COLLECTOR);
export_constant2("EAJ_NOVICE_HIGH",MAPID_NOVICE_HIGH);
export_constant2("EAJ_SWORDMAN_HIGH",MAPID_SWORDMAN_HIGH);
@ -378,6 +382,7 @@
export_constant2("EAJ_BABY_SOUL_REAPER",MAPID_BABY_SOUL_REAPER);
export_constant2("EAJ_SUPER_NOVICE",MAPID_SUPER_NOVICE);
export_constant2("EAJ_SUPERNOVICE",MAPID_SUPER_NOVICE);
export_constant2("EAJ_SUPER_BABY",MAPID_SUPER_BABY);
export_constant2("EAJ_SUPER_NOVICE_E",MAPID_SUPER_NOVICE_E);
export_constant2("EAJ_SUPER_BABY_E",MAPID_SUPER_BABY_E);
@ -387,6 +392,7 @@
/* sex */
export_constant(SEX_FEMALE);
export_constant(SEX_MALE);
export_constant(SEX_BOTH);
/* broadcasts */
export_constant(BC_ALL);
@ -807,6 +813,13 @@
export_constant(EQP_ACC_RL);
export_constant(EQP_SHADOW_ACC_RL);
export_constant2("EQP_Right_Hand", EQP_HAND_R);
export_constant2("EQP_Left_Hand", EQP_HAND_L);
export_constant2("EQP_Right_Accessory", EQP_ACC_R);
export_constant2("EQP_Left_Accessory", EQP_ACC_L);
export_constant2("EQP_Shadow_Right_Accessory", EQP_SHADOW_ACC_R);
export_constant2("EQP_Shadow_Left_Accessory", EQP_SHADOW_ACC_L);
/* looks */
export_constant(LOOK_BASE);
export_constant(LOOK_HAIR);
@ -4049,15 +4062,27 @@
export_constant(MAX_WEAPON_TYPE_ALL);
/* ammunition types */
export_constant(A_ARROW);
export_constant(A_DAGGER);
export_constant(A_BULLET);
export_constant(A_SHELL);
export_constant(A_GRENADE);
export_constant(A_SHURIKEN);
export_constant(A_KUNAI);
export_constant(A_CANNONBALL);
export_constant(A_THROWWEAPON);
/* Send deprecation notice and temporarily replace with new constant value. */
export_deprecated_constant3("A_ARROW", AMMO_ARROW, "AMMO_ARROW");
export_deprecated_constant3("A_DAGGER", AMMO_DAGGER, "AMMO_DAGGER");
export_deprecated_constant3("A_BULLET", AMMO_BULLET, "AMMO_BULLET");
export_deprecated_constant3("A_SHELL", AMMO_SHELL, "AMMO_SHELL");
export_deprecated_constant3("A_GRENADE", AMMO_GRENADE, "AMMO_GRENADE");
export_deprecated_constant3("A_SHURIKEN", AMMO_SHURIKEN, "AMMO_SHURIKEN");
export_deprecated_constant3("A_KUNAI", AMMO_KUNAI, "AMMO_KUNAI");
export_deprecated_constant3("A_CANNONBALL", AMMO_CANNONBALL, "AMMO_CANNONBALL");
export_deprecated_constant3("A_THROWWEAPON", AMMO_THROWWEAPON, "AMMO_THROWWEAPON");
export_constant(AMMO_ARROW);
export_constant(AMMO_DAGGER);
export_constant(AMMO_BULLET);
export_constant(AMMO_SHELL);
export_constant(AMMO_GRENADE);
export_constant(AMMO_SHURIKEN);
export_constant(AMMO_KUNAI);
export_constant(AMMO_CANNONBALL);
export_constant(AMMO_THROWWEAPON);
export_constant(MAX_AMMO_TYPE);
/* monsterinfo types */
export_constant(MOB_NAME);
@ -7937,6 +7962,24 @@
export_constant(BG_INFO_MAPS);
export_constant(BG_INFO_DESERTER_TIME);
/* item job classes */
export_constant(ITEMJ_NORMAL);
export_constant(ITEMJ_UPPER);
export_constant(ITEMJ_BABY);
export_constant(ITEMJ_THIRD);
export_constant(ITEMJ_THIRD_UPPER);
export_constant(ITEMJ_THIRD_BABY);
/* item drop effects */
export_constant(DROPEFFECT_NONE);
export_constant(DROPEFFECT_CLIENT);
export_constant(DROPEFFECT_WHITE_PILLAR);
export_constant(DROPEFFECT_BLUE_PILLAR);
export_constant(DROPEFFECT_YELLOW_PILLAR);
export_constant(DROPEFFECT_PURPLE_PILLAR);
export_constant(DROPEFFECT_ORANGE_PILLAR);
export_constant(DROPEFFECT_MAX);
#undef export_constant
#undef export_constant2
#undef export_parameter

View File

@ -15510,7 +15510,7 @@ bool skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_i
if( (i = sd->itemindex) == -1 ||
sd->inventory.u.items_inventory[i].nameid != sd->itemid ||
sd->inventory_data[i] == NULL ||
!sd->inventory_data[i]->flag.delay_consume ||
sd->inventory_data[i]->flag.delay_consume == DELAYCONSUME_NONE ||
sd->inventory.u.items_inventory[i].amount < 1
)
{ //Something went wrong, item exploit?
@ -15521,7 +15521,7 @@ bool skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_i
//Consume
sd->itemid = 0;
sd->itemindex = -1;
if( (skill_id == WZ_EARTHSPIKE && sc && sc->data[SC_EARTHSCROLL] && rnd()%100 > sc->data[SC_EARTHSCROLL]->val2) || sd->inventory_data[i]->flag.delay_consume == 2 ) // [marquis007]
if( (skill_id == WZ_EARTHSPIKE && sc && sc->data[SC_EARTHSCROLL] && rnd()%100 > sc->data[SC_EARTHSCROLL]->val2) || sd->inventory_data[i]->flag.delay_consume & DELAYCONSUME_NOCONSUME ) // [marquis007]
; //Do not consume item.
else if( sd->inventory.u.items_inventory[i].expire_time == 0 )
pc_delitem(sd,i,1,0,0,LOG_TYPE_CONSUME); // Rental usable items are not consumed until expiration
@ -16627,7 +16627,7 @@ bool skill_check_condition_castend(struct map_session_data* sd, uint16 skill_id,
sprintf(e_msg,msg_txt(sd,381), //Skill Failed. [%s] requires %dx %s.
skill_get_desc(skill_id),
require.ammo_qty,
itemdb_jname(sd->inventory.u.items_inventory[i].nameid));
itemdb_ename(sd->inventory.u.items_inventory[i].nameid));
clif_messagecolor(&sd->bl,color_table[COLOR_RED],e_msg,false,SELF);
return false;
}
@ -22319,7 +22319,7 @@ uint64 SkillDatabase::parseBodyNode(const YAML::Node &node) {
skill->require.ammo = 0;
} else {
for (const auto &it : ammoNode) {
std::string ammo = it.first.as<std::string>(), ammo_constant = "A_" + ammo;
std::string ammo = it.first.as<std::string>(), ammo_constant = "AMMO_" + ammo;
int64 constant;
if (!script_get_constant(ammo_constant.c_str(), &constant)) {

View File

@ -4022,31 +4022,38 @@ int status_calc_pc_sub(struct map_session_data* sd, enum e_status_calc_opt opt)
}
}
// We've got combos to process and check
if( sd->combos.count ) {
for (i = 0; i < sd->combos.count; i++) {
uint8 j = 0;
bool no_run = false;
struct item_combo *combo = NULL;
// Process and check item combos
if (!sd->combos.empty()) {
for (const auto &combo : sd->combos) {
s_item_combo *item_combo;
current_equip_item_index = -1;
current_equip_combo_pos = sd->combos.pos[i];
current_equip_combo_pos = combo->pos;
if (!sd->combos.bonus[i] || !(combo = itemdb_combo_exists(sd->combos.id[i])))
if (combo->bonus == nullptr || !(item_combo = itemdb_combo_exists(combo->id)))
continue;
bool no_run = false;
size_t j = 0;
// Check combo items
while (j < combo->count) {
struct item_data *id = itemdb_exists(combo->nameid[j]);
while (j < item_combo->nameid.size()) {
item_data *id = itemdb_exists(item_combo->nameid[j]);
// Don't run the script if at least one of combo's pair has restriction
if (id && !pc_has_permission(sd, PC_PERM_USE_ALL_EQUIPMENT) && itemdb_isNoEquip(id, sd->bl.m)) {
no_run = true;
break;
}
j++;
}
if (no_run)
continue;
run_script(sd->combos.bonus[i],0,sd->bl.id,0);
run_script(combo->bonus, 0, sd->bl.id, 0);
if (!calculating) // Abort, run_script retriggered this
return 1;
}

View File

@ -771,7 +771,7 @@ bool storage_guild_additem(struct map_session_data* sd, struct s_storage* stor,
id = itemdb_search(item_data->nameid);
if( id->stack.guildstorage && amount > id->stack.amount ) // item stack limitation
if( id->stack.guild_storage && amount > id->stack.amount ) // item stack limitation
return false;
if (!itemdb_canguildstore(item_data, pc_get_group_level(sd)) || item_data->expire_time) { // Check if item is storable. [Skotlex]
@ -787,7 +787,7 @@ bool storage_guild_additem(struct map_session_data* sd, struct s_storage* stor,
if(itemdb_isstackable2(id)) { //Stackable
for(i = 0; i < stor->max_amount; i++) {
if(compare_item(&stor->u.items_guild[i], item_data)) {
if( amount > MAX_AMOUNT - stor->u.items_guild[i].amount || ( id->stack.guildstorage && amount > id->stack.amount - stor->u.items_guild[i].amount ) )
if( amount > MAX_AMOUNT - stor->u.items_guild[i].amount || ( id->stack.guild_storage && amount > id->stack.amount - stor->u.items_guild[i].amount ) )
return false;
stor->u.items_guild[i].amount += amount;
@ -842,9 +842,9 @@ bool storage_guild_additem2(struct s_storage* stor, struct item* item, int amoun
for (i = 0; i < stor->max_amount; i++) {
if (compare_item(&stor->u.items_guild[i], item)) {
// Set the amount, make it fit with max amount
amount = min(amount, ((id->stack.guildstorage) ? id->stack.amount : MAX_AMOUNT) - stor->u.items_guild[i].amount);
amount = min(amount, ((id->stack.guild_storage) ? id->stack.amount : MAX_AMOUNT) - stor->u.items_guild[i].amount);
if (amount != item->amount)
ShowWarning("storage_guild_additem2: Stack limit reached! Altered amount of item \"" CL_WHITE "%s" CL_RESET "\" (%u). '" CL_WHITE "%d" CL_RESET "' -> '" CL_WHITE"%d" CL_RESET "'.\n", id->name, id->nameid, item->amount, amount);
ShowWarning("storage_guild_additem2: Stack limit reached! Altered amount of item \"" CL_WHITE "%s" CL_RESET "\" (%u). '" CL_WHITE "%d" CL_RESET "' -> '" CL_WHITE"%d" CL_RESET "'.\n", id->name.c_str(), id->nameid, item->amount, amount);
stor->u.items_guild[i].amount += amount;
stor->dirty = true;
return true;

View File

@ -3378,12 +3378,7 @@ int unit_free(struct block_list *bl, clr_type clrtype)
sd->npc_id = 0;
}
if( sd->combos.count ) {
aFree(sd->combos.bonus);
aFree(sd->combos.id);
aFree(sd->combos.pos);
sd->combos.count = 0;
}
sd->combos.clear();
if( sd->sc_display_count ) { /* [Ind] */
for( i = 0; i < sd->sc_display_count; i++ )

View File

@ -451,7 +451,7 @@ bool vending_searchall(struct map_session_data* sd, const struct s_search_store_
if( itemdb_isspecial(it->card[0]) ) { // something, that is not a carded
continue;
}
slot = itemdb_slot(it->nameid);
slot = itemdb_slots(it->nameid);
for( c = 0; c < slot && it->card[c]; c ++ ) {
ARR_FIND( 0, s->card_count, cidx, s->cardlist[cidx].itemId == it->card[c] );

View File

@ -4,10 +4,6 @@ COMMON_DIR_OBJ = $(COMMON_OBJ:%=../common/obj/%)
COMMON_H = $(shell ls ../common/*.hpp)
COMMON_INCLUDE = -I../common/
LIBCONFIG_H = $(shell ls ../../3rdparty/libconfig/*.h)
LIBCONFIG_AR = ../../3rdparty/libconfig/obj/libconfig.a
LIBCONFIG_INCLUDE = -I../../3rdparty/libconfig
YAML_CPP_OBJ = $(shell find ../../3rdparty/yaml-cpp/ -type f -name "*.cpp" | sed -e "s/\.cpp/\.o/g" )
YAML_CPP_DIR_OBJ = $(YAML_CPP_OBJ:%=obj/%)
YAML_CPP_AR = ../../3rdparty/yaml-cpp/obj/yaml-cpp.a
@ -20,29 +16,36 @@ MAPCACHE_OBJ = obj_all/mapcache.o
CSV2YAML_OBJ = obj_all/csv2yaml.o
YAML2SQL_OBJ = obj_all/yaml2sql.o
@SET_MAKE@
#####################################################################
.PHONY : all mapcache csv2yaml clean help
.PHONY : all mapcache csv2yaml yaml2sql clean help
all: mapcache csv2yaml
all: mapcache csv2yaml yaml2sql
mapcache: obj_all $(MAPCACHE_OBJ) $(COMMON_DIR_OBJ) $(LIBCONFIG_OBJ)
mapcache: obj_all $(MAPCACHE_OBJ) $(COMMON_DIR_OBJ)
@echo " LD $@"
@@CXX@ @LDFLAGS@ -o ../../mapcache@EXEEXT@ $(MAPCACHE_OBJ) $(COMMON_DIR_OBJ) $(LIBCONFIG_AR) @LIBS@
@@CXX@ @LDFLAGS@ -o ../../mapcache@EXEEXT@ $(MAPCACHE_OBJ) $(COMMON_DIR_OBJ) @LIBS@
csv2yaml: obj_all $(CSV2YAML_OBJ) $(COMMON_DIR_OBJ) $(YAML_CPP_AR)
@echo " LD $@"
@@CXX@ @LDFLAGS@ -o ../../csv2yaml@EXEEXT@ $(CSV2YAML_OBJ) $(COMMON_DIR_OBJ) $(YAML_CPP_AR) @LIBS@
@@CXX@ @LDFLAGS@ -o ../../csv2yaml@EXEEXT@ $(CSV2YAML_OBJ) $(COMMON_DIR_OBJ) ../common/obj/database.o $(YAML_CPP_AR) @LIBS@
yaml2sql: obj_all $(YAML2SQL_OBJ) $(COMMON_DIR_OBJ) $(YAML_CPP_AR)
@echo " LD $@"
@@CXX@ @LDFLAGS@ -o ../../yaml2sql@EXEEXT@ $(YAML2SQL_OBJ) $(COMMON_DIR_OBJ) $(YAML_CPP_AR) @LIBS@
clean:
@echo " CLEAN tool"
@rm -rf obj_all/*.o ../../mapcache@EXEEXT@
@rm -rf obj_all/*.o ../../mapcache@EXEEXT@ ../../csv2yaml@EXEEXT@ ../../yaml2sql@EXEEXT@
help:
@echo "possible targets are 'mapcache' 'all' 'clean' 'help'"
@echo "possible targets are 'mapcache' 'csv2yaml' 'yaml2sql' 'all' 'clean' 'help'"
@echo "'mapcache' - mapcache generator"
@echo "'csv2yaml' - csv2yaml converter"
@echo "'csv2yaml' - converts TXT databases to YAML"
@echo "'yaml2sql' - converts YAML databases to SQL"
@echo "'all' - builds all above targets"
@echo "'clean' - cleans builds and objects"
@echo "'help' - outputs this message"
@ -52,16 +55,13 @@ help:
obj_all:
-mkdir obj_all
obj_all/%.o: %.cpp $(COMMON_H) $(OTHER_H) $(LIBCONFIG_H) $(YAML_CPP_H)
obj_all/%.o: %.cpp $(COMMON_H) $(OTHER_H) $(YAML_CPP_H)
@echo " CXX $<"
@@CXX@ @CXXFLAGS@ $(COMMON_INCLUDE) $(LIBCONFIG_INCLUDE) $(YAML_CPP_INCLUDE) @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
@@CXX@ @CXXFLAGS@ $(COMMON_INCLUDE) $(YAML_CPP_INCLUDE) @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
# missing common object files
$(COMMON_DIR_OBJ):
@$(MAKE) -C ../common server
$(LIBCONFIG_AR):
@$(MAKE) -C ../../3rdparty/libconfig
$(YAML_CPP_AR):
@$(MAKE) -C ../../3rdparty/yaml-cpp

View File

@ -5,6 +5,7 @@
#include <functional>
#include <iostream>
#include <locale>
#include <map>
#include <unordered_map>
#include <vector>
@ -86,6 +87,100 @@ std::unordered_map<uint16, s_skill_unit_csv> skill_unit;
std::unordered_map<uint16, s_skill_copyable> skill_copyable;
std::unordered_map<uint16, s_skill_db> skill_nearnpc;
struct s_item_flag_csv2yaml {
bool buyingstore, dead_branch, group, guid, broadcast, bindOnEquip, delay_consume;
e_item_drop_effect dropEffect;
};
struct s_item_delay_csv2yaml {
uint32 delay;
std::string sc;
};
struct s_item_stack_csv2yaml {
uint16 amount;
bool inventory, cart, storage, guild_storage;
};
struct s_item_nouse_csv2yaml {
uint16 override;
bool sitting;
};
struct s_item_trade_csv2yaml {
uint16 override;
bool drop, trade, trade_partner, sell, cart, storage, guild_storage, mail, auction;
};
std::unordered_map<t_itemid, t_itemid> item_avail;
std::unordered_map<t_itemid, bool> item_buyingstore;
std::unordered_map<t_itemid, s_item_flag_csv2yaml> item_flag;
std::unordered_map<t_itemid, s_item_delay_csv2yaml> item_delay;
std::unordered_map<t_itemid, s_item_stack_csv2yaml> item_stack;
std::unordered_map<t_itemid, s_item_nouse_csv2yaml> item_nouse;
std::unordered_map<t_itemid, s_item_trade_csv2yaml> item_trade;
static std::map<std::string, int> um_mapid2jobname {
{ "Novice", JOB_NOVICE }, // Novice and Super Novice share the same value
{ "SuperNovice", JOB_NOVICE },
{ "Swordman", JOB_SWORDMAN },
{ "Mage", JOB_MAGE },
{ "Archer", JOB_ARCHER },
{ "Acolyte", JOB_ACOLYTE },
{ "Merchant", JOB_MERCHANT },
{ "Thief", JOB_THIEF },
{ "Knight", JOB_KNIGHT },
{ "Priest", JOB_PRIEST },
{ "Wizard", JOB_WIZARD },
{ "Blacksmith", JOB_BLACKSMITH },
{ "Hunter", JOB_HUNTER },
{ "Assassin", JOB_ASSASSIN },
{ "Crusader", JOB_CRUSADER },
{ "Monk", JOB_MONK },
{ "Sage", JOB_SAGE },
{ "Rogue", JOB_ROGUE },
{ "Alchemist", JOB_ALCHEMIST },
{ "BardDancer", JOB_BARD }, // Bard and Dancer share the same value
{ "BardDancer", JOB_DANCER },
{ "Gunslinger", JOB_GUNSLINGER },
{ "Ninja", JOB_NINJA },
{ "Taekwon", 21 },
{ "StarGladiator", 22 },
{ "SoulLinker", 23 },
// { "Gangsi", 26 },
// { "DeathKnight", 27 },
// { "DarkCollector", 28 },
#ifdef RENEWAL
{ "KagerouOboro", 29 }, // Kagerou and Oboro share the same value
{ "Rebellion", 30 },
{ "Summoner", 31 },
#endif
};
static std::unordered_map<std::string, equip_pos> um_equipnames {
{ "Head_Low", EQP_HEAD_LOW },
{ "Head_Mid", EQP_HEAD_MID },
{ "Head_Top", EQP_HEAD_TOP },
{ "Right_Hand", EQP_HAND_R },
{ "Left_Hand", EQP_HAND_L },
{ "Armor", EQP_ARMOR },
{ "Shoes", EQP_SHOES },
{ "Garment", EQP_GARMENT },
{ "Right_Accessory", EQP_ACC_R },
{ "Left_Accessory", EQP_ACC_L },
{ "Costume_Head_Top", EQP_COSTUME_HEAD_TOP },
{ "Costume_Head_Mid", EQP_COSTUME_HEAD_MID },
{ "Costume_Head_Low", EQP_COSTUME_HEAD_LOW },
{ "Costume_Garment", EQP_COSTUME_GARMENT },
{ "Ammo", EQP_AMMO },
{ "Shadow_Armor", EQP_SHADOW_ARMOR },
{ "Shadow_Weapon", EQP_SHADOW_WEAPON },
{ "Shadow_Shield", EQP_SHADOW_SHIELD },
{ "Shadow_Shoes", EQP_SHADOW_SHOES },
{ "Shadow_Right_Accessory", EQP_SHADOW_ACC_R },
{ "Shadow_Left_Accessory", EQP_SHADOW_ACC_L },
};
// Forward declaration of conversion functions
static bool guild_read_guildskill_tree_db( char* split[], int columns, int current );
static bool pet_read_db( const char* file );
@ -102,16 +197,24 @@ static bool skill_parse_row_nonearnpcrangedb(char* split[], int columns, int cur
static bool skill_parse_row_skilldb(char* split[], int columns, int current);
static bool quest_read_db(char *split[], int columns, int current);
static bool instance_readdb_sub(char* str[], int columns, int current);
static bool itemdb_read_itemavail(char *str[], int columns, int current);
static bool itemdb_read_buyingstore(char* fields[], int columns, int current);
static bool itemdb_read_flag(char* fields[], int columns, int current);
static bool itemdb_read_itemdelay(char* str[], int columns, int current);
static bool itemdb_read_stack(char* fields[], int columns, int current);
static bool itemdb_read_nouse(char* fields[], int columns, int current);
static bool itemdb_read_itemtrade(char* fields[], int columns, int current);
static bool itemdb_read_db(const char *file);
// Constants for conversion
std::unordered_map<t_itemid, std::string> aegis_itemnames;
std::unordered_map<uint16, uint16> aegis_itemviewid;
std::unordered_map<t_itemid, t_itemid> aegis_itemviewid;
std::unordered_map<uint16, std::string> aegis_mobnames;
std::unordered_map<uint16, std::string> aegis_skillnames;
std::unordered_map<const char*, int64> constants;
// Forward declaration of constant loading functions
static bool parse_item_constants( const char* path );
static bool parse_item_constants_txt( const char* path );
static bool parse_mob_constants( char* split[], int columns, int current );
static bool parse_skill_constants_txt( char* split[], int columns, int current );
static bool parse_skill_constants_yml(std::string path, std::string filename);
@ -142,6 +245,32 @@ static void skill_txt_data(const std::string& modePath, const std::string& fixed
sv_readdb(fixedPath.c_str(), "skill_nonearnpc_db.txt", ',', 2, 3, -1, skill_parse_row_nonearnpcrangedb, false);
}
// Item database data to memory
static void item_txt_data(const std::string& modePath, const std::string& fixedPath) {
item_avail.clear();
item_buyingstore.clear();
item_flag.clear();
item_delay.clear();
item_stack.clear();
item_nouse.clear();
item_trade.clear();
if (fileExists(fixedPath + "/item_avail.txt"))
sv_readdb(fixedPath.c_str(), "item_avail.txt", ',', 2, 2, -1, &itemdb_read_itemavail, false);
if (fileExists(modePath + "/item_buyingstore.txt"))
sv_readdb(modePath.c_str(), "item_buyingstore.txt", ',', 1, 1, -1, &itemdb_read_buyingstore, false);
if (fileExists(modePath + "/item_flag.txt"))
sv_readdb(modePath.c_str(), "item_flag.txt", ',', 2, 2, -1, &itemdb_read_flag, false);
if (fileExists(modePath + "/item_delay.txt"))
sv_readdb(modePath.c_str(), "item_delay.txt", ',', 2, 3, -1, &itemdb_read_itemdelay, false);
if (fileExists(modePath + "/item_stack.txt"))
sv_readdb(modePath.c_str(), "item_stack.txt", ',', 3, 3, -1, &itemdb_read_stack, false);
if (fileExists(fixedPath + "/item_nouse.txt"))
sv_readdb(fixedPath.c_str(), "item_nouse.txt", ',', 3, 3, -1, &itemdb_read_nouse, false);
if (fileExists(modePath + "/item_trade.txt"))
sv_readdb(modePath.c_str(), "item_trade.txt", ',', 3, 3, -1, &itemdb_read_itemtrade, false);
}
YAML::Emitter body;
// Implement the function instead of including the original version by linking
@ -277,11 +406,15 @@ bool process( const std::string& type, uint32 version, const std::vector<std::st
int do_init( int argc, char** argv ){
const std::string path_db = std::string( db_path );
const std::string path_db_mode = path_db + "/" + DBPATH;
const std::string path_db_import = path_db + "/" + DBIMPORT;
const std::string path_db_import = path_db + "/" + DBIMPORT + "/";
// Loads required conversion constants
parse_item_constants( ( path_db_mode + "/item_db.txt" ).c_str() );
parse_item_constants( ( path_db_import + "/item_db.txt" ).c_str() );
if (fileExists(item_db.getDefaultLocation())) {
item_db.load();
} else {
parse_item_constants_txt( ( path_db_mode + "item_db.txt" ).c_str() );
parse_item_constants_txt( ( path_db_import + "item_db.txt" ).c_str() );
}
sv_readdb( path_db_mode.c_str(), "mob_db.txt", ',', 31 + 2 * MAX_MVP_DROP + 2 * MAX_MOB_DROP, 31 + 2 * MAX_MVP_DROP + 2 * MAX_MOB_DROP, -1, &parse_mob_constants, false );
sv_readdb( path_db_import.c_str(), "mob_db.txt", ',', 31 + 2 * MAX_MVP_DROP + 2 * MAX_MOB_DROP, 31 + 2 * MAX_MVP_DROP + 2 * MAX_MOB_DROP, -1, &parse_mob_constants, false );
if (fileExists(path_db + "/" + "skill_db.yml")) {
@ -364,6 +497,20 @@ int do_init( int argc, char** argv ){
return 0;
}
item_txt_data(path_db_mode, path_db);
if (!process("ITEM_DB", 1, { path_db_mode }, "item_db", [](const std::string& path, const std::string& name_ext) -> bool {
return itemdb_read_db((path + name_ext).c_str());
})) {
return 0;
}
item_txt_data(path_db_import, path_db_import);
if (!process("ITEM_DB", 1, { path_db_import }, "item_db", [](const std::string& path, const std::string& name_ext) -> bool {
return itemdb_read_db((path + name_ext).c_str());
})) {
return 0;
}
// TODO: add implementations ;-)
return 0;
@ -405,7 +552,7 @@ bool askConfirmation( const char* fmt, ... ){
}
// Constant loading functions
static bool parse_item_constants( const char* path ){
static bool parse_item_constants_txt( const char* path ){
uint32 lines = 0, count = 0;
char line[1024];
@ -413,7 +560,7 @@ static bool parse_item_constants( const char* path ){
fp = fopen(path, "r");
if (fp == NULL) {
ShowWarning("itemdb_readdb: File not found \"%s\", skipping.\n", path);
ShowWarning("parse_item_constants_txt: File not found \"%s\", skipping.\n", path);
return false;
}
@ -450,21 +597,21 @@ static bool parse_item_constants( const char* path ){
if (p == NULL)
{
ShowError("itemdb_readdb: Insufficient columns in line %d of \"%s\" (item with id %d), skipping.\n", lines, path, atoi(str[0]));
ShowError("parse_item_constants_txt: Insufficient columns in line %d of \"%s\" (item with id %d), skipping.\n", lines, path, atoi(str[0]));
continue;
}
// Script
if (*p != '{')
{
ShowError("itemdb_readdb: Invalid format (Script column) in line %d of \"%s\" (item with id %d), skipping.\n", lines, path, atoi(str[0]));
ShowError("parse_item_constants_txt: Invalid format (Script column) in line %d of \"%s\" (item with id %d), skipping.\n", lines, path, atoi(str[0]));
continue;
}
str[19] = p + 1;
p = strstr(p + 1, "},");
if (p == NULL)
{
ShowError("itemdb_readdb: Invalid format (Script column) in line %d of \"%s\" (item with id %d), skipping.\n", lines, path, atoi(str[0]));
ShowError("parse_item_constants_txt: Invalid format (Script column) in line %d of \"%s\" (item with id %d), skipping.\n", lines, path, atoi(str[0]));
continue;
}
*p = '\0';
@ -473,14 +620,14 @@ static bool parse_item_constants( const char* path ){
// OnEquip_Script
if (*p != '{')
{
ShowError("itemdb_readdb: Invalid format (OnEquip_Script column) in line %d of \"%s\" (item with id %d), skipping.\n", lines, path, atoi(str[0]));
ShowError("parse_item_constants_txt: Invalid format (OnEquip_Script column) in line %d of \"%s\" (item with id %d), skipping.\n", lines, path, atoi(str[0]));
continue;
}
str[20] = p + 1;
p = strstr(p + 1, "},");
if (p == NULL)
{
ShowError("itemdb_readdb: Invalid format (OnEquip_Script column) in line %d of \"%s\" (item with id %d), skipping.\n", lines, path, atoi(str[0]));
ShowError("parse_item_constants_txt: Invalid format (OnEquip_Script column) in line %d of \"%s\" (item with id %d), skipping.\n", lines, path, atoi(str[0]));
continue;
}
*p = '\0';
@ -489,7 +636,7 @@ static bool parse_item_constants( const char* path ){
// OnUnequip_Script (last column)
if (*p != '{')
{
ShowError("itemdb_readdb: Invalid format (OnUnequip_Script column) in line %d of \"%s\" (item with id %d), skipping.\n", lines, path, atoi(str[0]));
ShowError("parse_item_constants_txt: Invalid format (OnUnequip_Script column) in line %d of \"%s\" (item with id %d), skipping.\n", lines, path, atoi(str[0]));
continue;
}
str[21] = p;
@ -509,7 +656,7 @@ static bool parse_item_constants( const char* path ){
}
if (lcurly != rcurly) {
ShowError("itemdb_readdb: Mismatching curly braces in line %d of \"%s\" (item with id %d), skipping.\n", lines, path, atoi(str[0]));
ShowError("parse_item_constants_txt: Mismatching curly braces in line %d of \"%s\" (item with id %d), skipping.\n", lines, path, atoi(str[0]));
continue;
}
}
@ -521,7 +668,7 @@ static bool parse_item_constants( const char* path ){
aegis_itemnames[item_id] = std::string(name);
if (atoi(str[14]) & (EQP_HELM | EQP_COSTUME_HELM) && util::umap_find(aegis_itemviewid, (uint16)atoi(str[18])) == nullptr)
if (atoi(str[14]) & (EQP_HELM | EQP_COSTUME_HELM) && util::umap_find(aegis_itemviewid, (t_itemid)atoi(str[18])) == nullptr)
aegis_itemviewid[atoi(str[18])] = item_id;
count++;
@ -534,6 +681,64 @@ static bool parse_item_constants( const char* path ){
return true;
}
const std::string ItemDatabase::getDefaultLocation(){
return std::string( db_path ) + "/item_db.yml";
}
uint64 ItemDatabase::parseBodyNode(const YAML::Node& node) {
t_itemid nameid;
if (!this->asUInt32(node, "Id", nameid))
return 0;
if (this->nodeExists(node, "AegisName")) {
std::string name;
if (!this->asString(node, "AegisName", name))
return 0;
aegis_itemnames[nameid] = name;
}
if (this->nodeExists(node, "View")) {
uint32 look;
if (!this->asUInt32(node, "View", look))
return 0;
if( look > 0 ){
if (this->nodeExists(node, "Locations")) {
const YAML::Node& locationNode = node["Locations"];
static std::vector<std::string> locations = {
"Head_Low",
"Head_Mid",
"Head_Top",
"Costume_Head_Low",
"Costume_Head_Mid",
"Costume_Head_Top"
};
for( std::string& location : locations ){
if (this->nodeExists(locationNode, location)) {
bool active;
if (!this->asBool(locationNode, location, active))
return 0;
aegis_itemviewid[look] = nameid;
break;
}
}
}
}
}
return 1;
}
ItemDatabase item_db;
static bool parse_mob_constants( char* split[], int columns, int current ){
uint16 mob_id = atoi( split[0] );
char* name = trim( split[1] );
@ -638,6 +843,39 @@ uint8 skill_split_atoi2(char *str, int64 *val, const char *delim, int min_value,
return i;
}
/**
* Split string to int
* @param str: String input
* @param val1: Temporary storage to first value
* @param val2: Temporary storage to second value
*/
static void itemdb_re_split_atoi(char* str, int* val1, int* val2) {
int i, val[2];
for (i = 0; i < 2; i++) {
if (!str)
break;
val[i] = atoi(str);
str = strchr(str, ':');
if (str)
*str++ = 0;
}
if (i == 0) {
*val1 = *val2 = 0;
return; // no data found
}
if (i == 1) { // Single Value
*val1 = val[0];
*val2 = 0;
return;
}
// We assume we have 2 values.
*val1 = val[0];
*val2 = val[1];
return;
}
// Implementation of the conversion functions
// Copied and adjusted from guild.cpp
@ -1022,7 +1260,7 @@ static bool mob_readdb_mobavail(char* str[], int columns, int current) {
}
if (atoi(str[7]) != 0) {
uint16 *headtop_item_id = util::umap_find(aegis_itemviewid, (uint16)atoi(str[7]));
t_itemid *headtop_item_id = util::umap_find(aegis_itemviewid, (t_itemid)atoi(str[7]));
if (headtop_item_id == nullptr) {
ShowError("Item ID for view ID %hu (head top) is not known.\n", atoi(str[7]));
@ -1040,7 +1278,7 @@ static bool mob_readdb_mobavail(char* str[], int columns, int current) {
}
if (atoi(str[8]) != 0) {
uint16 *headmid_item_id = util::umap_find(aegis_itemviewid, (uint16)atoi(str[8]));
t_itemid *headmid_item_id = util::umap_find(aegis_itemviewid, (t_itemid)atoi(str[8]));
if (headmid_item_id == nullptr) {
ShowError("Item ID for view ID %hu (head mid) is not known.\n", atoi(str[8]));
@ -1058,7 +1296,7 @@ static bool mob_readdb_mobavail(char* str[], int columns, int current) {
}
if (atoi(str[9]) != 0) {
uint16 *headlow_item_id = util::umap_find(aegis_itemviewid, (uint16)atoi(str[9]));
t_itemid *headlow_item_id = util::umap_find(aegis_itemviewid, (t_itemid)atoi(str[9]));
if (headlow_item_id == nullptr) {
ShowError("Item ID for view ID %hu (head low) is not known.\n", atoi(str[9]));
@ -2563,3 +2801,488 @@ static bool instance_readdb_sub(char* str[], int columns, int current) {
return true;
}
// item_db.yml function
//---------------------
static bool itemdb_read_itemavail(char *str[], int columns, int current) {
item_avail.insert({ strtoul(str[0], nullptr, 10), strtoul(str[1], nullptr, 10) });
return true;
}
// item_db.yml function
//---------------------
static bool itemdb_read_buyingstore(char* fields[], int columns, int current) {
item_buyingstore.insert({ strtoul(fields[0], nullptr, 10), true });
return true;
}
// item_db.yml function
//---------------------
static bool itemdb_read_flag(char* fields[], int columns, int current) {
s_item_flag_csv2yaml item = { 0 };
uint16 flag = abs(atoi(fields[1]));
if (flag & 1)
item.dead_branch = true;
if (flag & 2)
item.group = true;
if (flag & 4)
item.guid = true;
if (flag & 8)
item.bindOnEquip = true;
if (flag & 16)
item.broadcast = true;
if (flag & 32)
item.delay_consume = true;
if (flag & 64)
item.dropEffect = DROPEFFECT_CLIENT;
else if (flag & 128)
item.dropEffect = DROPEFFECT_WHITE_PILLAR;
else if (flag & 256)
item.dropEffect = DROPEFFECT_BLUE_PILLAR;
else if (flag & 512)
item.dropEffect = DROPEFFECT_YELLOW_PILLAR;
else if (flag & 1024)
item.dropEffect = DROPEFFECT_PURPLE_PILLAR;
else if (flag & 2048)
item.dropEffect = DROPEFFECT_ORANGE_PILLAR;
item_flag.insert({ strtoul(fields[0], nullptr, 10), item });
return true;
}
// item_db.yml function
//---------------------
static bool itemdb_read_itemdelay(char* str[], int columns, int current) {
s_item_delay_csv2yaml item = { 0 };
item.delay = atoi(str[1]);
if (columns == 3)
item.sc = trim(str[2]);
item_delay.insert({ strtoul(str[0], nullptr, 10), item });
return true;
}
// item_db.yml function
//---------------------
static bool itemdb_read_stack(char* fields[], int columns, int current) {
s_item_stack_csv2yaml item = { 0 };
item.amount = atoi(fields[1]);
int type = strtoul(fields[2], NULL, 10);
if (type & 1)
item.inventory = true;
if (type & 2)
item.cart = true;
if (type & 4)
item.storage = true;
if (type & 8)
item.guild_storage = true;
item_stack.insert({ strtoul(fields[0], nullptr, 10), item });
return true;
}
// item_db.yml function
//---------------------
static bool itemdb_read_nouse(char* fields[], int columns, int current) {
s_item_nouse_csv2yaml item = { 0 };
item.sitting = "true";
item.override = atoi(fields[2]);
item_nouse.insert({ strtoul(fields[0], nullptr, 10), item });
return true;
}
// item_db.yml function
//---------------------
static bool itemdb_read_itemtrade(char* str[], int columns, int current) {
s_item_trade_csv2yaml item = { 0 };
int flag = atoi(str[1]);
if (flag & 1)
item.drop = true;
if (flag & 2)
item.trade = true;
if (flag & 4)
item.trade_partner = true;
if (flag & 8)
item.sell = true;
if (flag & 16)
item.cart = true;
if (flag & 32)
item.storage = true;
if (flag & 64)
item.guild_storage = true;
if (flag & 128)
item.mail = true;
if (flag & 256)
item.auction = true;
item.override = atoi(str[2]);
item_trade.insert({ strtoul(str[0], nullptr, 10), item });
return true;
}
// Copied and adjusted from itemdb.cpp
static bool itemdb_read_db(const char* file) {
FILE* fp = fopen(file, "r");
if (fp == nullptr) {
ShowError("can't read %s\n", file);
return false;
}
int lines = 0;
size_t entries = 0;
char line[1024];
while (fgets(line, sizeof(line), fp)) {
char* str[32], * p;
int i;
lines++;
if (line[0] == '/' && line[1] == '/')
continue;
memset(str, 0, sizeof(str));
p = strstr(line, "//");
if (p != nullptr) {
*p = '\0';
}
p = line;
while (ISSPACE(*p))
++p;
if (*p == '\0')
continue;// empty line
for (i = 0; i < 19; ++i) {
str[i] = p;
p = strchr(p, ',');
if (p == NULL)
break;// comma not found
*p = '\0';
++p;
}
if (p == NULL) {
ShowError("itemdb_read_db: Insufficient columns in line %d (item with id %u), skipping.\n", lines, strtoul(str[0], nullptr, 10));
continue;
}
// Script
if (*p != '{') {
ShowError("itemdb_read_db: Invalid format (Script column) in line %d (item with id %u), skipping.\n", lines, strtoul(str[0], nullptr, 10));
continue;
}
str[19] = p + 1;
p = strstr(p + 1, "},");
if (p == NULL) {
ShowError("itemdb_read_db: Invalid format (Script column) in line %d (item with id %u), skipping.\n", lines, strtoul(str[0], nullptr, 10));
continue;
}
*p = '\0';
p += 2;
// OnEquip_Script
if (*p != '{') {
ShowError("itemdb_read_db: Invalid format (OnEquip_Script column) in line %d (item with id %u), skipping.\n", lines, strtoul(str[0], nullptr, 10));
continue;
}
str[20] = p + 1;
p = strstr(p + 1, "},");
if (p == NULL) {
ShowError("itemdb_read_db: Invalid format (OnEquip_Script column) in line %d (item with id %u), skipping.\n", lines, strtoul(str[0], nullptr, 10));
continue;
}
*p = '\0';
p += 2;
// OnUnequip_Script (last column)
if (*p != '{') {
ShowError("itemdb_read_db: Invalid format (OnUnequip_Script column) in line %d (item with id %u), skipping.\n", lines, strtoul(str[0], nullptr, 10));
continue;
}
str[21] = p;
p = &str[21][strlen(str[21]) - 2];
if (*p != '}') {
/* lets count to ensure it's not something silly e.g. a extra space at line ending */
int lcurly = 0, rcurly = 0;
for (size_t v = 0; v < strlen(str[21]); v++) {
if (str[21][v] == '{')
lcurly++;
else if (str[21][v] == '}') {
rcurly++;
p = &str[21][v];
}
}
if (lcurly != rcurly) {
ShowError("itemdb_read_db: Mismatching curly braces in line %d (item with id %u), skipping.\n", lines, strtoul(str[0], nullptr, 10));
continue;
}
}
str[21] = str[21] + 1; //skip the first left curly
*p = '\0'; //null the last right curly
t_itemid nameid = strtoul(str[0], nullptr, 10);
body << YAML::BeginMap;
body << YAML::Key << "Id" << YAML::Value << nameid;
body << YAML::Key << "AegisName" << YAML::Value << str[1];
body << YAML::Key << "Name" << YAML::Value << str[2];
int type = atoi(str[3]), subtype = atoi(str[18]);
body << YAML::Key << "Type" << YAML::Value << name2Upper(constant_lookup(type, "IT_") + 3);
if (type == IT_WEAPON && subtype)
body << YAML::Key << "SubType" << YAML::Value << name2Upper(constant_lookup(subtype, "W_") + 2);
else if (type == IT_AMMO && subtype)
body << YAML::Key << "SubType" << YAML::Value << name2Upper(constant_lookup(subtype, "AMMO_") + 5);
if (atoi(str[4]) > 0)
body << YAML::Key << "Buy" << YAML::Value << atoi(str[4]);
if (atoi(str[5]) > 0) {
if (atoi(str[4]) / 2 != atoi(str[5]))
body << YAML::Key << "Sell" << YAML::Value << atoi(str[5]);
}
if (atoi(str[6]) > 0)
body << YAML::Key << "Weight" << YAML::Value << atoi(str[6]);
#ifdef RENEWAL
int atk = 0, matk = 0;
itemdb_re_split_atoi(str[7], &atk, &matk);
if (atk > 0)
body << YAML::Key << "Attack" << YAML::Value << atk;
if (matk > 0)
body << YAML::Key << "MagicAttack" << YAML::Value << matk;
#else
if (atoi(str[7]) > 0)
body << YAML::Key << "Attack" << YAML::Value << atoi(str[7]);
#endif
if (atoi(str[8]) > 0)
body << YAML::Key << "Defense" << YAML::Value << atoi(str[8]);
if (atoi(str[9]) > 0)
body << YAML::Key << "Range" << YAML::Value << atoi(str[9]);
if (atoi(str[10]) > 0)
body << YAML::Key << "Slots" << YAML::Value << atoi(str[10]);
bool equippable = type == IT_UNKNOWN ? false : type == IT_ETC ? false : type == IT_CARD ? false : type == IT_PETEGG ? false : type == IT_PETARMOR ? false : type == IT_UNKNOWN2 ? false : true;
if (equippable) {
uint64 temp_mask = strtoull(str[11], NULL, 0);
if (temp_mask == 0) {
//body << YAML::Key << "Jobs";
//body << YAML::BeginMap << YAML::Key << "All" << YAML::Value << "false" << YAML::EndMap;
} else if (temp_mask == 0xFFFFFFFF) { // Commented out because it's the default value
//body << YAML::Key << "Jobs";
//body << YAML::BeginMap << YAML::Key << "All" << YAML::Value << "true" << YAML::EndMap;
} else if (temp_mask == 0xFFFFFFFE) {
body << YAML::Key << "Jobs";
body << YAML::BeginMap;
body << YAML::Key << "All" << YAML::Value << "true";
body << YAML::Key << "Novice" << YAML::Value << "false";
body << YAML::Key << "SuperNovice" << YAML::Value << "false";
body << YAML::EndMap;
} else {
body << YAML::Key << "Jobs";
body << YAML::BeginMap;
for (const auto &it : um_mapid2jobname) {
uint64 job_mask = 1ULL << it.second;
if ((temp_mask & job_mask) == job_mask)
body << YAML::Key << it.first << YAML::Value << "true";
}
body << YAML::EndMap;
}
int temp_class = atoi(str[12]);
if (temp_class == ITEMJ_NONE) {
body << YAML::Key << "Classes";
body << YAML::BeginMap << YAML::Key << "All" << YAML::Value << "false" << YAML::EndMap;
} else if (temp_class == ITEMJ_ALL) { // Commented out because it's the default value
//body << YAML::Key << "Classes";
//body << YAML::BeginMap << YAML::Key << "All" << YAML::Value << "true" << YAML::EndMap;
} else {
body << YAML::Key << "Classes";
body << YAML::BeginMap;
for (int32 i = ITEMJ_NONE; i <= ITEMJ_THIRD_BABY; i++) {
if (i & temp_class) {
const char* class_ = constant_lookup(i, "ITEMJ_");
if (class_ != nullptr)
body << YAML::Key << name2Upper(class_ + 6) << YAML::Value << "true";
}
}
body << YAML::EndMap;
}
switch (atoi(str[13])) {
case SEX_FEMALE:
body << YAML::Key << "Gender" << YAML::Value << "Female";
break;
case SEX_MALE:
body << YAML::Key << "Gender" << YAML::Value << "Male";
break;
//case SEX_BOTH: // Commented out because it's the default value
// body << YAML::Key << "Gender" << YAML::Value << "Both";
// break;
}
}
if (atoi(str[14]) > 0) {
int temp_loc = atoi(str[14]);
body << YAML::Key << "Locations";
body << YAML::BeginMap;
for (const auto &it : um_equipnames) {
if (it.second & temp_loc)
body << YAML::Key << it.first << YAML::Value << "true";
}
body << YAML::EndMap;
}
if (atoi(str[15]) > 0)
body << YAML::Key << "WeaponLevel" << YAML::Value << atoi(str[15]);
int elv = 0, elvmax = 0;
itemdb_re_split_atoi(str[16], &elv, &elvmax);
if (elv > 0)
body << YAML::Key << "EquipLevelMin" << YAML::Value << elv;
if (elvmax > 0)
body << YAML::Key << "EquipLevelMax" << YAML::Value << elvmax;
if (atoi(str[17]) > 0)
body << YAML::Key << "Refineable" << YAML::Value << "true";
if (strtoul(str[18], nullptr, 10) > 0 && type != IT_WEAPON && type != IT_AMMO)
body << YAML::Key << "View" << YAML::Value << strtoul(str[18], nullptr, 10);
auto it_avail = item_avail.find(nameid);
if (it_avail != item_avail.end()) {
std::string *item_name = util::umap_find(aegis_itemnames, static_cast<t_itemid>(it_avail->second));
if (item_name == nullptr)
ShowError("Item name for item id %u is not known (item_avail).\n", it_avail->second);
else
body << YAML::Key << "AliasName" << YAML::Value << *item_name;
}
auto it_flag = item_flag.find(nameid);
auto it_buying = item_buyingstore.find(nameid);
if (it_flag != item_flag.end() || it_buying != item_buyingstore.end()) {
body << YAML::Key << "Flags";
body << YAML::BeginMap;
if (it_buying != item_buyingstore.end())
body << YAML::Key << "BuyingStore" << YAML::Value << "true";
if (it_flag != item_flag.end() && it_flag->second.dead_branch)
body << YAML::Key << "DeadBranch" << YAML::Value << it_flag->second.dead_branch;
if (it_flag != item_flag.end() && it_flag->second.group)
body << YAML::Key << "Container" << YAML::Value << it_flag->second.group;
if (it_flag != item_flag.end() && it_flag->second.guid)
body << YAML::Key << "UniqueId" << YAML::Value << it_flag->second.guid;
if (it_flag != item_flag.end() && it_flag->second.bindOnEquip)
body << YAML::Key << "BindOnEquip" << YAML::Value << it_flag->second.bindOnEquip;
if (it_flag != item_flag.end() && it_flag->second.broadcast)
body << YAML::Key << "DropAnnounce" << YAML::Value << it_flag->second.broadcast;
if (it_flag != item_flag.end() && it_flag->second.delay_consume)
body << YAML::Key << "NoConsume" << YAML::Value << it_flag->second.delay_consume;
if (it_flag != item_flag.end() && it_flag->second.dropEffect)
body << YAML::Key << "DropEffect" << YAML::Value << name2Upper(constant_lookup(it_flag->second.dropEffect, "DROPEFFECT_") + 11);
body << YAML::EndMap;
}
auto it_delay = item_delay.find(nameid);
if (it_delay != item_delay.end()) {
body << YAML::Key << "Delay";
body << YAML::BeginMap;
body << YAML::Key << "Duration" << YAML::Value << it_delay->second.delay;
if (it_delay->second.sc.size() > 0)
body << YAML::Key << "Status" << YAML::Value << name2Upper(it_delay->second.sc.erase(0, 3));
body << YAML::EndMap;
}
auto it_stack = item_stack.find(nameid);
if (it_stack != item_stack.end()) {
body << YAML::Key << "Stack";
body << YAML::BeginMap;
body << YAML::Key << "Amount" << YAML::Value << it_stack->second.amount;
if (it_stack->second.inventory)
body << YAML::Key << "Inventory" << YAML::Value << it_stack->second.inventory;
if (it_stack->second.cart)
body << YAML::Key << "Cart" << YAML::Value << it_stack->second.cart;
if (it_stack->second.storage)
body << YAML::Key << "Storage" << YAML::Value << it_stack->second.storage;
if (it_stack->second.guild_storage)
body << YAML::Key << "GuildStorage" << YAML::Value << it_stack->second.guild_storage;
body << YAML::EndMap;
}
auto it_nouse = item_nouse.find(nameid);
if (it_nouse != item_nouse.end()) {
body << YAML::Key << "NoUse";
body << YAML::BeginMap;
body << YAML::Key << "Override" << YAML::Value << it_nouse->second.override;
body << YAML::Key << "Sitting" << YAML::Value << "true";
body << YAML::EndMap;
}
auto it_trade = item_trade.find(nameid);
if (it_trade != item_trade.end()) {
body << YAML::Key << "Trade";
body << YAML::BeginMap;
body << YAML::Key << "Override" << YAML::Value << it_trade->second.override;
if (it_trade->second.drop)
body << YAML::Key << "NoDrop" << YAML::Value << it_trade->second.drop;
if (it_trade->second.trade)
body << YAML::Key << "NoTrade" << YAML::Value << it_trade->second.trade;
if (it_trade->second.trade_partner)
body << YAML::Key << "TradePartner" << YAML::Value << it_trade->second.trade_partner;
if (it_trade->second.sell)
body << YAML::Key << "NoSell" << YAML::Value << it_trade->second.sell;
if (it_trade->second.cart)
body << YAML::Key << "NoCart" << YAML::Value << it_trade->second.cart;
if (it_trade->second.storage)
body << YAML::Key << "NoStorage" << YAML::Value << it_trade->second.storage;
if (it_trade->second.guild_storage)
body << YAML::Key << "NoGuildStorage" << YAML::Value << it_trade->second.guild_storage;
if (it_trade->second.mail)
body << YAML::Key << "NoMail" << YAML::Value << it_trade->second.mail;
if (it_trade->second.auction)
body << YAML::Key << "NoAuction" << YAML::Value << it_trade->second.auction;
body << YAML::EndMap;
}
if (*str[19])
body << YAML::Key << "Script" << YAML::Value << YAML::Literal << trim(str[19]);
if (*str[20])
body << YAML::Key << "EquipScript" << YAML::Value << YAML::Literal << trim(str[20]);
if (*str[21])
body << YAML::Key << "UnEquipScript" << YAML::Value << YAML::Literal << trim(str[21]);
body << YAML::EndMap;
entries++;
}
fclose(fp);
ShowStatus("Done reading '" CL_WHITE "%d" CL_RESET "' items in '" CL_WHITE "%s" CL_RESET "'.\n", entries, file);
return true;
}

View File

@ -159,8 +159,12 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\common\database.cpp" />
<ClCompile Include="csv2yaml.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\common\database.hpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>

View File

@ -14,5 +14,13 @@
<ClCompile Include="csv2yaml.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\common\database.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\common\database.hpp">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

557
src/tool/yaml2sql.cpp Normal file
View File

@ -0,0 +1,557 @@
// Copyright (c) rAthena Dev Teams - Licensed under GNU GPL
// For more information, see LICENCE in the main folder
#include <fstream>
#include <functional>
#include <iostream>
#include <locale>
#include <unordered_map>
#include <vector>
#ifdef WIN32
#include <conio.h>
#else
#include <termios.h>
#include <unistd.h>
#include <stdio.h>
#endif
#include <yaml-cpp/yaml.h>
#include "../common/cbasetypes.hpp"
#include "../common/core.hpp"
#include "../common/malloc.hpp"
#include "../common/mmo.hpp"
#include "../common/nullpo.hpp"
#include "../common/showmsg.hpp"
#include "../common/strlib.hpp"
#include "../common/utilities.hpp"
#include "../common/utils.hpp"
#ifdef WIN32
#include "../common/winapi.hpp"
#endif
using namespace rathena;
#ifndef WIN32
int getch( void ){
struct termios oldattr, newattr;
int ch;
tcgetattr( STDIN_FILENO, &oldattr );
newattr = oldattr;
newattr.c_lflag &= ~( ICANON | ECHO );
tcsetattr( STDIN_FILENO, TCSANOW, &newattr );
ch = getchar();
tcsetattr( STDIN_FILENO, TCSANOW, &oldattr );
return ch;
}
#endif
// Forward declaration of conversion functions
static bool item_db_yaml2sql(const std::string &file, const std::string &table);
bool fileExists( const std::string& path );
bool askConfirmation( const char* fmt, ... );
YAML::Node inNode;
std::ofstream out;
void copyFileIfExists( std::ofstream& file,const std::string& name ){
std::string path = "doc/yaml/sql/" + name + ".sql";
if( fileExists( path ) ){
std::ifstream source( path, std::ios::binary );
std::istreambuf_iterator<char> begin_source(source);
std::istreambuf_iterator<char> end_source;
std::ostreambuf_iterator<char> begin_dest( file );
copy( begin_source, end_source, begin_dest );
source.close();
}
}
void prepareHeader(std::ofstream &file, const std::string& name) {
copyFileIfExists( file, name );
file << "\n";
}
template<typename Func>
bool process( const std::string& type, uint32 version, const std::vector<std::string>& paths, const std::string& name, const std::string& to, const std::string& table, Func lambda ){
for( const std::string& path : paths ){
const std::string name_ext = name + ".yml";
const std::string from = path + name_ext;
if( fileExists( from ) ){
if( !askConfirmation( "Found the file \"%s\", which can be converted to sql.\nDo you want to convert it now? (Y/N)\n", from.c_str() ) ){
continue;
}
inNode.reset();
try {
inNode = YAML::LoadFile(from);
} catch (YAML::Exception &e) {
ShowError("%s (Line %d: Column %d)\n", e.msg.c_str(), e.mark.line, e.mark.column);
if (!askConfirmation("Error found in \"%s\" while attempting to load.\nPress any key to continue.\n", from.c_str()))
continue;
}
if (!inNode["Body"].IsDefined())
continue;
if (fileExists(to)) {
if (!askConfirmation("The file \"%s\" already exists.\nDo you want to replace it? (Y/N)\n", to.c_str())) {
continue;
}
}
out.open(to);
if (!out.is_open()) {
ShowError("Can not open file \"%s\" for writing.\n", to.c_str());
return false;
}
prepareHeader(out, table);
if( !lambda( path, name_ext, table ) ){
out.close();
return false;
}
out.close();
}
}
return true;
}
int do_init( int argc, char** argv ){
const std::string path_db = std::string( db_path );
const std::string path_db_mode = path_db + "/" + DBPATH;
const std::string path_db_import = path_db + "/" + DBIMPORT + "/";
#ifdef RENEWAL
const std::string item_table_name = "item_db_re";
const std::string item_import_table_name = "item_db2_re";
#else
const std::string item_table_name = "item_db";
const std::string item_import_table_name = "item_db2";
#endif
std::vector<std::string> item_table_suffixes = {
"usable",
"equip",
"etc"
};
for( const std::string& suffix : item_table_suffixes ){
if (!process("ITEM_DB", 1, { path_db_mode }, "item_db_" + suffix, "sql-files/" + item_table_name + "_" + suffix + ".sql", item_table_name, [](const std::string& path, const std::string& name_ext, const std::string& table) -> bool {
return item_db_yaml2sql(path + name_ext, table);
})) {
return 0;
}
}
if (!process("ITEM_DB", 1, { path_db_import }, "item_db", "sql-files/" + item_import_table_name + ".sql", item_import_table_name, [](const std::string& path, const std::string& name_ext, const std::string& table) -> bool {
return item_db_yaml2sql(path + name_ext, table);
})) {
return 0;
}
// TODO: add implementations ;-)
return 0;
}
void do_final(void){
}
bool fileExists( const std::string& path ){
std::ifstream in;
in.open( path );
if( in.is_open() ){
in.close();
return true;
}else{
return false;
}
}
bool askConfirmation( const char* fmt, ... ){
va_list ap;
va_start( ap, fmt );
_vShowMessage( MSG_NONE, fmt, ap );
va_end( ap );
char c = getch();
if( c == 'Y' || c == 'y' ){
return true;
}else{
return false;
}
}
std::string name2Upper(std::string name) {
std::transform(name.begin(), name.end(), name.begin(), ::tolower);
name[0] = toupper(name[0]);
for (size_t i = 0; i < name.size(); i++) {
if (name[i - 1] == '_' || (name[i - 2] == '1' && name[i - 1] == 'h') || (name[i - 2] == '2' && name[i - 1] == 'h'))
name[i] = toupper(name[i]);
}
return name;
}
const std::string WHITESPACE = " \n\r\t\f\v";
std::string ltrim(const std::string &s) {
size_t start = s.find_first_not_of(WHITESPACE);
return (start == std::string::npos) ? "" : s.substr(start);
}
std::string rtrim(const std::string &s) {
size_t end = s.find_last_not_of(WHITESPACE);
return (end == std::string::npos) ? "" : s.substr(0, end + 1);
}
std::string string_trim(const std::string &s) {
return rtrim(ltrim(s));
}
std::string string_escape(const std::string &s) {
size_t n = s.length();
std::string escaped;
escaped.reserve(n * 2);
for (size_t i = 0; i < n; ++i) {
if (s[i] == '\\' || s[i] == '\'')
escaped += '\\';
escaped += s[i];
}
return escaped;
}
/**
* Append the entry value to the string if the Node exists
* @param node: Node with entry
* @param value: String to store node value to
* @param string: If value is a string or not
*/
static bool appendEntry(const YAML::Node &node, std::string &value, bool string = false) {
if (node.IsDefined()) {
if (string) {
value.append("'");
value.append(string_trim(string_escape(node.as<std::string>())));
value.append("',");
} else {
value.append(string_trim(node.as<std::string>()));
value.append(",");
}
return true;
}
return false;
}
// Implementation of the conversion functions
// Copied and adjusted from itemdb.cpp
static bool item_db_yaml2sql(const std::string &file, const std::string &table) {
size_t entries = 0;
for (const YAML::Node &input : inNode["Body"]) {
std::string column = "", value = "";
if (appendEntry(input["Id"], value))
column.append("`id`,");
if (appendEntry(input["AegisName"], value, true))
column.append("`name_aegis`,");
if (appendEntry(input["Name"], value, true))
column.append("`name_english`,");
if (appendEntry(input["Type"], value, true))
column.append("`type`,");
if (appendEntry(input["SubType"], value, true))
column.append("`subtype`,");
if (appendEntry(input["Buy"], value))
column.append("`price_buy`,");
if (appendEntry(input["Sell"], value))
column.append("`price_sell`,");
if (appendEntry(input["Weight"], value))
column.append("`weight`,");
if (appendEntry(input["Attack"], value))
column.append("`attack`,");
#ifdef RENEWAL
if (appendEntry(input["MagicAttack"], value))
column.append("`magic_attack`,");
#endif
if (appendEntry(input["Defense"], value))
column.append("`defense`,");
if (appendEntry(input["Range"], value))
column.append("`range`,");
if (appendEntry(input["Slots"], value))
column.append("`slots`,");
const YAML::Node &jobs = input["Jobs"];
if (jobs) {
if (appendEntry(jobs["All"], value))
column.append("`job_all`,");
if (appendEntry(jobs["Acolyte"], value))
column.append("`job_acolyte`,");
if (appendEntry(jobs["Alchemist"], value))
column.append("`job_alchemist`,");
if (appendEntry(jobs["Archer"], value))
column.append("`job_archer`,");
if (appendEntry(jobs["Assassin"], value))
column.append("`job_assassin`,");
if (appendEntry(jobs["BardDancer"], value))
column.append("`job_barddancer`,");
if (appendEntry(jobs["Blacksmith"], value))
column.append("`job_blacksmith`,");
if (appendEntry(jobs["Crusader"], value))
column.append("`job_crusader`,");
if (appendEntry(jobs["Gunslinger"], value))
column.append("`job_gunslinger`,");
if (appendEntry(jobs["Hunter"], value))
column.append("`job_hunter`,");
#ifdef RENEWAL
if (appendEntry(jobs["KagerouOboro"], value))
column.append("`job_kagerouoboro`,");
#endif
if (appendEntry(jobs["Knight"], value))
column.append("`job_knight`,");
if (appendEntry(jobs["Mage"], value))
column.append("`job_mage`,");
if (appendEntry(jobs["Merchant"], value))
column.append("`job_merchant`,");
if (appendEntry(jobs["Monk"], value))
column.append("`job_monk`,");
if (appendEntry(jobs["Ninja"], value))
column.append("`job_ninja`,");
if (appendEntry(jobs["Novice"], value))
column.append("`job_novice`,");
if (appendEntry(jobs["Priest"], value))
column.append("`job_priest`,");
#ifdef RENEWAL
if (appendEntry(jobs["Rebellion"], value))
column.append("`job_rebellion`,");
#endif
if (appendEntry(jobs["Rogue"], value))
column.append("`job_rogue`,");
if (appendEntry(jobs["Sage"], value))
column.append("`job_sage`,");
if (appendEntry(jobs["SoulLinker"], value))
column.append("`job_soullinker`,");
if (appendEntry(jobs["StarGladiator"], value))
column.append("`job_stargladiator`,");
#ifdef RENEWAL
if (appendEntry(jobs["Summoner"], value))
column.append("`job_summoner`,");
#endif
if (appendEntry(jobs["SuperNovice"], value))
column.append("`job_supernovice`,");
if (appendEntry(jobs["Swordman"], value))
column.append("`job_swordman`,");
if (appendEntry(jobs["Taekwon"], value))
column.append("`job_taekwon`,");
if (appendEntry(jobs["Thief"], value))
column.append("`job_thief`,");
if (appendEntry(jobs["Wizard"], value))
column.append("`job_wizard`,");
}
const YAML::Node &classes = input["Classes"];
if (classes) {
if (appendEntry(classes["All"], value))
column.append("`class_all`,");
if (appendEntry(classes["Normal"], value))
column.append("`class_normal`,");
if (appendEntry(classes["Upper"], value))
column.append("`class_upper`,");
if (appendEntry(classes["Baby"], value))
column.append("`class_baby`,");
#ifdef RENEWAL
if (appendEntry(classes["Third"], value))
column.append("`class_third`,");
if (appendEntry(classes["Third_Upper"], value))
column.append("`class_third_upper`,");
if (appendEntry(classes["Third_Baby"], value))
column.append("`class_third_baby`,");
#endif
}
if (appendEntry(input["Gender"], value, true))
column.append("`gender`,");
const YAML::Node &locations = input["Locations"];
if (locations) {
if (appendEntry(locations["Head_Top"], value))
column.append("`location_head_top`,");
if (appendEntry(locations["Head_Mid"], value))
column.append("`location_head_mid`,");
if (appendEntry(locations["Head_Low"], value))
column.append("`location_head_low`,");
if (appendEntry(locations["Armor"], value))
column.append("`location_armor`,");
if (appendEntry(locations["Left_Hand"], value))
column.append("`location_left_hand`,");
if (appendEntry(locations["Right_Hand"], value))
column.append("`location_right_hand`,");
if (appendEntry(locations["Garment"], value))
column.append("`location_garment`,");
if (appendEntry(locations["Shoes"], value))
column.append("`location_shoes`,");
if (appendEntry(locations["Right_Accessory"], value))
column.append("`location_right_accessory`,");
if (appendEntry(locations["Left_Accessory"], value))
column.append("`location_left_accessory`,");
if (appendEntry(locations["Costume_Head_Top"], value))
column.append("`location_costume_head_top`,");
if (appendEntry(locations["Costume_Head_Mid"], value))
column.append("`location_costume_head_Mid`,");
if (appendEntry(locations["Costume_Head_Low"], value))
column.append("`location_costume_head_Low`,");
if (appendEntry(locations["Costume_Garment"], value))
column.append("`location_costume_Garment`,");
if (appendEntry(locations["Ammo"], value))
column.append("`location_ammo`,");
if (appendEntry(locations["Shadow_Armor"], value))
column.append("`location_shadow_armor`,");
if (appendEntry(locations["Shadow_Weapon"], value))
column.append("`location_shadow_weapon`,");
if (appendEntry(locations["Shadow_Shield"], value))
column.append("`location_shadow_shield`,");
if (appendEntry(locations["Shadow_Shoes"], value))
column.append("`location_shadow_shoes`,");
if (appendEntry(locations["Shadow_Right_Accessory"], value))
column.append("`location_shadow_right_accessory`,");
if (appendEntry(locations["Shadow_Left_Accessory"], value))
column.append("`location_shadow_left_accessory`,");
}
if (appendEntry(input["WeaponLevel"], value))
column.append("`weapon_level`,");
if (appendEntry(input["EquipLevelMin"], value))
column.append("`equip_level_min`,");
if (appendEntry(input["EquipLevelMax"], value))
column.append("`equip_level_max`,");
if (appendEntry(input["Refineable"], value))
column.append("`refineable`,");
if (appendEntry(input["View"], value))
column.append("`view`,");
if (appendEntry(input["AliasName"], value, true))
column.append("`alias_name`,");
const YAML::Node &flags = input["Flags"];
if (flags) {
if (appendEntry(flags["BuyingStore"], value))
column.append("`flag_buyingstore`,");
if (appendEntry(flags["DeadBranch"], value))
column.append("`flag_deadbranch`,");
if (appendEntry(flags["Container"], value))
column.append("`flag_container`,");
if (appendEntry(flags["UniqueId"], value))
column.append("`flag_uniqueid`,");
if (appendEntry(flags["BindOnEquip"], value))
column.append("`flag_bindonequip`,");
if (appendEntry(flags["DropAnnounce"], value))
column.append("`flag_dropannounce`,");
if (appendEntry(flags["NoConsume"], value))
column.append("`flag_noconsume`,");
if (appendEntry(flags["DropEffect"], value, true))
column.append("`flag_dropeffect`,");
}
const YAML::Node &delay = input["Delay"];
if (delay) {
if (appendEntry(delay["Duration"], value))
column.append("`delay_duration`,");
if (appendEntry(delay["Status"], value, true))
column.append("`delay_status`,");
}
const YAML::Node &stack = input["Stack"];
if (stack) {
if (appendEntry(stack["Amount"], value))
column.append("`stack_amount`,");
if (appendEntry(stack["Inventory"], value))
column.append("`stack_inventory`,");
if (appendEntry(stack["Cart"], value))
column.append("`stack_cart`,");
if (appendEntry(stack["Storage"], value))
column.append("`stack_storage`,");
if (appendEntry(stack["GuildStorage"], value))
column.append("`stack_guildstorage`,");
}
const YAML::Node &nouse = input["NoUse"];
if (nouse) {
if (appendEntry(nouse["Override"], value))
column.append("`nouse_override`,");
if (appendEntry(nouse["Sitting"], value))
column.append("`nouse_sitting`,");
}
const YAML::Node &trade = input["Trade"];
if (trade) {
if (appendEntry(trade["Override"], value))
column.append("`trade_override`,");
if (appendEntry(trade["NoDrop"], value))
column.append("`trade_nodrop`,");
if (appendEntry(trade["NoTrade"], value))
column.append("`trade_notrade`,");
if (appendEntry(trade["TradePartner"], value))
column.append("`trade_tradepartner`,");
if (appendEntry(trade["NoSell"], value))
column.append("`trade_nosell`,");
if (appendEntry(trade["NoCart"], value))
column.append("`trade_nocart`,");
if (appendEntry(trade["NoStorage"], value))
column.append("`trade_nostorage`,");
if (appendEntry(trade["NoGuildStorage"], value))
column.append("`trade_noguildstorage`,");
if (appendEntry(trade["NoMail"], value))
column.append("`trade_nomail`,");
if (appendEntry(trade["NoAuction"], value))
column.append("`trade_noauction`,");
}
if (appendEntry(input["Script"], value, true))
column.append("`script`,");
if (appendEntry(input["EquipScript"], value, true))
column.append("`equip_script`,");
if (appendEntry(input["UnEquipScript"], value, true))
column.append("`unequip_script`,");
column.pop_back(); // Remove last ','
value.pop_back(); // Remove last ','
out << "REPLACE INTO `" + table + "` (" + column + ") VALUES (" + value + ");\n";
entries++;
}
ShowStatus("Done converting '" CL_WHITE "%d" CL_RESET "' items in '" CL_WHITE "%s" CL_RESET "'.\n", entries, file.c_str());
return true;
}

177
src/tool/yaml2sql.vcxproj Normal file
View File

@ -0,0 +1,177 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{CDBBB260-B245-44EC-80FB-3F9421885E40}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>yaml2sql</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)</OutDir>
<IntDir>$(SolutionDir).vs\build\$(ProjectName)\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)</OutDir>
<IntDir>$(SolutionDir).vs\build\$(ProjectName)\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)</OutDir>
<IntDir>$(SolutionDir).vs\build\$(ProjectName)\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)</OutDir>
<IntDir>$(SolutionDir).vs\build\$(ProjectName)\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>$(DefineConstants);WIN32;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_WINSOCK_DEPRECATED_NO_WARNINGS;LIBCONFIG_STATIC;YY_USE_CONST;MINICORE;_DEBUG;_CONSOLE;_LIB;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<AdditionalIncludeDirectories>$(SolutionDir)3rdparty\yaml-cpp\include\</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>ws2_32.lib;$(SolutionDir).vs\build\common-minicore.lib;$(SolutionDir)3rdparty\zlib\lib\$(Platform)\zlib.lib;$(SolutionDir).vs\build\yaml-cpp.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>$(DefineConstants);WIN32;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_WINSOCK_DEPRECATED_NO_WARNINGS;LIBCONFIG_STATIC;YY_USE_CONST;MINICORE;_DEBUG;_CONSOLE;_LIB;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<AdditionalIncludeDirectories>$(SolutionDir)3rdparty\yaml-cpp\include\</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>ws2_32.lib;$(SolutionDir).vs\build\common-minicore.lib;$(SolutionDir)3rdparty\zlib\lib\$(Platform)\zlib.lib;$(SolutionDir).vs\build\yaml-cpp.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>$(DefineConstants);WIN32;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_WINSOCK_DEPRECATED_NO_WARNINGS;LIBCONFIG_STATIC;YY_USE_CONST;MINICORE;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<AdditionalIncludeDirectories>$(SolutionDir)3rdparty\yaml-cpp\include\</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>ws2_32.lib;$(SolutionDir).vs\build\common-minicore.lib;$(SolutionDir)3rdparty\zlib\lib\$(Platform)\zlib.lib;$(SolutionDir).vs\build\yaml-cpp.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>$(DefineConstants);WIN32;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_WINSOCK_DEPRECATED_NO_WARNINGS;LIBCONFIG_STATIC;YY_USE_CONST;MINICORE;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<AdditionalIncludeDirectories>$(SolutionDir)3rdparty\yaml-cpp\include\</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>ws2_32.lib;$(SolutionDir).vs\build\common-minicore.lib;$(SolutionDir)3rdparty\zlib\lib\$(Platform)\zlib.lib;$(SolutionDir).vs\build\yaml-cpp.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="yaml2sql.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<Target Name="AfterClean">
<Delete Files="$(SolutionDir)zlib.dll" ContinueOnError="true" />
<Delete Files="$(SolutionDir)serv.bat" ContinueOnError="true" />
<Delete Files="$(SolutionDir)yaml2sql.bat" ContinueOnError="true" />
</Target>
<Target Name="AfterBuild">
<Copy SourceFiles="$(SolutionDir)3rdparty\zlib\lib\$(Platform)\zlib.dll" DestinationFolder="$(SolutionDir)" ContinueOnError="true" Condition="!Exists('$(SolutionDir)zlib.dll')" />
<Copy SourceFiles="$(SolutionDir)tools\serv.bat" DestinationFolder="$(SolutionDir)" ContinueOnError="true" Condition="!Exists('$(SolutionDir)serv.bat')" />
<Copy SourceFiles="$(SolutionDir)tools\yaml2sql.bat" DestinationFolder="$(SolutionDir)" ContinueOnError="true" Condition="!Exists('$(SolutionDir)yaml2sql.bat')" />
</Target>
</Project>

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="yaml2sql.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@ -10,9 +10,13 @@ set MYSQL_PWD=%DB_ROOTPW%
%MYSQL% -u %DB_ROOT% %DB_NAME% -e "source sql-files\logs.sql"
%MYSQL% -u %DB_ROOT% %DB_NAME% -e "source sql-files\item_cash_db.sql"
%MYSQL% -u %DB_ROOT% %DB_NAME% -e "source sql-files\item_cash_db2.sql"
%MYSQL% -u %DB_ROOT% %DB_NAME% -e "source sql-files\item_db.sql"
%MYSQL% -u %DB_ROOT% %DB_NAME% -e "source sql-files\item_db_usable.sql"
%MYSQL% -u %DB_ROOT% %DB_NAME% -e "source sql-files\item_db_equip.sql"
%MYSQL% -u %DB_ROOT% %DB_NAME% -e "source sql-files\item_db_etc.sql"
%MYSQL% -u %DB_ROOT% %DB_NAME% -e "source sql-files\item_db2.sql"
%MYSQL% -u %DB_ROOT% %DB_NAME% -e "source sql-files\item_db_re.sql"
%MYSQL% -u %DB_ROOT% %DB_NAME% -e "source sql-files\item_db_re_usable.sql"
%MYSQL% -u %DB_ROOT% %DB_NAME% -e "source sql-files\item_db_re_equip.sql"
%MYSQL% -u %DB_ROOT% %DB_NAME% -e "source sql-files\item_db_re_etc.sql"
%MYSQL% -u %DB_ROOT% %DB_NAME% -e "source sql-files\item_db2_re.sql"
%MYSQL% -u %DB_ROOT% %DB_NAME% -e "source sql-files\mob_db.sql"
%MYSQL% -u %DB_ROOT% %DB_NAME% -e "source sql-files\mob_db2.sql"

View File

@ -10,9 +10,13 @@ mysql -u $DB_ROOT $DB_NAME < sql-files/main.sql || aborterror "Unable to import
mysql -u $DB_ROOT $DB_NAME < sql-files/logs.sql || aborterror "Unable to import logs database."
mysql -u $DB_ROOT $DB_NAME < sql-files/item_cash_db.sql || aborterror "Unable to import cash item table."
mysql -u $DB_ROOT $DB_NAME < sql-files/item_cash_db2.sql || aborterror "Unable to import cash item 2 table."
mysql -u $DB_ROOT $DB_NAME < sql-files/item_db.sql || aborterror "Unable to import pre-renewal item table."
mysql -u $DB_ROOT $DB_NAME < sql-files/item_db_usable.sql || aborterror "Unable to import pre-renewal usable item table."
mysql -u $DB_ROOT $DB_NAME < sql-files/item_db_equip.sql || aborterror "Unable to import pre-renewal equip item table."
mysql -u $DB_ROOT $DB_NAME < sql-files/item_db_etc.sql || aborterror "Unable to import pre-renewal etc item table."
mysql -u $DB_ROOT $DB_NAME < sql-files/item_db2.sql || aborterror "Unable to import pre-renewal item 2 table."
mysql -u $DB_ROOT $DB_NAME < sql-files/item_db_re.sql || aborterror "Unable to import renewal item table."
mysql -u $DB_ROOT $DB_NAME < sql-files/item_db_re_usable.sql || aborterror "Unable to import renewal usable item table."
mysql -u $DB_ROOT $DB_NAME < sql-files/item_db_re_equip.sql || aborterror "Unable to import renewal equip item table."
mysql -u $DB_ROOT $DB_NAME < sql-files/item_db_re_etc.sql || aborterror "Unable to import renewal etc item table."
mysql -u $DB_ROOT $DB_NAME < sql-files/item_db2_re.sql || aborterror "Unable to import renewal item 2 table."
mysql -u $DB_ROOT $DB_NAME < sql-files/mob_db.sql || aborterror "Unable to import pre-renewal monster table."
mysql -u $DB_ROOT $DB_NAME < sql-files/mob_db2.sql || aborterror "Unable to import pre-renewal monster 2 table."

View File

@ -1,107 +0,0 @@
#!/usr/bin/perl
# rAthena Item Type Converter
# Fixes incorrect weapon and armor item types.
# https://rathena.org/board/topic/90738-itemtype-update-read-this-very-important/
use strict;
use warnings;
use Getopt::Long;
use File::Basename;
use Scalar::Util qw(looks_like_number);
my $sFileins;
my @aFilein = ("../db/re/item_db.txt","../db/pre-re/item_db.txt","../db/item_db2.txt");
my $sFileouts;
my @aFileout = ("../db/re/item_db.txt","../db/pre-re/item_db.txt","../db/item_db2.txt");
my $sHelp = 0;
Main();
sub GetArgs {
GetOptions(
'i=s' => \$sFileins, #Output file name.
'o=s' => \$sFileouts, #Input file name.
'help!' => \$sHelp,
) or $sHelp=1; #Display help if invalid options are supplied.
if( $sHelp ) {
print "Incorrect option specified. Available options:\n"
."\t --o=filename => Output file name. (file must be separate by coma if multiple) \n"
."\t --i=filenames => Input files name. (file must be separate by coma if multiple) \n";
exit;
}
if($sFileins){
chomp($sFileins);
@aFilein = split(",",$sFileins);
}
if($sFileouts){
chomp($sFileouts);
@aFileout = split(",",$sFileouts);
}
unless(scalar(@aFileout)==scalar(@aFilein)){
print "ERROR: Number of input files doesn't match number of output files. You must specify an output for each input:\n"
."afilein = [ @aFilein ] \n"
."afileout = [ @aFileout ] \n";
exit;
}
}
sub Main {
my $sI=0;
my($filename, $dir, $suffix) = fileparse($0);
chdir $dir; #put ourself like was called in tool folder
GetArgs();
print "Running rAthena's item type converter...\n";
print "Files to be converted: '@aFilein' into '@aFileout'.\n";
foreach my $sFile (@aFilein){
my $sReplace=0; #should we replace file when finished
my $sFileouttmp=$aFileout[$sI];
if($sFile eq $sFileouttmp){
$sReplace=1;
$sFileouttmp = $sFileouttmp.".out";
print "Asking to replace file tmp fileout= $sFileouttmp \n";
}
unless(open FHIN,"$sFile"){
print "ERROR: Can't read or locate $sFile.\n";
next;
}
unless(open FHOUT,">$sFileouttmp"){
print "ERROR: Can't write or locate $aFileout[$sI].\n";
next;
}
$sI++;
while (<FHIN>){
if( $_ =~ /^\s*$/) { #ignore empty line
print FHOUT $_;
next;
}
my @champ = split(",",$_);
my $sDoconvertion=0; #should this comment be converted
if( $_ =~ /^\/\// ) { # // line
if(scalar(@champ)>3){
$champ[0] =~ s!\/\/!!g;
$sDoconvertion=looks_like_number($champ[0]);
$champ[0] = "//".$champ[0]; #recomment it
}
if($sDoconvertion==0) {
print FHOUT $_;
next;
}
}
if(scalar(@champ>3)){
if($champ[3] == 4) { $champ[3]=5; }
elsif($champ[3] == 5) { $champ[3]=4; }
my $newline = join(",",@champ);
print FHOUT $newline;
}
else { print FHOUT $_; }
}
close FHOUT;
close FHIN;
if($sReplace){
unlink $sFile;
rename $sFileouttmp, $sFile;
}
}
}

View File

@ -1,9 +1,5 @@
#!/usr/bin/perl
# Item Database:
# --i=../db/pre-re/item_db.txt --o=../sql-files/item_db.sql --t=pre --m=item --table=item_db
# --i=../db/re/item_db.txt --o=../sql-files/item_db_re.sql --t=re --m=item --table=item_db_re
#
# Mob Database:
# --i=../db/pre-re/mob_db.txt --o=../sql-files/mob_db.sql --t=pre --m=mob --table=mob_db
# --i=../db/re/mob_db.txt --o=../sql-files/mob_db_re.sql --t=re --m=mob --table=mob_db_re
@ -42,12 +38,12 @@ sub GetArgs {
'i=s' => \$sFilein, #Output file name.
'o=s' => \$sFileout, #Input file name.
't=s' => \$sTarget, #Renewal setting: pre-re, re.
'm=s' => \$sType, #Database: item, mob, mob_skill.
'm=s' => \$sType, #Database: mob, mob_skill.
'table=s' => \$sTable, #Table name.
'help!' => \$sHelp,
) or $sHelp=1; #Display help if invalid options are supplied.
my $sValidTarget = "re|pre";
my $sValidType = "item|mob|mob_skill";
my $sValidType = "mob|mob_skill";
if( $sHelp ) {
print "Incorrect option specified. Available options:\n"
@ -109,21 +105,10 @@ sub ConvertFile { my($sFilein,$sFileout,$sType)=@_;
if ($ligne =~ $line_format ) { @champ = ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19); }
}
elsif ($sType =~ /mob/i) { @champ = split(",",$ligne); }
elsif ($sType =~ /item/i ) {
if ($ligne =~ $line_format) { @champ = ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22); }
}
if ($#champ != $nb_columns - 1) { #Can't parse, it's a real comment.
printf $sFHout ("%s\n", $ligne);
} else {
printf $sFHout ("REPLACE INTO `%s` VALUES (", $db);
if( $sType =~ /item/i and $sWasCom == 0){ #check if aegis name is duplicate, (only for not com)
$hAEgisName{$champ[1]}++;
if($hAEgisName{$champ[1]} > 1){
print "Warning, aegisName=$champ[1] multiple occurence found, val=$hAEgisName{$champ[1]}, line=$ligne\n" ;
$champ[1] = $champ[1]."_"x($hAEgisName{$champ[1]}-1);
print "Converted into '$champ[1]'\n" ;
}
}
for (my $i=0; $i<$#champ; $i++) {
printField($sFHout,$champ[$i],",",$i);
}
@ -192,95 +177,7 @@ sub escape { my ($str,$sregex,$sreplace) = @_;
sub BuildDataForType{ my($sTarget,$sType) = @_;
print "Starting BuildDataForType with: \n\t Target=$sTarget, Type=$sType \n";
if($sType =~ /item/i) {
if($sTarget =~ /Pre/i){
$db = $sTable;
$db = "item_db" unless($db);
$nb_columns = 22;
@str_col = (1,2,19,20,21);
@str_col2 = (19,20,21);
$line_format = "([^\,]*),"x($nb_columns-3)."(\{.*\}),"x(2)."(\{.*\})"; #Last 3 columns are scripts.
$create_table =
"#
# Table structure for table `$db`
#
DROP TABLE IF EXISTS `$db`;
CREATE TABLE `$db` (
`id` int(10) unsigned NOT NULL DEFAULT '0',
`name_english` varchar(50) NOT NULL DEFAULT '',
`name_japanese` varchar(50) NOT NULL DEFAULT '',
`type` tinyint(2) unsigned NOT NULL DEFAULT '0',
`price_buy` mediumint(8) unsigned DEFAULT NULL,
`price_sell` mediumint(8) unsigned DEFAULT NULL,
`weight` smallint(5) unsigned NOT NULL DEFAULT '0',
`attack` smallint(5) unsigned DEFAULT NULL,
`defence` smallint(5) unsigned DEFAULT NULL,
`range` tinyint(2) unsigned DEFAULT NULL,
`slots` tinyint(2) unsigned DEFAULT NULL,
`equip_jobs` bigint(20) unsigned DEFAULT NULL,
`equip_upper` tinyint(2) unsigned DEFAULT NULL,
`equip_genders` tinyint(1) unsigned DEFAULT NULL,
`equip_locations` mediumint(7) unsigned DEFAULT NULL,
`weapon_level` tinyint(1) unsigned DEFAULT NULL,
`equip_level` tinyint(3) unsigned DEFAULT NULL,
`refineable` tinyint(1) unsigned DEFAULT NULL,
`view` smallint(5) unsigned DEFAULT NULL,
`script` text,
`equip_script` text,
`unequip_script` text,
PRIMARY KEY (`id`),
UNIQUE INDEX `UniqueAegisName` (`name_english`)
) ENGINE=MyISAM;
";
#NOTE: These do not match the table struct defaults.
@defaults = ('0','\'\'','\'\'','0','NULL','NULL',0,'NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL');
}
elsif($sTarget =~ /Re/i){
$db = $sTable;
$db = "item_db_re" unless($db);
$nb_columns = 22;
@str_col = (1,2,7,16,19,20,21);
@str_col2 = (19,20,21);
$line_format = "([^\,]*),"x($nb_columns-3)."(\{.*\}),"x(2)."(\{.*\})"; #Last 3 columns are scripts.
$create_table =
"#
# Table structure for table `$db`
#
DROP TABLE IF EXISTS `$db`;
CREATE TABLE `$db` (
`id` int(10) unsigned NOT NULL DEFAULT '0',
`name_english` varchar(50) NOT NULL DEFAULT '',
`name_japanese` varchar(50) NOT NULL DEFAULT '',
`type` tinyint(2) unsigned NOT NULL DEFAULT '0',
`price_buy` mediumint(8) unsigned DEFAULT NULL,
`price_sell` mediumint(8) unsigned DEFAULT NULL,
`weight` smallint(5) unsigned NOT NULL DEFAULT '0',
`atk:matk` varchar(11) DEFAULT NULL,
`defence` smallint(5) unsigned DEFAULT NULL,
`range` tinyint(2) unsigned DEFAULT NULL,
`slots` tinyint(2) unsigned DEFAULT NULL,
`equip_jobs` bigint(20) unsigned DEFAULT NULL,
`equip_upper` tinyint(2) unsigned DEFAULT NULL,
`equip_genders` tinyint(1) unsigned DEFAULT NULL,
`equip_locations` mediumint(7) unsigned DEFAULT NULL,
`weapon_level` tinyint(1) unsigned DEFAULT NULL,
`equip_level` varchar(10) DEFAULT NULL,
`refineable` tinyint(1) unsigned DEFAULT NULL,
`view` smallint(5) unsigned DEFAULT NULL,
`script` text,
`equip_script` text,
`unequip_script` text,
PRIMARY KEY (`id`),
UNIQUE INDEX `UniqueAegisName` (`name_english`)
) ENGINE=MyISAM;
";
#NOTE: These do not match the table struct defaults.
@defaults = ('0','\'\'','\'\'','0','NULL','NULL',0,'NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL','NULL');
}
}
elsif($sType =~ /mob_skill/i) { #Same format for Pre-Renewal and Renewal.
if($sType =~ /mob_skill/i) { #Same format for Pre-Renewal and Renewal.
$db = $sTable;
if($sTarget =~ /Pre/i){
$db = "mob_skill_db" unless($db);

2
tools/yaml2sql.bat Normal file
View File

@ -0,0 +1,2 @@
@ECHO OFF
CALL serv.bat yaml2sql.exe YAML 2 SQL