summaryrefslogtreecommitdiff
path: root/src/map/script.c
AgeCommit message (Collapse)AuthorFilesLines
2015-12-26Add *setgroupid script commands.Emistry1-0/+25
Useful for scripts that temporary adjust the group id of players.
2015-12-25Fix various ShowWarning that doesn't tell the source of the errorAnnieRuru1-7/+7
Closes #868 as merged
2015-12-25Implemented NoViewIDDastgir1-0/+3
(http://herc.ws/board/topic/10020-official-mapflag-to-disable-viewid/) Closes #926 as merged Signed-off-by: Haru <haru@dotalux.com>
2015-12-22Throw error when variable name length too longAnnieRuru1-0/+14
2015-12-22Update *dispbottom script command to allow 0xRRGGBB colorAnnieRuru1-9/+21
Closes #858 as merged Signed-off-by: Haru <haru@dotalux.com>
2015-12-22Update *message script command to allow to use account IDAnnieRuru1-8/+13
Signed-off-by: Haru <haru@dotalux.com>
2015-12-20*explode return array size.Emistry1-0/+2
http://herc.ws/board/topic/7489-explode-to-push-arraysize/ Closes #700 as merged Signed-off-by: Haru <haru@dotalux.com>
2015-12-20Fixed a memory leak in the explode script commandHaru1-18/+16
Minor refactoring Signed-off-by: Haru <haru@dotalux.com>
2015-12-20Fix the *getcharipAnnieRuru1-6/+13
-> it uses the dirties method to search for player -> seriously ? why have to search account_id AND char_id ? -> if the char_id gone big enough, it can reach to account_id
2015-12-20Fix certain script command report source npc twice if player not attachedAnnieRuru1-146/+136
Signed-off-by: Haru <haru@dotalux.com>
2015-12-20Change map->nick2sd into script>nick2sdAnnieRuru1-47/+46
- *getcharid and *getmapxy is exempted to check the condition Signed-off-by: Haru <haru@dotalux.com>
2015-12-20Change map->charid2sd into script->charid2sdAnnieRuru1-12/+11
- *charid2rid is exempted to check the condition Signed-off-by: Haru <haru@dotalux.com>
2015-12-20Change map->id2sd into script->id2sdAnnieRuru1-37/+33
- these 4 commands are exempted, because they are meant to check the condition: *playerattached, *attachrid, *isloggedin, *sleep2 Signed-off-by: Haru <haru@dotalux.com>
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