501 Commits

Author SHA1 Message Date
zephyrus
c4fb4f4361 - Some code cleanups.
- Added new Cell types (NoChat and NoDamage)
- Added JobChangeLevel and FreeSKPoints to #stats
- Added a Crash protection in clif_send with invalid fd values.
- Merged a missing update in TK Mission.
- Added script command 'getmapflag'
- Merged some new Status Change to Stable.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@12175 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-02-04 18:23:57 +00:00
ultramage
8d811654b9 Fixed npc reloading crash (bugreport:889)
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@12166 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-02-02 08:16:53 +00:00
zephyrus
e3ee239077 - Fixed a serious zeny exploid on scripts. Please update!!
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@12153 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-01-30 09:14:58 +00:00
ultramage
88cfb8ff5a Fixed card removal script functions' 'extra card' bug (bugreport:786)
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@12075 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-01-14 13:25:41 +00:00
ultramage
f96f0d27a9 Removed the hardcoded limit for numeric npc input boxes (bugreport:811)
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@12074 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-01-14 12:01:58 +00:00
skotlex
ced9aada8c - Fixed getmonsterinfo to return "null" when returning the name of a non-existing mob instead of -1.
- Extended the status_percent_damage define to include a bolean to specify whether or not the target can be killed from it.
- Corrected CR_CULTIVATION to fail when the target cell has some BL_CHAR on it already.
- Changed the meaning of 'flag' in status_percent_change, to enable differentiation between damage that can kill the object and damage that cannot.
- Script command percentheal will no longer kill the player if the specified amount is negative (and not -100).


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@12051 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-01-10 22:02:33 +00:00
skotlex
5c4212300a - corrected duration of sphere mines to be 30 secs regardless of skill level
- Corrected duel_count/duel_list (you DON'T place variables in a .h file! That is what 'extern' is for)
- Script command warpportal now places a warp in its initial state (as if a real warp portal was casted)
- Updated dispell to also not remove the following effects: Hindsight, Inc Hit/Atk Rate (NPC_POWERUP), Nen, TK stances and tumble, warm and speedup1 (the other speed potion)
- Chase-walking characters can now loot.
- Hiding characters can't drop items now. 


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@12036 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-01-09 16:08:57 +00:00
skotlex
9a2033c364 - Made the pc reg variables receive a const char* as the argument, since they duplicate the value anyway (and they were receiving const char* values from the setd function)
- Fixed Wand of Hermod not starting the SC_HERMOD status change (which blocks spells)
- Fixed a missing break in the cast cancel code.
- Fixed additional def/mdef from vit/int bonuses being lost when a status change that affects def/mdef triggers (for homunculus)


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@12033 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-01-08 13:30:43 +00:00
ultramage
144afd8189 Cleaned up mob_once_spawn() and mob_once_spawn_area().
- now they use mapid instead of mapname as input parameter
- moved the responsibility to perform "this" -> mapid resolution to the caller
- added a pair of swap() operations to prevent working with a negative-dimensioned area (fixes bugreport:87)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@12022 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-01-06 16:37:06 +00:00
ultramage
65834585a8 Modified showmsg code to not attach a timestamp to MSG_NONE-type messages, generated by ShowMessage(). It now works exactly like printf().
Removed/replaced all printf calls in the code.
Added a new flag to setting 'console_silent', for filtering debug messages.
Silenced the "Broken pipe found" and "Server running in debug mode" messages.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@12020 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-01-06 14:19:26 +00:00
ultramage
e7bb626a80 Modified the map_setcell() code to to use a boolean flag instead of needing SET_ / CLR_ pairs of defines (topic:174323).
Also removed script object 'setcell', added script function 'setcell'.
- Now you can manipulate cell information without needing @loadnpc
- You can also manipulate the terrain ('gat') type itself, using the new cell_walkable, cell_shootable and cell_water constants
  (currently the implementation uses bit flags too, so to get the type you want, you need to adjust the flags one by one)
- This breaks current scripts, so please adjust places that use setcell
  (also be sure to _only_ use predefined constants, not direct numbers)
- Details can be found in the script reference.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@12009 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-01-04 12:41:49 +00:00
ultramage
ca115ffc82 Removed map_data's block_count, as (quote Yor/ja2160), "Perhaps useful for debug, but uses memory AND CPU for nothing." (block lists are linked lists, they don't need count tracking)
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@12001 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-01-03 20:43:25 +00:00
FlavioJS
b465fb5f30 * Fixed get_val2 not using the stack, which automatically frees the data, causing memory leaks for string variables since r11976. (bugreport:723 , part of bugreport:714 and part of bugreport:708)
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11997 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-30 21:14:09 +00:00
FlavioJS
b6c11a8282 * Corrected description of scope and npc variables in script_commands.txt.
* Made temporary character string variables not have a limited length. (now all temporary string variables don't have limited length)
* Made temporary character variables reuse free positions.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11984 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-27 05:47:50 +00:00
ultramage
7906017662 Moved distance-related functions to path.c/h
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11981 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-26 17:18:57 +00:00
FlavioJS
214feac880 * Fixed string variables dereferencing directly to the value instead of dereferencing to a copy of the value. (fixes bugreport:684 bugreport:641)
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11976 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-26 00:55:27 +00:00
ultramage
1e6922174e Guardian hp handling code removal (see bugreport:342)
- removed guardian hp from the castle data structure, database, savefiles and various script functions (use upgrade_svn11914.sql)
- removed guardian hp calculation and manipulation from the castle manager npc, now the hp values are updated by the server itself (glitch: when castle defense changes, all guardians are healed to full)
- tweaked script function 'guardianinfo' to provide some data needed by the manager npc (currently available are hp, maxhp and visibility); also, it doesn't need a player attached to execute anymore
The whole thing is experimental, use at your own risk (seems to work though...)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11915 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-14 23:38:11 +00:00
FlavioJS
9bfc5b4425 * Fixed possible segmentation faults in the script engine.
- some strings that can be freed outside the script engine were being pushed into the stack as constant strings

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11901 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-13 21:42:38 +00:00
skotlex
9d353fba9b - Added query_logsql script command to perform sql commands using the log db connection.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11892 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-11 22:37:07 +00:00
FlavioJS
43ac1fd8ad ooops, two errors escaped... >.<
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11861 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-06 15:37:14 +00:00
FlavioJS
1d827807ae * Removed the attempts to recover from invalid syntax in npc_parsesrcfile since they can produce incorrect results (spaces in sscanf can match \n's and company).
* Made script_rid2sd report the script source directly and changed related return 1's to return 0's to avoid double script source reports.
* Added missing return 0's after script_rid2sd is used and an extra error message in buildin_set/buildin_setd.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11860 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-06 15:12:55 +00:00
skotlex
fc7b4eaef0 - The default event script behaviour is to trigger on labels rather than NPCs now.
- Removed several script config options which break NPC compatibility when you mess with them (event_script_type, event_requires_trigger, die_event_name, kill_pc_event_name, kill_mob_event_name, logout_event_name, login_event_name, loadmap_event_name, baselvup_event_name, joblvup_event_name)
- LoadMap events no longer set the variable "@maploaded$" to the name of the new map.
- Optimized/simplified the code now that the previous config options were removed.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11859 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-06 12:59:12 +00:00
ultramage
ea5212c5a8 * TXT/SQL login server code synchronization
- exported several core structures to login.h
- split off ladmin communication code from the TXT login server
- removed all occurences of login_log(); a unified function should be added when SQL's loginlog_db logging code gets synced with TXT
- removed conf setting login_log_filename
- fixed ladmin getting timeouts since the ping system was changed
- removed login/char server_fd[] arrays, added server[].fd instead

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11826 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-27 19:38:16 +00:00
skotlex
f98611b450 - Cleaned some more the sc_end check so it is more generic and not so limited just to infinite endure.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11821 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-27 10:08:22 +00:00
skotlex
9a56a88f4a - Corrected the online_data_cleanup routine setting offline characters that are still connected to the char-server.
- Added a check in script command sc_end to properly end infinte endure
- ASC_BREAKER no longer triggers status effect cards.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11817 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-27 09:21:18 +00:00
FlavioJS
83fb3336e7 * Fixed buildin_query_sql using Sql_Query instead of Sql_QueryStr, wrongly processing all %f,%d,... (fixes bureport:218)
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11809 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-26 18:14:06 +00:00
ultramage
128efc8d50 Fixed some old mistakes in npc shop code causing misinterpretation of the number of function parameters (bugreport:404)
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11788 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-23 02:25:50 +00:00
FlavioJS
69be534c6f * Moved the reset of references to after the empty script checks in parse_script. (fixes bugreport:222 and bugreport:449)
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11782 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-22 19:00:39 +00:00
FlavioJS
508ffb82d9 * Renamed fakenpcname to setnpcdisplay, fixed and extended it.
- See doc/script_commands.txt for information on how to use it

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11779 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-22 16:06:39 +00:00
skotlex
6840bb28ab - Moved subtype from struct block_list to struct npc_data.
- Fixed some compilation warnings.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11772 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-21 13:29:45 +00:00
ultramage
9ea5b9c76c * Replaced jA's way of allocating npc shop data with a simple dynamic array that gets allocated during loading and freed on unload
- automatically fixes bugreport:404, which would otherwise require manipulating the npcname_db (the original author didn't, hence the bug)
- now a supporting variable 'count' is used for tracking the length instead of an extra dummy entry at the end of the shop list
- partially removed the MAX_SHOPITEM restriction (if this was written properly, the system could support an unlimited amount of entries)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11753 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-18 10:36:09 +00:00
ultramage
42746f05f9 Fixed npc_debug_warps() not identifying x:0,y:0 as valid (random) coordinates
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11752 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-18 02:30:29 +00:00
ultramage
560005b13e Removed battle_config.error_log as console_silent already handles this
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11751 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-17 20:51:25 +00:00
ultramage
2d71189702 Added error reporting to buildin_warp when it fails.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11727 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-12 21:06:49 +00:00
ultramage
a5b2c3b30c Applied Rayce's improvements to the npc script parser (see bugreport:387 for details).
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11715 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-11 10:59:41 +00:00
ultramage
3b742b114e Fixed some more gcc incompatibilities...
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11706 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-10 13:59:23 +00:00
ultramage
5eda6c0e57 Replaced several 'int' variables with enums that they represent.
Expanded weapon_type enum with dual-wield constants (bugreport:384).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11704 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-09 22:42:56 +00:00
FlavioJS
9d2688ad87 * Changed EXIT_SUCCESS back to 0 in console.c to avoid an unnecessary include.
* 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://svn.code.sf.net/p/rathena/svn/trunk@11698 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-08 14:08:32 +00:00
ultramage
17eb2f7764 Added script function 'strnpcinfo', for increased npc awareness (originally from jAthena).
Updated script reference doc.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11650 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-03 22:07:47 +00:00
ultramage
9c9859a1c5 Fixed one wrong return value in buildin_getcharid (bugreport:33)
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11638 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-02 12:07:37 +00:00
ultramage
45cf77f464 Moved the BUILDIN_DEF() block to the end of script.c.
Removed the big list of BUILDIN_FUNC() declarations in script.c, as they are not needed anymore and no code utilizes them => file size-= 11 kB.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11637 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-02 11:42:36 +00:00
skotlex
fe0c93c77b - Fixed the pc_additem weight check breaking when your current weight is above your max.
- Some minor cleanups.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11621 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-10-31 00:42:56 +00:00
ultramage
fc9d14b1bd Command code cleaning (refer to topic:169759)
* separated the execution part of command code into interface part and internal part to better see which checks are done and when (fixes problem where 'nocommand' mapflag blocked server npcs)
 * moved the internal commands list (array) to the end of the file, this let me discard that long block of ACMD_FUNC() declarations
 * removed enum AtCommandType from command headers and commands array; its purpose was perhaps to identify aliased commands, but apparently it was never finished because the rest of the code doesn't use it (also doing aliases like this is not a very good idea)
 * internally, commands are now referenced to using their function name
 * removed the @/# symbols from the command lists; all lookup functions will now properly deal with strings with- and without a command symbol (commands interface still requires the symbol tho', so TODO for later)
 * removed several unneeded commands (*id2 code, dmalloc debug commands)
 * reverted atcommand config from alphabetically-sorted to how it was before (with additional fixes; see /conf changelog)
 * added missing code for #dropall / #storeall
 * added a warning when trying to set gm level of an undefined command

The structure of the commands table has changed, please adjust docs/guides to match the new format (sorry for the inconvenience).


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11607 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-10-29 09:16:39 +00:00
ultramage
2cb8a5838e * Fixed TXT charserver doing periodic random-sized memory allocation (bugreport:312)
* Set 'Create Converter's produce success rate to 100% (bugreport:302)
* Added check that verifies weapon/ammo/state requirements also when casting finishes (might have unwanted side-effects tho'!) (bugreport:228)
* Fixed Firewall knocking back undead/fire element mobs (bug in r11578)
* Added dummy 'openmail' to txt server to fix a script error message

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11585 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-10-27 11:59:35 +00:00
skotlex
480a4f0ac8 - added defines JOB_MAX_BASIC and JOB_MAX to mmo.h so the code can know which are the max valid classes.
- @/#jobchange no longer strip your equipment since pc_jobchange removes any unequippables already.
- removed the wasteful define MAX_PC_CLASS and replaced it by the CLASS_COUNT define (which is automatically updated using the previous JOB_MAX* defines) + pc_class2idx function (which converts high class IDs into values that fit in CLASS_COUNT)
- Made status_charge a function rather than a define to get rid of those warnings that have been there since forever.
- Merged the CELL_NOVENDING code (see topic #129209)
- Small check that disables the pet catching process if you try to use another item. 
- Added a check to fix a warning and prevent a crash in the npc duplicate check (even though I have no idea what this check is supposed to do, therefore I can't fix it properly other than to avoid the crash)


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11572 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-10-24 13:02:00 +00:00
zephyrus
c34325a53b - Added the new mail system. Requires optimization and tests.
- Updated the maildb sql structure.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11548 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-10-22 20:38:26 +00:00
ultramage
28dcdcdf9e * Fixed 'unequip' removing items in the wrong position (bugreport:252)
* Fixed #refine unequpping the caller's item by mistake (bugreport:265)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11534 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-10-21 02:18:15 +00:00
skotlex
a1becae58f - Added bonusautoscript and bonusautoscript2. These are used to attach a script to a player which gets executed on attack (or when attacked). Required for several of the more recent items.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11519 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-10-19 20:31:57 +00:00
ultramage
4cfb15d8bb Fixed numerous /W4 warnings (and created more :)
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11514 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-10-18 21:25:26 +00:00
ultramage
d2b9e2498e Some code cleaning...
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11505 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-10-18 08:04:53 +00:00