summaryrefslogtreecommitdiff
path: root/src/map/script.c
AgeCommit message (Collapse)AuthorFilesLines
2008-04-07* Made script command 'flagemblem' and guild_emblem_change send an update of ↵FlavioJS1-4/+23
the emblem_id to the players in the area. - known bug: ui components that are displaying the emblem at the time (emblem in flag npc and emblem over head in gvg maps) are not updated, but putting the mouse over the target shows the new emblem * Modified script command 'guardian': - returns the id of the guardian - if guardian index isn't supplied, it generates a temporary guardian * Implemented support for temporary guardians (not saved with castle). * Added missing includes from r12520. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12525 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-03-27Added proper script constants and documentation for the 'checkcell' command. ↵ultramage1-14/+18
(topic:183035) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12443 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-03-26Adjusted eAthena code to compile cleanly in C++ mode.ultramage1-56/+46
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12436 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-03-25Partially fixed the mess in status.c.ultramage1-6/+6
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12433 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-03-18- Added the official adoption method.zephyrus1-27/+0
( Parents need to create a party, invite a novice/first class, both equip the wedding rings and someone just right click the future baby ). - Fixed a bug sometimes client don't show job's bonus stats. - Removed the problematic adoption script. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12389 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-03-08- Auction System implementation completed.zephyrus1-0/+15
- As mail system, this will need a "mapflag" or something to only allow auctions on some maps. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12325 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-03-07- Added config settings mob_active_time and boss_active_time, what they do ↵skotlex1-3/+3
is specify a duration during which monsters will keep running their active AI after all players have left their vecinity. Their current defaults are set to 0 (disabled). - Script induced status changes can now be reduced by stats/cards (but only trigger rate is reduced, not duration) - Battle delay timers will now check if the target player has the invincible timer active or not. - Adjusted mob_ai_sub_hard to return a bool indicating whether the AI was executed or not. - Adjusted clif_damage and clif_skill_damage to set the endure type value based on dmotion and damage, rather than hardchecking for SC_ENDURE. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12315 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-03-04- Updated firepillar so it cannot be placed on top of others.skotlex1-1/+1
- Updated the firepillar code so it behaves like the other traps. - Changed the default format for @me and @main to avoid crashes on the newer clients. - Fixed the char-sql server so it returns a valid 'not found' packet when attempting to load a non-existing homunculus. - Fixed jump to use 0,0 for random coordinates rather than -1,-1 - Added missing \n to error reporting in getmonsterinfo - Additional status changes now only get triggered if the attack did damage, not if they get absorbed. - Fixed a logical comparison in unit_free to properly remove pets/homuncs when their intimacy is reduced to 0. - Properly set the opt3 value for Moonlight, Changeundead and Soul Link - Fixed the "no equip" flag of cards not being properly applied when attemting to equip items. - Added a check to avoid invoking pet menu entries when the pet is incuvated. - Fixed the session_data de-association in chrif_auth_delete - Cleaned chrif_auth_ok so that the latest received char info is kept when previous char login data was already in there. - Corrected docs mentioning non-existing flag 'mf_nopvp' git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12293 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-02-27Fixed 'cleararray' not able to erase array entry 127 (bugreport:864)ultramage1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12253 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-02-19* Forgotten update to the definition of script command 'input'.FlavioJS1-1/+1
* Enabled DEBUG_MEMMGR only in DEBUG mode. * Made autotrading characters be kicked instead of reporting double login. * Made create_session initialize session_data to NULL. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12218 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-02-15some compilation warning fixesultramage1-12/+6
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12206 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-02-11Getting rid of map_getallusers(), part 1ultramage1-123/+96
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12195 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-02-11* Expanded the script command 'input': (bugreport:811)FlavioJS1-14/+39
- two new optional arguments 'min' and 'max' - return value indicating if it's in the correct range - config variables for the default value of the arguments: 'input_min_value' and 'input_max_value' in script_athena.conf git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12192 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-02-08Fixed wrong message in item group loading code (bugreport:936)ultramage1-1/+1
Fixed 'charisalpha' not working for the first char (bugreport:940) Disabled signed/unsigned warnings for visual studio 2005 git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12186 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-02-04- Some code cleanups.zephyrus1-0/+62
- 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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12175 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-02-02Fixed npc reloading crash (bugreport:889)ultramage1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12166 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-01-30- Fixed a serious zeny exploid on scripts. Please update!!zephyrus1-0/+3
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12153 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-01-14Fixed card removal script functions' 'extra card' bug (bugreport:786)ultramage1-61/+60
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12075 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-01-14Removed the hardcoded limit for numeric npc input boxes (bugreport:811)ultramage1-6/+0
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12074 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-01-10- Fixed getmonsterinfo to return "null" when returning the name of a ↵skotlex1-1/+4
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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12051 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-01-09- corrected duration of sphere mines to be 30 secs regardless of skill levelskotlex1-1/+1
- 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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12036 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-01-08- Made the pc reg variables receive a const char* as the argument, since ↵skotlex1-2/+2
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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12033 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-01-06Cleaned up mob_once_spawn() and mob_once_spawn_area().ultramage1-27/+48
- 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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12022 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-01-06Modified showmsg code to not attach a timestamp to MSG_NONE-type messages, ↵ultramage1-51/+51
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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12020 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-01-04Modified the map_setcell() code to to use a boolean flag instead of needing ↵ultramage1-0/+28
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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12009 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-01-03Removed map_data's block_count, as (quote Yor/ja2160), "Perhaps useful for ↵ultramage1-10/+6
debug, but uses memory AND CPU for nothing." (block lists are linked lists, they don't need count tracking) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12001 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-30* Fixed get_val2 not using the stack, which automatically frees the data, ↵FlavioJS1-8/+17
causing memory leaks for string variables since r11976. (bugreport:723 , part of bugreport:714 and part of bugreport:708) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11997 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-27* Corrected description of scope and npc variables in script_commands.txt.FlavioJS1-5/+2
* 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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11984 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-26Moved distance-related functions to path.c/hultramage1-1/+2
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11981 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-26* Fixed string variables dereferencing directly to the value instead of ↵FlavioJS1-8/+17
dereferencing to a copy of the value. (fixes bugreport:684 bugreport:641) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11976 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-14Guardian hp handling code removal (see bugreport:342)ultramage1-45/+32
- 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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11915 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-13* Fixed possible segmentation faults in the script engine.FlavioJS1-19/+23
- some strings that can be freed outside the script engine were being pushed into the stack as constant strings git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11901 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-11- Added query_logsql script command to perform sql commands using the log db ↵skotlex1-12/+31
connection. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11892 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-06ooops, two errors escaped... >.<FlavioJS1-2/+2
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11861 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-06* Removed the attempts to recover from invalid syntax in npc_parsesrcfile ↵FlavioJS1-73/+233
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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11860 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-06- The default event script behaviour is to trigger on labels rather than ↵skotlex1-64/+13
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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11859 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-27* TXT/SQL login server code synchronizationultramage1-1/+1
- 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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11826 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-27- Cleaned some more the sc_end check so it is more generic and not so ↵skotlex1-13/+11
limited just to infinite endure. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11821 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-27- Corrected the online_data_cleanup routine setting offline characters that ↵skotlex1-0/+6
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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11817 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-26* Fixed buildin_query_sql using Sql_Query instead of Sql_QueryStr, wrongly ↵FlavioJS1-1/+1
processing all %f,%d,... (fixes bureport:218) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11809 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-23Fixed some old mistakes in npc shop code causing misinterpretation of the ↵ultramage1-4/+5
number of function parameters (bugreport:404) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11788 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-22* Moved the reset of references to after the empty script checks in ↵FlavioJS1-12/+15
parse_script. (fixes bugreport:222 and bugreport:449) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11782 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-22* Renamed fakenpcname to setnpcdisplay, fixed and extended it. FlavioJS1-12/+48
- See doc/script_commands.txt for information on how to use it git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11779 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-21- Moved subtype from struct block_list to struct npc_data.skotlex1-6/+6
- Fixed some compilation warnings. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11772 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-18* Replaced jA's way of allocating npc shop data with a simple dynamic array ↵ultramage1-88/+50
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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11753 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-18Fixed npc_debug_warps() not identifying x:0,y:0 as valid (random) coordinatesultramage1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11752 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-17Removed battle_config.error_log as console_silent already handles thisultramage1-24/+14
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11751 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-12Added error reporting to buildin_warp when it fails.ultramage1-12/+18
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11727 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-11Applied Rayce's improvements to the npc script parser (see bugreport:387 for ↵ultramage1-11/+15
details). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11715 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-10Fixed some more gcc incompatibilities...ultramage1-40/+0
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11706 54d463be-8e91-2dee-dedb-b68131a5f0ec