312 Commits

Author SHA1 Message Date
Lemongrass3110
da8229b8f5
Added some suggested code improvements (#8331)
Fixes #8309

Thanks to @mrpond
2024-05-13 17:46:47 +02:00
Jittapan Pluemsumran
d445497870
Converted a bunch of packets to structs (#8295)
Co-authored-by: Lemongrass3110 <lemongrass@kstp.at>
2024-05-09 23:06:32 +02:00
Lemongrass3110
b48948822a
Replaced NULL with nullptr (#8298) 2024-05-03 19:38:13 +02:00
Lemongrass3110
827517f8cf
Cleaned up a few TODOs from #7963 (#8254) 2024-05-02 22:44:31 +02:00
Lemongrass3110
cb42dceb87
Switched most C headers to C++ (#8225) 2024-04-07 22:14:51 +02:00
Atemo
a768af85ee
Updated geteleminfo script command (#8168)
* Updated geteleminfo script command
* Added a new <type> "2" that returns the class ID of the elemental spirit
* Fixed Dimensions Elemental* combos: item descriptions require high elemental spirit check
* Added new constants for geteleminfo

Thanks to @aleos89 @Badarosk0 !
2024-03-14 14:08:45 +01:00
Pokye
eb308dcad2
Implemented Dialog Types (#8110)
Fixes #8109

Co-authored-by: Aleos <aleos89@users.noreply.github.com>
Co-authored-by: Lemongrass3110 <lemongrass@kstp.at>
2024-02-26 22:08:52 +01:00
Lemongrass3110
d3fcb66d3a
Fixed some memleaks (#8107)
Improved memleak location reporting for parse_script
2024-01-17 18:58:13 +01:00
Vincent Stumpf
61c2480d89
Add explicit [[fallthrough]] attributes (#8054)
Fixes #7918
2023-12-29 01:08:24 +01:00
Vincent Stumpf
8336f046b7
Allow default sell values in npc shop scripts (#8050)
Fixes #6594
2023-12-27 22:16:04 +01:00
Vincent Stumpf
f2a3bad3e2
Cleanup uses of SWAP macro (#8051) 2023-12-27 11:36:46 +01:00
Lemongrass3110
cd0c44af60
Refactored script command rand (#8040)
Fixes #8041

Added support for int64, so the range of the random numbers that can be generated is much wider now.

Changed the logic to be more restrictive:
	(1) The range version is intended for positive numbers only.
	(2) If minimum and maximum are equal and no random value can be calculated.
Triggering the more restrictive behavior will trigger the script source (file) to be reported in the map-server.

Co-authored-by: Atemo <Atemo@users.noreply.github.com>
2023-12-26 23:52:37 +01:00
Lemon
7c153416bc
Improved randomness (part 1) (#7882)
Faster and with no module bias

Removed rnd_init, rnd_uint32 and rnd_uniform
From now on we will only use rnd_value(min, max) for values in range [min, max] and rnd_chance(chance, base) for chances

Fixes #7881
Fixes #7883
Fixes #7884
Fixes #7885

Co-authored-by: Lemongrass3110 <lemongrass@kstp.at>
2023-12-20 00:12:15 +01:00
HAO YAN
7ee7a25887
Add autoloot script command (#8032) 2023-12-14 15:39:57 +01:00
HAO YAN
7db67c6207
Battleground and clan support for addrid (#7969) 2023-12-11 08:47:00 +01:00
HAO YAN
461294f423
Add channel_join script command (#7970) 2023-12-11 08:43:56 +01:00
Atemo
c23afaeac0
Implemented script command opentips (#8005)
- Opens the tip box UI for the attached player or the given character ID.
2023-11-13 19:15:40 +01:00
HAO YAN
a1616903a6
Add has_autoloot script command (#7972)
* Adds the has_autoloot script command to check if a player is autolooting items.
2023-11-06 12:30:34 -05:00
Harvin
0e9ae33f64
Fix mailing special card (#7950)
Fixes #7947

Co-authored-by: Lemongrass3110 <lemongrass@kstp.at>
2023-10-05 09:12:09 +02:00
Atemo
8196149b2b
Additional check in script_instancegetid (#7929) 2023-09-15 17:36:50 +02:00
Singe Horizontal
af602d5535
Call script_hasdata before script_getnum in addrid (#7876)
* Fixes #7875.
* Calling script_hasdata before script_getnum in addrid
Co-authored-by: Aleos <aleos89@users.noreply.github.com>
2023-08-04 12:02:35 -04:00
Vincent Stumpf
833966f47b
Convert guild_db to unordered_map (#7612)
* Refactor guild db to STL container

* Split up struct guild and MapGuild/CharGuild
2023-06-16 19:42:55 -07:00
Vincent Stumpf
08a1c41d1b
Refactor MapFlag accessors (#7783)
Use methods instead of direct member access.
2023-06-03 17:38:29 -07:00
Atemo
b4b69a2cc1
Fixed an issue where mobs instantly walked after being spotted (#7738)
* Fixed an issue where mobs instantly walked after being spotted
  MIN_RANDOMWALKTIME was initialized too early
* This behavior is only applied on the monster script command
2023-05-12 00:34:36 +02:00
Singe Horizontal
b4be3b059a
Prevent an uint underflow and reformat array_size occurences in some commands (#7729)
Fixes #7728
2023-04-22 19:42:13 -07:00
Lemongrass3110
18ec884ba8 Removed a duplicate function call in erasequest
Thanks to @Pokye
2023-04-12 22:33:21 +02:00
Everade
7853e926c2
Episode 17.2 - Sage's Legacy (#6799)
* Episode 17.2 Initial Release of instances and quests
* Added warp portals and monster spawn scripts
* Added Episode 17.2 related database entries

Closed #6470 

Thanks to @Megelith @Pokye 

Co-authored-by: JohnnyPlayy <JohnnyPlayy@users.noreply.github.com>
Co-authored-by: Everade <privacy@gatheringro.com>
Co-authored-by: crazyarashi <26841779+crazy-arashi@users.noreply.github.com>
Co-authored-by: Atemo <capucrath@gmail.com>
2023-04-12 21:27:34 +02:00
Atemo
0413d0e85c
Initial release of Illusion of Luanda (#7559)
* Implemented the main quest, daily quests and exchange npcs related to Illusion of Luanda.
Fixed #6462 

Co-authored-by: Aleos <aleos89@users.noreply.github.com>
2023-04-12 18:38:26 +02:00
Atemo
db5874d677
Updated unitskilluseid and unitskillusepos script commands (#7684)
* Added the parameter 'ignore_range' to ignore the skill range defined in skill_db.yml
2023-04-07 01:09:44 +02:00
Vincent Stumpf
f0e374ea23
Fixes getrefine failing in OnEquip/OnUnequip scripts (#7592) 2023-03-20 10:08:04 -07:00
Vincent Stumpf
819b7cb361
Fix ASAN crashes and LSAN leaks (#7649) 2023-03-20 09:32:41 -07:00
Vincent Stumpf
7dd6eb5182
Add other player in mail transactions (#7568)
* Add other player's char_id in mail transactions

Thanks to @tokeiburu

Co-authored-by: Lemongrass3110 <lemongrass@kstp.at>
2023-03-14 02:30:23 -07:00
Vincent Stumpf
8f4a1d2932
Remove relative includes for 3rdparty imports (#7609)
This also changes the imports for config, custom to use the src include path
2023-03-07 16:21:28 -08:00
Vincent Stumpf
1b1164f91d
Change memcpy for safestrncpy for char * (#7629) 2023-03-06 09:53:23 -08:00
Lemongrass3110
839d378680 Added missing breaks to instance_warpall 2023-02-26 22:37:07 +01:00
Vincent Stumpf
e235c9cab4
Change common and config includes to use <> (#7596) 2023-02-12 12:46:06 -08:00
Atemo
bc7b9cdd2e
Updated instance_warpall script command (#7591)
* Added a parameter to the instance_warpall script command to prevent dead players from being warped

Thanks to @aleos89, @Lemongrass3110 and @vstumpf for the reviews!
2023-02-12 16:09:20 +01:00
Lemongrass3110
f261307bbe
Added script command mesitemlink (#7565)
Adds a new script command for itemlink generation for usage inside NPC dialogs (mes "").
A few cleanups related to the normal itemlink feature.

Thanks to @Atemo and @aleos89 for their help!

Co-authored-by: Atemo <Atemo@users.noreply.github.com>
Co-authored-by: Aleos <aleos89@users.noreply.github.com>
2023-02-07 10:47:36 +01:00
Lemongrass3110
ba32ccc928 Added two missing timer function names 2023-02-07 00:18:57 +01:00
Lemongrass3110
14cb61d598
Removed mapindex from char-server (#7533)
Converted last_point to mapname
Converted save_point to mapname
Converted memo to mapname
Converted start point to mapname
Removed default map
Converted party member to mapname
Converted maplists to mapname
Removed mapindex loading
Fixed instance loading with multiple map-servers
Fixed castle loading with multiple map-servers
Fixed battleground loading with multiple map-servers
Fixed warping between map-servers

Thanks to @aleos89 for his help!
2023-01-11 16:54:53 +01:00
Lemongrass3110
9dda166c0e
Converted cash shop database to YAML (#6299)
Co-authored-by: Atemo <Atemo@users.noreply.github.com>
Co-authored-by: Aleos <aleos89@users.noreply.github.com>
2023-01-05 18:30:07 +01:00
Atemo
d0b51d91a0
Fixed an issue with mail (#7518)
* mail should accept card with ID 0 (no card) when the parameter card is provided
2022-12-29 23:36:55 +01:00
Singe Horizontal
9e476cce31
Fixed specialeffect with npc names (#7502)
Fixes #7501

Co-authored-by: Lemongrass3110 <lemongrass@kstp.at>
2022-12-20 17:27:59 +01:00
Atemo
0e948b5f9a
Fixed a potential issue with getmapxy (#7498) 2022-12-18 13:15:57 +01:00
Lemongrass3110
d1e184e46c
Initial version of cashmall (#7450)
Introduces the cashmall
Added Cachua_Coupon exchange NPC
Enabled Devil Enchant Master and moved to Cash Mall
Moved Mergician
Added Basta, Mighty Hammer and Brock
Moved Shadow Blacksmith
Added Cash Hair Stylist
Added a feature switch for Stylist UI
Updated Hair Stylist

Thanks to @aleos89, @Atemo and @eppc0330!

Co-authored-by: aleos <aleos89@users.noreply.github.com>
Co-authored-by: Atemo <Atemo@users.noreply.github.com>
2022-12-18 00:39:50 +01:00
Lemongrass3110
165e0d668f
Fixed dynamic NPC timeout (#7497)
Fixes #7473
Updates the last interaction time on end; and close;
Additionally added the official dynamic NPC result packet.

Thanks to @eppc0330
2022-12-17 22:33:19 +01:00
Atemo
b862aed75c
Small correction for SHC_SAVAGE_IMPACT and SHC_DANCING_KNIFE skills (#7496)
* Small correction for SHC_SAVAGE_IMPACT and SHC_DANCING_KNIFE skills
* SHC_SAVAGE_IMPACT should move the player from 1 cell to the target, between the target and the player
* SHC_DANCING_KNIFE shouldn't force the player to stand
* The behaviour should be the same for GC_CROSSIMPACT than SHC_SAVAGE_IMPACT

Thanks to @aleos89 @Lemongrass3110 !
2022-12-17 14:08:09 +01:00
Lemongrass3110
ae686056a0
Added CodeQL analysis (#7208)
Adds CodeQL analysis because LGTM was disabled and removed.
2022-12-16 22:34:59 +01:00
Singe Horizontal
8eac71f57f
Cleaned struct tokens for map_session_data and status_change (#7490)
Fixes #7492
2022-12-16 19:16:29 +01:00
Vincent Stumpf
1f4c068c39
Refactor status change entries (#7356)
* Make map_session_data a class, call constructor/destructor on alloc/free

* add getSCE

* add create, delete, clear SCE

* Use getSCE, make data access private

* add a cache for last-fetched status
2022-12-13 23:47:53 -08:00