--- crossfire/server ---


Protocol:pserver User:anonymous
Machine:crossfire.cvs.sourceforge.net CVSROOT:/cvsroot/crossfire

Filename: skill_util.c
Revision 1.69ryo_saeba 2006/09/03 08:01:02 +3 -15
#1551386 (Alchemy with unpaid items)
Show difference between Revision 1.68 and 1.69
Revision 1.68gros 2006/07/25 06:44:44 +9 -2
Fix bug #1528197, by making dragons prefer clawing over anything else as unarmed combat technique.
gros - 2006/07/25
Show difference between Revision 1.67 and 1.68
Revision 1.67mwedel 2006/06/05 01:28:56 +4 -19
Clean up some compiler warnings. Most of the changes are related to replaced
%lld with FMT64 defines so that the format will be correct, no matter if
the 64 bit type is a long, long long, or if this is windows. #if 0 out a
bunch of code that isn't used.
--
common/exp.c: Replaced lld with FMT64
common/holy.c: #if 0 out baptize_altar(). Add banner copyright at top of file.
common/info.c, common/item.c, common/loader.l, common/loader.c, common/map.c:
common/porting.c Replaced lld with FMT64
common/time.c: Replace a bunch of variables declared as longs to be uint32.
Update various sprintf appropriately.
include/global.h: Add FMT64 and FMT64U as appropriate for different systems.
Change max_time to be a uint32
include/sockproto.h, include/sproto.h: rebuilt
server/apply.c: #if 0 out monster_apply_special
server/c_range.c: Add != 0 in assignment if statement - same meaning, clearer
on intention and avoids compiler warning.
server/c_wiz.c: Update command_kick() to take const char. Update command_speed()
to operate properly based on max_time being a uint32. Update various lld
to FMT64. Clarify ambiguous if/if/else statement in command_insert_into()
server/commands.c: Add cast to command_kick for new function prototype. #if
0 out find_command(), parse_string(), parse_command()
server/disease.c: #if 0 out find_disease(), reduce_symptoms()
server/egoitem.c: #if 0 out create_artifact(). Add copyright at top of file.
server/gods.c: #if 0 out get_god()
server/hiscore.c: Replace lld with FMT64
server/login.c: #if 0 out create_savedir_if_needed()
server/resurrection.c: Replace lld with FMT64. #if 0 out dead_character() and
dead_player_exists()
server/server.c: Remove info_keys() - hasn't been used in a long time. #if 0
out process_active_maps()
server/skill_util.c: Replace lld with FMT64
server/spell_util.c: #if 0 out check_spell_effect()
server/weather.c: #if 0 out feather_map(). Fix what I suspect is an error
in worldmap_to_weathermap() to skip over starting slashes.
socket/image.c: Add a fair number of char * casts to suppress warnings.
socket/init.c: Change buflen in init_connection() to socklen_t to match
function prototype. Add some char * casts.
socket/loop.c: Add some char * casts.
--
MSW 2006-06-04
Show difference between Revision 1.66 and 1.67
Revision 1.66akirschbaum 2006/05/26 17:29:07 +5 -2
Make attacking with melee in 'fire command work again. Now attacking with
<shift>+<direction> works again.
Show difference between Revision 1.65 and 1.66
Revision 1.65ryo_saeba 2006/05/05 04:26:35 +6 -3
First part of patch #1453869 courtesy Stefan Huehner (shuehner)
Show difference between Revision 1.64 and 1.65
Revision 1.64cavesomething 2006/03/07 12:46:26 +3 -3
Add settings permanent_experience_percentage, death_penalty_percentage and
death_penalty_levels to the settings file.
---
common/living.c: don't hardcode exp calculations
common/init.c, include/config.h, lib/settings: set defaults for new values
doc/settings: document new values
include/global.h: change settings struct to hold the new values
server/init.c: parse new values in the settings file.
server/skill_util.c: reference new value
Show difference between Revision 1.63 and 1.64
Revision 1.63akirschbaum 2006/02/17 15:29:48 +2 -2
Apply patch #1433271 (code-cleanup) by Stefan Huehner: Add const and static.
Show difference between Revision 1.62 and 1.63
Revision 1.62akirschbaum 2005/12/05 17:34:04 +2 -2
Apply patch #1371956 (code cleanup patch) by Stefan Huehner: fix old-style
function declarations and prototypes to proper Ansi C syntax. This patch
allows the compiler to check function arguments and also removes some warnings
when compiling with -Wstrict-prototypes.
Show difference between Revision 1.61 and 1.62
Revision 1.61ryo_saeba 2005/11/27 08:16:46 +4 -3
Add a filter to skills command
Show difference between Revision 1.60 and 1.61
Revision 1.60mwedel 2005/11/16 02:16:09 +12 -6
Commit for new blocking code. Not going to dictate all the changes -
but will outline the broad points. Note also that the
doc/Developers/objects is updated and goes into more details also.
- check for P_WALL no longer used - instead, need to use GET_MAP_MOVE_BLCOK
and check against movement type of objects.
- arch_blocked() changed to ob_blocked(), now takes object. Needed because
just looking at archetype move_ values is no longer sufficient.
- find_first_free_spot() changed to take object, since it just calls
arch_blocked()
- FLAG_FLYING removed, now in move type.
- walk_on/walk_off/fly_on/fly_off removed - now based on move_on and
move_off fields.
- Map space structure extended to hold the move_on/move_off, etc
values so that we can shortcut some processing by not having to
check every object on the space when something enters it if
move_on isn't set.
- archetypes recollected - boulders needed move_walk to properly trigger
buttons.
- Note that the new plugin code has to be fixed up for the new movement
code. Look for FIXME in plugins/cfpython/cfpython_object.c
MSW 2005-11-15
Show difference between Revision 1.59 and 1.60
Revision 1.59akirschbaum 2005/10/28 14:08:53 +2 -2
Fix compiler warnings. Most changes do not change the program (remove unused
variables, convert "if(x = y)" into "x = y; if(x)"); a few actually fix
(possible) problems (fix uninitialized variables, fix printf format
specifiers, fix mismatches between signed and unsigned variables, add missing
return and default statements).
Show difference between Revision 1.58 and 1.59
Revision 1.58cavesomething 2005/10/02 22:29:41 +5 -2
add support for specialised shops
Show difference between Revision 1.57 and 1.58
Revision 1.57ryo_saeba 2005/09/25 04:47:23 +2 -2
Fix some compilation warnings.
Show difference between Revision 1.56 and 1.57
Revision 1.56ryo_saeba 2005/09/24 04:28:05 +3 -3
Patch 1194964 (party obsoletion) by cavesomething
Show difference between Revision 1.55 and 1.56
Revision 1.55ryo_saeba 2005/08/12 08:46:34 +4 -4
Fields changed from char* to const char*, cleanup.
Show difference between Revision 1.54 and 1.55
Revision 1.54ryo_saeba 2005/08/12 03:18:59 +9 -8
Use const char* instead of char* when possible
Show difference between Revision 1.53 and 1.54
Revision 1.53ryo_saeba 2005/07/23 05:06:36 +2 -2
Fix message with 'null'
Show difference between Revision 1.52 and 1.53
Revision 1.52akirschbaum 2005/07/14 04:18:55 +2 -2
common/{button.c, treasure.c, utils.c}, server/{c_wiz.c, login.c, shop.c,
skill_util.c, spell_effect.c}, socket/{image.c, item.c}: Fix printf like
format specifiers. At least one of them fixes a means to crash the server.
Andreas Kirschbaum 2005-07-14
Show difference between Revision 1.51 and 1.52
Revision 1.51akirschbaum 2005/05/22 02:41:40 +2 -2
server/skill_util.c: Print correct permanent experience ratio for experience
values >2 billion.
Show difference between Revision 1.50 and 1.51
Revision 1.50akirschbaum 2005/03/06 14:38:55 +2 -2
common/{map.c, readable.c, treasure.c}, crossedit/Attr.c, server/{apply.c,
attack.c, c_wiz.c, init.c, monster.c, pets.c, shop.c, skill_util.c, skills.c,
spell_attack.c, spell_effect.c, time.c}, socket/{info.c, request.c}: Add
missing newline character to LOG() messages.
Show difference between Revision 1.49 and 1.50
Revision 1.49mwedel 2004/06/23 00:49:07 +3 -3
server/skill_util.c: Fix skills command so that it properly displays
percentage of permanent exp.
server/time.c: Modify move_arrow() so that it removes thrown objects
with no inventory.
MSW 2004-06-22
Show difference between Revision 1.48 and 1.49
Revision 1.48ryo_saeba 2004/06/06 11:25:40 +7 -2
Fix for monsters not using hands, and now ignore DM
Show difference between Revision 1.47 and 1.48
Revision 1.47mwedel 2004/04/08 01:48:51 +26 -1
common/item.c: If potion wasn't given a random spell, use the archetype
name when it is identified.
common/treasure.c: Fix potion codes so that healing and magic power potions
get the proper spell inserted into them. Also fix line termination issue.
server/skill_util.c: Add check in skill_attack() to make sure current_weapon
is not null - there has been some crashes here, but I can't figure out
how it gets to this state, so better to at least handle it.
MSW 2004-04-07
Show difference between Revision 1.46 and 1.47
Revision 1.46mwedel 2004/02/22 19:21:28 +13 -11
lib/*: different spell for dragons vs players for firebreath - update
treasures so monsters use ability version.
server/gods.c: Add missing call to link_player_skills(), resulting in players
having multiple praying skills.
server/skill_util.c: Change learn_skill() so we don't create a skill pointer
for the player if they didn't learn the skill (even if they can't use
such a created skill, it is still a bit confusing). Fix finding of
hand to hand skills to make sure the player can in fact use the skill
in question.
MSW 2004-02-22
Show difference between Revision 1.45 and 1.46
Revision 1.45mwedel 2004/02/13 01:42:09 +21 -3
common/object.c: change get_owner() so that it also returns no valid owner if
the owner is removed. This fixes a crash if a player quits but is still
sitting at the play again prompt when something he owns kills something.
server/skill_util.c: Fix show_skills() so that if the character has too many
skills for whatever reason, we don't crash, and instead print an error
to the player.
server/spell_attack.c: Fix typo - not sure actual effect, but probably nothing
good. '+ +' should just have been '+'
MSW 2004-02-12
Show difference between Revision 1.44 and 1.45
Revision 1.44ryo_saeba 2004/01/16 15:17:02 +9 -1
Writing inscription fix. Win32-specific stuff
Show difference between Revision 1.43 and 1.44
Revision 1.43mwedel 2003/10/27 01:24:14 +3 -2
Various bug fixes:
common/arch.c: Fix item_matched_string() so that it only passes in the length
of the pssed in name in the strncasecmp(), and not the shorter of the
passed in string or item name. Otherwise, if player does a 'drop wand of',
unidentified wands (name just wand) would match. Similarly, if a player
did 'drop ringmail', unidentified rings would match, etc.
common/living.c: Fix fix_player() to always process the praying skill with
respect to resistances and whatnot. This is necessary because the
god give abilities are put in this skill, and those shouldn't go away
depending on if the skill is in use or not. Also fix bug in add_exp
routines which wasn't multiplying permanent exp by PERM_EXP_GAIN_RATIO
common/object.c: Fix find_obj_by_type_subtype() - had extraneous semicolon
after the for loop, so the if code that was supposed to be for each object
was never called and instead would crash as it would get called with tmp
was null.
server/attack.c: Fix problem with kill_object() not finding proper skill -
it would use the skill object instead of the skill. Fix problem of
poisoning not setting up proper skill name in poisoning object.
server/c_range.c: If player is invoking a spell, don't update their
range_magic value.
server/skill_util.c: Fix divide by zero problem if improperly passed
skill object.
MSW 2003-10-26
Show difference between Revision 1.42 and 1.43
Revision 1.42mwedel 2003/10/26 01:56:57 +51 -1
common/glue.c, common/object.c, common/player.c, include/funcpoint.h,
server/init.c, server/monster.c, server/shop.c, server/skill_util.c: add
find_skill_by_number() function - this replaces find_skill. Locate new
function in skill_util.c, which is more a proper place than
common/player.c - this change necessitated adding glue function pointers
so the other common files can call it.
server/spell_effect.c: Fix cast_heal() so if the spell is not one that heals
hit points, don't process the code that checks for that and sets
a false success value.
socket/metaserver.c: Clean up formatting - no code changes.
MSW 2003-10-25
Show difference between Revision 1.41 and 1.42
Revision 1.41mwedel 2003/09/24 01:08:35 +3 -1
server/skill_util.c: Call esrv_send_inventory on the cauldron if we
performed alchemy. Needed for cauldron's contents to get updated.
MSW 2003-09-23
Show difference between Revision 1.40 and 1.41
Revision 1.40mwedel 2003/09/13 00:02:12 +535 -1305
Updated code for skill + spell code. skills and spells are now objects.
tuning these now means changing the archetypes. New spells can now
be added just by making a new archetype. Lots of code cleanup
also done.
MSW 2003-09-12
Show difference between Revision 1.39 and 1.40
Revision 1.39temitchell 2003/09/04 01:25:32 +2 -2
- add new type TRAP, make initial seperations from RUNE in code
add in traps triggering stuff if they are detonated
Show difference between Revision 1.38 and 1.39
Revision 1.38mwedel 2003/03/07 23:35:32 +3 -3
Patch for 64 bit experience total, as well as flexible number of levels.
Basically, max level is now dynamic, set in exp_table file. Experience
is now a 64 bit value, so much higher totals now allowed. To
allow for flexible levels, add new function - did_make_save() which is used
for players/monsters to see if they make their saving throw - this is
necessary because the savethrow[] array may not be as large as max level -
did_make_save takes this into account.
NOTE: If your updating a server, you will need to copy over/set up a
new exp_table file that has max_levels defined and at least one of the
tables uncommented. There are no longer any compiled in defaults
--
configure, configure.ac: Add AC_CHECK_SIZEOF calls for long and long long
so we can know which one to use for 64 bit support (other checks
may need to be added)
common/exp.c: Remove levels table, replace it with a 64 bit pointer.
Change init_experience to allocate appropriately sized table, have it
read max_level value from exp_table file. Replace atoi calls with
atoll to get 64 bit value. Update dump_experience to properly
print 64 bit values.
common/info.c: Update dump routines that dump exp to properly print
64 bit values.
common/init.c: Add initializing for settings.max_level value.
common/item.c: Update sprintf's to handle 64 bit output of exp (speed)
value in objects.
common/living.c: change MAX_EXP define, update MAX_EXP_IN_OBJ define,
add MAX_SAVE_LEVEL which corresponds to how large the savethrow
table is. Change MAXLEVEL to settings.max_level. Change level_exp()
to return 64 bit value, other updates in functions to use 64 bit
values. Add did_make_save() function.
common/loader.l, common/loader.c: Update load/save routins of exp to
deal with 64 bit values.
common/map.c: Update calculate_difficulty to use 64 bit values when
storing exp - unlikely to make a difference, since unlikely any map
will get to a point where it has that much exp on it.
common/porting.c: Remove dead code from save_long(), add save_long_long()
to save 64 bit values.
include/autoconf.h.in: SIZEOF_LONG and SIZEOF_LONG_LONG values added.
include/global.h: Add code to typedef sint64/uint64 types based on what
type gives us those values. Add max_level to settings array.
include/libproto.h: rebuilt.
include/living.h: Replace exp field with 64 bit value.
include/player.h: Update party kill log exp tracking to have 64 bit
values.
lib/exp_table: Udpate comments about max_level, uncomment what
was the default table so new installs have working table.
Add 5 levels to all the tables.
random_maps/monster.c: Update place_monsters to use 64 bit when storing
exp total for map/per square.
server/apply.c: Replace MAXLEVEL with settings.max_level, add
did_make_save calls where appropriate
server/c_misc.c: have statistics command properly print 64 bit
exp value.
server/c_wiz.c: Have stats command properly display 64 bit value.
server/hiscore.c: Replace exp values with 64 bit values, update to
properly load/display them.
server/player.c: replace savethrow[] reference with did_make_save()
server/skill_util.c: Update skills command to properly show 64 bit exp values.
server/spell_effect.c: replace savethrow[] reference with did_make_save(),
allow players to cast directors right beneath themselves, but other
walls must be on empty space.
MSW 2003-03-07
Show difference between Revision 1.37 and 1.38
Revision 1.37mwedel 2003/02/03 01:23:48 +1 -2
More bugfixes:
include/shop.h: remove _SHOP_H after endif, causing compiler warnings.
include/skills.h: Add check to USING_SKILL to make sure chosen_skill
is not null.
server/c_chat.c: Add some missing return values, resulting in compiler
warnings.
server/skill_util.c: Remove unused variable. compiler warnings again.
server/spell_effect.c: Change dimension door so that you can't go
through spaces that block passsage and also block view (eg walls).
This goes back to the more traditional behaviour. Remove
some unused variables.
server/spell_util.c: Add missing P_OUT_OF_MAP to move_missile, resulting
in crashes.
server/time.c: if generator is not on a map, don't have it generates.
Fixes crashes.
MSW 2003-02-02
Show difference between Revision 1.36 and 1.37
Revision 1.36garbled 2003/01/08 22:20:26 +6 -13
Rewrite alchemy slightly. Now in the formula, we include a difficulty
(percentage) and the experience value for the formula. We no longer
adjust the experience given by the difficulty of the map. We no longer
use the number of items to determine difficulty, rather we use the
difficulty rating in the formula. We no longer multiply the experience
given by the yield of the product, one "casting" one exp. When writing
formulae, calculate the difficulty in when setitng the exp, because it is
not multiplied in any way.

Fix a bug in Mark's new armour enchantment stuff. Send the item to the
player, otherwise they mysteriously dissapear, and only add the split
items back if they were spilt, avoiding a segv when enchanting a single
piece of armour.

Change alchemy skills to only utilize cauldrons directly beneath the
user.. the other behavior was getting annoying.

This should slow down the abusive nature of alchemy. The exp settings
and difficulty levels probably should be tuned better. Feel free.
Show difference between Revision 1.35 and 1.36
Revision 1.35mwedel 2003/01/08 02:39:21 +2 -3
Bulk of this commit is to improve code for tiled maps - replace
wall/blocks_magic/blocks_cleric, etc with get_map_flags which
also does map tiling translation as needed. This should fix a lot
of the bugs related to map tiling (there are sure to be more out
there - all the get_map_ob still need to be checked).
Other changes - many spells stopped progressing on spaces that
blocked view - that is now removed - didn't make a lot of sense.
Other fixes - some cleric spells (eg, word of recall) checked to
see if magic was prohibited, didn't check to see if cleric
was prohibited.
Clean up some bugs in the lighting code that would cause erroneous
results. Also, allow players to see immediately around them on
outdoor maps no matter how dark the map really is - behaviour
on indoor maps is the same.
Lots of code reformatted, and lots of obsoleted/dead code removed.
Add max range to dimension door.
Fix magic map - got broken when the layer stuff was redone - was
not showing proper colors. IT also works sensibly on tiled maps
now - rather than display based on the map, it gives the player a
50x50 area centered on where the player is.
Change fire_bow - move special player fire modes into own function -
makes code much cleaner.
Hopefully this fixes more bugs than it introduces.
common/los.c, common/map.c, common/object.c, crossedit/Edit.c,
include/libproto.h, include/sockproto.h, include/map.h,
include/spellist.h, include/sproto.h, random_maps/treasure.c,
random_maps/wall.c, server/attack.c, server/c_misc.c,
server/c_wiz.c, server/disease.c, server/main.c, server/monster.c,
server/pets.c, server/player.c, server/rune.c, server/shop.c,
server/skill_util.c, server/skills.c, server/spell_effect.c,
server/spell_util.c, server/time.c, socket/info.c: See note above
server/apply.c: Limit number of times weapon can be enchanted so
that it won't overflow item_power. Modify enchant armor
to enchant as normal armor is enchanted, also only allows one
item to be enchanted.
MSW 2002-01-07
Show difference between Revision 1.34 and 1.35
Revision 1.34mwedel 2002/12/03 01:40:18 +157 -133
TODO: Move more items from my mailbox to the TODO list.
common/living.c: Init item_power in player to zero in fix_player() -
bogus results were getting generated as it just kept getting incremented.
common/porting.c: fix remove_directory so it works properly - checking
for . and .. entries too late, calling unlink instead of rmdir.
include/sproto.h: rebuilt
lib/animations, lib/archetypes, lib/bmaps, lib/bmaps.paths, lib/crossfire.0,
lib/crossfire.1, lib/faces: Rebuilt - new archs added, catch is_thrown
addition to thrown rock/boulder archs.
server/c_move.c, server/c_range.c: Add another parameter to do_skill() - part, which
is closest part of creature to target object - current only used
for the throw code. Update calls to this function to add additional
parameter.
server/c_object.c: Remove the NDI_UNIQUE from the 'item is too heavy
to pick up' so that it won't flood the client with them if players
goes onto space with lots of objects.
server/main.c: Minor cleanup to fix compiler warning about ambigous
if/else.
server/monster.c: Pass closest part of monster when having it use
a skill so that it doesn't throw rocks into itself. Update calls to
do_skill as described above.
server/player.c: Cal delete_player() when player quits - this properly
cleans up any per player unique maps they have. Also, check for
any such maps currently in memory, and delete those so that unique
maps don't get 'gifted' to the next character of the same name.
Update calls to do_skill as described above.
server/shop.c: Combine items of the same name together in the output
of the shop listings. Include the number of items, remove special
casing of some objects so that query_base_name is used for all item
types.
server/skill_util.c: Modify do_skill() to take additional param as
described above. Also, have do_skill return 1 on success,
0 on failur to use skill, and not return exp - otherwise,
monster code has no idea if skill was successfully used, as throw
doesn't grant exp, and this caused monsters to move into the
object they just threw. Update calls to do_skill as described
above.
server/skills.c: Clean up skill_throw function to return meaningfull
value. Also, pass along extra part of closest monster part
to target. Modify do_throw to return value, use closest
part of body as origin point for thwon object.
server/spell_effect.c: Use isqrt function instead of definining
ISQRT that used float version. Cleans up compile warning - most
likely not seen before as spell was #ifdef SPELL_ENCUMBERANCE out.
server/time.c: Put sanity checking for players speed_left in
move_player_mover() - got some reports of infinite negative speed
on metalforge, and this is the only place in the code where I could
see that happening given the description of the events.
utils/arch2xml.py, utils/cfarches.xsl: New script (and template) by
Todd Mitchell. Script can convert archs to xml, and the template
is usuable with mozilla to look at the output.
MSW 2002-12-02
Show difference between Revision 1.33 and 1.34
Revision 1.33garbled 2002/11/26 02:37:11 +1 -5
get rid of #ifdef NO_AUTO_SKILL_SWITCH
Show difference between Revision 1.32 and 1.33
Revision 1.32garbled 2002/11/13 18:19:32 +1 -3
Nuke #ifdef ALCHEMY from orbit. If you don't want alchemy cp /dev/null
lib/formulae.
Show difference between Revision 1.31 and 1.32
Revision 1.31garbled 2002/11/11 02:59:09 +29 -4
New alchemy code, as discussed on the developer list. Now recipies include
two new tags: skill and cauldron. With skill, you can set which skill
activates this recipie, and the cauldron, corresponds to the arch name of
the facility you will use when creating the item. In this way, item
creation is now more generalized than just alchemy, and specific formulae
can be written to utilize different skills, or perhaps special formulae
would require a hard-to-find cauldron.

Functionally, the alchemy, or alchemy-like-skills are now activated by
the use_skill command. The secondary use of the alchemy spell has been
withdrawn, so now it functions in the way it was originally intended again.
Show difference between Revision 1.30 and 1.31
Revision 1.30mwedel 2002/09/11 01:21:46 +19 -18
INSTALL: Update directions with new automake method.
common/Makefile.am, common/Makefile.in: Fix code for building the libproto.h
file - it was including loader.l and not loader.c
common/exp.c: Add init_experience() and dump_experience() functions -
init_experience() loads the experience table from a file. Add default
experience table into this file
common/init.c: Add call to init_experience()
common/living.c: Remove experience tables - players can select the one they
want by changing the exp_table file. Remove reference to new_levels[] -
only levels[] is used now for the formentioned reason.
include/config.h: Update notes about SIMPLE_EXP system.
include/libproto.h: rebuilt.
lib/Makefile.am, lib/Makefile.in: Add exp_table to list of files.
lib/exp_table: New file that contains experience information.
server/c_object.c: Modify command_take() to look for objects above the player
to pick up, then objects below. This fixes the bug with not being able
to use the take command on items from a chest the player opens without
moving off the space.
server/init.c: Add -mexp dump switch to dump the experience table. Allow
the simple experience system to be set in the settings file.
server/skill_util.c: Fix oddness in calc_skill_exp() which could result
in add amounts of exp given.
MSW 2002-09-10
Show difference between Revision 1.29 and 1.30
Revision 1.29mwedel 2002/09/07 17:08:07 +2 -2
Automake patch - all files.
The changes for the source files is using confdir instead of
datadir.
Patch by Jacek Konieczny (jajcus@bnet.pl), applied by Mark Wedel,
2002-09-07.
Show difference between Revision 1.28 and 1.29
Revision 1.28mwedel 2002/07/14 23:57:13 +135 -116
-- Start body commit notes --
Major commit. This adds body locations which is used for equipping items.
Equipment has information which body part it gets equipped to, and monsters
have information on how which body locations they can have.

As part of this work, I also did a lot of code cleanup.

To use this, you must use up to date archetypes - the ones included
in this commit are fine - just make sure you install them. If
you don't, players will not be able to equip items.

common/arch.c: Initialize body_used to be same as body_info for
archetypes - this way when monsters are created, they can
start equipping items right away.
common/exp.c: update new_exp() - some flags it checked for before no longer
exist or have new names.
common/info.c: describe_item() now takes second parameter - update
dump_abilities to use new calling convention.
common/item.c: Add table that describes the body_info locations and
their names. Add functions that calculate item power for objects
that don't have it set. Update display functions to show
item_power in items. Update describe_monster() - use_horn/wand/rod
merged into just use_range. Modify describe_item() to take second
paramater - who the item is being described for. Show item_power
in describe_item.
common/living.c: Pull out MAXLEVEL from being defined in this file -
define in in define.h, since other files use it. Add NUM_STATS
define - replace hard coded values of having just 7 stats with it.
Update change_abil to not display that the player has a new
attacktype when equipping a bow that has it - fix_player() ignores
the attacktype of the bow, so it was incorrect information.
fix_player(): Initialize player ranges structure to null -
will get filled in by code in function, updated to deal with
updating the body_used data from body_info in the objects.
Replace instances of last_heal with gen_sp_armour. Rearrange
some code to make function more readable.
common/loader.c, common/loader.l: Remove the variable_const information - no
longer needed and confusing for new people when adding in new object
elements. Add set_body_info() - parses the string from the load file and
sets the appropriate array element. Add check_loaded_object() - does
sanity checking for an object after finished loading - replaces need for
long processing directive in the actual rules by having seperate function.
Remove unused flags from load directives (apply_once, no_pretext,
can_apply), add some new ones (item_power, gen_sp_armour), update others
to can_use_range. Replace flag_links with simple array that contains the
name for each corresponding flag. Update get_ob_diff to not use the V_
values and just include the actual string name - all recent changes have
done this, just updated for old stuff. Update get_ob_diff to save new
values that have been added.
common/object.c: clear_object: Modify to use memset to clear
the structure to zero - this is less error prone than listing
all the specific values, and probably faster. Also, makes it
easier to add new elements - no need to update object.c in most
cases.
common/player.c: Remove get_player_ob routine - this is now merged
in with get_player_ob in server/player.c. Remove generate_ext_title -
not used.
common/readable.c: Update to pass second argument to describe_item.
common/treasure.c: Update to calculate item_power of generated items.
Clean up a lot of code formatting. Update add_abilities
to use gen_sp_armour values, not last heal (note, it appears
the last_heal values weren't being used before). Update
calls to describe item to take second parameter.
doc/Developers/objects: Update will_apply notes, add note about
item_power, body location.
include/define.h: Comment out unused flags (flag_apply_once, flag_paralyzed,
flag_no_pretext, flag_ready_rod, flag_read_horn). Add flag_use_shield.
rename flag_use_wand to flag_use_range. rename flag_ready_wand to
flag_ready_range. Add flag_ready_scroll. Update ARMOUR_SPELLS access
macro. Add AP_PRINT flag to apply flags. Add CAN_APPLY_.. return types
for can_apply_object function.
include/includes.h: add strftime, mktime checks to this file.
include/libproto.h: rebuilt.
include/living.h: Add NUM_STATS define, update extern declarations
to use it for sizing.
include/loader.h: remove the V_.. info and xbm_.. externs that were not
used.
include/newserver.h: Remove ext_tile information.
include/object.h: Add Body_Locations structure, NUM_BODY_LOCATIONS define.
Add definitions for WILL_APPLY values. Clean up object structure -
formatting is now consistent, ordering of values groups values
together more logically. Update all types to use the int8/int16/int32
types. Several unused fields removed.
include/player.h: Update rangetype enum. Add unapplymode enum.
Clean up player structure - type updates, unused fields removed,
formatting fixed up.
include/spells.h: remove range_name extern. Update SpellTypeFrom
field to combine wand/rod/horn into spellMisc - none of the
spell casting code was differentiating these.
include/sproto.h: rebuilt.
lib/Makefile.in: Add new help files (applymode, bind, brace)
lib/archetypes: rebuilt for body_info, gen_sp_armour, item_power,
can_use_shield information.
lib/artifacts: updated for item_poer and gen_sp_armour changes.
lib/treasures: remove unused _force for player treasure.
plugin/plugin_python.c: Change FLAG_USE_WAND to FLAG_USE_RANGE.
server/apply.c: Move stftime, mktime to include/includes.h. Remove
draw_find() - one line function can just as easly be in the
code itself. Update calls to long_desc to pass second parameter.
move gravestone_text() to player.c file. Add direction parameter to
apply_scroll() - in this way monsters can use it properly.
Remove dead code. Update apply_special function. Add
unapply_special(), get_item_from_body_location(), unapply_for_ob(),
and can_apply_object() functions.
server/attack.c: Remove SET_FLAG(op, FLAG_PARALYZED) line - no code
was ever checking status of FLAG_PARALYZED.
server/c_misc.c: add command_body() which dumps body information for
player. Update who as idle element in player structure removed -
was not being used by anything. Add command_applymode() to
set players prefered unapply method. Remove calls to unlock_player()
in various functions - unlock_player() has not done anything
meaningful for a while.
server/c_object.c: Modify long_desc to take a second parameter
which is who is examing the object. this is needed so that we
can pass it down to some of the lower level functions.
Update calls to describe_item to pass this second parameter.
remove FLAG_NO_PRETEXT code - no archetyps were using it. When
examining objects, also tell player where to put them on.
server/c_range.c: Update legal_range() - we now store the object that
is responsible for a range in the player object, so code is
much simpler. Update change_spell() to not destroy golem
just by readying another spell - we now let players regain control
of golems after switching to another range. Update change_spell
to use item name of object for range description.
server/c_wiz.c: remove reference to count_left from player object -
field removed from structure.
server/commands.c: add new commands (applymode, body) to command dispatch
table.
server/login.c: Remove unlock_player() and lock_player() and calls to it -
current checking of names at login should be sufficient to
prevent duplicates. Remove dead code from check_name. Update
load/save code for unapply mode value. Add set_flag(op,
FLAG_USE_SHIELD) if player is allowed to use armor - needed since
flag_use_shield is really a class feature and so is not automatically
updated for old player files.
server/main.c: Remove references to count_left. memset marker object to
NULL - seems to increase stability on metalforge server.
server/monster.c: Many updates related to the body info - monsters follow some
rules as players. Add monster_should_cast_spell function - monsters will
use this for all spellcasting related actions (abilities, scrolls, wands,
etc). Update for merged rod/horn/wand ranges. Update bow use by monsters
- they don't actually need to equip it to fire - this way we don't need to
constantly swap the monsters weapons between the bow and melee item. Use
fire_bow from player.c for most of the work. Modify scroll usage -
monster will use it when player is near, not when it first picks it up.
Add FLAG_READY_SCROLL to denote the monster has a scroll to use. Also,
monster now casts it in appropriate direciton. Merge the
monster_use_wand/rod/horn into monster_use_range. Modify
check_good_weapon and check_good_armour to just look at the stats of the
two items without needing the monster to apply it first.
server/player.c: Print motd in green so it is more noticable. Update
get_player function to do work it did before as well as that of
get_player_ob. Have get_player take a parameter which is the object of
the player if he has one. Modify to use memset to clear the player
structure - more sure fire than explicitly listing values to initialize.
Remove calls to unlock_player. Modify fire_bow so that monsters can also
use the function. Add fire_misc_object() to fire_wand/rod/horn - removes
code from fire(). Add gravesetone_text() to this file.
server/shop.c: Update to pass second parameter to describe_item().
server/skill_util.c: Update check_skill_to_fire since there are fewer
rangetypes now. change range_scroll name to range_golem, as that is
a bit more accurate for what it actually does. Modify show_skills()
to show player his item power and total of items he has equipped.
server/skills.c: Add second paramater to long_desc, remove references to
count_left.
server/spell_effect.c: Add second paramater to long_desc, remove references to
count_left. Update range_scroll to range_golem
server/spell_util.c: remove references to count_left. Update messages
if player trying to cast where he can't with new range names.
socket/info.c: Update range information and how we display what it is -
we will use the object name of the range if available. Remove
reference last_known_spell, last_shoot, last_spell, last_value
player structure fields.
socket/init.c: Remove ext_title information.
socket/request.c: Add element for life_stealing in the resistance array.
Remove references to idle, count_left in player structure. remove
ext2 title information.
MSW 2002-07-14
-- End body commit notes --
Show difference between Revision 1.27 and 1.28
Revision 1.27mwedel 2002/03/20 00:27:46 +9 -8
Updates for 1.1.0 release - pretty much all minor bug fixes, like
compiler warning messages, invalid ANSI C constructs, missing files to
include in the distribution.
Makefile.in, include/version.h: update version.
include/Makefile.in: Add some missing files
include/libproto.h, sproto.h: rebuilt to prevent compiler warnings
lib/Makefile.in: Include the wizhelp files in the archive.
server/apply.c, server/skill_util.c: fix invalid code (function parameter
names can't match structs/typedefs), add a missing return value.
server/c_move.c, server/c_new.c, server/c_object.c, server/commands.c,
server/daemon.c: Don't include the sproto.h if CEXTRACT is defined.
server/plugins.c: fix printf command that was printing wrong value type.
doc/spoiler-html/Makefile.in: Remove extraneous newline
Show difference between Revision 1.26 and 1.27
Revision 1.26avogl 2002/03/03 14:05:58 +2 -2
two fixes to my dragon-race code:

- fixed stringcompares wich caused crashed
with players that have race NULL.
- forgot to commit "server/init.c" before,
which resulted in function dragon_ability_gain()
not to get bound, thus missing dragon ability gains.
Show difference between Revision 1.25 and 1.26
Revision 1.25avogl 2002/03/01 19:48:51 +21 -8
small fix: dragons now always use clawing
skill as default combat skill. That's
needed because only on clawing skill go the
special attacktypes.
Show difference between Revision 1.24 and 1.25
Revision 1.24avogl 2002/03/01 15:33:11 +21 -1
As announced on cf-devel, this is the patch which
adds a new dragon-race to Crossfire.
Players of this dragon race can gain resistances
by eating the flesh of their defeated foes.

They can also specify in a certain resistance-type
and gain various abilities when increasing levels.
This "focus" can be switched by eating very special
As announced on cf-devel, this is the patch which
adds a new dragon-race to Crossfire.
Players of this dragon race can gain resistances
by eating the flesh of their defeated foes.

They can also specify in a certain resistance-type
and gain various abilities when increasing levels.
This "focus" can be switched by eating very special
flesh, which will be available for sale.
Dragon players gain special titles which cannot
be overwritten by manually set titles.

Also see the dragon race description during the
race selection process.
Note that the quetzal has been slightly modified
(picture and race) to prevent getting mixed up with
the new dragon race.

Please keep in mind that this is the first version
of this dragon-race-code. Do not expect it to be
perfectly balanced in all aspects.
Player's opinions will provide some good feedback
for further development I hope.

--AndreasV
Show difference between Revision 1.23 and 1.24
Revision 1.23gros 2002/01/25 04:53:37 +6 -5
Bugfix: Corrected strange behaviour with the use of inscription skill,
resulting in corrupted strings sometimes. - Gros 01/25/02
Show difference between Revision 1.22 and 1.23
Revision 1.22michtoen 2001/11/26 22:33:46 +0 -0
Arch type & subtype patch

Added type & subtype system with 2 subtypes.
Type & subtype will be send to client.

Adding new types:

FLOOR 71
WALL 77
LIGHT_SOURCE 78
MISC_OBJECT 79
MONSTER 80
SPAWN_GENERATOR 81

Added subtypes for armor & weapons.

new commands are:
sub_type <uint8>
sub_typ2 <uint16>

sub_type2 is for internal server use.

Added new command:
casting_speed <delay>

This will be included later.

I will use the sdl client as tester for this patch,
older clients will not be effected even when the
arches are updated.
Show difference between Revision 1.21 and 1.22
Revision 1.21michtoen 2001/11/26 11:52:26 +2 -1
Attack Patch 25.11.01

Detailed information in the dev list.
The changes are to many to explain here.
Show difference between Revision 1.20 and 1.21
Revision 1.20garbled 2001/09/26 16:34:08 +2 -2
Apply the big luck patch to all these files. This removes the special
cases for alchemy and prayer as well.

Discussed at length with dhb, av and gros. Has been tested on both the
mids crossfire server, and on my private server.

This code removes all current use of the luck stat for players, and replaces
it with a general luck modifier for all random rolls. The intent of this
code is to give a general positive (or negative) effect on a player due
to luck. This effect should be generally intangible to the player, yet
help him out over the course of a game.

garbled 2001-09-26
Show difference between Revision 1.19 and 1.20
Revision 1.19mwedel 2001/07/13 23:11:18 +2 -2
Map tiling checkin
server/Makefile.in: Remove encounter.c file. Use cproto instead of
cextract to create proto file.
server/alchemy.c,server/attack.c,server/c_object.c,server/c_wiz.c,
server/disease.c, server/login.c, server/main.c, server/monster.c,
server/move.c, server/pets.c, server/player.c, server/resurrection.c,
server/rune.c, server/shop.c,server/skill_util.c, server/skills.c,
server/spell_effect.c, server/spell_util.c, server/swap.c, server/time.c
modified to use modified insert_ob_in_map function,
use new macros to access map structure related data.
change calls to update_all_los, remove lighting related code.
server/apply.c: modified to use new insert_ob_in_map function. Update
calls to update_object. remove RANDOM_ENCOUNTER code.
for exits, modified to use the head for valid coordinates since the
other parts may not have valid values since they are not saved out to
disk anymore.
server/c_misc.c,server/hiscore.c: modified to use new map
structure/information.
server/commands.c: remove dumplights command.
server/encounter.c: removed - code no longer used
server/init.c: remove RANDOM_ENCOUNTERS code.
server/script.c: change Script_getMapObject to return NULL since there
is no longer a map object. Modify to use new insert_ob_in_map and
update_object functions.
MSW 2001-07-13
Show difference between Revision 1.18 and 1.19
Revision 1.18mwedel 2001/06/29 00:59:46 +100 -170
common/object.c, common/player.c, include/object.h, server/skill_util.c:
Remove the unused LINKED_SKILL code.
common/Makefile.in: Use cproto to make prototypes - cextract fails for
some reason and now seems unsupported. Cproto generates a bunch
of warnings, but does do the job.
common/arch.c,server/apply.c, server/main.c, server/monster.c: cleanup some
compile warnings (unusued variables, returns without value
doc/playbook/Makefile.in: Create proper dependencies for files.
doc/playbook/treas2-extract: Add player_force to value to ignore.
doc/spoiler-html/spoiler.html: rebuilt
server/skill_util.c: Remove the unused LINKED_SKILL code. Prevent
characters that have meditation skill from learning melee weapon skill.
MSW 2001-06-28
Show difference between Revision 1.17 and 1.18
Revision 1.17mwedel 2001/05/28 23:41:54 +45 -7
Make ALLOW_SKILLS standard part of game (remove #ifdef's for it)
Files affected: common/living.c common/object.c common/treasure.c
include/config.h include/player.h server/apply.c server/attack.c
server/c_move.c server/c_range.c server/c_wiz.c server/commands.c
server/init.c server/login.c server/monster.c server/player.c
server/rune.c server/skill_util.c server/spell_util.c
Make MULTIPLE_GODS standards part of game (remove #ifdefs for it)
Files affected: common/readable.c include/spellist.h include/config.h
server/attack.c server/gods.c server/skills.c server/spell_effect.c
server/spell_util.c
doc/Makefile.in, doc/Protocol: Add protocol description file here instead
of in the client distribution.
include/global.h: Move declaration of MAX_EXP_CAT near top of file
so it is set before player.h is included.
include/newclient.h: Add CS_STAT_SKILL* values for sending skill
experience information to client.
include/newserver.h: Add skillexp value to socket struct which determines
if client wants skill experience informatiion.
include/player.h: Add skill information tracking to player structure
so we can easily know when to send updates to client.
random_maps/expand2x.c: remove unused variable to prevent compiler warnings.
random_maps/square_spiral.c: Include prototype information on all systems,
not just win32 to prevent compiler warnings.
server/skill_util.c: Initialize skill pointers to make it easier to
find skill information when we want to update client.
socket/init.c: Init socket->skillexp to 0.
socket/loop.c: Fix indentation of table - whitespace change only
socket/metaserver.c: Minor fix to prevent compile warnings (on the sprintf
that composes the data to send to the metaserver)
socket/request.c: Redo SetUp function to be more compact and IMO simpler as
wll as easier to read (functionality remains the same).
VersionCmd modified to warn users of on dxclients (code on MT)
StatsCmd added to send skill information if client wants it.
The sending of skill experience is by MT, rest of the changes by me.
MSW 2001-05-28
Show difference between Revision 1.16 and 1.17
Revision 1.16mwedel 2001/04/18 23:37:36 +4 -3
server/skill_util.c: Add missing call to out_of_map in skill_attack which
could result in crashes if player is at edge of maps and decides to attack
in direction off map. MSW 2001-04-18
Show difference between Revision 1.15 and 1.16
Revision 1.15mwedel 2001/04/09 01:59:46 +3 -56
Main thing this commit does:
Undo MT's last commit, which should not have been checked it at this time.
As that did not fix any bugs, it should wait until after 1.0 (at least
one file also fails to compile)
Fix minor bug in server/player.c which prevent keyring weight from
getting updated when keys are automatically used out of the rings.
move the GETTIMEOFDAY macro to include/global.h so it doesn't have to
be done in both arch.c and time.c
remove some ^M characters from porting.c
MSW 2001-04-08
Show difference between Revision 1.14 and 1.15
Revision 1.14michtoen 2001/04/08 19:56:59 +57 -4
Add skill exp
Show difference between Revision 1.13 and 1.14
Revision 1.13cvs 2001/01/19 01:43:57 +35 -4
MSW 2001/01/18:
server/skill_util.c: add change_skill_to_skill function to be used when
we already know the skill object we want to use. This is more efficient
than change_skill which takes a skill number and then searches the
inventory for the object.
remove extra esrv_send_item from do_skill_attack - don't need to send
skills to player.
do_skill_attack: remove call to hth_damage - that function does not take
into account objects in the player inventory that increase damage,
and since that is called each attack, it is not feasible to have it
search the players inventory. Instead, we just rely on damage generated
by fix_player - only think hth_damage did was adjust damage based on
level difference.
Show difference between Revision 1.12 and 1.13
Revision 1.12cvs 2000/12/27 01:53:35 +7 -1
MSW 2000/12/26:
Checkin of Jan's new god intervention code. I haven't played around with
it much, but I haven't seen any really obvious problems.
common/living.c: remove learn_prayer_chance
common/treasure.c: Various changes to treasure generation - mostly to
deal with starting equipment and putting it in the inventory.
doc/crossfire.doc: Update docs on god intervention.
include/define.h: GT_... flags removed.
include/treasure.h: GT_... flags added. Addition flags added from
what was in define.h before.
lib/archetypes, lib/crossfire.png, lib/treasures: Updated with new
archetypes and treasures.
random_maps/standalone.c,server/rune.c,server/time.c: Calls to
create_treasure updated
server/apply.c: New functions for god intervention added, update calls
to create_treasure, other god related changes.
server/c_wiz.c: Calls to create_treasure updated, various functions to
allow DM's to learn/unlearn spells added.
server/commands.c: Various commands added to the wiz set of commands.
See commen for c_wiz.c
server/disease.c: Changes to reduce_symptoms
server/gods.c: Numerous updates for god intervention code.
server/player.c: Modifications for starting player equipment.
server/skill_util.c: Display the god the character worships when they
issue the skills command.
server/skills.c: Minor cosmetic change made to message when praying on altar.
server/spell_effect.c: Changes related to gods, cure spells, and
generation of treasures & items.
End of MSW 2000/12/26 checkin.
Show difference between Revision 1.11 and 1.12
Revision 1.11peterm 2000/12/17 19:46:07 +5 -3
Multiple skills of the same sort will now eventually join.
Show difference between Revision 1.10 and 1.11
Revision 1.10peterm 2000/10/16 14:19:31 +15 -13
Major race/class change by PeterM:
BEGIN:
*****************
apply.c: new function, apply changes to player. If the change is a CLASS,
player receives certain attributes from the class.

login.c: make sure people using the old race/class archetypes in their
player files can still use them.

player.c:
1) give_initial_items modified for greater flexibility: you
can pass in a treasurelist.
2) Also, initial forces are applied to the player.
3) Comment added on the stat roll function.
4) Word of recall into the new class-choice map (unfortunately hard-wired.) for newly-rolled players.
5) gen_sp and gen_hp and gen_grace now allowed to go negative to slow down player
regen.

skill_util.c
1) Don't give out basic skills anymore. This interferes with the class code.

spell_util.c
1) Praying failures moderated in frequency.
2) Summoned creatures enhanced in wc, speed, depending on casting level.
3) Word of recall allowed to work in no-magic areas if a flag is set.

time.c
1) Move player changer function added.
2) Marker object expiration added.

END race/class stuff 10/16/2000
***************************
Show difference between Revision 1.9 and 1.10
Revision 1.9peterm 2000/09/26 19:50:47 +12 -1
Implemented levitation skill.
Show difference between Revision 1.8 and 1.9
Revision 1.8cvs 2000/08/25 01:23:28 +8 -2
common/living.c, server/skill_util.c: Patches by Garth Denley:
Fixes divide by zero crash, sets up perm exp when a new player is loaded,
seperates permanent exp code/calculations into another function.
checked in by MSW, 8/24/2000
Show difference between Revision 1.7 and 1.8
Revision 1.7cvs 2000/08/02 01:04:50 +29 -4
include/config.h, include/global.h, common/init.c, common/living.c,
server/init.c, server/player.c, server/skill_util.c: Add permanent
experience and balanced stat loss features (code by Garth Denley).
Permanent experience make some experience in the skills permanent. Balance
stat loss makes stat loss less likely/costly at low level and more costly
at higher levels. These features are by default off, but can be turned
on either in the config.h file or via command line options. Code checked
in by MSW 8/1/2000
Show difference between Revision 1.6 and 1.7
Revision 1.6cvs 2000/06/13 23:04:16 +2 -2
server/skill_util.c: Fix type in change_skill - was doing an == operation
when it should just have been an =. MSW 6/13/2000
Show difference between Revision 1.5 and 1.6
Revision 1.5jec 2000/05/26 04:50:49 +43 -85
* apply() cleanup patch 26/5/2000
Show difference between Revision 1.4 and 1.5
Revision 1.4cvs 2000/04/13 01:30:44 +47 -8
server/skill_util.c: Fixed some log messages that were lacking a newline at
the end. SK_level(): Rewrite of this function to simplify its structure.
Print error message if we find an invalid level. Add top copyright/contact
banner (msw) Patch by Jan Echternach, applied & checked in by Mark Wedel,
4/12/2000
Show difference between Revision 1.3 and 1.4
Revision 1.3cvs 2000/02/10 23:00:10 +15 -15
Change NO_STAT define in living.h,skillist.h,skill_util.c to NO_STAT_VAL
to remove conflict on AIX systems. - msw
Show difference between Revision 1.2 and 1.3
Revision 1.2cvs 2000/02/08 01:51:27 +2 -2
server/skill_util.c: Fixed spelling of unwield
configure.in: Update -z checks to not use eval, double quote the variable.
This seems to be needed on solaris and probably other systems.
Both changes commited by Mark Wedel, 2/7/2000
Show difference between Revision 1.1 and 1.2
Revision 1.1uid200 1999/04/02 13:10:04 None
Initial revision
First version
Revision 1.1.1.1uid200 1999/04/02 13:10:04 +0 -0
First CVS revsion: crossfire-0.95.3
Show difference between Revision 1.1 and 1.1.1.1


File made using version 1.98 of cvs2html by leaf at 2011-07-21 17:46