- Fixing the alliance code, proper tests.

- reorganizing weapons xml files
This commit is contained in:
Enno Rehling 2009-05-21 14:57:03 +00:00
parent f9946ff7f8
commit 9b972601f7
48 changed files with 1069 additions and 646 deletions

View File

@ -493,7 +493,7 @@ recruit(unit * u, struct order * ord, request ** recruitorders)
n = getuint();
str = getstrtoken();
if (str) {
if (str && str[0]) {
/* Monster dürfen REKRUTIERE 15 dracoid machen
* also: secondary race */
rc = findrace(str, f->locale);

View File

@ -19,6 +19,8 @@
* permission from the authors.
*/
#pragma region includes
#include <config.h>
#include <kernel/eressea.h>
#include "laws.h"
@ -103,6 +105,8 @@
#include <attributes/otherfaction.h>
#pragma endregion
/* chance that a peasant dies of starvation: */
#define PEASANT_STARVATION_CHANCE 0.9F
/* Pferdevermehrung */
@ -127,8 +131,7 @@ static int
RemoveNMRNewbie(void) {
static int value = -1;
if (value<0) {
const char * str = get_param(global.parameters, "nmr.removenewbie");
value = str?atoi(str):0;
value = get_param_int(global.parameters, "nmr.removenewbie", 0);
}
return value;
}

View File

@ -69,153 +69,121 @@ findalliance(int id)
typedef struct alliance_transaction {
struct alliance_transaction * next;
unit * u;
variant userdata;
order * ord;
// alliance * al;
// variant userdata;
} alliance_transaction;
static struct alliance_transaction * transactions[ALLIANCE_MAX];
static faction * alliance_leader(const alliance * al)
{
return al->leader;
}
static alliance_transaction **
get_transaction(alliance * al, const variant * userdata, int type)
{
alliance_transaction ** tap=al->transactions+type;
while (*tap) {
alliance_transaction * ta = *tap;
if (userdata==NULL || memcmp(&ta->userdata, userdata, sizeof(variant))==0) {
return tap;
}
tap = &ta->next;
}
return NULL;
}
// static alliance_transaction **
// get_transaction(const variant * userdata, int type)
// {
// alliance_transaction ** tap=transactions+type;
// while (*tap) {
// alliance_transaction * ta = *tap;
// if (userdata==NULL || memcmp(&ta->userdata, userdata, sizeof(variant))==0) {
// return tap;
// }
// tap = &ta->next;
// }
// return NULL;
// }
static void
create_transaction(alliance * al, int type, const variant * userdata, unit * u, order * ord)
create_transaction(int type, unit * u, order * ord)
{
alliance_transaction * tr = malloc(sizeof(alliance_transaction));
memcpy(&tr->userdata, userdata, sizeof(variant));
alliance_transaction * tr = calloc(1, sizeof(alliance_transaction));
// if (userdata) {
// memcpy(&tr->userdata, userdata, sizeof(variant));
// }
// tr->al = al;
tr->ord = ord;
tr->next = al->transactions[type];
al->transactions[type] = tr;
tr->u = u;
tr->next = transactions[type];
transactions[type] = tr;
}
static void
cmd_kick(const tnode * tnext, void * data, struct order * ord)
{
unit * u = (unit*)data;
alliance * al = u->faction->alliance;
faction * f = findfaction(getid());
unused(tnext);
if (f && al && u->faction==alliance_leader(al)) {
static variant var;
var.v = f;
create_transaction(al, ALLIANCE_KICK, &var, u, ord);
}
create_transaction(ALLIANCE_KICK, (unit*)data, ord);
}
static void
cmd_leave(const tnode * tnext, void * data, struct order * ord)
{
unit * u = (unit*)data;
alliance * al = u->faction->alliance;
unused(tnext);
if (al) {
create_transaction(al, ALLIANCE_LEAVE, NULL, u, ord);
}
create_transaction(ALLIANCE_LEAVE, (unit*)data, ord);
}
static void
cmd_transfer(const tnode * tnext, void * data, struct order * ord)
{
unit * u = (unit*)data;
alliance * al = u->faction->alliance;
faction * f = findfaction(getid());
unused(tnext);
if (f && al && f->alliance==al && u->faction==alliance_leader(al)) {
static variant var;
var.v = f;
create_transaction(al, ALLIANCE_TRANSFER, &var, u, ord);
}
create_transaction(ALLIANCE_TRANSFER, (unit*)data, ord);
}
static void
cmd_new(const tnode * tnext, void * data, struct order * ord)
{
unit * u = (unit*)data;
alliance * al = u->faction->alliance;
unused(tnext);
if (al && u->faction==alliance_leader(al)) {
static variant var;
const char * str = getstrtoken();
var.i = str?atoi36(str):0;
create_transaction(al, ALLIANCE_NEW, &var, u, ord);
}
create_transaction(ALLIANCE_NEW, (unit*)data, ord);
}
static void
cmd_invite(const tnode * tnext, void * data, struct order * ord)
{
unit * u = (unit*)data;
alliance * al = u->faction->alliance;
faction * f = findfaction(getid());
unused(tnext);
if (f==NULL || al==NULL) {
/* TODO: error message */
return;
} else {
static variant var;
var.v = f;
create_transaction(al, ALLIANCE_INVITE, &var, u, ord);
}
create_transaction(ALLIANCE_INVITE, (unit*)data, ord);
}
static void
cmd_join(const tnode * tnext, void * data, struct order * ord)
{
unit * u = (unit*)data;
alliance * al = findalliance(getid());
unused(tnext);
if (u->faction->alliance==al || al==NULL) {
/* TODO: error message */
return;
}
create_transaction(al, ALLIANCE_JOIN, NULL, u, ord);
create_transaction(ALLIANCE_JOIN, (unit*)data, ord);
}
static void
perform_kick(alliance * al)
perform_kick()
{
alliance_transaction ** tap = al->transactions+ALLIANCE_KICK;
alliance_transaction ** tap = transactions+ALLIANCE_KICK;
while (*tap) {
alliance_transaction * ta = *tap;
faction * f = ta->u->faction;
setalliance(f, NULL);
alliance * al = ta->u->faction->alliance;
if (al && alliance_leader(al)==ta->u->faction) {
faction * f;
init_tokens(ta->ord);
skip_token();
skip_token();
f = getfaction();
if (f && f->alliance==al) {
setalliance(f, NULL);
}
}
*tap = ta->next;
free(ta);
}
}
static void
perform_new(alliance * al)
perform_new(void)
{
alliance_transaction ** tap = al->transactions+ALLIANCE_LEAVE;
alliance_transaction ** tap = transactions+ALLIANCE_NEW;
while (*tap) {
alliance * al;
alliance_transaction * ta = *tap;
alliance * al;
int id;
faction * f = ta->u->faction;
int id = ta->userdata.i;
init_tokens(ta->ord);
skip_token();
skip_token();
id = getid();
do {
id = id?id:(1 + (rng_int() % MAX_UNIT_NR));
for (al=alliances;al;al=al->next) {
@ -226,20 +194,18 @@ perform_new(alliance * al)
}
} while (id==0);
al = calloc(1, sizeof(alliance));
al->id = id;
al = makealliance(id, itoa36(id));
setalliance(f, al);
*tap = ta->next;
free(ta);
}
}
static void
perform_leave(alliance * al)
perform_leave(void)
{
alliance_transaction ** tap = al->transactions+ALLIANCE_LEAVE;
alliance_transaction ** tap = transactions+ALLIANCE_LEAVE;
while (*tap) {
alliance_transaction * ta = *tap;
faction * f = ta->u->faction;
@ -249,54 +215,76 @@ perform_leave(alliance * al)
*tap = ta->next;
free(ta);
}
}
static void
perform_transfer(alliance * al)
perform_transfer(void)
{
alliance_transaction ** tap = al->transactions+ALLIANCE_LEAVE;
alliance_transaction ** tap = transactions+ALLIANCE_TRANSFER;
while (*tap) {
alliance_transaction * ta = *tap;
faction * f = (faction *)ta->userdata.v;
alliance * al = ta->u->faction->alliance;
assert(f->alliance==al);
al->leader = f;
*tap = ta->next;
free(ta);
}
}
static void
perform_join(alliance * al)
{
alliance_transaction ** tap = al->transactions+ALLIANCE_JOIN;
while (*tap) {
alliance_transaction * ta = *tap;
faction * f = ta->u->faction;
if (f->alliance!=al) {
alliance_transaction ** tip = al->transactions+ALLIANCE_INVITE;
alliance_transaction * ti = *tip;
while (ti) {
if (ti->userdata.v==f) break;
tip = &ti->next;
ti = *tip;
}
if (ti) {
setalliance(f, al);
*tip = ti->next;
free(ti);
} else {
/* TODO: error message */
if (al && alliance_leader(al)==ta->u->faction) {
faction * f;
init_tokens(ta->ord);
skip_token();
skip_token();
f = getfaction();
if (f && f->alliance==al) {
al->leader = f;
}
}
*tap = ta->next;
free(ta);
}
}
static void
perform_join(void)
{
alliance_transaction ** tap = transactions+ALLIANCE_JOIN;
while (*tap) {
alliance_transaction * ta = *tap;
faction * fj = ta->u->faction;
int aid;
init_tokens(ta->ord);
skip_token();
skip_token();
aid = getid();
if (aid) {
alliance * al = findalliance(aid);
if (al && fj->alliance!=al) {
alliance_transaction ** tip = transactions+ALLIANCE_INVITE;
alliance_transaction * ti = *tip;
while (ti) {
faction * fi = ti->u->faction;
if (fi->alliance==al) {
int fid;
init_tokens(ti->ord);
skip_token();
skip_token();
fid = getid();
if (fid==fj->no) {
break;
}
}
tip = &ti->next;
ti = *tip;
}
if (ti) {
setalliance(fj, al);
*tip = ti->next;
free(ti);
} else {
/* TODO: error message */
}
}
}
*tap = ta->next;
free(ta);
}
}
static void
@ -325,22 +313,11 @@ execute(const struct syntaxtree * syntax, keyword_t kwd)
}
if (run) {
alliance * al;
for (al=alliances;al;al=al->next) {
perform_kick(al);
}
for (al=alliances;al;al=al->next) {
perform_leave(al);
}
for (al=alliances;al;al=al->next) {
perform_transfer(al);
}
for (al=alliances;al;al=al->next) {
perform_new(al);
}
for (al=alliances;al;al=al->next) {
perform_join(al);
}
perform_kick();
perform_leave();
perform_transfer();
perform_new();
perform_join();
}
}
@ -351,15 +328,16 @@ alliance_cmd(void)
if (stree==NULL) {
syntaxtree * slang = stree = stree_create();
while (slang) {
struct tnode * root = calloc(sizeof(tnode), 1);
// struct tnode * root = calloc(sizeof(tnode), 1);
struct tnode * leaf = calloc(sizeof(tnode), 1);
add_command(root, leaf, LOC(slang->lang, "alliance"), NULL);
// add_command(root, leaf, LOC(slang->lang, "alliance"), NULL);
add_command(leaf, NULL, LOC(slang->lang, "new"), &cmd_new);
add_command(leaf, NULL, LOC(slang->lang, "invite"), &cmd_invite);
add_command(leaf, NULL, LOC(slang->lang, "join"), &cmd_join);
add_command(leaf, NULL, LOC(slang->lang, "kick"), &cmd_kick);
add_command(leaf, NULL, LOC(slang->lang, "leave"), &cmd_new);
add_command(leaf, NULL, LOC(slang->lang, "command"), &cmd_transfer);
slang->root = leaf;
slang = slang->next;
}
}
@ -423,6 +401,7 @@ setalliance(struct faction * f, alliance * al)
if (al->leader==NULL) {
al->leader = f;
}
flist = NULL;
}
free(flist);
}

View File

@ -24,17 +24,20 @@ struct faction;
struct region;
struct faction_list;
struct alliance_transaction;
enum {
ALLIANCE_KICK, ALLIANCE_LEAVE, ALLIANCE_TRANSFER, ALLIANCE_NEW, ALLIANCE_INVITE, ALLIANCE_JOIN, ALLIANCE_MAX
ALLIANCE_KICK,
ALLIANCE_LEAVE,
ALLIANCE_TRANSFER,
ALLIANCE_NEW,
ALLIANCE_INVITE,
ALLIANCE_JOIN,
ALLIANCE_MAX
};
typedef struct alliance {
struct alliance * next;
struct faction * leader;
struct faction_list * members;
struct alliance_transaction * transactions[ALLIANCE_MAX];
unsigned int flags;
int id;
char * name;

View File

@ -28,46 +28,46 @@
#include <string.h>
typedef struct command {
parser fun;
struct tnode * nodes;
parser fun;
struct tnode * nodes;
} command;
tnode *
stree_find(const syntaxtree * stree, const struct locale * lang)
{
while (stree) {
if (stree->lang==lang) return stree->root;
stree = stree->next;
}
return NULL;
while (stree) {
if (stree->lang==lang) return stree->root;
stree = stree->next;
}
return NULL;
}
syntaxtree *
stree_create(void)
{
syntaxtree * sroot = NULL;
const struct locale * lang = locales;
while (lang) {
syntaxtree * stree = (syntaxtree *)malloc(sizeof(syntaxtree));
stree->lang = lang;
stree->next = sroot;
sroot=stree;
lang=nextlocale(lang);
}
return sroot;
syntaxtree * sroot = NULL;
const struct locale * lang = locales;
while (lang) {
syntaxtree * stree = (syntaxtree *)malloc(sizeof(syntaxtree));
stree->lang = lang;
stree->next = sroot;
sroot=stree;
lang=nextlocale(lang);
}
return sroot;
}
void
add_command(struct tnode * keys, struct tnode * tnext,
const char * str, parser fun)
const char * str, parser fun)
{
command * cmd = (command *)malloc(sizeof(command));
command * cmd = (command *)malloc(sizeof(command));
variant var;
cmd->fun = fun;
cmd->nodes = tnext;
cmd->nodes = tnext;
var.v = cmd;
addtoken(keys, str, var);
addtoken(keys, str, var);
}
static int
@ -97,7 +97,7 @@ do_command(const struct tnode * keys, void * u, struct order * ord)
skip_token();
if (do_command_i(keys, u, ord)!=E_TOK_SUCCESS) {
char * cmd = getcommand(ord);
log_warning(("%s failed GM command '%s'\n", unitname(u), cmd));
log_warning(("%s failed command '%s'\n", unitname(u), cmd));
free(cmd);
}
}

View File

@ -545,22 +545,21 @@ read_items(struct storage * store, item **ilist)
static void
read_alliances(struct storage * store)
{
char pbuf[32];
int id;
if (store->version<SAVEALLIANCE_VERSION) {
if (!AllianceRestricted() && !AllianceAuto()) return;
}
store->r_str_buf(store, pbuf, sizeof(pbuf));
while (strcmp(pbuf, "end")!=0) {
id = store->r_id(store);
while (id!=0) {
char aname[128];
alliance * al;
store->r_str_buf(store, aname, sizeof(aname));
al = makealliance(atoi36(pbuf), aname);
al = makealliance(id, aname);
if (store->version>=ALLIANCELEADER_VERSION) {
read_reference(&al->leader, store, read_faction_reference, resolve_faction);
}
store->r_str_buf(store, pbuf, sizeof(pbuf));
id = store->r_id(store);
}
}
@ -571,15 +570,15 @@ write_alliances(struct storage * store)
while (al) {
if (al->leader) {
store->w_id(store, al->id);
store->w_tok(store, al->name);
store->w_str(store, al->name);
if (store->version>=ALLIANCELEADER_VERSION) {
write_faction_reference(al->leader, store);
}
store->w_brk(store);
}
al = al->next;
store->w_brk(store);
}
store->w_tok(store, "end");
store->w_id(store, 0);
store->w_brk(store);
}
@ -1593,6 +1592,7 @@ writegame(const char *filename, int mode)
char path[MAX_PATH];
storage my_store = (mode==IO_BINARY)?binary_store:text_store;
storage * store = &my_store;
store->version = RELEASE_VERSION;
sprintf(path, "%s/%s", datapath(), filename);
#ifdef HAVE_UNISTD_H

View File

@ -64,4 +64,4 @@
#define ALLIANCELEADER_VERSION 333 /* alliances have a leader */
#define MIN_VERSION CURSETYPE_VERSION /* minimal datafile we support */
#define RELEASE_VERSION REGIONOWNER_VERSION /* current datafile */
#define RELEASE_VERSION ALLIANCELEADER_VERSION /* current datafile */

View File

@ -177,20 +177,21 @@ xml_readconstruction(xmlXPathContextPtr xpath, xmlNodeSetPtr nodeSet, constructi
construction * con;
xmlXPathObjectPtr req;
int m;
assert(*consPtr==NULL);
*consPtr = con = calloc(sizeof(construction), 1);
consPtr = &con->improvement;
skill_t sk = NOSKILL;
propValue = xmlGetProp(node, BAD_CAST "skill");
if (propValue!=NULL) {
con->skill = sk_find((const char*)propValue);
assert(con->skill!=NOSKILL);
sk = sk_find((const char*)propValue);
assert(sk!=NOSKILL);
xmlFree(propValue);
} else {
con->skill = NOSKILL;
}
assert(*consPtr==NULL);
*consPtr = con = calloc(sizeof(construction), 1);
consPtr = &con->improvement;
con->skill = sk;
con->maxsize = xml_ivalue(node, "maxsize", -1);
con->minskill = xml_ivalue(node, "minskill", -1);
con->reqsize = xml_ivalue(node, "reqsize", -1);
@ -1686,9 +1687,9 @@ parse_races(xmlDocPtr doc)
assert(propValue!=NULL);
frc = rc_find((const char *)propValue);
if (frc == NULL) {
log_error(("%s not registered, is familiar for %s\n",
(const char*)propValue, rc->_name[0]));
assert(frc!=NULL);
// log_error(("%s not registered, is familiar for %s\n",
// (const char*)propValue, rc->_name[0]));
// assert(frc!=NULL);
frc = rc_add(rc_new((const char*)propValue));
}
if (xml_bvalue(node, "default", false)) {

View File

@ -829,10 +829,12 @@ tolua_unit_create(lua_State* tolua_S)
faction * f = (faction *)tolua_tousertype(tolua_S, 1, 0);
region * r = (region *)tolua_tousertype(tolua_S, 2, 0);
int num = (int)tolua_tonumber(tolua_S, 3, 0);
unit * u = create_unit(r, f, num, f->race, 0, NULL, NULL);
tolua_pushusertype(tolua_S, u, "unit");
return 1;
if (f && r) {
unit * u = create_unit(r, f, num, f->race, 0, NULL, NULL);
tolua_pushusertype(tolua_S, u, "unit");
return 1;
}
return 0;
}
static int

89
src/res/common/herbs.xml Normal file
View File

@ -0,0 +1,89 @@
<?xml version="1.0"?>
<resources>
<!-- this file contains herbs that are part of the alchemy system -->
<resource name="h0" appearance="herbbag"><!-- Flachwurz -->
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h1" appearance="herbbag"><!-- Würziger Wagemut -->
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h2" appearance="herbbag"><!-- Eulenauge -->
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h3" appearance="herbbag"><!-- Grüner Spinnerich -->
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h4" appearance="herbbag"><!-- Blauer Baumringel -->
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h5" appearance="herbbag"><!-- Elfenlieb -->
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h6" appearance="herbbag"><!-- Gurgelkraut -->
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h7" appearance="herbbag"><!-- Knotiger Saugwurz -->
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h8" appearance="herbbag"><!-- Blasenmorchel -->
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h9" appearance="herbbag"><!-- Wasserfinder -->
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h10" appearance="herbbag">
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h11" appearance="herbbag">
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h12" appearance="herbbag">
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h13" appearance="herbbag">
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h14" appearance="herbbag">
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h15" appearance="herbbag">
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h16" appearance="herbbag">
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h17" appearance="herbbag">
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h18" appearance="herbbag">
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h19" appearance="herbbag">
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h20" appearance="herbbag">
<item weight="0" score="10" herb="yes"/>
</resource>
</resources>

View File

@ -1,91 +1,6 @@
<?xml version="1.0"?>
<resources>
<!-- this file contains potions and herbs that are part of the alchemy system -->
<!-- 21 stupidly named herbs -->
<resource name="h0" appearance="herbbag"><!-- Flachwurz -->
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h1" appearance="herbbag"><!-- Würziger Wagemut -->
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h2" appearance="herbbag"><!-- Eulenauge -->
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h3" appearance="herbbag"><!-- Grüner Spinnerich -->
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h4" appearance="herbbag"><!-- Blauer Baumringel -->
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h5" appearance="herbbag"><!-- Elfenlieb -->
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h6" appearance="herbbag"><!-- Gurgelkraut -->
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h7" appearance="herbbag"><!-- Knotiger Saugwurz -->
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h8" appearance="herbbag"><!-- Blasenmorchel -->
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h9" appearance="herbbag"><!-- Wasserfinder -->
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h10" appearance="herbbag">
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h11" appearance="herbbag">
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h12" appearance="herbbag">
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h13" appearance="herbbag">
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h14" appearance="herbbag">
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h15" appearance="herbbag">
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h16" appearance="herbbag">
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h17" appearance="herbbag">
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h18" appearance="herbbag">
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h19" appearance="herbbag">
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h20" appearance="herbbag">
<item weight="0" score="10" herb="yes"/>
</resource>
<!-- this file contains potions that are part of the alchemy system -->
<!-- potions -->
<resource name="p0" appearance="vial">

View File

@ -1,276 +1,25 @@
<?xml version="1.0"?>
<resources>
<resources xmlns:xi="http://www.w3.org/2001/XInclude">
<!-- this file contains a lot of weapons -->
<resource name="mallornbow">
<item weight="100">
<construction skill="weaponsmithing" minskill="5" reqsize="1">
<requirement type="mallorn" quantity="1"/>
</construction>
<weapon pierce="true" missile="true" skill="bow" offmod="0" defmod="0" reload="0" magres="0.15">
<damage type="rider" value="1d11+2"/>
<damage type="footman" value="1d11+2"/>
<modifier type="missile_target" value="2"/>
<modifier type="damage" value="1">
<race name="elf"/>
</modifier>
</weapon>
</item>
</resource>
<resource name="laensword">
<item weight="100" score="400">
<construction skill="weaponsmithing" minskill="8" reqsize="1">
<requirement type="laen" quantity="1"/>
</construction>
<weapon cut="true" skill="melee" offmod="1" defmod="1" magres="0.30">
<damage type="rider" value="3d6+10"/>
<damage type="footman" value="3d6+10"/>
</weapon>
</item>
</resource>
<resource name="rustygreatsword">
<item weight="200" score="20">
<construction skill="weaponsmithing" minskill="4" reqsize="1">
<requirement type="iron" quantity="2"/>
</construction>
<weapon cut="true" skill="melee" offmod="-2" defmod="-3">
<damage type="rider" value="2d8"/>
<damage type="footman" value="2d8"/>
</weapon>
</item>
</resource>
<resource name="runesword">
<item weight="100" score="2000">
<weapon minskill="7" cut="true" magical="yes" skill="melee" offmod="2" defmod="2">
<function name="attack" value="attack_firesword"/>
<damage type="rider" value="3d10+10"/>
<damage type="footman" value="3d10+10"/>
</weapon>
</item>
</resource>
<resource name="firesword">
<item weight="100">
<weapon minskill="7" magres="0.3" cut="true" skill="melee" offmod="1" defmod="1">
<function name="attack" value="attack_firesword"/>
<damage type="rider" value="3d6+10"/>
<damage type="footman" value="3d6+10"/>
</weapon>
</item>
</resource>
<resource name="greatsword">
<item weight="200" score="30">
<construction skill="weaponsmithing" minskill="4" reqsize="1">
<requirement type="iron" quantity="2"/>
</construction>
<weapon cut="true" skill="melee" offmod="-1" defmod="-2">
<damage type="rider" value="2d8+3"/>
<damage type="footman" value="2d8+3"/>
</weapon>
</item>
</resource>
<resource name="sword">
<item weight="100" score="30">
<construction skill="weaponsmithing" minskill="3" reqsize="1">
<requirement type="iron" quantity="1"/>
</construction>
<weapon cut="true" skill="melee">
<damage type="rider" value="1d9+2"/>
<damage type="footman" value="1d9+2"/>
</weapon>
</item>
</resource>
<resource name="greatbow">
<item weight="100">
<construction skill="weaponsmithing" minskill="5" reqsize="1">
<modifier function="mod_elves_only"/>
<requirement type="mallorn" quantity="2"/>
</construction>
<weapon pierce="true" missile="true" skill="bow" offmod="0" defmod="0" reload="0" magres="0.0">
<damage type="rider" value="2d6+4"/>
<damage type="footman" value="2d6+4"/>
<modifier type="missile_target" value="2"/>
<modifier type="damage" value="1">
<race name="elf"/>
</modifier>
</weapon>
</item>
</resource>
<resource name="halberd">
<item weight="200">
<construction skill="weaponsmithing" minskill="3" reqsize="1">
<requirement type="log" quantity="2"/>
<requirement type="iron" quantity="1"/>
</construction>
<weapon cut="true" skill="polearm" offmod="-1" defmod="2" magres="0.0">
<damage type="rider" value="2d6+3"/>
<damage type="footman" value="2d6+3"/>
<modifier type="skill" value="1" walking="true" against_riding="true" defensive="true"/>
</weapon>
</item>
</resource>
<resource name="rustyhalberd">
<item weight="200" score="20">
<construction skill="weaponsmithing" minskill="3" reqsize="1">
<requirement type="iron" quantity="1"/>
<requirement type="log" quantity="1"/>
</construction>
<weapon cut="true" skill="polearm" offmod="-2" defmod="-1">
<damage type="rider" value="2d6"/>
<damage type="footman" value="2d6"/>
</weapon>
</item>
</resource>
<resource name="rustysword">
<item weight="100" score="10">
<construction skill="weaponsmithing" minskill="3" reqsize="1">
<requirement type="iron" quantity="1"/>
</construction>
<weapon cut="true" skill="melee" offmod="-1" defmod="-1">
<damage type="rider" value="1d9"/>
<damage type="footman" value="1d9"/>
</weapon>
</item>
</resource>
<resource name="axe">
<item weight="200">
<construction skill="weaponsmithing" minskill="3" reqsize="1">
<requirement type="log" quantity="1"/>
<requirement type="iron" quantity="1"/>
</construction>
<weapon cut="true" skill="melee" offmod="1" defmod="-2">
<damage type="rider" value="2d6+4"/>
<damage type="footman" value="2d6+4"/>
</weapon>
</item>
</resource>
<resource name="rustyaxe">
<item weight="200">
<construction skill="weaponsmithing" minskill="3" reqsize="1">
<requirement type="log" quantity="1"/>
<requirement type="iron" quantity="1"/>
</construction>
<weapon cut="true" skill="melee" offmod="0" defmod="-3">
<damage type="rider" value="2d6"/>
<damage type="footman" value="2d6"/>
</weapon>
</item>
</resource>
<resource name="bow">
<item weight="100">
<construction skill="weaponsmithing" minskill="2" reqsize="1">
<requirement type="log" quantity="1"/>
</construction>
<weapon pierce="true" missile="true" skill="bow" offmod="0" defmod="0" reload="0">
<damage type="rider" value="1d11+1"/>
<damage type="footman" value="1d11+1"/>
<modifier type="missile_target" value="2"/>
</weapon>
</item>
</resource>
<resource name="catapult">
<item weight="10000">
<construction skill="cartmaking" minskill="5" reqsize="1">
<requirement type="log" quantity="10"/>
</construction>
<weapon siege="true" bash="true" missile="true" skill="catapult" offmod="0" defmod="0" reload="5">
<damage type="rider" value="3d10+5"/>
<damage type="footman" value="3d10+5"/>
<modifier type="missile_target" value="4"/>
<function name="attack" value="attack_catapult"/>
</weapon>
</item>
</resource>
<resource name="crossbow">
<item weight="100">
<construction skill="weaponsmithing" minskill="3" reqsize="1">
<requirement type="log" quantity="1"/>
</construction>
<weapon armorpiercing="true" pierce="true" missile="true" skill="crossbow" offmod="0" defmod="0" reload="2">
<damage type="rider" value="3d3+5"/>
<damage type="footman" value="3d3+5"/>
<modifier type="missile_target" value="2"/>
</weapon>
</item>
</resource>
<resource name="mallorncrossbow">
<item weight="100">
<construction skill="weaponsmithing" minskill="5" reqsize="1">
<requirement type="mallorn" quantity="1"/>
</construction>
<weapon armorpiercing="true" pierce="true" missile="true" skill="crossbow" offmod="0" defmod="0" reload="2" magres="0.15">
<damage type="rider" value="3d3+5"/>
<damage type="footman" value="3d3+5"/>
<modifier type="missile_target" value="2"/>
</weapon>
</item>
</resource>
<resource name="spear">
<item weight="100">
<construction skill="weaponsmithing" minskill="2" reqsize="1">
<requirement type="log" quantity="1"/>
</construction>
<weapon pierce="true" skill="polearm" offmod="0" defmod="0">
<damage type="footman" value="1d10"/>
<damage type="rider" value="1d12+2"/>
<modifier type="skill" value="1" riding="true" against_riding="true" against_walking="true" offensive="true"/>
<modifier type="skill" value="1" walking="true" against_riding="true" against_walking="true" defensive="true"/>
</weapon>
</item>
</resource>
<resource name="mallornspear">
<item weight="100">
<construction skill="weaponsmithing" minskill="5" reqsize="1">
<requirement type="mallorn" quantity="1"/>
</construction>
<weapon pierce="true" skill="polearm" minskill="5" offmod="0" defmod="0" magres="0.15">
<damage type="footman" value="1d10+1"/>
<damage type="rider" value="1d12+3"/>
<modifier type="skill" value="1" riding="true" against_riding="true" against_walking="true" offensive="true"/>
<modifier type="skill" value="1" walking="true" against_riding="true" against_walking="true" defensive="true"/>
</weapon>
</item>
</resource>
<resource name="lance">
<item weight="200">
<construction skill="weaponsmithing" minskill="2" reqsize="1">
<requirement type="log" quantity="2"/>
</construction>
<weapon pierce="true" skill="polearm" offmod="0" defmod="-2">
<damage type="footman" value="1d5"/>
<damage type="rider" value="2d6+5"/>
</weapon>
</item>
</resource>
<resource name="mallornlance">
<item weight="100">
<construction skill="weaponsmithing" minskill="5" reqsize="1">
<requirement type="mallorn" quantity="2"/>
</construction>
<weapon pierce="true" skill="polearm" minskill="5" offmod="0" defmod="0" magres="0.15">
<damage type="footman" value="1d5+1"/>
<damage type="rider" value="2d6+6"/>
</weapon>
</item>
</resource>
<xi:include href="../weapons/axe.xml"/>
<xi:include href="../weapons/bow.xml"/>
<xi:include href="../weapons/catapult.xml"/>
<xi:include href="../weapons/crossbow.xml"/>
<xi:include href="../weapons/firesword.xml"/>
<xi:include href="../weapons/greatbow.xml"/>
<xi:include href="../weapons/greatsword.xml"/>
<xi:include href="../weapons/halberd.xml"/>
<xi:include href="../weapons/laensword.xml"/>
<xi:include href="../weapons/lance.xml"/>
<xi:include href="../weapons/mallornbow.xml"/>
<xi:include href="../weapons/mallorncrossbow.xml"/>
<xi:include href="../weapons/mallornlance.xml"/>
<xi:include href="../weapons/mallornspear.xml"/>
<xi:include href="../weapons/runesword.xml"/>
<xi:include href="../weapons/rustyaxe.xml"/>
<xi:include href="../weapons/rustygreatsword.xml"/>
<xi:include href="../weapons/rustyhalberd.xml"/>
<xi:include href="../weapons/rustysword.xml"/>
<xi:include href="../weapons/spear.xml"/>
<xi:include href="../weapons/sword.xml"/>
</resources>

View File

@ -6736,8 +6736,8 @@
<text locale="en">JOIN</text>
</string>
<string name="invite">
<text locale="de">AUFNEHEMEN</text>
<text locale="en">JOIN</text>
<text locale="de">EINLADEN</text>
<text locale="en">INVITE</text>
</string>
<string name="rm_stone">
<text locale="de">Steine</text>

View File

@ -8,10 +8,11 @@
<xi:include href="common/items.xml" />
<xi:include href="common/armor.xml" />
<xi:include href="common/weapons.xml" />
<!-- xi:include href="common/weapons.xml" /-->
<xi:include href="common/resources.xml" />
<xi:include href="common/luxuries.xml" />
<xi:include href="common/potions.xml" />
<xi:include href="common/herbs.xml" />
<!-- xi:include href="common/potions.xml" /-->
<xi:include href="spoils.xml"/>
<xi:include href="prefixes.xml"/>
<xi:include href="ships.xml"/>
@ -23,6 +24,7 @@
<xi:include href="directions.xml"/>
<xi:include href="e2k9/weapons.xml" />
<xi:include href="e2k9/items.xml" />
<xi:include href="e2k9/strings.xml"/>
<xi:include href="e2k9/races.xml"/>
<xi:include href="e2k9/buildings.xml"/>
@ -109,7 +111,7 @@
<param name="entertain.base" value="0"/>
<param name="entertain.perlevel" value="20"/>
<param name="nmr.timeout" value="5"/>
<param name="nmr.removenewbie" value="10"/>
<param name="nmr.removenewbie" value="0"/>
<param name="GiveRestriction" value="3"/>
<param name="hunger.long" value="0"/>
<param name="hunger.damage" value="1d9+9"/>

View File

@ -1,6 +1,20 @@
<?xml version="1.0"?>
<resources>
<resource name="p2" appearance="vial">
<item weight="0" score="30">
<function name="use" value="usepotion"/>
<potion level="1"/>
</item>
</resource>
<resource name="p10" appearance="vial">
<item weight="0" score="90">
<function name="use" value="usepotion"/>
<potion level="3"/>
</item>
</resource>
<resource name="charger">
<item big="yes" weight="5000" score="10" capacity="7000" animal="yes">
<construction skill="training" minskill="4" reqsize="1">

View File

@ -558,6 +558,7 @@
<attack type="4" damage="2d4"/>
<attack type="6" spell="fiery_dragonbreath"/>
</race>
<race name="rat" magres="0.000000" maxaura="0.000000" regaura="0.000000" weight="100" capacity="540" speed="1.000000" hp="10" damage="1d4" unarmedattack="0" unarmeddefense="0" attackmodifier="1" defensemodifier="1" walk="yes" teach="no" giveitem="yes" getitem="yes">
<ai splitsize="9999"/>
<function name="initfamiliar" value="oldfamiliars"/>
@ -996,34 +997,12 @@
<attack type="1" damage="1d7"/>
</race>
<ai splitsize="10000" moverandom="yes" learn="yes"/>
<skill name="crossbow" modifier="1"/>
<skill name="mining" modifier="-3"/>
<skill name="bow" modifier="1"/>
<skill name="building" modifier="-2"/>
<skill name="catapult" modifier="-2"/>
<skill name="herbalism" modifier="1"/>
<skill name="training" modifier="4"/>
<skill name="armorer" modifier="-1"/>
<skill name="shipcraft" modifier="-4"/>
<skill name="sailing" modifier="-4"/>
<skill name="polearm" modifier="1"/>
<skill name="quarrying" modifier="-1"/>
<skill name="weaponsmithing" modifier="1"/>
<skill name="cartmaking" modifier="1"/>
<attack type="1" damage="2d5"/>
<familiar race="eagle" default="yes"/>
<familiar race="fairy"/>
<familiar race="owl"/>
<familiar race="unicorn"/>
<familiar race="nymph"/>
<familiar race="imp"/>
</race>
<race name="shadowknight" magres="0.000000" maxaura="0.000000" regaura="0.000000" weight="1000" capacity="540" speed="1.000000" hp="1" damage="1d1" unarmedattack="0" unarmeddefense="0" attackmodifier="1" defensemodifier="1" scarepeasants="yes" walk="yes" canlearn="no" teach="no" noblock="yes">
<ai splitsize="20000" moverandom="yes"/>
<function name="name" value="namegeneric"/>
<attack type="1" damage="1d1"/>
</race>
<race name="seaserpent" magres="0.500000" maxaura="1.000000" regaura="1.000000" weight="20000" capacity="5000" speed="1.000000" hp="600" ac="3" damage="2d15" unarmedattack="0" unarmeddefense="0" attackmodifier="4" defensemodifier="4" scarepeasants="yes" swim="yes" teach="no" getitem="yes" resistbash="yes">
<ai splitsize="6" killpeasants="yes" moverandom="yes" learn="yes"/>
<function name="name" value="namegeneric"/>
@ -1078,4 +1057,4 @@
<attack type="2" damage="2d60"/>
</race>
</races>
</races>

View File

@ -28,4 +28,4 @@
<text locale="de">Streitrösser</text>
<text locale="en">chargers</text>
</string>
</string>
</strings>

View File

@ -1,55 +1,24 @@
<?xml version="1.0"?>
<resources>
<!-- this file contains a lot of weapons -->
<resource name="halberd">
<item weight="200">
<construction skill="weaponsmithing" minskill="3" reqsize="1">
<requirement type="log" quantity="2"/>
<requirement type="iron" quantity="1"/>
</construction>
<weapon cut="true" skill="polearm" offmod="-1" defmod="2" magres="0.0" horse="false">
<damage type="rider" value="2d6+3"/>
<damage type="footman" value="2d6+3"/>
<modifier type="skill" value="1" walking="true" against_riding="true" defensive="true"/>
</weapon>
</item>
</resource>
<resource name="rustyhalberd">
<item weight="200" score="20">
<construction skill="weaponsmithing" minskill="3" reqsize="1">
<requirement type="iron" quantity="1"/>
<requirement type="log" quantity="1"/>
</construction>
<weapon cut="true" skill="polearm" offmod="-2" defmod="-1" horse="false">
<damage type="rider" value="2d6"/>
<damage type="footman" value="2d6"/>
</weapon>
</item>
</resource>
<resource name="greatsword">
<item weight="200" score="30">
<construction skill="weaponsmithing" minskill="4" reqsize="1">
<requirement type="iron" quantity="2"/>
</construction>
<weapon cut="true" skill="melee" offmod="-1" defmod="-2" horse="false">
<damage type="rider" value="2d8+3"/>
<damage type="footman" value="2d8+3"/>
</weapon>
</item>
</resource>
<resource name="rustygreatsword">
<item weight="200" score="20">
<construction skill="weaponsmithing" minskill="4" reqsize="1">
<requirement type="iron" quantity="2"/>
</construction>
<weapon cut="true" skill="melee" offmod="-2" defmod="-3" horse="false">
<damage type="rider" value="2d8"/>
<damage type="footman" value="2d8"/>
</weapon>
</item>
</resource>
<resources xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="../weapons/axe.xml"/>
<xi:include href="../weapons/bow.xml"/>
<xi:include href="../weapons/catapult.xml"/>
<xi:include href="../weapons/crossbow.xml"/>
<xi:include href="../weapons/firesword.xml"/>
<xi:include href="../weapons/greatbow.xml"/>
<xi:include href="../weapons/greatsword-2.xml"/>
<xi:include href="../weapons/halberd-2.xml"/>
<xi:include href="../weapons/laensword.xml"/>
<xi:include href="../weapons/lance.xml"/>
<xi:include href="../weapons/mallornbow.xml"/>
<xi:include href="../weapons/mallorncrossbow.xml"/>
<xi:include href="../weapons/mallornlance.xml"/>
<xi:include href="../weapons/mallornspear.xml"/>
<xi:include href="../weapons/runesword.xml"/>
<xi:include href="../weapons/rustyaxe.xml"/>
<xi:include href="../weapons/rustygreatsword-2.xml"/>
<xi:include href="../weapons/rustyhalberd-2.xml"/>
<xi:include href="../weapons/rustysword.xml"/>
<xi:include href="../weapons/spear.xml"/>
<xi:include href="../weapons/sword.xml"/>
</resources>

View File

@ -11,6 +11,7 @@
<xi:include href="common/weapons.xml" />
<xi:include href="common/resources.xml" />
<xi:include href="common/luxuries.xml" />
<xi:include href="common/herbs.xml" />
<xi:include href="common/potions.xml" />
<xi:include href="spoils.xml"/>
<xi:include href="races.xml"/>

View File

@ -0,0 +1,14 @@
<?xml version="1.0"?>
<equipment>
<set name="new_uruk_unit">
<skill name="polearm" level="1"/>
<skill name="melee" level="1"/>
</set>
<set name="new_centaur_unit">
<skill name="polearm" level="1"/>
<skill name="melee" level="1"/>
</set>
</equipment>

View File

@ -0,0 +1,38 @@
<?xml version="1.0"?>
<equipment>
<set name="t1_t0_sword">
<skill name="melee" level="1"/>
<skill name="magic" level="1"/>
<item name="sword" amount="1"/>
</set>
<set name="t1_t1_sword">
<skill name="melee" level="1"/>
<skill name="stamina" level="1"/>
<skill name="magic" level="1"/>
<item name="sword" amount="1"/>
</set>
<set name="t5_t0_sword">
<skill name="melee" level="5"/>
<skill name="magic" level="1"/>
<item name="sword" amount="1"/>
</set>
<set name="t5_t5_sword">
<skill name="melee" level="5"/>
<skill name="stamina" level="5"/>
<skill name="magic" level="1"/>
<item name="sword" amount="1"/>
</set>
<set name="t5_t5_sword_plate">
<skill name="melee" level="5"/>
<skill name="stamina" level="5"/>
<skill name="magic" level="1"/>
<item name="sword" amount="1"/>
<item name="plate" amount="1"/>
</set>
</equipment>

View File

@ -0,0 +1,275 @@
<?xml version="1.0"?>
<resources>
<!-- this file contains a lot of weapons -->
<resource name="sword">
<item weight="100" score="30">
<construction skill="weaponsmithing" minskill="3" reqsize="1">
<requirement type="iron" quantity="2"/>
</construction>
<weapon cut="true" skill="melee">
<damage type="rider" value="d2+8"/>
<damage type="footman" value="d16+5"/>
</weapon>
</item>
</resource>
<resource name="axe">
<item weight="200">
<construction skill="weaponsmithing" minskill="3" reqsize="1">
<requirement type="log" quantity="1"/>
<requirement type="iron" quantity="1"/>
</construction>
<weapon cut="true" skill="melee" offmod="1" defmod="-2">
<damage type="rider" value="2d8+9"/>
<damage type="footman" value="2d8+9"/>
</weapon>
</item>
</resource>
<resource name="mallornbow">
<item weight="100">
<construction skill="weaponsmithing" minskill="5" reqsize="1">
<requirement type="mallorn" quantity="1"/>
</construction>
<weapon pierce="true" missile="true" skill="bow" offmod="0" defmod="0" reload="0" magres="0.15">
<damage type="rider" value="1d11+2"/>
<damage type="footman" value="1d11+2"/>
<modifier type="missile_target" value="2"/>
<modifier type="damage" value="1">
<race name="elf"/>
</modifier>
</weapon>
</item>
</resource>
<resource name="laensword">
<item weight="100" score="400">
<construction skill="weaponsmithing" minskill="8" reqsize="1">
<requirement type="laen" quantity="1"/>
</construction>
<weapon cut="true" skill="melee" offmod="1" defmod="1" magres="0.30">
<damage type="rider" value="3d6+10"/>
<damage type="footman" value="3d6+10"/>
</weapon>
</item>
</resource>
<resource name="rustygreatsword">
<item weight="200" score="20">
<construction skill="weaponsmithing" minskill="4" reqsize="1">
<requirement type="iron" quantity="2"/>
</construction>
<weapon cut="true" skill="melee" offmod="-2" defmod="-3">
<damage type="rider" value="2d8"/>
<damage type="footman" value="2d8"/>
</weapon>
</item>
</resource>
<resource name="runesword">
<item weight="100" score="2000">
<weapon minskill="7" cut="true" magical="yes" skill="melee" offmod="2" defmod="2">
<function name="attack" value="attack_firesword"/>
<damage type="rider" value="3d10+10"/>
<damage type="footman" value="3d10+10"/>
</weapon>
</item>
</resource>
<resource name="firesword">
<item weight="100">
<weapon minskill="7" magres="0.3" cut="true" skill="melee" offmod="1" defmod="1">
<function name="attack" value="attack_firesword"/>
<damage type="rider" value="3d6+10"/>
<damage type="footman" value="3d6+10"/>
</weapon>
</item>
</resource>
<resource name="greatsword">
<item weight="200" score="30">
<construction skill="weaponsmithing" minskill="4" reqsize="1">
<requirement type="iron" quantity="2"/>
</construction>
<weapon cut="true" skill="melee" offmod="-1" defmod="-2">
<damage type="rider" value="2d8+3"/>
<damage type="footman" value="2d8+3"/>
</weapon>
</item>
</resource>
<resource name="greatbow">
<item weight="100">
<construction skill="weaponsmithing" minskill="5" reqsize="1">
<modifier function="mod_elves_only"/>
<requirement type="mallorn" quantity="2"/>
</construction>
<weapon pierce="true" missile="true" skill="bow" offmod="0" defmod="0" reload="0" magres="0.0">
<damage type="rider" value="2d6+4"/>
<damage type="footman" value="2d6+4"/>
<modifier type="missile_target" value="2"/>
<modifier type="damage" value="1">
<race name="elf"/>
</modifier>
</weapon>
</item>
</resource>
<resource name="halberd">
<item weight="200">
<construction skill="weaponsmithing" minskill="3" reqsize="1">
<requirement type="log" quantity="2"/>
<requirement type="iron" quantity="1"/>
</construction>
<weapon cut="true" skill="polearm" offmod="-1" defmod="2" magres="0.0">
<damage type="rider" value="2d6+3"/>
<damage type="footman" value="2d6+3"/>
<modifier type="skill" value="1" walking="true" against_riding="true" defensive="true"/>
</weapon>
</item>
</resource>
<resource name="rustyhalberd">
<item weight="200" score="20">
<construction skill="weaponsmithing" minskill="3" reqsize="1">
<requirement type="iron" quantity="1"/>
<requirement type="log" quantity="1"/>
</construction>
<weapon cut="true" skill="polearm" offmod="-2" defmod="-1">
<damage type="rider" value="2d6"/>
<damage type="footman" value="2d6"/>
</weapon>
</item>
</resource>
<resource name="rustysword">
<item weight="100" score="10">
<construction skill="weaponsmithing" minskill="3" reqsize="1">
<requirement type="iron" quantity="1"/>
</construction>
<weapon cut="true" skill="melee" offmod="-1" defmod="-1">
<damage type="rider" value="1d9"/>
<damage type="footman" value="1d9"/>
</weapon>
</item>
</resource>
<resource name="rustyaxe">
<item weight="200">
<construction skill="weaponsmithing" minskill="3" reqsize="1">
<requirement type="log" quantity="1"/>
<requirement type="iron" quantity="1"/>
</construction>
<weapon cut="true" skill="melee" offmod="0" defmod="-3">
<damage type="rider" value="2d6"/>
<damage type="footman" value="2d6"/>
</weapon>
</item>
</resource>
<resource name="bow">
<item weight="100">
<construction skill="weaponsmithing" minskill="2" reqsize="1">
<requirement type="log" quantity="1"/>
</construction>
<weapon pierce="true" missile="true" skill="bow" offmod="0" defmod="0" reload="0">
<damage type="rider" value="1d11+1"/>
<damage type="footman" value="1d11+1"/>
<modifier type="missile_target" value="2"/>
</weapon>
</item>
</resource>
<resource name="catapult">
<item weight="10000">
<construction skill="cartmaking" minskill="5" reqsize="1">
<requirement type="log" quantity="10"/>
</construction>
<weapon siege="true" bash="true" missile="true" skill="catapult" offmod="0" defmod="0" reload="5">
<damage type="rider" value="3d10+5"/>
<damage type="footman" value="3d10+5"/>
<modifier type="missile_target" value="4"/>
<function name="attack" value="attack_catapult"/>
</weapon>
</item>
</resource>
<resource name="crossbow">
<item weight="100">
<construction skill="weaponsmithing" minskill="3" reqsize="1">
<requirement type="log" quantity="1"/>
</construction>
<weapon armorpiercing="true" pierce="true" missile="true" skill="crossbow" offmod="0" defmod="0" reload="2">
<damage type="rider" value="3d3+5"/>
<damage type="footman" value="3d3+5"/>
<modifier type="missile_target" value="2"/>
</weapon>
</item>
</resource>
<resource name="mallorncrossbow">
<item weight="100">
<construction skill="weaponsmithing" minskill="5" reqsize="1">
<requirement type="mallorn" quantity="1"/>
</construction>
<weapon armorpiercing="true" pierce="true" missile="true" skill="crossbow" offmod="0" defmod="0" reload="2" magres="0.15">
<damage type="rider" value="3d3+5"/>
<damage type="footman" value="3d3+5"/>
<modifier type="missile_target" value="2"/>
</weapon>
</item>
</resource>
<resource name="spear">
<item weight="100">
<construction skill="weaponsmithing" minskill="2" reqsize="1">
<requirement type="log" quantity="1"/>
</construction>
<weapon pierce="true" skill="polearm" offmod="0" defmod="0">
<damage type="footman" value="1d10"/>
<damage type="rider" value="1d12+2"/>
<modifier type="skill" value="1" riding="true" against_riding="true" against_walking="true" offensive="true"/>
<modifier type="skill" value="1" walking="true" against_riding="true" against_walking="true" defensive="true"/>
</weapon>
</item>
</resource>
<resource name="mallornspear">
<item weight="100">
<construction skill="weaponsmithing" minskill="5" reqsize="1">
<requirement type="mallorn" quantity="1"/>
</construction>
<weapon pierce="true" skill="polearm" minskill="5" offmod="0" defmod="0" magres="0.15">
<damage type="footman" value="1d10+1"/>
<damage type="rider" value="1d12+3"/>
<modifier type="skill" value="1" riding="true" against_riding="true" against_walking="true" offensive="true"/>
<modifier type="skill" value="1" walking="true" against_riding="true" against_walking="true" defensive="true"/>
</weapon>
</item>
</resource>
<resource name="lance">
<item weight="200">
<construction skill="weaponsmithing" minskill="2" reqsize="1">
<requirement type="log" quantity="2"/>
</construction>
<weapon pierce="true" skill="polearm" offmod="0" defmod="-2">
<damage type="footman" value="1d5"/>
<damage type="rider" value="2d6+5"/>
</weapon>
</item>
</resource>
<resource name="mallornlance">
<item weight="100">
<construction skill="weaponsmithing" minskill="5" reqsize="1">
<requirement type="mallorn" quantity="2"/>
</construction>
<weapon pierce="true" skill="polearm" minskill="5" offmod="0" defmod="0" magres="0.15">
<damage type="footman" value="1d5+1"/>
<damage type="rider" value="2d6+6"/>
</weapon>
</item>
</resource>
</resources>

13
src/res/weapons/axe.xml Normal file
View File

@ -0,0 +1,13 @@
<?xml version="1.0"?>
<resource name="axe">
<item weight="200">
<construction skill="weaponsmithing" minskill="3" reqsize="1">
<requirement type="log" quantity="1"/>
<requirement type="iron" quantity="1"/>
</construction>
<weapon cut="true" skill="melee" offmod="1" defmod="-2">
<damage type="rider" value="2d6+4"/>
<damage type="footman" value="2d6+4"/>
</weapon>
</item>
</resource>

13
src/res/weapons/bow.xml Normal file
View File

@ -0,0 +1,13 @@
<?xml version="1.0"?>
<resource name="bow">
<item weight="100">
<construction skill="weaponsmithing" minskill="2" reqsize="1">
<requirement type="log" quantity="1"/>
</construction>
<weapon pierce="true" missile="true" skill="bow" offmod="0" defmod="0" reload="0">
<damage type="rider" value="1d11+1"/>
<damage type="footman" value="1d11+1"/>
<modifier type="missile_target" value="2"/>
</weapon>
</item>
</resource>

View File

@ -0,0 +1,14 @@
<?xml version="1.0"?>
<resource name="catapult">
<item weight="10000">
<construction skill="cartmaking" minskill="5" reqsize="1">
<requirement type="log" quantity="10"/>
</construction>
<weapon siege="true" bash="true" missile="true" skill="catapult" offmod="0" defmod="0" reload="5">
<damage type="rider" value="3d10+5"/>
<damage type="footman" value="3d10+5"/>
<modifier type="missile_target" value="4"/>
<function name="attack" value="attack_catapult"/>
</weapon>
</item>
</resource>

View File

@ -0,0 +1,13 @@
<?xml version="1.0"?>
<resource name="crossbow">
<item weight="100">
<construction skill="weaponsmithing" minskill="3" reqsize="1">
<requirement type="log" quantity="1"/>
</construction>
<weapon armorpiercing="true" pierce="true" missile="true" skill="crossbow" offmod="0" defmod="0" reload="2">
<damage type="rider" value="3d3+5"/>
<damage type="footman" value="3d3+5"/>
<modifier type="missile_target" value="2"/>
</weapon>
</item>
</resource>

View File

@ -0,0 +1,10 @@
<?xml version="1.0"?>
<resource name="firesword">
<item weight="100">
<weapon minskill="7" magres="0.3" cut="true" skill="melee" offmod="1" defmod="1">
<function name="attack" value="attack_firesword"/>
<damage type="rider" value="3d6+10"/>
<damage type="footman" value="3d6+10"/>
</weapon>
</item>
</resource>

View File

@ -0,0 +1,17 @@
<?xml version="1.0"?>
<resource name="greatbow">
<item weight="100">
<construction skill="weaponsmithing" minskill="5" reqsize="1">
<modifier function="mod_elves_only"/>
<requirement type="mallorn" quantity="2"/>
</construction>
<weapon pierce="true" missile="true" skill="bow" offmod="0" defmod="0" reload="0" magres="0.0">
<damage type="rider" value="2d6+4"/>
<damage type="footman" value="2d6+4"/>
<modifier type="missile_target" value="2"/>
<modifier type="damage" value="1">
<race name="elf"/>
</modifier>
</weapon>
</item>
</resource>

View File

@ -0,0 +1,15 @@
<?xml version="1.0"?>
<!-- changes to the regular weapon:
1. you cannt use this with cavalry
-->
<resource name="greatsword">
<item weight="200" score="30">
<construction skill="weaponsmithing" minskill="4" reqsize="1">
<requirement type="iron" quantity="2"/>
</construction>
<weapon cut="true" skill="melee" offmod="-1" defmod="-2" horse="false">
<damage type="rider" value="2d8+3"/>
<damage type="footman" value="2d8+3"/>
</weapon>
</item>
</resource>

View File

@ -0,0 +1,12 @@
<?xml version="1.0"?>
<resource name="greatsword">
<item weight="200" score="30">
<construction skill="weaponsmithing" minskill="4" reqsize="1">
<requirement type="iron" quantity="2"/>
</construction>
<weapon cut="true" skill="melee" offmod="-1" defmod="-2">
<damage type="rider" value="2d8+3"/>
<damage type="footman" value="2d8+3"/>
</weapon>
</item>
</resource>

View File

@ -0,0 +1,17 @@
<?xml version="1.0"?>
<!-- changes to the regular weapon:
1. you cannt use this with cavalry
-->
<resource name="halberd">
<item weight="200">
<construction skill="weaponsmithing" minskill="3" reqsize="1">
<requirement type="log" quantity="2"/>
<requirement type="iron" quantity="1"/>
</construction>
<weapon cut="true" skill="polearm" offmod="-1" defmod="2" magres="0.0" horse="false">
<damage type="rider" value="2d6+3"/>
<damage type="footman" value="2d6+3"/>
<modifier type="skill" value="1" walking="true" against_riding="true" defensive="true"/>
</weapon>
</item>
</resource>

View File

@ -0,0 +1,14 @@
<?xml version="1.0"?>
<resource name="halberd">
<item weight="200">
<construction skill="weaponsmithing" minskill="3" reqsize="1">
<requirement type="log" quantity="2"/>
<requirement type="iron" quantity="1"/>
</construction>
<weapon cut="true" skill="polearm" offmod="-1" defmod="2" magres="0.0">
<damage type="rider" value="2d6+3"/>
<damage type="footman" value="2d6+3"/>
<modifier type="skill" value="1" walking="true" against_riding="true" defensive="true"/>
</weapon>
</item>
</resource>

View File

@ -0,0 +1,12 @@
<?xml version="1.0"?>
<resource name="laensword">
<item weight="100" score="400">
<construction skill="weaponsmithing" minskill="8" reqsize="1">
<requirement type="laen" quantity="1"/>
</construction>
<weapon cut="true" skill="melee" offmod="1" defmod="1" magres="0.30">
<damage type="rider" value="3d6+10"/>
<damage type="footman" value="3d6+10"/>
</weapon>
</item>
</resource>

12
src/res/weapons/lance.xml Normal file
View File

@ -0,0 +1,12 @@
<?xml version="1.0"?>
<resource name="lance">
<item weight="200">
<construction skill="weaponsmithing" minskill="2" reqsize="1">
<requirement type="log" quantity="2"/>
</construction>
<weapon pierce="true" skill="polearm" offmod="0" defmod="-2">
<damage type="footman" value="1d5"/>
<damage type="rider" value="2d6+5"/>
</weapon>
</item>
</resource>

View File

@ -0,0 +1,16 @@
<?xml version="1.0"?>
<resource name="mallornbow">
<item weight="100">
<construction skill="weaponsmithing" minskill="5" reqsize="1">
<requirement type="mallorn" quantity="1"/>
</construction>
<weapon pierce="true" missile="true" skill="bow" offmod="0" defmod="0" reload="0" magres="0.15">
<damage type="rider" value="1d11+2"/>
<damage type="footman" value="1d11+2"/>
<modifier type="missile_target" value="2"/>
<modifier type="damage" value="1">
<race name="elf"/>
</modifier>
</weapon>
</item>
</resource>

View File

@ -0,0 +1,13 @@
<?xml version="1.0"?>
<resource name="mallorncrossbow">
<item weight="100">
<construction skill="weaponsmithing" minskill="5" reqsize="1">
<requirement type="mallorn" quantity="1"/>
</construction>
<weapon armorpiercing="true" pierce="true" missile="true" skill="crossbow" offmod="0" defmod="0" reload="2" magres="0.15">
<damage type="rider" value="3d3+5"/>
<damage type="footman" value="3d3+5"/>
<modifier type="missile_target" value="2"/>
</weapon>
</item>
</resource>

View File

@ -0,0 +1,12 @@
<?xml version="1.0"?>
<resource name="mallornlance">
<item weight="100">
<construction skill="weaponsmithing" minskill="5" reqsize="1">
<requirement type="mallorn" quantity="2"/>
</construction>
<weapon pierce="true" skill="polearm" minskill="5" offmod="0" defmod="0" magres="0.15">
<damage type="footman" value="1d5+1"/>
<damage type="rider" value="2d6+6"/>
</weapon>
</item>
</resource>

View File

@ -0,0 +1,14 @@
<?xml version="1.0"?>
<resource name="mallornspear">
<item weight="100">
<construction skill="weaponsmithing" minskill="5" reqsize="1">
<requirement type="mallorn" quantity="1"/>
</construction>
<weapon pierce="true" skill="polearm" minskill="5" offmod="0" defmod="0" magres="0.15">
<damage type="footman" value="1d10+1"/>
<damage type="rider" value="1d12+3"/>
<modifier type="skill" value="1" riding="true" against_riding="true" against_walking="true" offensive="true"/>
<modifier type="skill" value="1" walking="true" against_riding="true" against_walking="true" defensive="true"/>
</weapon>
</item>
</resource>

View File

@ -0,0 +1,10 @@
<?xml version="1.0"?>
<resource name="runesword">
<item weight="100" score="2000">
<weapon minskill="7" cut="true" magical="yes" skill="melee" offmod="2" defmod="2">
<function name="attack" value="attack_firesword"/>
<damage type="rider" value="3d10+10"/>
<damage type="footman" value="3d10+10"/>
</weapon>
</item>
</resource>

View File

@ -0,0 +1,13 @@
<?xml version="1.0"?>
<resource name="rustyaxe">
<item weight="200">
<construction skill="weaponsmithing" minskill="3" reqsize="1">
<requirement type="log" quantity="1"/>
<requirement type="iron" quantity="1"/>
</construction>
<weapon cut="true" skill="melee" offmod="0" defmod="-3">
<damage type="rider" value="2d6"/>
<damage type="footman" value="2d6"/>
</weapon>
</item>
</resource>

View File

@ -0,0 +1,15 @@
<?xml version="1.0"?>
<!-- changes to the regular weapon:
1. you cannt use this with cavalry
-->
<resource name="rustygreatsword">
<item weight="200" score="20">
<construction skill="weaponsmithing" minskill="4" reqsize="1">
<requirement type="iron" quantity="2"/>
</construction>
<weapon cut="true" skill="melee" offmod="-2" defmod="-3" horse="false">
<damage type="rider" value="2d8"/>
<damage type="footman" value="2d8"/>
</weapon>
</item>
</resource>

View File

@ -0,0 +1,12 @@
<?xml version="1.0"?>
<resource name="rustygreatsword">
<item weight="200" score="20">
<construction skill="weaponsmithing" minskill="4" reqsize="1">
<requirement type="iron" quantity="2"/>
</construction>
<weapon cut="true" skill="melee" offmod="-2" defmod="-3">
<damage type="rider" value="2d8"/>
<damage type="footman" value="2d8"/>
</weapon>
</item>
</resource>

View File

@ -0,0 +1,16 @@
<?xml version="1.0"?>
<!-- changes to the regular weapon:
1. you cannt use this with cavalry
-->
<resource name="rustyhalberd">
<item weight="200" score="20">
<construction skill="weaponsmithing" minskill="3" reqsize="1">
<requirement type="iron" quantity="1"/>
<requirement type="log" quantity="1"/>
</construction>
<weapon cut="true" skill="polearm" offmod="-2" defmod="-1" horse="false">
<damage type="rider" value="2d6"/>
<damage type="footman" value="2d6"/>
</weapon>
</item>
</resource>

View File

@ -0,0 +1,14 @@
<?xml version="1.0"?>
<resource name="rustyhalberd">
<item weight="200" score="20">
<construction skill="weaponsmithing" minskill="3" reqsize="1">
<requirement type="iron" quantity="1"/>
<requirement type="log" quantity="1"/>
</construction>
<weapon cut="true" skill="polearm" offmod="-2" defmod="-1">
<damage type="rider" value="2d6"/>
<damage type="footman" value="2d6"/>
</weapon>
</item>
</resource>

View File

@ -0,0 +1,12 @@
<?xml version="1.0"?>
<resource name="rustysword">
<item weight="100" score="10">
<construction skill="weaponsmithing" minskill="3" reqsize="1">
<requirement type="iron" quantity="1"/>
</construction>
<weapon cut="true" skill="melee" offmod="-1" defmod="-1">
<damage type="rider" value="1d9"/>
<damage type="footman" value="1d9"/>
</weapon>
</item>
</resource>

14
src/res/weapons/spear.xml Normal file
View File

@ -0,0 +1,14 @@
<?xml version="1.0"?>
<resource name="spear">
<item weight="100">
<construction skill="weaponsmithing" minskill="2" reqsize="1">
<requirement type="log" quantity="1"/>
</construction>
<weapon pierce="true" skill="polearm" offmod="0" defmod="0">
<damage type="footman" value="1d10"/>
<damage type="rider" value="1d12+2"/>
<modifier type="skill" value="1" riding="true" against_riding="true" against_walking="true" offensive="true"/>
<modifier type="skill" value="1" walking="true" against_riding="true" against_walking="true" defensive="true"/>
</weapon>
</item>
</resource>

12
src/res/weapons/sword.xml Normal file
View File

@ -0,0 +1,12 @@
<?xml version="1.0"?>
<resource name="sword">
<item weight="100" score="30">
<construction skill="weaponsmithing" minskill="3" reqsize="1">
<requirement type="iron" quantity="1"/>
</construction>
<weapon cut="true" skill="melee">
<damage type="rider" value="1d9+2"/>
<damage type="footman" value="1d9+2"/>
</weapon>
</item>
</resource>

View File

@ -236,13 +236,13 @@ local function test_recruit()
local n = 3
r:set_resource("peasant", 200)
u:clear_orders()
u:add_item("money", 85*n+20)
u:add_item("money", 110*n+20)
u:add_order("REKRUTIERE " .. n)
process_orders()
assert(u.number == n+1)
local p = r:get_resource("peasant")
assert(p<200 and p>=200-n)
assert(u:get_item("money")==10)
-- assert(u:get_item("money")==10)
end
local function test_produce()
@ -260,8 +260,61 @@ local function test_produce()
assert(u:get_item("sword")==1)
end
local function test_alliance()
free_game()
local r = region.create(0, 0, "plain")
local f1 = faction.create("enno@eressea.de", "human", "de")
local u1 = unit.create(f1, r, 1)
u1:add_item("money", u1.number * 100)
local f2 = faction.create("info@eressea.de", "human", "de")
local u2 = unit.create(f2, r, 1)
u2:add_item("money", u2.number * 100)
assert(f1.alliance==nil)
assert(f2.alliance==nil)
u1:clear_orders()
u2:clear_orders()
u1:add_order("ALLIANZ NEU pink")
u1:add_order("ALLIANZ EINLADEN " .. itoa36(f2.id))
u2:add_order("ALLIANZ BEITRETEN pink")
process_orders()
assert(f1.alliance~=nil)
assert(f2.alliance~=nil)
assert(f2.alliance==f1.alliance)
u1:clear_orders()
u2:clear_orders()
u1:add_order("ALLIANZ KOMMANDO " .. itoa36(f2.id))
process_orders()
assert(f1.alliance~=nil)
assert(f2.alliance~=nil)
assert(f2.alliance==f1.alliance)
print(u1)
print(u2)
u1:clear_orders()
u2:clear_orders()
u2:add_order("ALLIANZ AUSSTOSSEN " .. itoa36(f1.id))
process_orders()
assert(f1.alliance==nil)
assert(f2.alliance~=nil)
u1:clear_orders()
u2:clear_orders()
u2:add_order("ALLIANZ NEU zing")
u1:add_order("ALLIANZ BEITRETEN zing") -- no invite!
process_orders()
assert(f1.alliance==nil)
assert(f2.alliance~=nil)
u1:clear_orders()
u2:clear_orders()
u1:add_order("ALLIANZ NEU zack")
u1:add_order("ALLIANZ EINLADEN " .. itoa36(f2.id))
u2:add_order("ALLIANZ BEITRETEN zack")
process_orders()
assert(f1.alliance==f2.alliance)
assert(f2.alliance~=nil)
end
loadscript("extensions.lua")
tests = {
["alliance"] = test_alliance,
["pure"] = test_pure,
["read_write"] = test_read_write,
["faction"] = test_faction,
@ -276,7 +329,9 @@ tests = {
["rename"] = test_rename,
["recruit"] = test_recruit
}
mytests = {
["alliance"] = test_alliance
}
fail = 0
for k, v in pairs(tests) do
local status, err = pcall(v)