1305 Commits

Author SHA1 Message Date
lighta
46d417a458 merge master into cppcheck 2015-10-30 02:48:40 -04:00
Cydh Ramdh
de40271000 * Follow up 2cee5b6ff1bf53c4ae53bc1278b09ae84b8a0a76: gethominfo, getpetinfo, and getmercinfo for type 0 were correct 'to get ID' from database/their unique ID, not as GID.
* Added type for `gethominfo`, `getpetinfo`, and `getmercinfo` to return GID.
* Added `geteleminfo`, to retrieve Elemental ID and GID. The otherinfo can be gained from `getunitdata`

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2015-10-14 10:27:31 +07:00
Cydh Ramdh
857b82d6ee Fixed #635, thank @julia40124009.
Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2015-10-11 20:50:45 +07:00
Cydh Ramdh
927d1e2f5c * Fixed #629. Thank @anacondaqq and @theultramage
* Added optional param `char_id` for `instance_enter`.

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2015-10-10 19:04:15 +07:00
aleos89
cef2f9ea63 Bug Fixes
* Fixes #629 - Removed an extra costume check during action requests.
* Fixes #632 - Fixed long broadcast messages getting truncated.
* Fixes #635 - Fixed Elementals getting removed twice from a map during map_quit().
* Fixes #639 - Adjusted two checks from status_get_sc_def() so that tick_def2 is properly adjusted when pc_sc_def_rate is adjusted in battle config.
* Fixes #645 - Fixed atcommand 'iteminfo' displaying items not dropping from any monsters when battle flag 'mobinfo_type' is active.
* Fixes #652 - Don't call clif_scriptclose() on script command 'close' and script command 'end' when an NPC shop is active.
* Fixes #670 - Resolved a possible map crash when using the Lux Anima Runestone.
2015-10-09 18:22:35 -04:00
Cydh Ramdh
c9c988abba * Fixed #654, TF_BACKSLIDE failed if player has 'no knock back' bonus.
* Clean up on buildin scripts, to use constant in return value.

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2015-10-03 22:29:46 +07:00
Lemongrass3110
a760e01c59 Follow up to 78b6c15
Fixed a possible buffer overflow in mapindex.c
2015-10-02 20:31:07 +02:00
Lemongrass3110
78b6c150d2 Added usage of enum values in script.c in some places. 2015-10-02 15:09:01 +02:00
Cydh Ramdh
e112fc1c50 Fixed #647. Fail to get parameter value from readparam if the parameter given is constant as param-type value. So for an example, readparam(BaseLevel) will be fine now, the result same as like BaseLevel itself.
Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2015-09-27 21:44:54 +07:00
Cydh Ramdh
230811c8ab Bug fixes:
* Fixed #651, now quest_db is separated between Renewal and Pre-Renewal to avoid non-existent monster/item (current missing monster/items are removed on Pre-Renewal). Thank @lordganja.
* Fixed #622, cast warning in script.c::get_val2. Thank @Litro .

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2015-09-24 07:41:02 +07:00
Cydh Ramdh
631747bb07 * Fixed memleak when use @set command for string type variable.
* Removed `0x2715` and `logchrif_parse_updmail`, not being used that was duplicated by `logchrif_parse_reqchangemail` (`0x2722`).
* Changed packet header `0x2736` to `0x2b13` of `chrif_update_ip` from map-server to char-server. That was ambiguous with `0x2736` of `logchrif_parse_updcharip` that being used by char-server to login-server.
* Changed packet header `0x3804` to `0x2726`, the one that being used to send back global account reg from login-server to char-server. That was ambiguous with `0x3804` that being used by char-server (was inter actually) to map-server.
* Some indent clean up as result from char & login server refactor.

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2015-09-14 20:17:12 +07:00
Cydh Ramdh
31505d1423 * Fixed #607:
* Added array variable option in 3rd param of `getguildmember` and `getpartymember`, so the script will returns the result in reserved array instead using temporary global variable.
  * Also, the script returns the member found directly.

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2015-09-04 00:32:38 +07:00
aleos89
ebaefc1476 Bug Fix
* Fixes #615 - Fixed script command 'query_sql' not returning any results.
2015-09-02 10:32:00 -04:00
Aleos
6295c77d39 Merge pull request #457 from rathena/feature/script_engine_upgrade
Script Engine Upgrade
* More information here: https://rathena.org/board/topic/102946-script-engine-upgrade/
2015-08-31 14:26:15 -04:00
aleos89
b8f6e16f9d Follow up to 9738c82
* Fixed some more memory leaks.
* Added a few checks that were left out/removed by mistake.
2015-08-25 13:23:23 -04:00
aleos89
9738c825cc Follow up to f53916e
* Fixed remaining memory leak.
* Cleaned up and optimized a few more ERS allocations.
2015-08-25 10:31:38 -04:00
aleos89
f53916e060 Script Engine Fixes
* Cleaned up db_vdestroy errors at server shutdown.
* Expanded the ERS system. Thanks to Hercules.
* Added ERS to the database trees to speed up iterator memory allocation. Thanks to Hercules.
2015-08-21 15:16:52 -04:00
aleos89
d95f5d2db7 Bug Fixes
* Fixes #447 - Added script command 'unitblockmove' to be used with OnTouch and Unit Commands.
* Fixes #448 - Leech End will no longer get a player stuck in stand/sit modes.
* Fixes #503 - Added script command 'ignoretimeout' which disables the SECURE_NPCTIMEOUT of a specific script.
* Fixes #521 - Pre-renewal Shield Chain should always be Neutral damage.
* Fixes #532 - Fixed an issue with the 'item_check' config not saving the unique ID when enabled.
* Fixes #537 - Arms Cannon is now a single unit target skill.
* Fixes #541 - Cleaned up Ignition Break damage formula.
* Fixes #543 and Fixes #552 - Cleaned up Reverberation to match official. Now splits damage among targets.
* Fixes #546 - Updated Randomize Spell to the latest official skill list and rates.
* Fixes #547 - Escape is now a self skill and can use normal Traps if no Alloy Traps are available.
* Fixes #551 - Great Echo and Sound of Destruction can now blocked by Pneuma.
* Fixes #556 - Adjusted Arrullo, Deep Sleep Lullaby, Netherworld, and Voice of Siren duration formulas to properly account base/job levels.
* Fixes #561 - Pre-renewal Tiger Cannon now properly removes HP when casting skill.
* Fixes #576 - Shield Spell, Exceed Break, Overbrand, Moon Slasher, Piety, Earth Drive, and Hesperuslit no longer have fixed cast time.
* Cleaned up Shadow Formation SP Drain formula to be 11-skill_lv per second.
* Sound of Destruction is now a placement skill type.
* Updated variable cast time for Windmill Rush from 2 seconds to 1 second.
2015-08-17 14:13:22 -04:00
icxbb-xx
88cfff01e6 Follow up to 58c2b77
* Fixed #484,Client Crashing 2014-10-22, thank you @gengstergile, @limitro
* small fix script command
2015-08-12 22:24:25 +07:00
Cydh Ramdh
c0e4b06005 Implemented 'Broadcast Obtain Special Item'
* Added flag &16 to add manually special item that will be broadcasted if: Dropped by monster -> player pick it up. Added items with this flag:
  * Gold_Key77 (7782)
  * Silver_Key77 (7783)
* Be used also to broadcast item in package/group with flag 'isAnnounced', replaced intif_broadcast().
* The message is using msgstringtable.txt on client side, make sure your translation is not messy.
* Credits:
  * fcba8a2161
  * 2761bb0af9

* Misc updates: Fixed job and class for items:
  * Sealed_Gloom_Under_Night_Gachapon (14696)
  * Sealed_General_Egnigem_Cenia_Scroll (14739)
  * Sealed_Vesper_Scroll (14740)
  * Midgard_Celebration_Lucky_Egg (14741)
  * Hero_Midgard_Egg (14753)
  * Safe_To_Smelting_Scroll (14758)
  * Limited_Edition_JOB_Battle_Manual (14765)
  * Rise_Midgard_Lucky_Egg (17494)
  * Lucky_Silvervine_Fruit_Box_III10 (17495)
  * Lucky_Silvervine_Fruit_Box_III110 (17496)
  * Epic_Heroes_Scroll (17519)
  * Majestic_Lucky_Egg (17526)

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2015-08-12 00:43:04 +07:00
Cydh Ramdh
e1b658e462 * Item GUID Updates:
* Removed `ENABLE_ITEM_GUID` from src/config/core.h, after long time introduction it's worth to be enabled by default. Just remove all items with GUID flag if want to remove it generates GUID .
  * Implemented client interface to merge the items. Packet struct credits: 856b6f1feb
  * Edited `mergeitem` script command to use the interface, moved the 'old' `mergeitem` to `mergeitem2`.
  * Fixed the behavior to add GUID'd item to inventory in Cash Shop.
  * Updated item_flag.txt for listing `IT_CASH` items (item type 18).
  * NOTE: `IT_CASH` items which defined in item_flag.txt with flag `4`, cannot be merged.
  * NOTE: Please check the packets for older clients. Tested work on 2012-04-10, 2013-08-07 and 2014-10-22.
  * NOTE: Please import 'upgrade_20150804.sql' for MySQL Log Database.
* Removed duplicate clif functions:
  * `clif_msgtable()` -> `clif_msg()`
  * `clif_msgtable_num()` -> `clif_msg_value()`
* Item DB Updates:
  * Indonesia_Box2 (17079) should gives 5x Wing_Of_Butterfly (602).
  * Changed some item types to 18.

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2015-08-04 20:57:49 +07:00
Cydh Ramdh
64cb02e5f1 * Introducing Item Reuse Limit Group
* By expanding current item_delay.txt's function to implement official item reuse limit.
  * There's the 3rd optional column, put SC ID value to add reuse limit. The reuse delay will be acknowledged as status change. Ignoring this column will use 'normal' item delay.
  * Added some items to their reuse limit group.
* Item DB Updates
  * Added effect for ASPD_Potion (12684).
  * Added effect and delay for Para_Team_Mark_ (22508).

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2015-08-03 20:48:35 +07:00
aleos89
ae6b8f2613 Merge branch 'master' of https://github.com/rathena/rathena 2015-07-22 17:47:05 -04:00
aleos89
51f6465709 Bug Fixes
* Fixes #479 - Fixed the unique item ID system not giving new items their unique ID. Blame 7295bdc.
* Fixes #488 - Fixed Water Barrier, Zephyr, and Power of Gaia not being applied to targets walking into the area of effect.
* Fixes #500 - Cursed Circle will now properly release targets if the caster moves out of AREA_SIZE.
* Fixes #501 - Reverberation can be placed an unlimited amount of times. The magic part now only deals neutral damage.
* Fixes #506 - Magnetic Field will now affect others in PvP maps, except for the caster. Thanks to @exneval.
* Fixes #527 - The Roulette item database will not be loaded at all if the feature is disabled.
* Fixed a small typo for 'unitwalk' and 'unitwalkto' script commands.
2015-07-22 17:46:38 -04:00
Heler
9d47aa4ad9 Fixed warnings 2015-07-16 19:46:20 +03:00
Cydh Ramdh
a5b85c925c Merge pull request #482 from anubisK/Wroom_utils
Waiting room utils:
* waitingroomkick
* getwaitingroomusers
2015-07-06 12:11:15 +07:00
aleos89
35cd68873b Merged with master 2015-06-26 10:36:40 -04:00
Cydh Ramdh
25dbd6eba4 Bug Fixes:
* Fixed #439, Sightrasher doesn't check target's status. Thank @reigneil.
* Fixed #476, Genetic Change Material ignored the created item if stackable or not. Thank @juanfus.
* Fixed compile warnings, unused `num` in getunitdata().
* Fixed wrong return value in BUILDIN_FUNC(questinfo).

Item Updates:
* Added items: C_Flying_Ljosalfar (20099), Protect_Feathers (19024), Sograt_Lucky_Scroll (17598).
* Corrected view_id for C_Coiledup_Snake (20110).
* Follow up 3f549cafb5570a67c046c5078cddbe3a95b772dc, wrong bonuses and revert 18575. Thank @zackdreaver.

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2015-06-24 22:12:45 +07:00
cristian gonzalez
bae01b5c42 Waiting room utils:
* waitingroomkick "<NPC object name>" , "<character name>"; Kicks one player, there was just a method for several players
    * getwaitingroomusers "<NPC object name>"; get the mumber of players inside a waitingroom and the rids.
2015-06-23 02:23:03 +02:00
aleos89
44d8bd81f5 Follow up to 3d9c6e7
* Changed an argument requirement for clif_colormes().
2015-06-19 20:36:49 -04:00
aleos89
9a78bbdb29 Compile Warning Cleanup
* Fixes a few issues from 3d9c6e7 and b6212a6.
* Cleaned up some miscellaneous warnings.
2015-06-19 15:08:53 -04:00
aleos89
3d9c6e7763 2014 Client Support
* Implemented the Roulette Game feature.
* Implemented per-character sex change feature.
* More info: https://rathena.org/board/topic/102247-2014-client-support/
- Special thanks to HerculesWS/Hercules@239d480 for the base.
2015-06-19 14:07:34 -04:00
Cydh Ramdh
6ad4ed13d1 * Added script command showscript "<message>"{,<GID>}; by using clif_showscript.
* Removed hardcoded message that displayed clif_showscript for `transform` script, replaced its usage for item script by using `showscript`.
* Changed unittalk usage on `F_Cat_Hard_Biscuit` and `F_Rice_Weevil_Bug` function in quests_malangdo.txt.

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2015-06-19 00:37:48 +07:00
Cydh Ramdh
b71ed05857 Bug Fixes
* Now coma triggered on every attack types (bugreport:3100)
  * Added bonuses `bonus2 bComaRace,r,n;` and `bonus2 bComaClass,c,n;`, replacing the current usages of `bWeaponComaRace` and `bWeaponComaClass`.
  * This bonus has no effect for GVG and BG monsters.
* Fixed Shockwave Trap (HT_SHOCKWAVE) SP reduction, should be % of MaxSP not % of 'current' SP.
* Fixed #462, failure in `setunitdata` for NPC. Thank a91323, @julia40124009
* Fixed #470, changed SO_ARRULLO target to BL_CHAR.
* Added skill flag INF2_HIT_TRAP (0x40000) to removed hardcoded 'skill that can hit traps'.
  * NOTE: Client-side's factor also determines that skill can be targeted to trap-type skill or not.

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2015-06-17 00:33:08 +07:00
aleos89
0696125b82 Script Engine Upgrade
* Upgraded the script engine variables to no longer be limited.
* Increased array limit from 127 to 2 billion.
* Improvement in overall speed and storage size.
* All variable types now support arrays.
- Merge from HerculesWS/Hercules@82b583b. Thanks to those who worked on it.
2015-06-11 10:44:13 -04:00
aleos89
6aa16a766c Follow up to 730311e
* Fixed some compile warnings.
2015-06-09 12:56:07 -04:00
aleos89
730311e009 Script Command Adjustments and Additions
* Fixes #158 - Implemented 'getvar' script command to avoid blindly attaching players and messing up their NPC progress.
* Fixes #449 - Fixed 'unitskilluseid' and 'unitskillusepos' not casting skills that require stat info when the NPC's status wasn't loaded.
* Implemented 'getunittype' script command to return the object type of the given GID.
* Adjusted 'unitwalk' to support an Event Label which is executed when the object reaches the target.
* Added 'unitwalkto' when giving a target GID rather than coordinates. Also supports Event Labels.
- Thanks to @cydh.
2015-06-09 11:10:05 -04:00
Cydh Ramdh
549f491fe6 Item Bonus Updates
* Added `bonus2 bSubSkill,sk,n;` -> Reduces n% damage received from skill sk.
* Added `bonus bHPGainAttack,n;` -> Heals +n HP with a normal attack.
* Added `bonus bSPGainAttack,n;` -> Heals +n SP with a normal attack.
* Added `bonus bHPGainAttackRate,n;` -> Heals +n% HP of inflicted damage on every hit when attacking an enemy.
* Added `bonus bSPGainAttackRate,n;` -> Heals +n% SP of inflicted damage on every hit when attacking an enemy.
* Added `bonus2 bHPGainAttackRate,n,x;` -> Has chance x/10% to heals +n% HP of inflicted damage on every hit when attacking an enemy.
* Added `bonus2 bSPGainAttackRate,n,x;` -> Has chance x/10% to heals +n% SP of inflicted damage on every hit when attacking an enemy.
* Replaced `bonus2 bHPDrainValue,n,x;` for x = 0 to `bonus bHPGainAttack,n;`. Since x = 1 is same as `bonus bHPDrainValue,n;` and if there are items with bonus with 'x' is different, the value will be sum'd but the type switched.
* Replaced `bonus2 bSPDrainValue,n,x;` for x = 0 to `bonus bSPGainAttack,n;`. Since x = 1 is same as `bonus bSPDrainValue,n;` and if there are items with bonus with 'x' is different, the value will be sum'd but the type switched.
* Replaced `bonus3 bSPDrainRate,n,x,y;` for y = 0 to `bonus2 bSPGainAttackRate,n,x;`. Since y = 1 is same as `bonus2 bSPDrainRate,x,n;` and if there are items with bonus with 'x' is different, the value will be sum'd but the type switched.
* Updated the documentations.

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2015-06-07 19:00:24 +07:00
Lemongrass3110
a674869113 Fixed a lot of scanf issues reported by rathena's cppcheck 2015-05-13 14:47:07 -04:00
Cydh Ramdh
9b1c138af0 Fixed #397 as follow up 823bc539. Thank @LyndisRain
Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2015-04-16 15:44:43 +07:00
Cydh Ramdh
177ea6c779 Follow ups & fix
* Follow up df2f850c, correcting `class_idx` usage that should be compared with `enum e_job` in `pc_calc_basesp` and also in `pc_calc_basehp`
* Follow up 308c4779, fixed typo fix
* Makes `instance_id()` doesn't show debug message when it return 0 for instance id

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2015-04-15 20:03:06 +07:00
Cydh Ramdh
27ba6c5002 * Fixed #387
* Replacing 'rand()' leftwover with 'rnd()' of mt19937ar
* Cleaned up script commands related with item group: 'groupranditem', 'getrandgroupitem', 'getgroupitem'
* Corrected item scripts that are using 'getrandgroupitem'
* Updated script command and item group doc

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2015-04-09 20:54:01 +07:00
Cydh Ramdh
1c3c4955cb Follow up 823bc5397ba2fd96d042f53b37c7a6d78157e723, thank @cawogeek
Signed-off-by: Cydh Ramdh <cydh@pservero.com>
2015-04-06 10:48:43 +07:00
Cydh Ramdh
ef5fe8e4f1 Added optional param for 'char_id' in some script commands
Signed-off-by: Cydh Ramdh <house.bad@gmail.com>
2015-04-03 17:27:15 +07:00
Cydh Ramdh
1ab08b8f10 Another follow up 5f21afb2555d73bba219fd9fdb1d117c0e1950b1 (again)
Signed-off-by: Cydh Ramdh <house.bad@gmail.com>
2015-04-02 15:54:51 +07:00
Cydh Ramdh
0f137f3c67 Added command 'getattachedrid()' as discussion result with @aleos89
Signed-off-by: Cydh Ramdh <house.bad@gmail.com>
2015-04-01 22:37:14 +07:00
Cydh Ramdh
c7062e5e7d Added status change (SC) documentation as merge #238. Thank @nanakiwurtz
Signed-off-by: Cydh Ramdh <house.bad@gmail.com>
2015-03-31 17:52:25 +07:00
Cydh Ramdh
f41a63fd0c Changed macro & script_*2sd logic
Signed-off-by: Cydh Ramdh <house.bad@gmail.com>
2015-03-30 12:50:25 +07:00
Cydh Ramdh
cbdc01271d NPC Shop fixes:
* Follow up 40c63f40: Fixed #368, warning fixes
* Fixed `pointshop` failed to get temporary player's variable (`@`) as currency.

Signed-off-by: Cydh Ramdh <house.bad@gmail.com>
2015-03-29 20:55:12 +07:00
Cydh Ramdh
7d929a06a3 NPC Market Shop support
* New shop script definition: `<map name>,<x>,<y>,<facing>%TAB%marketshop%TAB%<NPC Name>%TAB%<sprite id>,<itemid>:<price>:<quantity>{,<itemid>:<price>:<quantity>...}`
* Added script command to update shop NPC: 'npcshopupdate "<name>",<itemid>,<price>{,<stock>}'
* Added NPCMarketDB (DBMap) for market data persistance method.
* Added `market_table` definition for market table in conf/inter_athena.conf.
* Thank to @aleos89, @Lemongrass, @icxbb-xx, merged HerculesWS/Hercules@cf19b26.

NOTES:
* Minimum client needed 2013-12-23 (but this client has bugs there-and-there).
* There's new table, see `upgrade_20150327.sql`.
* Market shop doesn't support discount.
* Added items by script `npcshopitem` or `npchopadditem` will be assumed as persistance items, will be loaded on next script reload or server start even market_shop NPC does't list them (unless NPC is not exists, entries will be removed).

Signed-off-by: Cydh Ramdh <house.bad@gmail.com>
2015-03-27 21:11:07 +07:00