summaryrefslogtreecommitdiff
path: root/src/map/script.c
AgeCommit message (Collapse)AuthorFilesLines
2015-12-20Add script->id2sd function to throw error properly if player not foundAnnieRuru1-0/+33
- included script->charid2sd and script->nick2sd
2015-12-18Add *getunittype and update *getmapxyAnnieRuru1-26/+91
- unlike rathena, hercules' getunittype use the value from getmapxy - getmapxy now can search object position using GID Closes #871 as merged Signed-off-by: Haru <haru@dotalux.com>
2015-12-15Added GPL-compliant header to all sources and build scriptsHaru1-4/+20
Signed-off-by: Haru <haru@dotalux.com>
2015-12-15Fixed some too long char buffer initializers.Florian Wilkemeyer1-3/+3
- While they don't really cause an overflow (in C), there's no point in initializing strings to "\0". - Original commit message was: Found some static-assignment overflows -> fixed. Signed-off-by: Haru <haru@dotalux.com>
2015-12-13Fix double source script warning in-case of invalid battle config flag requestedhemagx1-1/+0
2015-12-13- Fixed #723 now it's possible to retrieve Battle Config Settings from ↵Your Name1-1/+13
plugins into scripts - Fixed Possible Crash when null parse function pointer passed to HPMi->addConf - Now it's possible to use same parse function for all config entries - Now Battle Config entries must have a return function
2015-11-21This reverts commit 3eb8f6cc123835fae6bbd847f02cdd45fcfccd60.AnnieRuru1-2/+2
2015-11-21Fix getitem/getitem2 give stacked items when ForceSerial on (#703)AnnieRuru1-2/+2
2015-11-14Changed struct map_session_data::queues into a VECTOR and renamed to ↵Haru1-12/+8
::script_queues Signed-off-by: Haru <haru@dotalux.com>
2015-11-14Changed struct script_queue_iterator::item into a VECTOR and Renamed to ↵Haru1-16/+20
::entries Signed-off-by: Haru <haru@dotalux.com>
2015-11-14Changed struct script_queue::item into a VECTOR and Renamed to ::entriesHaru1-83/+43
Signed-off-by: Haru <haru@dotalux.com>
2015-11-14Standardized script-queue related commandsHaru1-20/+21
- The commands queueadd, queueremove, queueopt, queuedel and qiclear now all return true (success) or false (failure). - Taken/extended from AnnieRuru's PR #847. - The constants HQO_OnDeath, HQO_OnLogOut, HQO_OnMapChange were renamed to QUEUEOPT_DEATH, QUEUEOPT_LOGOUT, QUEUEOPT_MAPCHANGE respectively. - The name of the variable @QMapChangeTo$ used during the QUEUEOPT_MAPCHANGE event has been renamed to @Queue_Destination_Map$. Signed-off-by: Haru <haru@dotalux.com>
2015-11-14Refactored the script queue systemHaru1-185/+333
- Corrected return value in bool functions (true always means success, false means failure, some were inverted). The script command return values are left unchanged for backwards compatibility. - Added some missing script_pushint to commands that are expected to return a value (on failure). - Cleaned up and optimized various functions. Signed-off-by: Haru <haru@dotalux.com>
2015-11-14Renamed hQueue/hQueueIterator/hQueueOpt to latest standardsHaru1-19/+19
Signed-off-by: Haru <haru@dotalux.com>
2015-11-14Changed script->hq and script->hqi into VECTOR typeHaru1-91/+85
Signed-off-by: Haru <haru@dotalux.com>
2015-11-14Corrected an issue causing queue iterators not to return their last valueHaru1-9/+21
- Follow-up to 918b1123963ac2f91a4d074b092ceef1db71b4e8, a9042bf0bee2d2453058b22973bea8f335c5a201 - Thanks to Dastgir Signed-off-by: Haru <haru@dotalux.com>
2015-10-24Merge pull request #751 from dastgir/script_docDastgir1-1/+1
Updated script_commands.txt
2015-10-19rename malloc.c/h to memmgr.Andrei Karas1-1/+1
2015-10-01Split function set_reg and get_val into functions based on variable types.Andrei Karas1-88/+144
2015-09-28Added Missing ScriptCommands in the doc.Dastgir1-1/+1
Corrected sleep/sleep2 parameter list. Changed bg_join_team return values.
2015-09-25More aggressive whitespace cleanup. Follow up to 51329e6Haru1-221/+156
Signed-off-by: Haru <haru@dotalux.com>
2015-09-24Fix script command checkcell without player attached.Andrei Karas1-2/+1
Was broken in previous commits.
2015-09-24Add bl parameter to map_searchrandfreecell and map_addflooritem.Andrei Karas1-8/+8
2015-09-24Add bl parameter to getcell functions.Andrei Karas1-2/+3
2015-09-18Clarified the intent of several assignments inside conditional expressionsHaru1-8/+8
Signed-off-by: Haru <haru@dotalux.com>
2015-09-18Clarified intent in various side-effect assignmentsHaru1-15/+15
While this doesn't change anything in the way those assignments work, it clarifies that they're intended to be side-effect assignments and not typos (to both human readers and static analyzers) Signed-off-by: Haru <haru@dotalux.com>
2015-09-08Fixed some memory leaks in code using libconfigHaru1-0/+1
- Special thanks to Dastgir Signed-off-by: Haru <haru@dotalux.com>
2015-09-06Fixed compilation error.Emistry1-1/+2
error: ‘for’ loop initial declarations are only allowed in C99 mode
2015-09-06Revert "Revert "Updated getwaitingroomstate() script command.""Emistry1-1/+15
This reverts commit c3ce0fb9b04d4c51d632c21f24f7a348c2681bf2.
2015-09-06Revert "Updated getwaitingroomstate() script command."Emistry1-15/+1
This reverts commit 1bd8e9d50ed6de9433c3d6ccb842491cdafcd0a1.
2015-09-06Updated getwaitingroomstate() script command.Emistry1-1/+15
type 0 - return number of users in the waiting room and account_id list stored in $@chatmembers[] type 34 - Minimum Base Level to enter waiting room. type 35 - Maximum Base Level to enter waiting room. type 36 - Minimum Zeny to enter waiting room.
2015-08-31npctalk support extra npc name parameter.Emistry1-2/+10
The command will display the message on the NPC that name specified in the parameter. Useful in quest script that required a lot of different NPC to talk at the same time. Especially instances script.
2015-08-18Fixed a qiget/qicheck crash in queue iteratorsHaru1-2/+2
- Fixes #652 - Follow-up to 918b1123963ac2f91a4d074b092ceef1db71b4e8 - Thanks to Dastgir, Andrei Karas Signed-off-by: Haru <haru@dotalux.com>
2015-08-15HPM compatibility improvementsHaru1-0/+1
Improved compatibility, portability and standards conformance. - Since it is not possible to portably and reliably re-use the core's symbols in plugins, symbols are no longer exported unless explicitly required, in the UNIX builds. This mimics the Windows behavior and adds HPM compatibility to OSes such as FreeBSD. Credits to Andrei Karas for making this possible. - For convenience, it is no longer necessary to call GET_SYMBOL, since the plugin will automatically import all the available symbols when it's loaded, depending on the included headers. - Plugins are now supposed to include the "common/hercules.h" header before including anything else. Incluing common/HPMi.h, common/cbasetypes.h or conf/core.h is no longer necessary, as those are guaranteed to be automatically included by hercules.h. - HPM API version bumped to 1.1. Signed-off-by: Haru <haru@dotalux.com>
2015-08-15Moved session array into the socket interfaceHaru1-3/+3
Signed-off-by: Haru <haru@dotalux.com>
2015-08-15Cleaned up socket interfaceHaru1-1/+1
- Replaced some macro calls with the proper interface syntax - Removed useless macros and workarounds API changes summary: - WFIFOSET() can now be safely used both inside and outside socket.c - RFIFOSKIP() can now be safely used both inside and outside socket.c - do_close() is now sockt->close() - flush_fifo() is now sockt->flush() - flush_fifos() is now sockt->flush_fifos() - getips() is now sockt->getips() - host2ip() is now sockt->host2ip() - ip2str() is now sockt->ip2str() - ntows() is now sockt->ntows() - make_connection() is now sockt->make_connection() - make_listen_bind() is now sockt->make_listen_bind() - realloc_fifo() is now sockt->realloc_fifo() - realloc_writefifo() is now sockt->realloc_writefifo() - session_isActive() is now sockt->session_is_active() - session_isValid() is now sockt->session_is_valid() - set_defaultparse() is now sockt->set_defaultparse() - set_eof() is now sockt->eof() - set_noblocking() is now sockt->set_noblocking() - str2ip() is now sockt->str2ip() Signed-off-by: Haru <haru@dotalux.com>
2015-08-10Add script interface function run_pet. It do same thing as run.Andrei Karas1-0/+1
2015-08-10Add script interface function run_npc. It do same thing as run.Andrei Karas1-1/+2
2015-08-10Move unequip item script function call into function ↵Andrei Karas1-0/+17
script_run_item_unequip_script.
2015-08-10Move equip item script function call into function script_run_item_equip_script.Andrei Karas1-0/+17
2015-08-10Move use item script function call into function script_run_use_script.Andrei Karas1-2/+19
2015-08-09Removed deprecated script command checkreHaru1-1/+0
- Follow-up to ca877ecbef0d3fe8df1b69fcaa9e72693c104f02 Signed-off-by: Haru <haru@dotalux.com>
2015-08-05Add optional parameter to warp script command for prevent stoping npc ↵Andrei Karas1-1/+7
scripts after warp.
2015-07-15Follow up 98274e4 fix script command questactive warningsAngelmelody1-5/+14
Signed-off-by: Angelmelody <Angelmelody@gmail.com>
2015-07-08Update Unique ID system to match official now it cover all cash items ↵Ibrahim Hossam1-0/+12
include stackable ones. Implement ForceSerial option in Package Item Database to force serial for any item. Implement ForceSerial option in item database to force serial for any item. Implement Merge Client interface to merge stackable items with serial numbers ( check npc/other/item_merge.txt ).
2015-07-05Follow up 25c5a610555f442005d562ad463a4f22efb6f744Emistry1-1/+1
missing character.
2015-07-05Added script command `showscript "<message>"{,<GID>};`Emistry1-0/+32
Makes attached player or GID says a message like shouting a skill name, the message will be seen to everyone around but not in chat window.
2015-06-19Removed ".." from include directivesHaru1-47/+46
- Include directives are now directory-independent. - This will allow building plugins from other directories in future. Signed-off-by: Haru <haru@dotalux.com>
2015-06-04Implemented strcmp Function.Dastgir1-0/+9
2015-06-01Replaced some of the hardcoded values with constants (map)Haru1-32/+29
- Replaced several hardcoded values with the appropriate enums. - Added documentation for some hardcoded values that haven't been replaced by enums (yet) - Minor code legibility improvements. Signed-off-by: Haru <haru@dotalux.com>