summaryrefslogtreecommitdiff
path: root/src/map/script.c
AgeCommit message (Collapse)AuthorFilesLines
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
2015-04-22Fix a crash condition when incorrectly using return outside the scope of a ↵Kpy!1-1/+8
function or subroutine.
2015-04-21Fix script function return always removing references from NPC variables.Kpy!1-1/+1
Bugreport:8642 http://hercules.ws/board/tracker/issue-8642-script-engine-issue-quo/
2015-03-15Follow up 330e31cc71ece055908acb1eb967b4009ebc9c46shennetsind1-3/+15
Fixed an issue caused by unescaped characters being written and read out of the .pot unproperly. This commit also causes map server to print the file it wrote to when terminating Signed-off-by: shennetsind <ind@henn.et>
2015-03-14Fixed a script function related memory leak on mapserver shutdownHaru1-8/+6
- If a script function was running when the server is shut down, the memory allocated by its local variables would not get freed. - Special thanks to Ind. Signed-off-by: Haru <haru@dotalux.com>
2015-03-05Memory Slasher: Script Parser Boostshennetsind1-17/+14
Noticed this improvement while working on the ultimate localization design. During my experiments I noticed an average 11% speed mod. This patch makes script (item/pet/npc) parsing 11% faster, while dropping map server memory usage by 2.7MB (its faster and uses less memory, signature Hercules achievement). Signed-off-by: shennetsind <ind@henn.et>
2015-02-28Skipped translations in minimal (script-checker) modeHaru1-0/+3
- Translations aren't used in script-checker mode, so there is no point loading them. - Fixes an error message caused by a missing default language when starting in script-checker mode. - Special thanks to Ind, jaBote. Signed-off-by: Haru <haru@dotalux.com>
2015-02-23Hercules Ultimate Localization Designshennetsind1-13/+605
Servers can now run on any number of languages, without editing npc files. Designed by Haruna and Ind http://hercules.ws/board/topic/8687-hercules-ultimate-localization-design/ Signed-off-by: shennetsind <ind@henn.et>
2015-02-15Fixed a parser issue on direct assignmentsHaru1-29/+35
- Fixes an undetected error in case a semicolon is missing after a direct assignment line in a script. - Special thanks to Dastgir. Signed-off-by: Haru <haru@dotalux.com>
2015-02-15Follow up 909c0644ce45945c8e3fdc5eb77ebdd1a1cb93d0shennetsind1-1/+0
No longer returns any value. Either it will succeed, or it will stop the script (at which point having a return value has no purpose) Signed-off-by: shennetsind <ind@henn.et>
2015-02-15Updated 'delequip' Script Commandshennetsind1-3/+6
delequip will now stop a script when attempting to delete a item in a position the player has no gear. Special Thanks to Michieru, Haruna. Signed-off-by: shennetsind <ind@henn.et>
2015-02-02Fixed state tracking of dialog windows when the script is suspended and resumedHaru1-1/+0
- If a script was suspended, and then resumed (`sleep2`, but also `getexp`), state tracking of dialog windows would get reset, and a `close` or `close2` would trigger a warning even if a message box was present. - Special thanks to Dastgir. Signed-off-by: Haru <haru@dotalux.com>
2015-01-24Added script command 'channelmes'Haru1-0/+26
Special thanks to Dastgir Signed-off-by: Haru <haru@dotalux.com>
2015-01-23Deprecated command isday().Haru1-1/+1
- The command is deprecated and it will be removed in about a month. Please use isnight() in your custom scripts instead. Signed-off-by: Haru <haru@dotalux.com>
2015-01-23Merged petskillattack and petskillattack2.Haru1-35/+9
Existing custom scripts will need edits. In a nutshell: - Existing calls to `petskillattack` should be changed to specify an extra <number of attacks> argument (after <skill level>), set to 0. - Existing calls to `petskillattack2` should be changed to `petskillattack`, keeping the same arguments. Signed-off-by: Haru <haru@dotalux.com>
2015-01-20Minor fixes and tweaks suggested by cppcheckHaru1-412/+413
- Variable scopes reduced - Parenthesized ambiguous expressions - Removed or added NULL checks where (un)necessary - Corrected format strings - Fixed typos potentially leading to bugs Signed-off-by: Haru <haru@dotalux.com>
2015-01-18Fixing 38 issuesshennetsind1-9/+7
Addressing out of bounds read/write, pointless null checks on already deferenced variables, dead code. Special Thanks to 4144 and Haruna! Signed-off-by: shennetsind <ind@henn.et>
2015-01-1727 Fixesshennetsind1-8/+12
Addressing out of bounds read/write, pointless null checks on already deferenced variables. Special Thanks to 4144 and Haruna! Signed-off-by: shennetsind <ind@henn.et>
2015-01-17Another ~10 Fixesshennetsind1-1/+1
Addressing out of bounds read/write. Special Thanks to 4144 and Haruna! Signed-off-by: shennetsind <ind@henn.et>
2015-01-11Convert pcdb_checkid into function in pc interface.Andrei Karas1-2/+2
2015-01-02Add npcdb_checkid to npc interface.Andrei Karas1-1/+1
2015-01-01Removed deprecated command cmdothernpcHaru1-13/+0
- Follow-up to d22e937e62b3443b74051ecc47ccc3137f9ff5f5 Signed-off-by: Haru <haru@dotalux.com>
2015-01-01Removed deprecated script command aliases enablearena/disablearenaHaru1-2/+0
- Follow-up to 134a4bae206a9c14f7da86095b5555b91ace3035 Signed-off-by: Haru <haru@dotalux.com>
2015-01-01Removed deprecated script command alias 'save'Haru1-1/+0
- Follow-up to e914ab9088250b64c81953aa4e35435aabb26055 Signed-off-by: Haru <haru@dotalux.com>
2014-12-31Add some missing null pointer checks after automatic checks.Andrei Karas1-2/+4
2014-12-26Add script function for change per character gender.Andrei Karas1-10/+35
New script function: changecharsex
2014-12-23Removed deprecated commands checkdragon, setdragonHaru1-54/+0
Follow-up to a852bdd Signed-off-by: Haru <haru@dotalux.com>
2014-12-23Removed deprecated commands setmadogear, checkmadogearHaru1-43/+0
Follow-up to b3aef69 Signed-off-by: Haru <haru@dotalux.com>
2014-12-23Removed deprecated commands setriding, checkridingHaru1-45/+0
Follow-up to c6f102e Signed-off-by: Haru <haru@dotalux.com>
2014-12-17Fixed a compile error on MSVC < 2013Haru1-25/+21
Thanks to Ind, Michieru Signed-off-by: Haru <haru@dotalux.com>
2014-12-16Add function what call OnUntouch event.Andrei Karas1-2/+3
2014-12-16Extend script command getareausers.Andrei Karas1-13/+56
2014-12-16Fix incorrect memory access in script command getareausers.Andrei Karas1-1/+2
2014-12-16Add script command getnpcclass.Andrei Karas1-0/+30
2014-12-16Add getnpcdir and setnpcdir functions.Andrei Karas1-0/+69
2014-12-16Add script command to set npc click/activate instance.Andrei Karas1-0/+11
New script command: setnpcdistance N Where N is distance in tiles from where npc can be clicked. Add setnpcdistance into docs.
2014-12-10Merge pull request #401 from GmOcean/masterHaruna1-14/+199
A few additional commands, with an edit to *getinventorylist;
2014-12-06Removed extra ? in *equip2 code.GmOcean1-1/+1
2014-12-04Edited *changebase command, replaced unnecessary code with it's equivalent ↵GmOcean1-9/+2
through pc->changelook.
2014-12-04Added explicit parenthesis for *checkbound command, during the check for ↵GmOcean1-1/+1
bound type as per suggested by Haruna.
2014-12-03Modified *checkbound & *equip2 commands in src/map/script.cGmOcean1-9/+8
Modified the corresponding documentation to match source code.
2014-12-02Replace some direct methods usage to interfaces.Andrei Karas1-1/+1
2014-12-02Removed checkquest commandHaru1-18/+0
- Follow-up to 3ad4a9d Signed-off-by: Haru <haru@dotalux.com>
2014-12-02Removed petheal commandHaru1-50/+7
- Follow-up to 8bb0078 Signed-off-by: Haru <haru@dotalux.com>
2014-12-02Removed jump_zero commandHaru1-1/+0
- Follow-up to bcf7a77 Signed-off-by: Haru <haru@dotalux.com>
2014-11-29Updated script.c to reflect suggestion by QQfoolsorellina as well as an ↵GmOcean1-16/+6
unused int under equip2.
2014-11-23Fixed whitespaceGmOcean1-39/+39
2014-11-23Added Commands to script_commands.txt and script.cGmOcean1-19/+222