Commit graph

64 commits

Author SHA1 Message Date
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
turley
fd92b259a4 minor refactoring
possible bug in executor (array assign)
2011-12-19 18:25:03 +00:00
dsourc
13a4ff3b44 Support for HSA botes ( no smooth move yet, but now all boats are usable ) 2011-12-13 16:41:34 +00:00
KevinEady
25c1b0ccb8 11-22-2011 kevin:
Added:	pol/sqlscrobj.cpp pol/sqlscrobj.h
  Changed:	pol/module/sqlmod.cpp pol/module/sqlmod.h
  			Add preliminary MySQL database support.
  			New eScript objects: BSQLConnection, BSQLResultSet, BSQLRow 
  			Added several new sql module functions:
  				mysql_connect(host,username,password);
				mysql_query(connection,query);
				mysql_fetch_row(result);
				mysql_affected_rows(result);
				mysql_num_fields(result);
				mysql_num_rows(result);
				mysql_select_db(connection,database);
				mysql_field_name(result,column_index);
				mysql_free_result(result);
				mysql_close(connection);
			In order to build with MySQL support, define the HAVE_MYSQL preprocessor directive in your build configuration.
			You must have the MySQL headers and libraries installed. 
			Only really tested with dynamically linking mysql libraries on Linux.
			
	Added:	pol/network/auxclient.h
  Changed:	pol/network/auxclient.cpp pol/module/osmod.cpp pol/module/osmod.h clib/socketsvc.cpp clib/socketsvc.h
  			Moved AuxClient-related classes to its own header file (shared between auxclient.cpp and osmod.cpp)
  			Implemented os::OpenConnection() to create outgoing TCP/IP connections. 
  			
  Changed:	runecl/runecl.cpp
  			Added the sql module to runecl to allow quick testing

  Changed:	pol/uoscrobj.cpp pol/mobile/charactr.cpp pol/mobile/character.h bscript/parser.cpp bscript/objmembers.h
  			Added read/write property "mountedsteps" for mobiles. Represents number of steps taken while character was mounted.

  Changed:	bscript/parser.cpp
  			Declaring an array only using "{}" will show a compiler warning; please explicitly state 'array', 'struct', or 'dictionary' 
  Changed:	pol/pol.cpp
  			If using Linux, remove pol.pid on shutdown of pol.

  Changed:	pol/uoexec.h pol/scrsched.cpp
  			Added script option "AUXSVC_ASSUME_STRING" which will allow aux service connections to send and receive non-packed strings.

  Changed:	ecompile/ecompile.cpp
  			If using Linux, a slash ("/") cannot be used to define ecompile options to allow support for absolute filenames.

  Changed:	bscript/object.cpp bscript/bobject.h
  			Implemented array operation MultiSubscript. Will return a splice of an array, eg:
  				array{"a","b","c","d","e"}[2,4] will return array{"b","c","d"}
2011-11-23 05:49:30 +00:00
AustinHeilman
f55162e603 Applied KnightRage's patches for errors found by Andenixa 2011-10-22 07:26:34 +00:00
AustinHeilman
d86a8705f7 Added read only property to the item class: item.doubleclickrange 2011-10-15 19:09:59 +00:00
turley
c9cabbf9a2 Added: DestroyMulti(house) returns error "House currently being customized."
Added: house.cancelediting(chr, drop_changes) will stop editing mode.
drop_changes 1/0 if true drops all non committed changes
Errors: "House is not custom","House is currently not been edited","Character is not editing this house"
Added: Syshook CloseCustomHouse(mobile, house)
called after client quits editing, or when house.cancelediting() is called
return value is ignored
Added: servspecopt.cfg
"SpeedHack_MountRunDelay"  default 80 ms
"SpeedHack_MountWalkDelay" default 180 ms
"SpeedHack_FootRunDelay"   default 180 ms
"SpeedHack_FootWalkDelay"  default 380 ms
Change them on your own risk
2011-09-03 08:15:59 +00:00
AustinHeilman
235a204b46 Changed merchants to send a .shopping list with EVID_MERCHANT_SOLD containing an array of structs .item and .amount (script is responsible for breaking up stacks) - Scripts will be responsible for gold checks, etc when something is purchased.
Added item.SplitStackInto(container, amt) - Returns a reference to the new item stack or errors. Have spot for item.SplitStackAt(x, y, z, real, amt) next.
2011-08-09 00:02:14 +00:00