summaryrefslogtreecommitdiff
path: root/src/map/script.c
AgeCommit message (Collapse)AuthorFilesLines
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>
2015-05-19Fixed some issues reported by coverity scan [1/3]Haru1-0/+2
Signed-off-by: Haru <haru@dotalux.com>
2015-05-18Removed duplicates of clif->msgtableHaru1-1/+1
- Removed clif->msgtable, and renamed clif->msg to clif->msgtable. - Removed clif->msgtable_num, and renamed clif->msg_value to clif->msgtable_num - Renamed clif->msg_skill to clif->msgtable_skill - Removed clif_viewequip_fail - Replaced hardcoded message IDs with constants (see enum clif_messages) Signed-off-by: Haru <haru@dotalux.com>
2015-05-17Fixed some issues detected by coverity scanHaru1-2/+2
Signed-off-by: Haru <haru@dotalux.com>
2015-05-16Added charid2rid script commandHaru1-0/+18
- Returns the account ID (RID) for the given character ID. - As per Streusel's request. Signed-off-by: Haru <haru@dotalux.com>
2015-05-16Fix log10() function actually using log10. Used natural log before.Streusel1-1/+1
2015-05-15Renamed log to log10, as it is creating errors with items called Log.Streusel1-21/+2
Removed floor() and ceil() as they don't make sense since everything is int to begin with.
2015-05-15Added floor(), ceil() and log() functions for usage in scripts.Streusel1-10/+40
2015-05-08Deprecated command checkre().Haru1-1/+1
- The command is deprecated and it will be removed in about a month. Please use the constants RENEWAL, RENEWAL_CAST, RENEWAL_DROP, RENEWAL_EXP, RENEWAL_LVDMG, RENEWAL_EDP, RENEWAL_ASPD instead. Signed-off-by: Haru <haru@dotalux.com>
2015-05-08Removed deprecated command isdayHaru1-6/+0
- Follow-up to b1b1b1aa8edc866a83029081e93d3e7d0f138189 Signed-off-by: Haru <haru@dotalux.com>
2015-05-08Added support for RENEWAL constants in scriptsHaru1-0/+37
Supported constants: - RENEWAL (globally enabled renewal mode) - RENEWAL_CAST (renewal cast time) - RENEWAL_DROP (renewal drop rate algorithms) - RENEWAL_EXP (renewal exp rate algorithms) - RENEWAL_LVDMG (renewal level modifier on damage) - RENEWAL_EDP (renewal enchant deadly poison algorithm) - RENEWAL_ASPD (renewal ASPD) Signed-off-by: Haru <haru@dotalux.com>
2015-04-25Merge pull request #502 from k-py/bugfix-return-getvariableofnpcHaruna1-11/+21
Fix script function return always removing references from NPC variables.
2015-04-25Fixed @changesex issues on PACKETVERs that don't support per-character sex.Haru1-7/+2
- Fixes bugreport:8504 http://hercules.ws/board/tracker/issue-8504-changesex/ - Existing database entries with an incorrect per-character sex will be fixed automatically when the character logs in to match the account's sex, if the PACKETVER doesn't support per-character sex. Signed-off-by: Haru <haru@dotalux.com>
2015-04-22Minor refactoring of script function return.Kpy!1-10/+13