summaryrefslogtreecommitdiff
path: root/src/map/itemdb.c
AgeCommit message (Collapse)AuthorFilesLines
2007-11-08* Changed EXIT_SUCCESS back to 0 in console.c to avoid an unnecessary include.FlavioJS1-2/+2
* Fixed gm_account_db not being deallocated in login-converter.c. * Refactoring names and documentation in db.h/db.c: - changed 'struct dbt' to 'struct DBMap' and 'DB' to 'DBMap*' - changed 'struct db' to 'struct DBMap_impl' and 'DB_impl' to 'DBMap_impl*' - changed COUNT to DB_COUNTSTAT and made it's existence not depend on DB_ENABLE_STATS - removed some @see links and corrected small typos in the documentation git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11698 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-10-15- fixed Halo-Halo not being consumed on use.skotlex1-5/+22
- Updated the item price/sell reading code to enable 'null' values. The difference between a blank value and 0 is that when the value is blank, it should automatically take half/double the other value. The previous behaviour did this automatically and didn't let you specify, for example, if you wanted a given item to sell for 0. - Also added a warning when an item in the db has an exploitable price (through overcharge/discount). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11482 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-10-13Fixed a messup in r11398 - option to skip brackets around item scripts was ↵ultramage1-1/+1
added but not used where it should have been. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11452 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-10-12* Fixed wrong index calculation in TXT char creation code (ref: r11410)ultramage1-0/+4
* Fixed SQL itemdb loading crash on NULL columns (ref: 11398) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11434 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-10-10* Fixed itemdb_read_sqldb blowing up the server with segmentation faults.FlavioJS1-34/+16
* Added an option for parse_script to ignore the checks for the set of brackets around the script. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11398 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-10-05* Removed a broken remnant of code from old gospel code (r4349) that's ↵ultramage1-1/+1
_supposed_ to clear the gospel status (no item use?) when you step out of its zone - 1) the constant UNT_GOSPEL was used in a switch() instead of PA_GOSPEL (thus actually ending 'NPC_STUNATTACK' status), and - 2) this code path is never taken, because Gospel is not recorded in skill_unit_temp[] (it has a periodic timer and is not DUALMODE) * Now the first empty spot in the 'skill_unit_temp' array will be used when tracking movement between land skills; reduced its length to 20 * Fixed the skill unit mechanism that is supposed to track whether you're still standing in a certain land skill's AoE or not, which was not working correctly since the time it was added (r3133) - solves the nasty problem of Loki, Quagmire, ... status not ending even after stepping out of it in some cases, if there was another song overlapping the skill's area (fixes bugreport:34) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11361 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-10-04* Added MAX_HOTKEYS to supplement the HOTKEY_SAVING defineultramage1-3/+3
* Fixed a compile problem when hotkey saving is disabled (topic:167265) * Added script source error reporting to countitem() (topic:167165) * Removed integer mob skill state/target definition support (unused) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11353 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-09-28* Changed back the query to get the friends of a character to a LEFT JOIN.FlavioJS1-0/+9
* Setting the item script variables to NULL when they are freed. (bugreport:142 ?) (a double @reloaditemdb might result in a double free) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11328 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-09-27* Reimplemented mmo_char_fromsql using sql statements. (fixes bugreport:93)FlavioJS1-30/+51
* Fixed buildin_gethominfo not being included in the script engine. (bugreport:124) * homunculus_evolution -> homevolution in script_commands.txt. * Deleted item DEFAULT from item_db.txt and regenerated item_db.sql. (bugreport:103) * Skip empty lines and give more feedback (for invalid lines) when reading item_db.txt/item_db2.txt. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11311 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-09-21* itemdb.c/h using a static array of 32k struct item_data* entries (faster ↵FlavioJS1-83/+162
itemdb loockup and a first step to remove map_session_data->inventory_data). * Fixed a typo in the configure script that replaced CFLAGS with CPPFLAGS when -Wno-pointer-sign is supported by the compiler. [FlavioJS] git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11259 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-09-20* Merged the tmpsql branch:FlavioJS1-307/+189
- Abstraction for the sql code (sql.c/h). - New configure script and makefiles. - Restored txt zeny logging code. (r10814) - Rewrote mapserver's sql code - itemdb, mobdb, mapreg, logs. (r10814) - Fixed a precedence issue (&& and ) in char_sql/char.c. (r10833) - Improved db reading code a bit for consistency. (r11077) - Added separate atcommand for mail deletion. (r11077) - Corrected a few messages that said "new" instead of "unread". (r11077) - Broadcast (*) messages now use "*" as the target's name (not ""). (r11077) - Moved StringBuf code from utils.c/h to strlib.c/h. (r11084 r11117) - Some misc login server cleanups (reformatting etc). (r11136) - Corrected/modified some header entries. (r11141 r11147 11148) - Adjusted VS project files. (r11147) - Adjusted the way the sql charserver does item saving. (r11192) - Corrected usage of reserved keyword 'friend' in mmo.h. (r11192) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11245 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-08-19* Cleaned/clarified some #include relationships between headersultramage1-4/+5
* Changed clif_sitting() to use 'bl' instead of 'sd' (for non-player objects) * Removed way messed-up script function 'unitdeadsit' * Tagged 'FIXME' lines written by myself git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11040 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-05-27Cleaned up a hack from r10112 (forward declaration does the trick)ultramage1-3/+3
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10633 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-05-25Corrected some weird fgets() statements, plus reformatted themultramage1-5/+10
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10616 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-05-19Reformatting @_@ultramage1-50/+31
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10581 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-04-22- Removed the include of features.h from the console.c plugin. It is ↵skotlex1-1/+1
apparently not needed (and it was preventing compilation on FreeBSD) - Fixed bug which totally broke item group bonuses. - Added warnings when setting a pvp/gvg flag removes the other flags on the same map (gvg and pvp can't coexist on the same map) - Optimized the unequip loop when changing sex. - Removed the check that prevented you from casting soul-collect when you already have 5 spirits. - Corrected Magic Rod so it doesn't displays any skill-use animation until it triggers. - Debuff on logout&2 is again set to default, instead of removing food bonuses now it removes Maximize Power, Maximum Overthrust and Steel Body. - Corrected Steel Body's icon (it actually belongs to AutoBerserk) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10317 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-04-03- Fixed @reloaditemdb not unsetting the consume delay flag when a type 11 ↵skotlex1-1/+2
item was changed to something else before reloading. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10146 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-04-01- Fixed the server crashing on startup due to bad defineultramage1-57/+14
- Fixed the server crashing on a timer-queued disguise / undisguise (no sd check) - re-added the item_group_list for consistency's sake, moved to itemdb.h (after some hacking to remove the ugly map.h dependency) - Removed some overly verbose item group messages & code git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10112 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-03-12- Corrected the new packet version entries for skilluseposinfoskotlex1-1/+2
- Corrected item reloading not unsetting the "delay consume" flag if the item had changed it's type. - the Attack_Type variable in skill_attack now inherits the damage.flag properties, this fixes ranged status effects not triggering. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9992 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-01- Item search is now a bit smarter. When no item is found with the same ↵skotlex1-19/+13
'aegis name', then the 'normal' name is used instead. - Updated the @/# commands that take an item name so that you can use quotes when specifying item names with spaces in them. For example, @item "poring card" 1 will work now. Note that only the commands that work on ONE item have been updated, those that do an item list need to be updated as well. - Removed some garbage from the item_data structure. - Improved a bit the description of the mvp item get time config settings. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9767 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-27Removed useless read-from-GRF featuresDracoRPG1-159/+0
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9725 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-09- Changes to script buildin functions:FlavioJS1-6/+6
* functions checking if a player is attached as soon as possible. * functions that required a player attached and would crash if none was there terminate the script now. (others keep the current behaviour to maintain full backward compatibility) * removed the unused flag argument in guildskill. * bonus,bonus2,bonus3,bonus4 use the same function now (remains the same script-wise) * added an optional parameter to setcart,setfalcon,setriding so it's possible to remove the cart/falcon/mount or select a specific cart * other cleanups git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9636 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-07Undid the memset->malloc_set replacementultramage1-7/+7
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9626 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-07- re-added the duplicit nj/gs name messages in msg_athenaultramage1-6/+6
- renamed atcommand_sub to is_atcommand_sub (charcommand too) - reformatted conf-tmpl's comments a bit - and a fix to the stable changelog to make my last commit more descriptive git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9625 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-27- Cleaned up item_misc.txtskotlex1-2/+2
- Fixed a bug which makes the group heal bonus be applied as many times as the item is in that group. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9578 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-22- Added support for the new "make new char" packet that has the rename ↵skotlex1-6/+6
button data. Thanks to Sara-chan for the format change update. - Fixed itemdb.c sql compilation - Now when you specify a max level beyond what the exp table has, the last entry of the exp table will be duplicated to fill in the remaining levels. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9558 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-22- Change strncpy to memcpy when parsing switches in the script engine since ↵FlavioJS1-5/+5
it's guaranteed to be a word of that size (skip_word). - Made scriptlabel_db duplicate the key. When str_buf is reallocated, the keys in scriptlabel_db could become invalid, causing a crash in npc_convertlabel_db. ( removed the readded >=0x81 equivalent ) - Now npc_convertlabel_db clears scriptlabel_db after using it. - parse_script has an extra parameter options. At the moment it only indicates if scriptlabel_db should be used or not. - Fixed "UINT_MAX undeclared" on systems that don't declare it in limits.h git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9557 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-05- Massive EOL normalization & 'svn:eol-style native' flag setting for all ↵FlavioJS1-1277/+1277
txt/conf/h/c files. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9410 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-09-25- Fixed item group 35 (lottobox) in item_misc.txtskotlex1-1/+4
- Item group reading will now complain when a line doesn't has enough fields. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8865 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-09-15- Updated the item_db search functions so that when returning the ↵skotlex1-1/+5
dummy-item, it first updates the nameid to match the requested one, this prevents pc_additem later on giving you an item with ID 500 instead of the ID requested. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8764 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-08-27* Optional macro MEMSET_TURBO for faster low-level memory initializations.Lance1-7/+7
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8499 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-08-19- Fixed job-mask 0x100000 in the item_db enabling Dancers/Bards to use the ↵skotlex1-2/+3
items (0x80000 should be for them and 0x100000 should be currently unused) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8368 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-08-11- Fixed the item group bonus not working.skotlex1-1/+1
- Removed unnecessary member id from the item group structure. - Fixed songs/dances always being considered overlapped with themselves. - Added some additional song/dance overlap code that should correctly change the effect of songs/dances when they overlap. - Added a check so that the status-change packet is always send to self when the inflicted char is a player disguised. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8242 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-08-09- Should have fixed a signed/unsigned warning in login-txtskotlex1-0/+1
- Moved the class-change code from battle_calc_weapon_attack to skill_additional_effect. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8211 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-08-04- Changed function itemdb_group to itemdb_group_bonus, it now calculates the ↵skotlex1-22/+11
total group bonuses of a player for a given item. - Changed itemhealrate to itemgrouphealrate, added a structure itemhealrate to allow storing item-healing bonuses per item. - Modified bAddItemHealRate so it can receive both item-id and item-group values (since the first item-id is +500, there's no risk of mixing them up). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8136 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-07-27- Synced the script.c file with as much data as possible from jA's:skotlex1-11/+11
- A lot of functions were moved around, a bunch of indentation and space-usage changes were done to make it easier to diff against their files. - Miscellanous addition and corrections were applied. - Largest one is likely a restructuring of run_script_main, which hopes to solve the memory leaks. - script engine now uses the setjmp functions to restore memory state when there's an error parsing scripts, which means that script errors won't cause the map-server to inmediately bail out anymore. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7926 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-07-27- Fixed a memory leak when reading the item_db txt.skotlex1-2/+2
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7906 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-07-25- Cleaned up the skill_landprotector function to correctly block only magic ↵skotlex1-1/+16
skills from being placed on land protectors. - Corrected itemdb_group so that it will not return the random item givers (should give priority to actual item groups, so that the item heal bonuses work correctly) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7867 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-07-21- Added a check to prevent Blind from ending while standing on a fog of wall.skotlex1-2/+2
- The mob Slave ai will be executed now even when the slave has a target. This will allow for "instant" warping to the master when it changes maps or teleports. if the slave has a target already, it won't unlock it and chase back to the master or anything like that. - Removed a couple of checks that prevents item ids above 20000. However, remember that the max id is still ~32k or the client is the one who's gonna crash! git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7799 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-07-11- Coded @reset.skotlex1-47/+78
- Reenabled @changesex - Added function pet_create_egg which handles creating pet eggs correctly (when passed item id is indeed a valid petegg). Applied this on @createitem and getitem. - Cleaned up code of @item - Added define UNKNOWN_ITEM_ID (512 = apple) - Added IT_* enumation item_Types to identify said data from items. - Cleaned up the itemdb_isequip functions. itemdb_isequip will now return if the item is equipable by players, itemdb_isstackable returns if the item can be stacked, and itemdb_isidentified returns if the item should drop identified. - Added defines CARD0_PET/CARD0_FORGE/CARD0_CREATED to identify if a given item has "invalid" cards, added define function itemdb_isspecial to simplify this check. - Removed itemdb.c considering item ids above 20000 as invalid. - Cleaned up script commands getitem and card-counting related ones. - Cleaned up a bit more pc_isequip git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7613 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-07-10- One closer inspection, removed that clear in itemdb_reload for a foreach ↵skotlex1-2/+11
call again. And modified itemdb_load to scrap the dummy item entry from the item_db and replace it with proper data for the item. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7597 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-07-10- itemdb_reload will clear the itemdb before reloading info instead of only ↵skotlex1-1/+1
clearing the scripts now. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7596 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-07-07- itemdb_exists will now return NULL for item_id 0.skotlex1-1/+3
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7572 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-07-06- Rewrote all the item restriction functions so that they will take into ↵skotlex1-14/+29
account slotted card restrictions as well. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7552 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-28- Corrected Musical Strike having a different damage equation from Throw Arrow.skotlex1-5/+10
- Some minor cleanup of Soul Change - Added state rewarp to players. It gets set when a pc_setpos call is triggered while the player is changing maps so that when the player finish loading the map, it is inmediately rewarped to where it has been rewarped/recalled to. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7370 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-23- Modified pc_setoption so that it will correctly update sprite AND clothes ↵skotlex1-1/+1
color when mounting/unmounting changing into/from xmas/wedding sprites. - Allowed itemdb_exists to return the dummy item. Enables "invalid" items to be sold, traded, dropped, etc. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7321 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-23- Standarized PF_MEMORIZE to be 50% cast time on all skills (instead of -50% ↵skotlex1-26/+20
for targetted skills and -66% for ground skills >.>) - Cleared up the comment on what item_check does and how it works. - Changed the pointer dummy_item to a normal struct variable. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7316 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-17- Added IG_LottoBox for that tricky Lotto Box item.skotlex1-5/+6
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7227 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-12- Fixed npc_checknear's distance check returning the opposite of what it ↵skotlex1-7/+32
should (false when the range is correct and viceversa) - SL_STIN/SL_STUN have dex-reducable casting times now. - Added a warning on item loading when an item is of equippable type but has no equippable position. - Turning an alliance to an opposition won't work now during WoE - Slaves can summon other mobs now. The only ones who can't do this are player summoned mobs. - Merged the following functions for faster processing of items: clif_storageitemlist + clif_storageequiplist = clif_storagelist clif_guildstorageitemlist + clif_guildstorageequiplist = clif_guildstoragelist clif_itemlist + clif_equiplist = clif_inventorylist - Increased max knockback value support to 25. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7109 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-22* WARNING: New scripting system contains memory leakLance1-10/+10
TODO: Free all scripts using script_free_code() instead of old methods. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6690 54d463be-8e91-2dee-dedb-b68131a5f0ec