summaryrefslogtreecommitdiff
path: root/src/map/script.c
AgeCommit message (Collapse)AuthorFilesLines
2012-07-01Fixed bugreport:5984 rental items exploit which allowed a rental item from ↵shennetsind1-3/+0
never being deleted when used alongside storage has been fixed, blame on r14958 git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16361 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-06-29Implemented new item script bonuses:rud0lp201-0/+3
- bSkillCooldown,n,x; - bSkillFixedCast,n,x; - *bSkillVariableCast,n,x; - bFixedCastrate,x; - *bVariableCastrate,x; *Pending until RE Casting system is fully implemented. ATM bCastrate is used to manipulate variable cast time where it should not. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16355 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-06-21Added mercenary and elemental objects support for getmapxy.greenboxal21-0/+21
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16326 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-06-15Fixed bugreport:5740 var reference was not being restored to call ↵greenboxal21-3/+29
buildin_set on assignment statements. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16300 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-06-14Added support for new carts (requires packetver 20120201 or newer). ↵shennetsind1-1/+4
Super-Ultra-Plus thanks to Fatal Error and Judas. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16297 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-06-12Added new bonus as per kenpachi's request: bonus2 bUseSPrateSkill,n,x; // ↵shennetsind1-52/+51
Reduced increases/reduced the SP consumption of skilln by x%. (supports skill names) e.g. bonus2 bUseSPrateSkill,"AL_BLESSING",50; -> increases AL_BLESSING sp usage by 50% (e.g. if its 50 it goes to 75) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16273 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-06-12Improved bonus-adding processes by no longer having to add it to the zero'd ↵shennetsind1-13/+10
memset bullshit, replaced it by moving the first set of bonus into its own struct and simply zeroing the struct prior to recalc. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16272 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-06-08Follow up on r16240 update RK_CRUSHTRIKE formula and weapon break percentage.rud0lp201-3/+3
Fixed bugreport:5953 GC_CROSSRIPPERSLASHER range is now (8 + 1 * skill level) cells. Fixed bugreport:5943 SC_GROOMY is now really remove selected mounts. Updated Guillotine cross skills formula base on re-balancing formulas... git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16243 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-05-30Fixed bugreport:5873 sex changed shouldn't now make exploits regarding item ↵rud0lp201-0/+4
bonuses. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16167 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-05-29Fixed bugreport:5850 GN_HELLS_PLANT damage formula and behavior are now updated.rud0lp201-1/+1
Fixed bugreport:5848 RK_DRAGONTRAINING should now work normally. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16166 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-05-27Fixed bugreport:5821 GN_SLINGITEM item requirements(item throwables) should ↵rud0lp201-1/+1
now works normally. Fixed bugreport:5223 GN_BLOOD_SUCKER should now work like official behavior. Fixed part of bugreport:5674 Spiral Pierce is now in RE. Fixed setmadogear now it accepts optional parameter(0=unmount 1=mount). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16155 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-05-21Added new script command: instance_check_party <Party ↵rud0lp201-0/+59
ID>{,<amount>{,<min>{,<max>}}}; -Checks the Players Party if it meets the above set requirements. see script_commands.txt for more info. Thanks Masao git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16134 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-05-17- Added +11 and above refiner NPC.masao871-14/+53
- Added NPC to refine Oridecons / Eluniums to Cardium / Bradium. - Added downrefitem script command and updated script_commands.txt with it. - Updated refine_db.txt with probably custom values for +11 to +20 values. Source : http://ratemyserver.net/index.php?page=misc_table_refine - Some little script improvements to Suhnbi. (Enriched Elunium / Oridecon Upgrader.) * Further improvements for the refinement system and refinement NPC's will come within the next few days. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16126 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-05-16Fixed bugreport:5749 Amplify Magic Power should now work properly on ↵rud0lp201-1/+65
multi-hit magical skills. Fixed bugreport:5748 Masquerade-Groomy now removes Dragon and Warg. Fixed bugreport:5751 Implemented script command in checking/mounting Dragon, Warg and MADO Gear, also made a clean up regarding MADO Gear and Warg conditions. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16114 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-05-04Fix bugreport:5695 local scoped variables reference map not being freed ↵greenboxal21-8/+16
after return. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16079 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-05-03Regularized file not found error messages.xazax-hun1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16073 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-04-30- Amended the permanent NPC variable instance system to utilise the same ↵epoque111-4/+2
allocated DBMap** (follow-up to r16018) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16019 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-04-30- Fixed NPC instance variables not being passed through to callfunc; or ↵epoque111-4/+10
callsub; stacks properly (bugreport:5673) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16018 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-04-30- Removed copyarray; functionality when running set; or assigning variables ↵epoque111-2/+4
(bugreport:5675) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16017 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-04-29- Removed leftover TXT configs, follow-up to r15503.brianluau1-0/+3
- Edited more ***_config_read() functions to show a warning if "Unknown setting" is found. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16009 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-04-29reasonably-sized performance improvement: @reloadscript is about to 3 times ↵shennetsind1-3/+1
faster. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16004 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-04-29- Fixed a missing variable storage allocation resulting in NPC variables not ↵epoque111-1/+1
being saved (bugreport:5669) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16003 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-04-29- Fixed a map-server crash when script variable storage reference is NULL ↵epoque111-2/+8
(bugreport:5666) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16002 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-04-28- Fixed an issue with the instance variable storage system never being ↵epoque111-15/+12
initialised (since unknown revision) - Combined both string and integer instance variables into a single DBMap* structure - Fixed a missing new-line at the end of src/common/conf.h causing warnings git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15998 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-04-28- Updated the script engine to make use of the DBMap* structure for storing ↵epoque111-76/+59
variables (for Ind <3) - Fixed missing new-lines at the end of various files causing warnings git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15997 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-04-28- Updated the script engine to store references to important re-used methods ↵epoque111-53/+76
(set, callfunc, callsub, getelementofarray) - Updated the user-defined function invocation to reduce strdb_get() calls to find a matching function - Updated the direct variable assignment system to remove an unnecessary for loop while processing variable names - Updated the direct variable assignment system to support assigning an array to a variable directly (without the use of copyarray) - Note: copyarray; is still required to be defined in the source git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15994 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-04-27- Fixed typo for the -- operator (follow-up to r15982)epoque111-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15985 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-04-27- Added initial support for direct variable assignment (allows assigning ↵epoque111-4/+187
values to variables without the use of 'set') - Note: the set; function is still required to be defined in the source git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15982 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-04-26- Follow-up to r15979, updated parse_simpleexpr to parse direction function ↵epoque111-0/+12
invocation - Added SCRIPT_CALLFUNC_CHECK macro to disable direct callback if affecting performance git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15981 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-04-26- Added support for scripts to call user-defined functions without the use ↵epoque111-2/+15
of callfunc - Note: the callfunc; method is still required to be defined in the source git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15979 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-04-25Minor performance improvement on script function is_function -- replaced ↵shennetsind1-3/+3
strdb_get with strdb_exists since we don't use the data at all. Modified get_revision to return the revision number rather than it's string, when revision is not known by the server it now returns -1. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15969 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-04-25Removed pc_cant_newmount since it has been proved newer clients still ↵shennetsind1-3/+1
support them. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15966 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-04-22* Merged changes up to eAthena 15090.eathenabot1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15929 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-04-20Initial support for Genetic, Sorcerer and Elemental Summons. Special Thanks ↵shennetsind1-1/+1
to 3CeAM for the base. Notice this revision onwards requires you to update your char sql table and add the elemental sql table (check sql-files/upgrade_svn15885_log.sql) If you step by any bugs, let us know at http://rathena.org/board/tracker/ Thank you very much. ARRIBA ARRIBA. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15885 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-04-19- Added 22nd argument to 'getmonsterinfo' which returns the mvp_exp of a ↵brianluau1-1/+2
monster. - Changed 'checkvending' to return 2 if player is using @autotrade. - Follow up to r15871: used spaces so everything lines up (people might use different Tab Size in their text editors). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15872 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-04-15Let there be light! GREEN TREE ON ALL DISTROS, I CHOOSE YOU, NOW!shennetsind1-34/+34
All 64-bit warnings should be cleared by this revision. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15862 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-04-04More cleanups for old clients.protimus1-2/+0
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15830 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-04-02Fixed gcc warning on script.c, getnpcidshennetsind1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15823 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-04-02- Fixed grouprandomitem; always produced negative item IDs. (bugreport:5529)epoque111-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15822 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-03-31* Merged changes up to eAthena 15085.eathenabot1-7/+18
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15819 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-03-28Fixed bugreport:5497, LK/RG/PD/RG new mounts are now available again to ↵shennetsind1-1/+3
clients prior to november 2011, items with delayed consumption are no longer available to users in new mount state. Updated setoption to consider pc_cant_mount and remove OPTION_MOUNTING from the opt bundle git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15808 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-03-23* Merged changes up to eAthena 15083.eathenabot1-0/+20
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15773 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-03-20- Fixed Clown/Gypsy/Minstrel/Wanderer not receiving skill points upon change-sexepoque111-0/+1
- Fixed missing casts from void* to struct online_char_data* in char.c git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15735 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-03-19 - Script label db now utilizes `DBMap`'s ability to store integer-type data ↵gepard19841-6/+6
(follow-up to r15682). - Some minor code cleanups. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15734 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-03-19Refine DB updatelordttseven1-1/+1
* DB courtesy of Kenpachi * added support for different stats per refine level for renewal * cleaned up the corresponding code a little * REMODE now displays the atk values on the client correctly git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15730 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-03-13Enhanced `DBMap` implementation to allow storing integer type data in ↵gepard19841-3/+7
addition to void pointers. - Added enum for data: `int`, `unsigned int` and `void*` - Replaced generic `void*` data with `DBData` struct to hold `int`, `unsigned int` or `void*` (member of `DBNode`) - Added `db_i2data`, `db_ui2data` and `db_ptr2data` functions to cast from `int`/`uint`/`void*` to `DBData` (used in `DBMap::put()`) - Added `db_data2i`, `db_data2ui` and `db_data2ptr` functions to get `int`/`uint`/`void*` from `DBData` - Enabled statistics for new functions in `db_stats` struct - `DBCreateData` functions (used in `DBMap::ensure()`) now return `DBData` instead of `void*` - `DBApply` functions (used in `DBMap::foreach()` and `DBMap::destroy()`) now take `DBData*` as a parameter instead of `void*` - `DBMatcher` functions (used in `DBMap::getall()`) now take `DBData` as a parameter instead of `void*` - `DBReleaser` functions now take `DBData` as parameter instead of `void*` - Default releasers release data if it is `void*` (`DB_DATA_PTR`) type - `DBIterator` functions: `first()`, `last()`, `next()` and `prev()` now return `DBData*` instead of `void*` - `DBIterator::remove()` now returns `int` (1 if node was found and removed, 0 otherwise) instead of `void*` and takes an extra `DBData*` parameter for the data of removed entry - `DBMap::get()` and `DBMap::ensure()` now return `DBData*` instead of `void*` - `DBMap::remove()` and `DBMap::put()` now return `int` (1 if node already existed, 0 otherwise) instead of `void*` and take an extra `DBData*` parameter for the data of removed entry - `DBMap::put()` now takes `DBData` as parameter instead of `void*` - `DBMap::getall()` now puts data into `DBData**` buffer instead of `void**` buffer - Updated macros: - (`i`/`ui`/`str`)`db_get` and (`i`/`ui`/`str`)`db_ensure` were wrapped with `db_data2ptr` to extract data from `DBData*` that is now returned by `DBMap::get()` - added (`i`/`ui`/`str`)`db_iget` and (`i`/`ui`/`str`)`db_uiget` that get `DBData` from `DBMap` and extract `int`/`unsigned int` from it (with `db_data2i`/`db_data2ui`) - `db_put`, `idb_put`, `uidb_put` and `strdb_put` data params were wrapped with `db_ptr2data` to match new signature of `DBMap::put()` (`DBData` instead of `void*`) - added (`i`/`ui`/`str`)`db_iput` and (`i`/`ui`/`str`)`db_uiput` that put `int`/`unsigned int` into `DBMap` (first wrapping it with `DBData`) - added `NULL` in place of extra parameter for removed data in `db_remove` macros - `dbi_first`, `dbi_last`, `dbi_next` and `dbi_prev` were wrapped with `db_data2ptr` to extract data from `DBData*` that is now returned by these `DBIterator` functions - Updated `DBMap` documentation, and fixed a dozen of typos in it. - Updated rest of rA code to reflect `DBMap` changes (mostly required signature changes of `DBCreateData` and `DBApply` functions). - Fixed a bug where `DBMap::put()` would return data of a deleted entry. - Removed some unnecessary pointer casts. - Increased `showmsg.c` static buffer size to fit entire DBMap stats report. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15682 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-03-05- Guild Castle code cleanup:gepard19841-30/+8
- all changes to guild castle data are now handled first by map-server and only sent to char-server for saving - ensured that changes made to guild castle during char-server disconnection time will be resent on reconnect - actually removed definition of `MAX_GUILDCASTLE` (r15657) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15658 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-03-04- Guild Castle code cleanup:gepard19841-72/+66
- removed `MAX_GUILDCASTLE` limit - char-server now caches guild castles in `DBMap` - improved guild castle SQL queries to support non-default values of `MAX_GUARDIANS` - disallowed declaring guild castles on maps that are on other map-servers - map-server now requests data for all guild castles from char-server on initial connect (bugreport:287) - removed ''guildcastleinfo events'' as they were esentially duplicated ''OnAgitInit'' - optimized castle data load packets (bugreport:287) - updated WoE scripts to reflect source changes (scripts no longer need or should request castle or guild data) - updated related docs - Added `db_size` macro. - Replaced manual counting of castles occupied by a guild with `guild_checkcastles()` calls. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15657 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-03-03* fixed getiteminfo offset being off by one in REMODE (bugreport:5378)lordttseven1-0/+2
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15652 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-03-02Replaced some magic numbers related to castle guardians with `MAX_GUARDIANS`.gepard19841-21/+11
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15650 54d463be-8e91-2dee-dedb-b68131a5f0ec