Commit graph

121 commits

Author SHA1 Message Date
Gabriele Tozzi
c87fa09947 Merge branch 'master' of https://github.com/polserver/polserver 2016-01-20 19:11:40 +01:00
turley
ef3ff034c7 corrected doxygen comments 2016-01-20 12:14:30 +01:00
Gabriele Tozzi
e979010408 Added: New Item.house property
Returns a reference to the house if the item is a component of it
(listed in House.components()).
This is the intended replacement for the previously removed CProp
"house_serial": use item.house.serial instead of
GetObjProperty(item, "house_serial").
2016-01-20 05:00:32 +01:00
Gabriele Tozzi
c6a9a6cb73 Merge branch 'stable' 2015-12-19 00:05:55 +01:00
Gabriele Tozzi
ebb6f8a404 Added: support for "\xFF" string escape sequence in eScript 2015-12-19 00:04:32 +01:00
Gabriele Tozzi
5bf416ca24 Merge branch 'cmake'
Conflicts:
- pol-core/clib/xmain.cpp
- pol-core/ecompile/ecompile.cpp
2015-12-18 23:41:43 +01:00
Gabriele Tozzi
144f0600f7 Documentation: improving comments in code
Most of them coming from the "unicode" branch
2015-12-15 02:53:58 +01:00
Gabriele Tozzi
24d3488f7a Merge branch 'master' into cmake 2015-12-07 17:57:03 +01:00
Gabriele Tozzi
7511d15286 Documentation: reformatting comment block
This seems to be very important. Using doxygen syntax, so that it can
be more easily found in future.
2015-12-05 12:47:10 +01:00
Gabriele Tozzi
7593188ff7 Merge branch 'master' into cmake 2015-12-05 09:17:28 +01:00
Gabriele Tozzi
05b2a3a6bc Buff Bar Support
The buff status is held in a new buffs_ property of Character. It is
modified via Character.addBuff(), Character.delBuff(),
Character.clearBuffs() functions. (Maybe also a readBuffs() function
could be useful in future?). Packets are automatically sent when on
a "when needed" basis.
2015-12-05 09:06:40 +01:00
Gabriele Tozzi
66c6200e2a Merge branch 'master' into cmake 2015-11-30 05:49:34 +01:00
Gabriele Tozzi
17c45a8fd2 New Client object properties last_packet_at and last_activity_at 2015-11-28 11:12:52 +01:00
Thomas Volkert
d9646eadd9 Added missing initializers to avoid compiler warnings 2015-11-01 01:06:41 +01:00
Thomas Volkert
202e7f1496 Merge remote-tracking branch 'origin/cmake'
Conflicts:
	pol-core/.gitignore
2015-10-31 19:52:33 +01:00
Gabriele Tozzi
27eabb1721 Added: Item insurance support, new Item.insured property (0/1)
An insured item behaves on death like a newbie item, except that
the insured flag gets reset back to 0 after every death. If the
item for some reason (e.g. when backpack is full) will get dropped
instead, the insured flag will be reset anyway. Insured items are
not stackable with normal items but they can still be sold to
vendors.
Hint: this feature can also be used in conjunction with CanDie
sys hook to determine via script which items a player will drop
on death; since the CanDie hook is called exactly one moment
before death you can use it to insure the items that you don't
want to fall on the corpse.
2015-09-03 13:56:30 +02:00
Thomas Volkert
44d7785438 Added missing initializers 2015-08-31 15:59:22 +02:00
Gabriele Tozzi
15a2ccfd32 Added: new bscript keyword "unused"
Has no practical effect, but tells the compiler not to issue a warning
if the following variable in a function or program definition is will
not be used. The compiler will instead issue a warning if the given
variable is used.

Example:
program onremovescript( character, container, unused item, unused item_amount, movetype )
  <some code here...>
endprogram

function myfunc( parameter1, unused parameter_for_future_use )
  <some code here...>
endfunction
2015-08-27 22:46:48 +02:00
turley
c755d44e75 Added: array.cycle([count])
will move array backwards or forwards in-place as it were a conveyor belt.
{1, 2, 3}.cycle()
Will make it:
{3, 1, 2}
Accepts a negative value as a shift to move different direction
Changed: string.format()
Now actually faster than string concatenation in eScript
Fixes a bug where {:d} formating could cause an arbitrary number shown instead of a real value
tag errors are slightly more intuitive and compact.
Note: Patches submitted by andenixa
2015-07-27 19:17:49 +02:00
frozenblit
ab592b0bf6 Instead of .c_str(), the log will take a copy of the formatter string 2015-05-16 16:00:26 +02:00
frozenblit
943b820eba More and more cleanups
Added some missing include guards, corrected wrong include guard names.
Removed more stl_inc.h includes.
2014-11-02 19:40:40 +01:00
turley
e0b722a93b fixed several uninitialized variables 2014-08-30 12:25:08 +02:00
turley
05c5b2d60b removed old code
testing a threadpool 
added chr.last_textcolor member which returns the clientside chatcolor
2014-06-01 09:59:12 +00:00
turley
21723568bc fixed some minor crashes 2014-03-22 08:30:02 +00:00
frozenblit
cbc05e909d New member for the Character class: chr.temporally_criminal will return true if a criminal timer is running
Note that chr.criminal returns true when a criminal timer is running or character.murderer is true! This behavior has not changed.
2014-03-01 17:15:22 +00:00
turley
31ee263a45 activated new logging facility 2014-01-18 13:29:38 +00:00
turley
99d7dc3037 namespaces...finally :)
Hard part is finished every file is touched. Namespaces are currently rough named by directory name.
Maybe we could split it more
2013-12-21 09:10:46 +00:00
dsourc
ad5b5ddffa Added: character.DisableSkillsFor( duration ) method to disable skills that are started with start_skill_script or by scritps defined in attributes.cfg for duration ( seconds )
This method overrides the default Delay setting in attributes.cfg if used ( for example if on failing a skill you want no delay just set it to 0 )
             This can also be used to disable skills for example during an event or pvp
    Added:   item.name_suffix for adding crafter marks or such
             item.desc returns the formatted name and suffix added to it without formatting if it exists
             item.name does not include this suffix, so that can be used to get the item name without formatting and without suffix
2013-09-25 18:43:43 +00:00
turley
b0338db350 some c++11 changes 2013-09-21 09:45:04 +00:00
dsourc
b8a0cdfadd Added Weapon RW member .speed_mod
Changed Weapon RW member .dmg_mod to dynamic
Fixed in UContainer set_script_member functions the new members to cast correctly the values to short from int
2013-09-03 11:14:56 +00:00
dsourc
6fd2500e99 Added Container RW members .max_items_mod .max_weight_mod and max_slots_mod
Fixed a possible problem with max_slots where it was reading the default value from ssopt instead of desc value
Fixed the set part of dynamic members so that during server restarts it doesnt fill the map for nothing if the value is 0 and when setting the value to 0 whenever removes it from the map
2013-09-02 16:35:38 +00:00
frozenblit
4fed077538 Added string formatter from andenixa. Missing: write tests!
(http://forums.polserver.com/viewtopic.php?f=41&t=5078)
2013-08-27 22:11:09 +00:00
turley
3a37cd1006 Added: string methods:
str.length() : returns like len(str) the length of the string
str.upper() : returns like upper(str) the uppercase version and also modifies the str
str.lower() : returns like lower(str) the lowercase version and also modifies the str
str.find(Search,[Start]) : returns like Find(string, search, start) the index of the first occurance of 'search' after 'start' within str
but unlike the basic.em function the Start parameter is optional if not given it searches the whole string
str.join(array) : returns a string which is the concatenation of the array elements, seperated by str
2012-11-16 16:27:26 +00:00
turley
e6851b8b99 more codecleanup 2012-10-06 09:54:20 +00:00
turley
81bf53a069 Added: ecompile parameter -wP
Added:      ecompile.cfg entry ParanoiaWarnings
  Note:       since "{}" is valid syntax, only complain about it if ParanoiaWarnings is enabled
2012-10-05 16:47:53 +00:00
turley
15c949d185 added UnitTest for valid member/method definition 2012-09-29 11:10:32 +00:00
turley
f365e6e171 fixed an error in the member definition (why is it in the source since one year? nothing since "house_parts" should have worked) 2012-09-17 18:10:27 +00:00
dsourc
0b49173a9c Changed: MoveItemToContainer( item, container, x := -1, y := -1 ); to MoveItemToContainer( item, container, x := -1, y := -1, add_to_existing_stack := 0 );
Changed:    item.SplitStackInto( container, amount ) to item.SplitStackInto( container, amount, add_to_existing_stack := 0 )
  Note:       The optional add_to_existing_stack parameter defines if the items moved to the container will look for an existing stack and add to it or just add as a new item ( old behaviour )
              If add_to_existing_stack == 1 and there is no stack in the container, it will return Error "There is no existing stack", so its up to scripts to check this.
  Added:      item.HasExistingStack( container ) to allow scripts to check if there is an existing stack in a container or not, returns the ItemRef of the stack if it exists.
2012-08-27 11:06:41 +00:00
KevinEady
bdfb1de6ce Added: R/W member carrying_capacity_mod for mobiles to modify carrying capacity on a mobile-per-mobile basis. Is taken into account prior to global ssopt modifier. 2012-08-01 23:44:25 +00:00
dsourc
1051d6230c Added Readonly members .active_skill and .casting_spell for characters
return values 0/1 if character has an active attached skill or spell script
2012-06-03 10:47:15 +00:00
dsourc
315bf23344 Added R/W member editable 0/1 for maps 2012-04-15 13:58:22 +00:00
dsourc
e05a49a5c1 Added Support for new map message packet 0xF5 for clients 7.0.13+
This packet supports the new facetXX.mul files and now can use every different realm for cartography maps and sea charts.
     Added    r/w member .facetid for Maps
              This has actually nothing to do with realms, the value is the same as in FacetXX.mul file
2012-04-14 19:03:18 +00:00
dsourc
ce4681659e Removed: char members .lastx, .lasty and .lastz and replaced with .lastcoord that returns a struct{ .lastx, .lasty, .lastz }
Fixed:   Roof problem at 4th floor on a custom house. 
         Patch submitted by Agata
Added:   Packet 0xD6 to be ignored for activity ( fixes inactivity logout for ML+ )
         Patch submitted by OWHorus
2012-04-06 16:49:59 +00:00
KevinEady
a1a758660b Added: ecompile.cfg directive "ErrorOnWarning" and ecompile switch -y to treat warnings on errors during ecompile. Default is 'false'
Fixed: various locations were showing warnings even without the -w switch provided.
2012-04-05 23:43:46 +00:00
dsourc
8a35267583 Added: character readonly members .lastx, .lasty and .lastz 2012-03-26 06:44:18 +00:00
dsourc
bd36000ba9 Added: character readonly member .tradewindow
return ContainerRef if the char has an active trade and error if no active trade
2012-02-08 21:55:04 +00:00
dsourc
27fe484ab5 One more fix for boat components and server restart
Added: readonly member .multiid for houses and boats
2012-02-02 15:35:50 +00:00
turley
9677a77c2c added XmlNode.clonenode()
since all NodeObjects get destroyed when the corresponding XmlFileObject is destroyed, use this method to store a Node for later use.
2012-01-02 13:44:52 +00:00
turley
03dc8c934e linux fixes for 64bit 2011-12-23 14:49:51 +00:00
turley
4e7e400254 64bit compilation.. 2011-12-23 13:28:38 +00:00