156 Commits

Author SHA1 Message Date
Lemongrass3110
44435cc626
Fixed dummy item in SQL mode (#5676)
Fixes #5646
Additionally adds some protection for invalid item ids to the script commands npcshopitem and npcshopadditem

Thanks to @mplaten
2021-01-06 18:42:11 +01:00
javirst
f74915193d
Unlock target when setunitdata TARGETID 0 (#5578)
Fixes #5577
2020-11-29 21:37:28 +01:00
Atemo
ae3c6ce38b
Min/max issue (#5574)
* Fixed min/max issue for zero variable value
* Added a CI test script

Co-authored-by: Lemongrass3110 <lemongrass@kstp.at>
2020-11-27 14:50:29 +01:00
Lemongrass3110
f97dd6e85f
Fixed an issue with fake NPCs (#5554)
Correctly removing the state tracking of fake NPC usage in case the player was detached before the script ended.

Fixes #5379

Thanks to @blipblopblip and @Patotron
2020-11-22 21:10:16 +01:00
Aleos
be9babee32
Converts the random option databases to YAML (#5494)
* Fixes #3084.
* Creating random option groups now further reflects official behavior.
* Group bonuses can now be created without having to create multiple permutations of the same group.
* Specific slot options can now be defined which guarantee a bonus.
* Non-guaranteed options can now be defined along with a maximum amount.
* Random option value can now be defined as a range instead of a static value.
* Adds conversion of official random option groups.
* Includes CSV2YAML conversion tool.
Thanks to @Lemongrass3110!
Co-authored-by: Lemongrass3110 <lemongrass@kstp.at>
2020-11-08 12:21:52 -05:00
Atemo
0964881a81
Small correction of getiteminfo script command (subtype shifted the values) (#5508)
Fixed #5505 

Thanks to @Triedge !
2020-10-30 18:32:09 +01:00
Lemongrass3110
ed473d066d
Cleaned up hat effect code (#5462)
Converted from self written container to std::vector.
Converted clif code to struct usage.
2020-10-23 01:07:12 +02:00
Aleos
04cfe17b2b
Converted item database to YAML (#4335)
* Combines item_avail, item_buyingstore, item_delay, item_flag, item_nouse, item_stack, and item_trade databases into one.
* General cleanups and optimizations.
* Includes CSV2YAML conversion tool.
* Includes YAML2SQL conversion tool.
* Adjusts dummy_item from being created by malloc and now creates it by make_shared.
* Item combos are now stored as a STL.
Thanks to @Lemongrass3110, @Atemo, and @cydh!
Co-authored-by: Lemongrass3110 <lemongrass@kstp.at>
2020-10-21 19:02:11 -04:00
Atemo
08adc45ba9
bg_join - battleground doc update (#5385)
* Added more information in the doc about waitingroom2bg_single and bg_join commands
* Added MF_BATTLEGROUND mapflag check in waitingroom2bg_single and bg_join to prevent the player to join a bg when the battle map is not a battleground map
2020-09-09 15:09:55 +02:00
Daegaladh
1c123a517e
Added/improved SG's maps and monsters reset script and GM commands (#5359) 2020-08-26 23:52:26 +02:00
Daegaladh
78676d8a6f
Removed skilleffect/npcskilleffect cap (#5319)
*Partially revert of eccf5ab20c3ae02cf46c9827f485b8d88a62b531
2020-08-13 08:10:18 +02:00
Aleos
5c5c6839a0
Fixes item production with high item IDs (#5315)
* Fixes #5312.
* Fixes general item production skills not consuming catalyst items with high IDs.
* Adjusts item searching functions to use t_itemid instead of uint32.
* Adjusts script command makeitem2 to use t_itemid isntead of uint32.
* Fixes output and lookups for atcommands idsearch, autolootitem, iteminfo, whodrops, makeegg, and itemlist.
* Fixes signed vs unsigned checks.
* Fixes MVP logging.
* Fixes item drop ratio storage.
* Fixes CSV2YAML conversion checks.
Thanks to @idk-whoami and @Lemongrass3110!
Co-authored-by: Lemongrass3110 <lemongrass@kstp.at>
2020-08-11 10:39:37 -04:00
Vincent Stumpf
3776bfbaa3
Support itemids up to ~2 billion (#5141)
Co-authored-by: aleos89 <aleos89@users.noreply.github.com>
Co-authored-by: Lemongrass3110 <lemongrass@kstp.at>
2020-08-08 12:06:07 +02:00
Aleos
eccf5ab20c
Adjusts npcskilleffect and skilleffect (#5270)
* Fixes #2156.
* Adjusts the two script commands to take into account the type of skill being used.
* Adjusts documentation to reflect.
* Verify skill and skill level.
Thanks to @Yuchinin and @Lemongrass3110!
2020-08-03 20:57:09 -04:00
Daegaladh
2e88b27b9b
Fixed secure timeout triggering npc_scriptcont debug messages (#5239) 2020-07-28 19:40:04 +02:00
Aleos
7bdf67e3d3
Adjusted script command progressbar_npc behavior (#2381)
* Players are no longer detached from the script.
* Players can't walk, attack, use items, or use skills while progress bar is active.

Co-authored-by: Lemongrass3110 <lemongrass@kstp.at>
Co-authored-by: Atemo <Atemo@users.noreply.github.com>
2020-07-20 13:34:43 -04:00
Atemo
43ea987ba7
countbound script command update (#5200)
* the command now returns the number of differents type of item found
* the amount by item ID is now save in bound_amount array

Thanks to @Daegaladh
2020-07-14 15:48:21 +02:00
Lemongrass3110
429569d4b6
Added some missing pet egg checks (#5175)
Also cleaned up some code duplicates to use the existing function for the respective check.

Fixes #5152

Thanks to @admkakaroto
2020-07-11 13:11:50 +02:00
Aleos
b13e4f0fbc
Adds support for object groups and titles (#5171)
* Fixes #4529.
* Adds support for applying groups and titles to non-player objects.
* Expands script command setunitdata and getunitdata to support group ID.
* Adds script commands setunittitle and getunittitle.
Co-authored-by: Lemongrass3110 <lemongrass@kstp.at>
2020-07-03 13:25:17 -04:00
Aleos
dbe27fe510
Adds script commands to count rental items (#5080)
* Fixes #5047.
* Adds script commands rentalcountitem, rentalcountitem2, and rentalcountitem3.
* Adjusts Malangdo Culvert and Octopus Cave script to utilize script command rentalcountitem.
Thanks to @reunite-ro and @attackjom!
2020-06-17 21:48:26 -04:00
Aleos
7cc59c6708
Adjusts a few checks for item tradability (#4995)
* Follow up to bfb6972.
* Adds a new return array for script command inventorylist: `@inventorylist_tradable`
* Adjusts script command countitem to not count rental items.
2020-05-25 20:28:11 -04:00
Aleos
14c388b401
Resolves some Battleground issues (#4725)
* Queue data will now be kept available until a Battleground event is over.
* Players can now join an active Battleground.
* Adds a more detailed queue state tracking feature.
* When a battleground is being prepared and not enough players click accept, stop the battleground from beginning.
* When a player logs off or leaves a queue they will now properly be removed from the queue.
* Cleans up MinPlayers and MaxPlayers parsing to not accept values less than 1.
* Resolves players not being able to join an active battleground (up to MaxPlayers) unless someone quit early.
* Adds a team size priority check to avoid adding more players to a larger team.
* Fixes battlechat messages.
* Adds a battle_config to disable the ability for players on maps with MF_NOWARP to join Battlegrounds.
* Adds a new optional ActiveEvent label to the database.
* Fixes a typo in Flavius 2 during unbooking process.
* Cleans up the behavior of the Battle Therapists to use areapercentheal and areawarp.
* Fixes KVM score not properly set on the first Battleground.
* Fixes the global timer checks not ending the main timers on Flavius and Tierra Gorge.
* Added an extra bg_reserve on global timer checks in case someone tries to join the battleground just before it's ended.
* Fixed OnReadyCheck being called on global timer checks, causing the battlegrounds to start when there were no players on the map.
* Fixed a bug on Tierra Gorge where multiple barricade walls could be stacked.
* Fixes Croix also receiving 9 badges when Guillaume wins.
* Adjusts StartDelay default to 0.
* Add a database setting to give the ability to enable or disable joining as an individual, party, or guild.
* Add a database setting to restrict jobs from entering Battlegrounds.
* Better documents script commands bg_reserve and bg_unbook.
* Other fixes and cleanups.
Thanks to @roSBK and @Daegaladh, @admkakaroto, @Artuvazro, and @Atemo!
Co-authored-by: Daegaladh <Daegaladh@users.noreply.github.com>
Co-authored-by: Atemo <Atemo@users.noreply.github.com>
2020-05-25 12:39:36 -04:00
Sader Fawall
49c4ddf8f9
npctalk script command now accepts color parameter (#4910)
Co-authored-by: Jittapan Pluemsumran <secret@jittapan.app>
Co-authored-by: Lemongrass3110 <lemongrass3110@users.noreply.github.com>
Co-authored-by: Aleos <aleos89@users.noreply.github.com>
2020-05-10 13:34:00 +07:00
Kreustoo
d1719f670f
Adds missing args for round/ceil/floor (#4899)
* Fixes #4898.
* Only missing one integer in parameter in BUILDIN_DEF2, already ready to read in the definition of the function.
Thanks to @Kreustoo!
2020-05-08 08:28:14 -04:00
Daegaladh
ca56c060cf
Added independent idle time and settings for homunculus share (#4761)
* Follow up to 921b3e2c3e9eae36cbf2ca35bcede6e0d73ba074
2020-04-27 20:21:22 +02:00
Aleos
b65443d8f5
Removal of OnPCStatCalcEvent (#4831)
* Fixes #4812.
* This script event can be replaced with the other various player script events.
* The trigger during equipment changing causes headache across other calculation events in source.
2020-04-23 16:53:07 -04:00
Aleos
8716121b4c
Fixes to Battleground script commands (#4764)
* Fixes #4763.
* Cleans up script commands bg_getareausers and bg_get_data.
Thanks to @voyfmyuh and @Lemongrass3110!
2020-04-09 14:18:50 -04:00
Daegaladh
42f695fe8e
Fixed autotraders counting for instance requirements (#4779) 2020-04-09 18:03:18 +02:00
Aleos
06c159c405
Refactored Instances to utilize C++ features (#3163)
* Fixes #3087 and fixes #3095.
* Converts database file to YAML.
* Converts static array to unordered_map which frees up pre-allocated memory that may never be fully used.
* Got rid of all DBMap/ERS features.
* Removes MAX_INSTANCE_DATA in favor of INT_MAX.
* Includes TXT converter.
Thanks to @Lemongrass3110, @secretdataz, @Atemo, @lighta, @InusualZ, @Angelic234, @Normynator, @cydh, and @ecdarreola!
2020-04-08 12:52:45 -04:00
Aleos
2f326bf04a
Converted Quest Database to YAML (#4064)
* Changes TimeLimit format to be human readable.
* Converts title to string.
* Converts objectives and drop items to vectors.
* General clean ups and optimizations.
* Got rid of dummy_quest.
* Added TXT to YAML converter.
Thanks to @Atemo and @Normynator!
Co-authored-by: atemo <capucrath@gmail.com>
2020-03-30 13:17:19 -04:00
Aleos
652d77eb02
Job Improvement Project - Genetic (#3284)
* Fixes #2571.
* Updates Homunculus skills from kRO maintenance: http://ro.gnjoy.com/news/update/View.asp?seq=218&curpage=1
* Updates Genetic skills from kRO maintenance: http://ro.gnjoy.com/news/update/View.asp?seq=246&curpage=1
Thanks to @Tokeiburu, @Badarosk0, @Balferian, and @Haydrich!
2020-03-25 13:26:26 -04:00
Atemo
de80c5aab6
[Suggestion] Implement cloakonnpc/cloakoffnpc (#4688)
* The player can interact with a NPC cloaked by cloakonnpc command (click, mob event..) but the NPC trigger area is disabled (= the OnTouch* part is disabled).
* The changes last until the player leaves the map, logs out, or the npc option is updated by disablenpc/enablenpc/hideonnpc/hideoffnpc/cloakonnpc/cloakoffnpc commands.

Thanks to @aleos89
2020-03-11 22:47:23 +01:00
Lemongrass3110
d165c19b73 Fixed jump_zero for conditions over INT32_MAX
Thanks to @Atemo
2020-02-17 22:50:19 +01:00
Aleos
2931c00bd4
Implemented the Battleground Queue System (#3995)
* Fixes #1310.
* Added a battle config which allows toggling of the Battleground Queue client feature and also toggles between the modes of scripts.
* Added script commands bg_reserve, bg_unbook, and bg_desert.
* Removed old custom Battleground scripts.
Thanks to @Lemongrass3110, @Locien, @secretdataz, @InusualZ, @Normynator, @Atemo, @iubantot, @admkakaroto, and @noobzter003!
2020-02-12 08:26:59 -05:00
aleos
9b6976ea7b Removes some warnings from script command mail
* Follow up to e5c22b3.
* Remove the warnings for refine and bound options as these aren't mandatory fields.
Thanks to @Lemongrass3110!
2020-02-11 17:25:38 -05:00
Jason L
e5c22b360f
Added refine and bound options for mail command (#4272)
* Added refine and bound option for mail script command.
* Made some slight corrections to the script_commands document.
* Note: Any custom scripts that use this command and give some sort of card or random option bonus need to be adjusted as refine and bound come before these options now.
Thanks to @Skormie!
Co-authored-by: Daegaladh <Daegaladh@users.noreply.github.com>
2020-02-11 10:18:59 -05:00
Atemo
ac0d17f4aa
Corrected getfreecell command for flag 2 (#4491)
* Little simplification of the code
* Extends the target type for flag 2 to match the docs (target applicable for player, monster, pet, homunculus)
Thanks to @Lemongrass3110
2020-02-04 19:58:04 +01:00
Lemongrass3110
b86926a7a2
Fixed a compiler warning in script.cpp (#4586)
Fixes #4582

Thanks to @idk-whoami and @aleos89
2020-02-03 14:44:58 +01:00
Sader Fawall
fc1c05aee9 Announce Accept Char id (#4203)
Adjusted script command announce to accept charID
* Fixes #3901.
* Script command announce will now accept a character ID to display locally.
Thanks to @sader1992!
Co-authored-by: Atemo <Atemo@users.noreply.github.com>
Co-authored-by: Lemongrass3110 <lemongrass@kstp.at>
2020-01-17 21:22:49 -05:00
Lemongrass3110
8f512d8abb Fixed a newly introduced stack bug
Fixes #4537

Thanks to @Triedge
2020-01-14 09:47:28 +01:00
Lemongrass3110
e72c7360cf
Added int64 support to the script engine (#4522)
Added support for signed 64 bit integer value computation into the script engine.
This is required because newer official features require support for bigger numbers inside the scripts.

This also cleans up a lot of messy code and fixes a few issues like script stack corruptions.

Thanks to @aleos89 and everyone who supported me with this.
2020-01-13 14:44:48 +01:00
Aleos
b0119631a4
Allow NPC view data modifications (#4385)
* Fixes #4289.
* Updated script commands setunitdata and getunitdata to support the modification of NPC view data.
* Converted mob_avail database to YAML.
Thanks to @Lemongrass3110, @4144, @exneval, @Balferian, @cahya1992 and @teededung!
Co-authored-by: Lemongrass3110 <lemongrass@kstp.at>
2019-12-22 10:27:43 -05:00
Jittapan Pluemsumran
3a7b832906
Threshold for blacksmith refine fame points (#4409)
* Made refine threshold for giving Blacksmith ranking point configurable. Fixes #4408
2019-12-21 16:45:00 +07:00
Sader Fawall
c1079cd44a Fixed script command getunits (#4417)
* Fixes #4416.
* Resolves an issue with script command getunits returning failure on a valid map index.
Thanks to @javirst and @sader1992!
2019-10-24 12:32:01 -04:00
Atemo
b412c4fcab
questinfo requirement update (#4168)
* The <quest ID> is now removed, all the conditions are handled by a <condition> argument. The <condition> is using the achievement_check_condition (like in achievement_db.yml) so any condition (in theory) can be used to display the icon.
* A new script command has been added to refresh the bubble for the given player anytime.

Thanks to @aleos89 and @secretdataz for the review!
2019-10-06 17:15:46 +02:00
Lemongrass3110
f290bc97be
Fixed achievementexists script command (#4379)
Fixes #4378

Thanks to @ecdarreola and @teededung
2019-10-02 08:19:03 +02:00
Atemo
378e44d85d
Removed the option ID requirement for countitem3, rentitem3, getitem3, makeitem3 and delitem3 (#4270)
* These functions now accept the option ID array fill with 0
* They don't throw a warning anymore when the item doesn't have option ID
2019-08-16 14:52:09 +02:00
Atemo
786186f728
Small isequippedcnt script command update (#4229)
* Updated the command to only count the unique ID

Thanks to @cydh, @secretdataz and @aleos89 for the reviews !
2019-08-14 23:27:09 +02:00
Aleos
8050f7c84e
Properly free function script counter (#4269)
* Fixes #3613.
* Script functions will now properly reset the script instance counter when the function terminates the script.
Thanks to @Tokeiburu!
2019-07-29 19:16:07 -04:00
Atemo
5fae7c26c1
convertpcinfo script command (#3924)
Implemented convertpcinfo script command
* The command allows to convert more easily a player data to another.
* It fails silently if the character is not found/online.

Thanks to @aleos89, @Normynator, @cydh !
2019-07-01 21:06:55 +02:00