New: familiars are initialized with an equipment-set.

New: familiars can have a LUA initialization function.

Moved the spell implementations from spell.c to spells.c where they "belong".

Spell ids moved to a separate header (to phase them out eventually)
This commit is contained in:
Enno Rehling 2005-10-23 09:05:11 +00:00
parent b7a8660eef
commit 4dc1339ec3
35 changed files with 10346 additions and 10283 deletions

View File

@ -1131,7 +1131,7 @@ report_computer(FILE * F, faction * f, struct seen_region ** seen, const faction
} }
fprintf(F, "%d;Rekrutierungskosten\n", f->race->recruitcost); fprintf(F, "%d;Rekrutierungskosten\n", f->race->recruitcost);
fprintf(F, "%d;Anzahl Personen\n", count_all(f)); fprintf(F, "%d;Anzahl Personen\n", count_all(f));
fprintf(F, "\"%s\";Magiegebiet\n", neue_gebiete[f->magiegebiet]); fprintf(F, "\"%s\";Magiegebiet\n", magietypen[f->magiegebiet]);
if (f->race == new_race[RC_HUMAN]) { if (f->race == new_race[RC_HUMAN]) {
fprintf(F, "%d;Anzahl Immigranten\n", count_migrants(f)); fprintf(F, "%d;Anzahl Immigranten\n", count_migrants(f));

View File

@ -11,9 +11,11 @@
#include <kernel/movement.h> #include <kernel/movement.h>
#include <kernel/order.h> #include <kernel/order.h>
#include <kernel/plane.h> #include <kernel/plane.h>
#include <kernel/pool.h>
#include <kernel/region.h> #include <kernel/region.h>
#include <kernel/ship.h> #include <kernel/ship.h>
#include <kernel/skill.h> #include <kernel/skill.h>
#include <kernel/spell.h>
#include <kernel/study.h> #include <kernel/study.h>
#include <kernel/unit.h> #include <kernel/unit.h>
@ -90,6 +92,65 @@ use_speedsail(struct unit * u, const struct item_type * itype, int amount, struc
} }
/* END speedsail */ /* END speedsail */
/* ------------------------------------------------------------- */
/* Kann auch von Nichtmagiern benutzt werden, erzeugt eine
* Antimagiezone, die zwei Runden bestehen bleibt */
static void
use_antimagiccrystal(region * r, unit * mage, int amount, struct order * ord)
{
int i;
for (i=0;i!=amount;++i) {
int effect, duration = 2;
double force;
spell *sp = find_spell(M_GRAU, "antimagiczone");
attrib ** ap = &r->attribs;
unused(ord);
assert(sp);
/* Reduziert die Stärke jedes Spruchs um effect */
effect = sp->level;
/* Hält Sprüche bis zu einem summierten Gesamtlevel von power aus.
* Jeder Zauber reduziert die 'Lebenskraft' (vigour) der Antimagiezone
* um seine Stufe */
force = sp->level * 20; /* Stufe 5 =~ 100 */
/* Regionszauber auflösen */
while (*ap && force > 0) {
curse * c;
attrib * a = *ap;
if (!fval(a->type, ATF_CURSE)) {
do { ap = &(*ap)->next; } while (*ap && a->type==(*ap)->type);
continue;
}
c = (curse*)a->data.v;
/* Immunität prüfen */
if (c->flag & CURSE_IMMUNE) {
do { ap = &(*ap)->next; } while (*ap && a->type==(*ap)->type);
continue;
}
force = destr_curse(c, effect, force);
if(c->vigour <= 0) {
a_remove(&r->attribs, a);
}
if(*ap) ap = &(*ap)->next;
}
if(force > 0) {
variant var ;
var.i = effect;
create_curse(mage, &r->attribs, ct_find("antimagiczone"), force, duration, var, 0);
}
}
use_pooled(mage, mage->region, R_ANTIMAGICCRYSTAL, amount);
ADDMSG(&mage->faction->msgs, msg_message("use_antimagiccrystal",
"unit region", mage, r));
return;
}
static int static int
use_instantartsculpture(struct unit * u, const struct item_type * itype, use_instantartsculpture(struct unit * u, const struct item_type * itype,
int amount, struct order * ord) int amount, struct order * ord)
@ -193,6 +254,7 @@ use_aurapotion50(struct unit * u, const struct item_type * itype,
void void
register_itemimplementations(void) register_itemimplementations(void)
{ {
register_function((pf_generic)use_antimagiccrystal, "use_antimagiccrystal");
register_function((pf_generic)use_instantartsculpture, "use_instantartsculpture"); register_function((pf_generic)use_instantartsculpture, "use_instantartsculpture");
register_function((pf_generic)use_studypotion, "use_studypotion"); register_function((pf_generic)use_studypotion, "use_studypotion");
register_function((pf_generic)use_speedsail, "use_speedsail"); register_function((pf_generic)use_speedsail, "use_speedsail");

View File

@ -1933,7 +1933,7 @@ report(FILE *F, faction * f, struct seen_region ** seen, const faction_list * ad
rnl(F); rnl(F);
sprintf(buf, "%s, %s/%s (%s)", factionname(f), sprintf(buf, "%s, %s/%s (%s)", factionname(f),
LOC(f->locale, rc_name(f->race, 1)), LOC(f->locale, rc_name(f->race, 1)),
LOC(f->locale, mkname("school", neue_gebiete[f->magiegebiet])), LOC(f->locale, mkname("school", magietypen[f->magiegebiet])),
f->email); f->email);
centre(F, buf, true); centre(F, buf, true);
if (f->alliance!=NULL) { if (f->alliance!=NULL) {
@ -3338,13 +3338,13 @@ out_faction(FILE *file, faction *f)
if (alliances!=NULL) { if (alliances!=NULL) {
fprintf(file, "%s (%s/%d) (%.3s/%.3s), %d Einh., %d Pers., $%d, %d %s\n", fprintf(file, "%s (%s/%d) (%.3s/%.3s), %d Einh., %d Pers., $%d, %d %s\n",
f->name, itoa36(f->no), f->alliance?f->alliance->id:0, f->name, itoa36(f->no), f->alliance?f->alliance->id:0,
LOC(default_locale, rc_name(f->race, 0)), neue_gebiete[f->magiegebiet], LOC(default_locale, rc_name(f->race, 0)), magietypen[f->magiegebiet],
f->no_units, f->num_total, f->money, turn - f->lastorders, f->no_units, f->num_total, f->money, turn - f->lastorders,
turn - f->lastorders != 1 ? "NMRs" : "NMR "); turn - f->lastorders != 1 ? "NMRs" : "NMR ");
} else { } else {
fprintf(file, "%s (%.3s/%.3s), %d Einh., %d Pers., $%d, %d %s\n", fprintf(file, "%s (%.3s/%.3s), %d Einh., %d Pers., $%d, %d %s\n",
factionname(f), LOC(default_locale, rc_name(f->race, 0)), factionname(f), LOC(default_locale, rc_name(f->race, 0)),
neue_gebiete[f->magiegebiet], f->no_units, f->num_total, f->money, magietypen[f->magiegebiet], f->no_units, f->num_total, f->money,
turn - f->lastorders, turn - f->lastorders != 1 ? "NMRs" : "NMR "); turn - f->lastorders, turn - f->lastorders != 1 ? "NMRs" : "NMR ");
} }
} }

View File

@ -186,9 +186,9 @@ setstealth_cmd(unit * u, struct order * ord)
return 0; return 0;
} }
/* Pseudodrachen können sich nur als Drachen tarnen */ /* Singdrachen können sich nur als Drachen tarnen */
if (u->race == new_race[RC_PSEUDODRAGON] || u->race == new_race[RC_BIRTHDAYDRAGON]) { if (u->race == new_race[RC_SONGDRAGON] || u->race == new_race[RC_BIRTHDAYDRAGON]) {
if (trace==new_race[RC_PSEUDODRAGON]||trace==new_race[RC_FIREDRAGON]||trace==new_race[RC_DRAGON]||trace==new_race[RC_WYRM]) { if (trace==new_race[RC_SONGDRAGON]||trace==new_race[RC_FIREDRAGON]||trace==new_race[RC_DRAGON]||trace==new_race[RC_WYRM]) {
u->irace = trace; u->irace = trace;
if (u->race->flags & RCF_SHAPESHIFTANY && get_racename(u->attribs)) if (u->race->flags & RCF_SHAPESHIFTANY && get_racename(u->attribs))
set_racename(&u->attribs, NULL); set_racename(&u->attribs, NULL);

View File

@ -11,6 +11,7 @@
*/ */
#include <config.h> #include <config.h>
#include "eressea.h" #include "eressea.h"
#include "combatspells.h"
/* kernel includes */ /* kernel includes */
#include "battle.h" #include "battle.h"
@ -25,6 +26,7 @@
#include "unit.h" #include "unit.h"
#include "movement.h" #include "movement.h"
#include "spell.h" #include "spell.h"
#include "spellid.h"
#include "race.h" #include "race.h"
#include "skill.h" #include "skill.h"

View File

@ -0,0 +1,56 @@
/* vi: set ts=2:
+-------------------+ Christian Schlittchen <corwin@amber.kn-bremen.de>
| | Enno Rehling <enno@eressea-pbem.de>
| Eressea PBEM host | Katja Zedel <katze@felidae.kn-bremen.de>
| (c) 1998 - 2003 | Henning Peters <faroul@beyond.kn-bremen.de>
| | Ingo Wilken <Ingo.Wilken@informatik.uni-oldenburg.de>
+-------------------+ Stefan Reich <reich@halbling.de>
This program may not be used, modified or distributed
without prior permission by the authors of Eressea.
*/
#ifndef H_GC_COMBATSPELLS
#define H_GC_COMBATSPELLS
#ifdef __cplusplus
extern "C" {
#endif
struct fighter;
/* Kampfzauber */
extern int sp_fumbleshield(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_shadowknights(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_combatrosthauch(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_kampfzauber(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_healing(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_keeploot(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_reanimate(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_chaosrow(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_flee(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_berserk(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_tiredsoldiers(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_reeling_arrows(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_denyattack(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_sleep(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_windshield(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_strong_wall(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_versteinern(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_hero(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_frighten(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_mindblast(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_speed(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_wolfhowl(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_dragonodem(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_reduceshield(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_armorshield(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_stun(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_undeadhero(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_shadowcall(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_immolation(struct fighter * fi, int level, double power, struct spell * sp);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -82,6 +82,14 @@ equipment_setskill(equipment * eq, skill_t sk, const char * value)
} }
} }
void
equipment_addspell(equipment * eq, spell * sp)
{
if (eq!=NULL) {
spelllist_add(&eq->spells, sp);
}
}
void void
equipment_setitem(equipment * eq, const item_type * itype, const char * value) equipment_setitem(equipment * eq, const item_type * itype, const char * value)
{ {
@ -108,6 +116,14 @@ equip_unit(struct unit * u, const struct equipment * eq)
if (eq) { if (eq) {
skill_t sk; skill_t sk;
itemdata * idata; itemdata * idata;
sc_mage * m = get_mage(u);
if (m!=NULL) {
spell_list * sp = eq->spells;
while (sp) {
add_spell(m, sp->data);
sp = sp->next;
}
}
for (sk=0;sk!=MAXSKILLS;++sk) { for (sk=0;sk!=MAXSKILLS;++sk) {
if (eq->skills[sk]!=NULL) { if (eq->skills[sk]!=NULL) {
int i = dice_rand(eq->skills[sk]); int i = dice_rand(eq->skills[sk]);

View File

@ -23,6 +23,7 @@
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
struct spell;
typedef struct itemdata { typedef struct itemdata {
const struct item_type * itype; const struct item_type * itype;
@ -44,6 +45,7 @@ extern "C" {
char * name; char * name;
struct itemdata * items; struct itemdata * items;
char * skills[MAXSKILLS]; char * skills[MAXSKILLS];
struct spell_list * spells;
struct subset * subsets; struct subset * subsets;
struct equipment * next; struct equipment * next;
} equipment; } equipment;
@ -54,6 +56,7 @@ extern "C" {
extern void equipment_setitem(struct equipment * eq, const struct item_type * itype, const char * value); extern void equipment_setitem(struct equipment * eq, const struct item_type * itype, const char * value);
extern void equipment_setskill(struct equipment * eq, skill_t sk, const char * value); extern void equipment_setskill(struct equipment * eq, skill_t sk, const char * value);
extern void equipment_addspell(struct equipment * eq, struct spell * sp);
extern void equip_unit(struct unit * u, const struct equipment * eq); extern void equip_unit(struct unit * u, const struct equipment * eq);

View File

@ -57,6 +57,7 @@ struct plane;
struct order; struct order;
struct spell; struct spell;
struct region; struct region;
struct fighter;
struct region_list; struct region_list;
struct race; struct race;
struct ship; struct ship;
@ -653,18 +654,18 @@ enum {
RC_PEASANT, RC_PEASANT,
RC_WOLF, /* 31 */ RC_WOLF, /* 31 */
RC_HOUSECAT, RC_LYNX,
RC_TUNNELWORM, RC_TUNNELWORM,
RC_EAGLE, RC_EAGLE,
RC_RAT, RC_RAT,
RC_PSEUDODRAGON, RC_SONGDRAGON,
RC_NYMPH, RC_NYMPH,
RC_UNICORN, RC_UNICORN,
RC_WARG, RC_DIREWOLF,
RC_WRAITH, RC_GHOST,
RC_IMP, /* 41 */ RC_IMP, /* 41 */
RC_DREAMCAT, RC_DREAMCAT,
RC_FEY, RC_FAIRY,
RC_OWL, RC_OWL,
RC_HELLCAT, RC_HELLCAT,
RC_TIGER, RC_TIGER,

View File

@ -28,7 +28,6 @@
#include "pool.h" #include "pool.h"
#include "race.h" #include "race.h"
#include "region.h" #include "region.h"
#include "spell.h"
#include "save.h" #include "save.h"
#include "skill.h" #include "skill.h"
#include "unit.h" #include "unit.h"
@ -781,64 +780,6 @@ destroy_curse_crystal(attrib **alist, int cast_level, int force)
} }
#endif #endif
/* ------------------------------------------------------------- */
/* Kann auch von Nichtmagiern benutzt werden, erzeugt eine
* Antimagiezone, die zwei Runden bestehen bleibt */
static void
use_antimagiccrystal(region * r, unit * mage, int amount, struct order * ord)
{
int i;
for (i=0;i!=amount;++i) {
int effect, duration = 2;
double force;
spell *sp = find_spellbyid(SPL_ANTIMAGICZONE);
attrib ** ap = &r->attribs;
unused(ord);
/* Reduziert die Stärke jedes Spruchs um effect */
effect = sp->level;
/* Hält Sprüche bis zu einem summierten Gesamtlevel von power aus.
* Jeder Zauber reduziert die 'Lebenskraft' (vigour) der Antimagiezone
* um seine Stufe */
force = sp->level * 20; /* Stufe 5 =~ 100 */
/* Regionszauber auflösen */
while (*ap && force > 0) {
curse * c;
attrib * a = *ap;
if (!fval(a->type, ATF_CURSE)) {
do { ap = &(*ap)->next; } while (*ap && a->type==(*ap)->type);
continue;
}
c = (curse*)a->data.v;
/* Immunität prüfen */
if (c->flag & CURSE_IMMUNE) {
do { ap = &(*ap)->next; } while (*ap && a->type==(*ap)->type);
continue;
}
force = destr_curse(c, effect, force);
if(c->vigour <= 0) {
a_remove(&r->attribs, a);
}
if(*ap) ap = &(*ap)->next;
}
if(force > 0) {
variant var ;
var.i = effect;
create_curse(mage, &r->attribs, ct_find("antimagiczone"), force, duration, var, 0);
}
}
use_pooled(mage, mage->region, R_ANTIMAGICCRYSTAL, amount);
add_message(&mage->faction->msgs,
new_message(mage->faction, "use_antimagiccrystal%u:unit%r:region", mage, r));
return;
}
/* ------------------------------------------------------------- */ /* ------------------------------------------------------------- */
/* Kann auch von Nichtmagier benutzt werden, modifiziert Taktik für diese /* Kann auch von Nichtmagier benutzt werden, modifiziert Taktik für diese
* Runde um -1 - 4 Punkte. */ * Runde um -1 - 4 Punkte. */
@ -1012,10 +953,6 @@ static t_item itemdata[MAXITEMS] = {
{"Delphin", "Delphine", "Delphin", "Delphine"}, {"Delphin", "Delphine", "Delphin", "Delphine"},
IS_MAGIC, 0, 0, {0, 0, 0, 0, 0, 0}, 5000, 0, FL_ITEM_ANIMAL | FL_ITEM_NOTINBAG | FL_ITEM_NOTLOST, NULL IS_MAGIC, 0, 0, {0, 0, 0, 0, 0, 0}, 5000, 0, FL_ITEM_ANIMAL | FL_ITEM_NOTINBAG | FL_ITEM_NOTLOST, NULL
}, },
{ /* I_ANTIMAGICCRYSTAL 63 */
{"Antimagiekristall", "Antimagiekristalle", "Amulett", "Amulette"},
IS_MAGIC, 0, 0, {0, 0, 0, 0, 0, 0}, 0, 0, 0, &use_antimagiccrystal
},
{ /* I_RING_OF_NIMBLEFINGER 64 */ { /* I_RING_OF_NIMBLEFINGER 64 */
{"Ring der flinken Finger", "Ringe der flinken Finger", "", ""}, {"Ring der flinken Finger", "Ringe der flinken Finger", "", ""},
IS_MAGIC, 0, 0, {0, 0, 0, 0, 0, 0}, 0, 0, 0, NULL IS_MAGIC, 0, 0, {0, 0, 0, 0, 0, 0}, 0, 0, 0, NULL
@ -2030,8 +1967,6 @@ item_score(item_t i)
case I_RING_OF_NIMBLEFINGER: case I_RING_OF_NIMBLEFINGER:
case I_FEENSTIEFEL: case I_FEENSTIEFEL:
return 6000; return 6000;
case I_ANTIMAGICCRYSTAL:
return 2000;
} }
return 0; return 0;
} }
@ -2284,7 +2219,6 @@ register_resources(void)
register_function((pf_generic)use_potion, "usepotion"); register_function((pf_generic)use_potion, "usepotion");
register_function((pf_generic)use_tacticcrystal, "usetacticcrystal"); register_function((pf_generic)use_tacticcrystal, "usetacticcrystal");
register_function((pf_generic)use_birthdayamulet, "usebirthdayamulet"); register_function((pf_generic)use_birthdayamulet, "usebirthdayamulet");
register_function((pf_generic)use_antimagiccrystal, "useantimagiccrystal");
register_function((pf_generic)use_warmthpotion, "usewarmthpotion"); register_function((pf_generic)use_warmthpotion, "usewarmthpotion");
register_function((pf_generic)use_bloodpotion, "usebloodpotion"); register_function((pf_generic)use_bloodpotion, "usebloodpotion");
register_function((pf_generic)use_foolpotion, "usefoolpotion"); register_function((pf_generic)use_foolpotion, "usefoolpotion");

View File

@ -312,7 +312,6 @@ enum {
I_PEGASUS, I_PEGASUS,
I_UNICORN, I_UNICORN,
I_DOLPHIN, I_DOLPHIN,
I_ANTIMAGICCRYSTAL,
I_RING_OF_NIMBLEFINGER, I_RING_OF_NIMBLEFINGER,
I_TROLLBELT, I_TROLLBELT,
I_PRESSCARD, I_PRESSCARD,

View File

@ -39,6 +39,7 @@
#include "ship.h" #include "ship.h"
#include "skill.h" #include "skill.h"
#include "spell.h" #include "spell.h"
#include "spellid.h"
#include "unit.h" #include "unit.h"
#include <triggers/timeout.h> #include <triggers/timeout.h>
@ -1243,6 +1244,18 @@ fumble(region * r, unit * u, const spell * sp, int cast_grade)
return true; return true;
} }
/* ------------------------------------------------------------- */
/* Dummy-Zauberpatzer, Platzhalter für speziel auf die Sprüche
* zugeschnittene Patzer */
static void
patzer(castorder *co)
{
unit *mage = (unit *)co->magician;
cmistake(mage, co->order, 180, MSG_MAGIC);
return;
}
/* Die normalen Spruchkosten müssen immer bezahlt werden, hier noch /* Die normalen Spruchkosten müssen immer bezahlt werden, hier noch
* alle weiteren Folgen eines Patzers * alle weiteren Folgen eines Patzers
*/ */

View File

@ -62,7 +62,6 @@
#include <attributes/at_movement.h> #include <attributes/at_movement.h>
#include <attributes/otherfaction.h> #include <attributes/otherfaction.h>
extern border_type bt_wisps;
int * storms; int * storms;
typedef struct traveldir { typedef struct traveldir {
@ -1054,7 +1053,7 @@ next_region(unit * u, region * current, region * next)
if (b->type->move) { if (b->type->move) {
region * rto = b->type->move(b, u, current, next, true); region * rto = b->type->move(b, u, current, next, true);
if (rto!=next) { if (rto!=next) {
/* the target region was changed (bt_wisps, for example). check the /* the target region was changed (wisps, for example). check the
* new target region for borders */ * new target region for borders */
next = rto; next = rto;
b = get_borders(current, next); b = get_borders(current, next);
@ -1146,7 +1145,7 @@ movement_speed(unit * u)
case RC_WYRM: case RC_WYRM:
case RC_FIREDRAGON: case RC_FIREDRAGON:
case RC_BIRTHDAYDRAGON: case RC_BIRTHDAYDRAGON:
case RC_PSEUDODRAGON: case RC_SONGDRAGON:
return BP_DRAGON; return BP_DRAGON;
} }

View File

@ -28,11 +28,11 @@
#include "alchemy.h" #include "alchemy.h"
#include "build.h" #include "build.h"
#include "building.h" #include "building.h"
#include "equipment.h"
#include "faction.h" #include "faction.h"
#include "item.h" #include "item.h"
#include "magic.h" #include "magic.h"
#include "region.h" #include "region.h"
#include "spell.h"
#include "unit.h" #include "unit.h"
#include "names.h" #include "names.h"
#include "pathfinder.h" #include "pathfinder.h"
@ -301,133 +301,13 @@ racename(const struct locale *loc, const unit *u, const race * rc)
} }
static void static void
oldfamiliars(unit * familiar) oldfamiliars(unit * u)
{ {
sc_mage * m = NULL; char fname[64];
race_t frt = old_race(familiar->race); /* these familiars have no special skills.
*/
switch(frt) { snprintf(fname, sizeof(fname), "%s_familiar", u->race->_name[0]);
case RC_HOUSECAT: equip_unit(u, get_equipment(fname));
/* Kräu+1, Mag, Pfer+1, Spi+3, Tar+3, Wahr+4, Aus */
set_level(familiar, SK_MAGIC, 1);
set_level(familiar, SK_SPY, 1);
set_level(familiar, SK_STEALTH, 1);
set_level(familiar, SK_OBSERVATION, 1);
m = create_mage(familiar, M_GRAU);
break;
case RC_TUNNELWORM:
/* Ber+50,Hol+50,Sbau+50,Aus+2*/
set_level(familiar, SK_MAGIC, 1);
set_level(familiar, SK_MINING, 1);
set_level(familiar, SK_LUMBERJACK, 1);
set_level(familiar, SK_AUSDAUER, 1);
m = create_mage(familiar, M_GRAU);
break;
case RC_EAGLE:
/* Spi, Wahr+2, Aus */
set_level(familiar, SK_MAGIC, 1);
set_level(familiar, SK_OBSERVATION, 1);
m = create_mage(familiar, M_GRAU);
break;
case RC_RAT:
/* Spionage+5, Tarnung+4, Wahrnehmung+2, Ausdauer */
set_level(familiar, SK_MAGIC, 1);
set_level(familiar, SK_SPY, 1);
set_level(familiar, SK_STEALTH, 1);
set_level(familiar, SK_OBSERVATION, 1);
set_level(familiar, SK_AUSDAUER, 1+rand()%8);
/* set_number(familiar, 50+rand()%500+rand()%500); */
m = create_mage(familiar, M_GRAU);
break;
case RC_PSEUDODRAGON:
/* Magie+1, Spionage, Tarnung, Wahrnehmung, Ausdauer */
m = create_mage(familiar, M_GRAU);
set_level(familiar, SK_MAGIC, 1);
break;
case RC_NYMPH:
/* Alc, Arm, Bog+2, Han-2, Kräu+4, Mag+1, Pfer+5, Rei+5,
* Rüs-2, Sbau, Seg-2, Sta, Spi+2, Tak-2, Tar+3, Unt+10,
* Waf-2, Wag-2, Wahr+2, Steu-2, Aus-1 */
set_level(familiar, SK_MAGIC, 1);
set_level(familiar, SK_LONGBOW, 1);
set_level(familiar, SK_HERBALISM, 1);
set_level(familiar, SK_HORSE_TRAINING, 1);
set_level(familiar, SK_RIDING, 1);
set_level(familiar, SK_SPY, 1);
set_level(familiar, SK_STEALTH, 1);
set_level(familiar, SK_ENTERTAINMENT, 1);
set_level(familiar, SK_OBSERVATION, 1);
m = create_mage(familiar, M_GRAU);
break;
case RC_UNICORN:
/* Mag+2, Spi, Tak, Tar+4, Wahr+4, Aus */
set_level(familiar, SK_MAGIC, 1);
set_level(familiar, SK_STEALTH, 1);
set_level(familiar, SK_OBSERVATION, 1);
m = create_mage(familiar, M_GRAU);
break;
case RC_WARG:
/* Spi, Tak, Tar, Wahri+2, Aus */
set_level(familiar, SK_MAGIC, 1);
set_level(familiar, SK_OBSERVATION, 1);
m = create_mage(familiar, M_GRAU);
break;
case RC_WRAITH:
/* Mag+1, Rei-2, Hie, Sta, Spi, Tar, Wahr, Aus */
set_level(familiar, SK_MAGIC, 1);
m = create_mage(familiar, M_GRAU);
break;
case RC_IMP:
/* Mag+1,Rei-1,Hie,Sta,Spi+1,Tar+1,Wahr+1,Steu+1,Aus*/
set_level(familiar, SK_MAGIC, 1);
set_level(familiar, SK_SPY, 1);
set_level(familiar, SK_STEALTH, 1);
set_level(familiar, SK_OBSERVATION, 1);
set_level(familiar, SK_TAXING, 1);
m = create_mage(familiar, M_GRAU);
break;
case RC_DREAMCAT:
/* Mag+1,Hie,Sta,Spi+1,Tar+1,Wahr+1,Steu+1,Aus*/
set_level(familiar, SK_MAGIC, 1);
set_level(familiar, SK_SPY, 1);
set_level(familiar, SK_STEALTH, 1);
set_level(familiar, SK_OBSERVATION, 1);
set_level(familiar, SK_TAXING, 1);
m = create_mage(familiar, M_GRAU);
break;
case RC_FEY:
/* Mag+1,Rei-1,Hie-1,Sta-1,Spi+2,Tar+5,Wahr+2,Aus */
set_level(familiar, SK_MAGIC, 1);
m = create_mage(familiar,M_GRAU);
break;
case RC_OWL:
/* Spi+1,Tar+1,Wahr+5,Aus */
set_level(familiar, SK_MAGIC, 1);
set_level(familiar, SK_SPY, 1);
set_level(familiar, SK_STEALTH, 1);
set_level(familiar, SK_OBSERVATION, 1);
m = create_mage(familiar,M_GRAU);
break;
case RC_HELLCAT:
/* Spi, Tak, Tar, Wahr+1, Aus */
set_level(familiar, SK_MAGIC, 1);
set_level(familiar, SK_OBSERVATION, 1);
m = create_mage(familiar,M_GRAU);
break;
case RC_TIGER:
/* Spi, Tak, Tar, Wahr+1, Aus */
set_level(familiar, SK_MAGIC, 1);
set_level(familiar, SK_OBSERVATION, 1);
m = create_mage(familiar,M_GRAU);
break;
}
if (m!=NULL) {
spell_list * fspells = familiarspells(familiar->race);
while (fspells!=NULL) {
add_spell(m, fspells->data);
fspells=fspells->next;
}
}
} }
static item * static item *
@ -592,89 +472,7 @@ register_races(void)
sprintf(zBuffer, "%s/races.xml", resourcepath()); sprintf(zBuffer, "%s/races.xml", resourcepath());
} }
/** familiars **/
typedef struct familiar_spells {
struct familiar_spells * next;
spell_list * spells;
const race * familiar_race;
} familiar_spells;
static familiar_spells * racespells;
spell_list *
familiarspells(const race * rc)
{
familiar_spells * fspells = racespells;
while (fspells && rc!=fspells->familiar_race) {
fspells = fspells->next;
}
if (fspells!=NULL) return fspells->spells;
return NULL;
}
familiar_spells *
mkspells(const race * rc)
{
familiar_spells * fspells;
fspells = malloc(sizeof(familiar_spells));
fspells->next = racespells;
racespells = fspells;
fspells->familiar_race = rc;
fspells->spells = NULL;
return fspells;
}
void
init_familiarspells(void)
{
familiar_spells * fspells;
fspells = mkspells(new_race[RC_PSEUDODRAGON]);
spelllist_add(&fspells->spells, find_spellbyid(SPL_FLEE));
spelllist_add(&fspells->spells, find_spellbyid(SPL_SLEEP));
spelllist_add(&fspells->spells, find_spellbyid(SPL_FRIGHTEN));
fspells = mkspells(new_race[RC_NYMPH]);
spelllist_add(&fspells->spells, find_spellbyid(SPL_SEDUCE));
spelllist_add(&fspells->spells, find_spellbyid(SPL_CALM_MONSTER));
spelllist_add(&fspells->spells, find_spellbyid(SPL_SONG_OF_CONFUSION));
spelllist_add(&fspells->spells, find_spellbyid(SPL_DENYATTACK));
fspells = mkspells(new_race[RC_NYMPH]);
spelllist_add(&fspells->spells, find_spellbyid(SPL_SEDUCE));
spelllist_add(&fspells->spells, find_spellbyid(SPL_CALM_MONSTER));
spelllist_add(&fspells->spells, find_spellbyid(SPL_SONG_OF_CONFUSION));
spelllist_add(&fspells->spells, find_spellbyid(SPL_DENYATTACK));
fspells = mkspells(new_race[RC_UNICORN]);
spelllist_add(&fspells->spells, find_spellbyid(SPL_RESISTMAGICBONUS));
spelllist_add(&fspells->spells, find_spellbyid(SPL_SONG_OF_PEACE));
spelllist_add(&fspells->spells, find_spellbyid(SPL_CALM_MONSTER));
spelllist_add(&fspells->spells, find_spellbyid(SPL_HERO));
spelllist_add(&fspells->spells, find_spellbyid(SPL_HEALINGSONG));
spelllist_add(&fspells->spells, find_spellbyid(SPL_DENYATTACK));
fspells = mkspells(new_race[RC_WRAITH]);
spelllist_add(&fspells->spells, find_spellbyid(SPL_STEALAURA));
spelllist_add(&fspells->spells, find_spellbyid(SPL_FRIGHTEN));
spelllist_add(&fspells->spells, find_spellbyid(SPL_SUMMONUNDEAD));
fspells = mkspells(new_race[RC_IMP]);
spelllist_add(&fspells->spells, find_spellbyid(SPL_STEALAURA));
fspells = mkspells(new_race[RC_DREAMCAT]);
spelllist_add(&fspells->spells, find_spellbyid(SPL_ILL_SHAPESHIFT));
spelllist_add(&fspells->spells, find_spellbyid(SPL_TRANSFERAURA_TRAUM));
fspells = mkspells(new_race[RC_FEY]);
spelllist_add(&fspells->spells, find_spellbyid(SPL_DENYATTACK));
spelllist_add(&fspells->spells, find_spellbyid(SPL_CALM_MONSTER));
spelllist_add(&fspells->spells, find_spellbyid(SPL_SEDUCE));
}
void void
init_races(void) init_races(void)
{ {
init_familiarspells();
} }

View File

@ -169,8 +169,6 @@ extern boolean allowed_dragon(const struct region * src, const struct region * t
extern void register_races(void); extern void register_races(void);
extern void init_races(void); extern void init_races(void);
extern boolean r_insectstalled(const struct region *r); extern boolean r_insectstalled(const struct region *r);
extern spell_list * familiarspells(const struct race * rc);
extern void add_raceprefix(const char *); extern void add_raceprefix(const char *);
extern char ** race_prefixes; extern char ** race_prefixes;

View File

@ -58,15 +58,6 @@
const char * g_reportdir; const char * g_reportdir;
const char *neue_gebiete[] = {
"none",
"illaun",
"tybied",
"cerddor",
"gwyrrd",
"draig"
};
const char *coasts[MAXDIRECTIONS] = const char *coasts[MAXDIRECTIONS] =
{ {
"coast::nw", "coast::nw",

View File

@ -31,7 +31,6 @@ extern "C" {
#define REPORTWIDTH 78 #define REPORTWIDTH 78
extern const char *directions[]; extern const char *directions[];
extern const char *neue_gebiete[];
extern const char *coasts[]; extern const char *coasts[];
/* kann_finden speedups */ /* kann_finden speedups */

File diff suppressed because it is too large Load Diff

View File

@ -12,8 +12,8 @@
* prior permission by the authors of Eressea. * prior permission by the authors of Eressea.
*/ */
#ifndef H_KRNL_SPELLS #ifndef H_KRNL_SPELL
#define H_KRNL_SPELLS #define H_KRNL_SPELL
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
@ -26,201 +26,6 @@ extern "C" {
struct castorder; struct castorder;
struct curse; struct curse;
/* Sprüche. Neue NUR hinten anfügen, oder das Datenfile geht kaputt */
enum {
SPL_NOSPELL,
LUASPL_ARTEFAKT_OF_POWER,
LUASPL_ARTEFAKT_OF_AURAPOWER,
LUASPL_ARTEFAKT_OF_REGENERATION,
SPL_FIREBALL,
SPL_HAGEL,
SPL_RUSTWEAPON,
SPL_COMBATRUST,
SPL_TREEGROW,
SPL_HEALING,
SPL_HEALINGSONG,
SPL_BADDREAMS,
SPL_GOODDREAMS,
SPL_DREAMREADING,
SPL_SWEETDREAMS,
SPL_TIREDSOLDIERS,
SPL_PLAGUE,
SPL_MAGICBOOST,
SPL_CHAOSROW,
SPL_SONG_OF_CONFUSION,
SPL_FLEE,
SPL_SONG_OF_FEAR,
SPL_BERSERK,
SPL_BLOODTHIRST,
SPL_MAELSTROM,
SPL_BLESSEDHARVEST,
SPL_RAINDANCE,
SPL_TRANSFERAURA_DRUIDE,
SPL_TRANSFERAURA_BARDE,
SPL_TRANSFERAURA_CHAOS,
SPL_TRANSFERAURA_TRAUM,
SPL_TRANSFERAURA_ASTRAL,
SPL_STONEGOLEM,
SPL_IRONGOLEM,
SPL_SUMMONSHADOW,
SPL_SUMMONSHADOWLORDS,
SPL_REELING_ARROWS,
SPL_ANTIMAGICZONE,
LUASPL_CREATE_ANTIMAGICCRYSTAL,
SPL_KAELTESCHUTZ,
SPL_STEALAURA,
SPL_SUMMONUNDEAD,
SPL_AURALEAK,
SPL_GREAT_DROUGHT,
SPL_STRONG_WALL,
SPL_HOMESTONE,
SPL_DROUGHT,
SPL_FOREST_FIRE,
LUASPL_STRENGTH,
SPL_SUMMONENT,
SPL_DISTURBINGDREAMS,
SPL_DENYATTACK,
SPL_SLEEP,
SPL_EARTHQUAKE,
SPL_IRONKEEPER,
SPL_STORMWINDS,
SPL_GOODWINDS,
SPL_FLYING_SHIP,
SPL_SUMMON_ALP,
SPL_WINDSHIELD,
SPL_RAISEPEASANTS,
SPL_DEPRESSION,
SPL_HEADACHE,
LUASPL_ARTEFAKT_NIMBLEFINGERRING,
SPL_ENTERASTRAL,
SPL_LEAVEASTRAL,
SPL_SHOWASTRAL,
SPL_VERSTEINERN,
SPL_TREEWALKENTER,
SPL_TREEWALKEXIT,
SPL_CHAOSSUCTION,
SPL_VIEWREALITY,
SPL_DISRUPTASTRAL,
SPL_SEDUCE,
SPL_PUMP,
SPL_CALM_MONSTER,
SPL_HERO,
SPL_FRIGHTEN,
SPL_MINDBLAST,
SPL_SPEED,
SPL_SPEED2,
SPL_FIREDRAGONODEM,
SPL_DRAGONODEM,
SPL_WYRMODEM, /* 83 */
SPL_MAGICSTREET,
SPL_REANIMATE,
SPL_RECRUIT,
SPL_GENEROUS,
SPL_PERMTRANSFER,
SPL_SONG_OF_PEACE,
SPL_MIGRANT,
SPL_RALLYPEASANTMOB,
SPL_RAISEPEASANTMOB,
SPL_ILL_SHAPESHIFT,
SPL_WOLFHOWL,
SPL_FOG_OF_CONFUSION,
SPL_DREAM_OF_CONFUSION,
SPL_RESISTMAGICBONUS,
SPL_KEEPLOOT,
SPL_SCHILDRUNEN,
SPL_SONG_RESISTMAGIC,
SPL_SONG_SUSCEPTMAGIC,
SPL_ANALYSEMAGIC,
SPL_ANALYSEDREAM,
SPL_UNIT_ANALYSESONG,
SPL_OBJ_ANALYSESONG,
SPL_TYBIED_DESTROY_MAGIC,
SPL_DESTROY_MAGIC,
SPL_METEORRAIN,
SPL_REDUCESHIELD,
SPL_ARMORSHIELD,
SPL_DEATHCLOUD,
SPL_ORKDREAM,
SPL_SUMMONDRAGON,
SPL_READMIND,
SPL_BABBLER,
SPL_MOVECASTLE,
SPL_BLESSSTONECIRCLE,
SPL_ILLAUN_FAMILIAR,
SPL_GWYRRD_FAMILIAR,
SPL_DRAIG_FAMILIAR,
SPL_CERDDOR_FAMILIAR,
SPL_TYBIED_FAMILIAR,
SPL_SONG_OF_ENSLAVE,
LUASPL_TRUESEEING_GWYRRD,
LUASPL_TRUESEEING_DRAIG,
LUASPL_TRUESEEING_ILLAUN,
LUASPL_TRUESEEING_CERDDOR,
LUASPL_TRUESEEING_TYBIED,
LUASPL_INVISIBILITY_GWYRRD,
LUASPL_INVISIBILITY_DRAIG,
LUASPL_INVISIBILITY_ILLAUN,
LUASPL_INVISIBILITY_CERDDOR,
LUASPL_INVISIBILITY_TYBIED,
LUASPL_ARTEFAKT_CHASTITYBELT,
LUASPL_ARTEFAKT_RUNESWORD,
SPL_FUMBLECURSE,
SPL_ICASTLE,
SPL_GWYRRD_DESTROY_MAGIC,
SPL_DRAIG_DESTROY_MAGIC,
SPL_ILLAUN_DESTROY_MAGIC,
SPL_CERDDOR_DESTROY_MAGIC,
SPL_GWYRRD_ARMORSHIELD,
SPL_DRAIG_FUMBLESHIELD,
SPL_GWYRRD_FUMBLESHIELD,
SPL_CERRDOR_FUMBLESHIELD,
SPL_TYBIED_FUMBLESHIELD,
SPL_SHADOWKNIGHTS,
LUASPL_FIRESWORD,
LUASPL_CREATE_TACTICCRYSTAL,
SPL_ITEMCLOAK,
SPL_FIREWALL,
SPL_WISPS,
SPL_SPARKLE_CHAOS,
SPL_SPARKLE_DREAM,
LUASPL_BAG_OF_HOLDING,
SPL_PULLASTRAL,
SPL_FETCHASTRAL,
SPL_ILLAUN_EARN_SILVER,
SPL_GWYRRD_EARN_SILVER,
SPL_DRAIG_EARN_SILVER,
SPL_TYBIED_EARN_SILVER,
SPL_CERDDOR_EARN_SILVER,
SPL_SHOCKWAVE,
SPL_UNDEADHERO,
LUASPL_ARTEFAKT_SACK_OF_CONSERVATION,
SPL_BECOMEWYRM,
SPL_ETERNIZEWALL,
SPL_PUTTOREST,
SPL_UNHOLYPOWER,
SPL_HOLYGROUND,
SPL_BLOODSACRIFICE,
SPL_MALLORN,
SPL_CLONECOPY,
SPL_DRAINODEM, /* 174? */
SPL_AURA_OF_FEAR, /* 175? */
SPL_SHADOWCALL, /* 176? */
SPL_MALLORNTREEGROW,
LUASPL_INVISIBILITY2_ILLAUN,
SPL_BIGRECRUIT,
SPL_IMMOLATION,
SPL_FIREODEM, /* 181 */
SPL_ICEODEM,
SPL_ACIDODEM,
#ifdef WDW_PYRAMIDSPELL
SPL_WDWPYRAMID_TRAUM,
SPL_WDWPYRAMID_ASTRAL,
SPL_WDWPYRAMID_DRUIDE,
SPL_WDWPYRAMID_BARDE,
SPL_WDWPYRAMID_CHAOS,
#endif
};
/* Prototypen */ /* Prototypen */
void do_shock(struct unit *u, const char *reason); void do_shock(struct unit *u, const char *reason);
@ -230,55 +35,8 @@ extern "C" {
int sp_antimagiczone(struct castorder *co); int sp_antimagiczone(struct castorder *co);
extern double destr_curse(struct curse* c, int cast_level, double force); extern double destr_curse(struct curse* c, int cast_level, double force);
/* Kampfzauber */
extern int sp_fumbleshield(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_shadowknights(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_combatrosthauch(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_kampfzauber(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_healing(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_keeploot(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_reanimate(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_chaosrow(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_flee(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_berserk(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_tiredsoldiers(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_reeling_arrows(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_denyattack(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_sleep(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_windshield(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_strong_wall(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_versteinern(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_hero(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_frighten(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_mindblast(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_speed(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_wolfhowl(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_dragonodem(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_reduceshield(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_armorshield(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_stun(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_undeadhero(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_shadowcall(struct fighter * fi, int level, double power, struct spell * sp);
extern int sp_immolation(struct fighter * fi, int level, double power, struct spell * sp);
/* ------------------------------------------------------------- */ /* ------------------------------------------------------------- */
/* für Feuerwände: in movement muß das noch explizit getestet werden.
* besser wäre eine blcok_type::move() routine, die den effekt
* der Bewegung auf eine struct unit anwendet.
*/
extern struct border_type bt_chaosgate;
extern struct border_type bt_firewall;
extern struct border_type bt_wisps;
typedef struct wall_data {
struct unit * mage;
int force;
boolean active;
} wall_data;
extern struct attrib_type at_cursewall;
extern struct attrib_type at_unitdissolve; extern struct attrib_type at_unitdissolve;
#ifdef WDW_PYRAMIDSPELL #ifdef WDW_PYRAMIDSPELL
extern struct attrib_type at_wdwpyramid; extern struct attrib_type at_wdwpyramid;
@ -288,9 +46,115 @@ extern "C" {
extern void init_spells(void); extern void init_spells(void);
extern void register_spell(struct spell * sp); extern void register_spell(struct spell * sp);
extern struct spell * find_spell(magic_t mtype, const char * name); extern struct spell * find_spell(magic_t mtype, const char * name);
extern void patzer(struct castorder *co);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
/* ------------------------------------------------------------- */
/* Erläuterungen zu den Spruchdefinitionen
*
* Spruchstukturdefinition:
* spell{
* id, name,
* beschreibung,
* syntax,
* parameter,
* magietyp,
* sptyp,
* rank,level,
* costtyp, aura,
* komponenten[5][2][faktorart],
* &funktion, patzer}
*
* id:
* SPL_NOSPELL muss der letzte Spruch in der Liste spelldaten sein,
* denn nicht auf die Reihenfolge in der Liste sondern auf die id wird
* geprüft
*
* sptyp:
* besondere Spruchtypen und Flags
* (Regionszauber, Kampfzauber, Farcastbar, Stufe variable, ..)
*
* rank:
* gibt die Priorität und damit die Reihenfolge an, in der der Spruch
* gezaubert wird.
* 1: Aura übertragen
* 2: Antimagie
* 3: Magierverändernde Sprüche (Magic Boost, ..)
* 4: Monster erschaffen
* 5: Standartlevel
* 7: Teleport
*
* Komponenten[Anzahl mögl. Items][Art:Anzahl:Kostentyp]
*
* R_AURA:
* Grundkosten für einen Zauber. Soviel Mp müssen mindestens investiert
* werden, um den Spruch zu wirken. Zusätzliche Mp können unterschiedliche
* Auswirkungen haben, die in der Spruchfunktionsroutine definiert werden.
*
* R_PERMAURA:
* Kosten an permantenter Aura
*
* Komponenten Kostentyp:
* SPC_LEVEL == Spruch mit Levelabhängigen Magiekosten. Die angegeben
* Kosten müssen für Stufe 1 berechnet sein.
* SPC_FIX == Feste Kosten
*
* Wenn keine spezielle Syntax angegeben ist, wird die
* Syntaxbeschreibung aus sptyp generiert:
* FARCASTING: ZAUBER [REGION x y]
* SPELLLEVEL: ZAUBER [STUFE n]
* UNITSPELL : ZAUBER <spruchname> <Einheit-Nr> [<Einheit-Nr> ..]
* SHIPSPELL : ZAUBER <spruchname> <Schiff-Nr> [<Schiff-Nr> ..]
* BUILDINGSPELL: ZAUBER <spruchname> <Gebäude-Nr> [<Gebäude-Nr> ..]
* ONETARGET : ZAUBER <spruchname> <target-nr>
* PRECOMBATSPELL : KAMPFZAUBER [STUFE n] <spruchname>
* COMBATSPELL : KAMPFZAUBER [STUFE n] <spruchname>
* POSTCOMBATSPELL: KAMPFZAUBER [STUFE n] <spruchname>
*
* Das Parsing
*
* Der String spell->parameter gibt die Syntax an, nach der die
* Parameter des Spruches in add_spellparameter() geparst werden sollen.
*
* u : eine Einheitennummer
* r : hier kommen zwei Regionskoordinaten x y
* b : Gebäude- oder Burgnummer
* s : Schiffsnummer
* c : String, wird ohne Weiterverarbeitung übergeben
* i : Zahl (int), wird ohne Weiterverarbeitung übergeben
* k : Keywort - dieser String gibt den Paramter an, der folgt. Der
* Parameter wird mit findparam() identifiziert.
* k muss immer von einem c als Platzhalter für das Objekt gefolgt
* werden.
* Ein gutes Beispiel sind hierfür die Sprüche zur Magieanalyse.
* + : gibt an, das der vorherige Parameter mehrfach vorkommen kann. Da
* ein Ende nicht definiert werden kann, muss dies immer am Schluss
* kommen.
*
* Flags für das Parsing:
* TESTRESISTANCE : alle Zielobjekte, also alle Parameter vom Typ Unit,
* Burg, Schiff oder Region, werden auf ihre
* Magieresistenz überprüft
* TESTCANSEE : jedes Objekt vom Typ Einheit wird auf seine
* Sichtbarkeit überprüft
* SEARCHGLOBAL : die Zielobjekte werden global anstelle von regional
* gesucht
* REGIONSPELL : Ziel ist die Region, auch wenn kein Zielobjekt
* angegeben wird. Ist TESTRESISTANCE gesetzt, so wird
* die Magieresistenz der Region überprüft
*
* Bei fehlendem Ziel oder wenn dieses dem Zauber widersteht, wird die
* Spruchfunktion nicht aufgerufen.
* Sind zu wenig Parameter vorhanden, wird der Zauber ebenfalls nicht
* ausgeführt.
* Ist eins von mehreren Zielobjekten resistent, so wird das Flag
* pa->param[n]->flag == TARGET_RESISTS
* Ist eins von mehreren Zielobjekten nicht gefunden worden, so ist
* pa->param[n]->flag == TARGET_NOTFOUND
*
*/
/* ------------------------------------------------------------- */

209
src/common/kernel/spellid.h Normal file
View File

@ -0,0 +1,209 @@
/* vi: set ts=2:
* +-------------------+ Christian Schlittchen <corwin@amber.kn-bremen.de>
* | | Enno Rehling <enno@eressea.de>
* | Eressea PBEM host | Katja Zedel <katze@felidae.kn-bremen.de>
* | (c) 1998 - 2005 |
* | | This program may not be used, modified or distributed
* +-------------------+ without prior permission by the authors of Eressea.
*
*/
#ifndef H_KRNL_SPELLID
#define H_KRNL_SPELLID
/* Sprüche. Neue NUR hinten anfügen, oder das Datenfile geht kaputt */
enum {
SPL_NOSPELL = 0,
LUASPL_ARTEFAKT_OF_POWER,
LUASPL_ARTEFAKT_OF_AURAPOWER,
LUASPL_ARTEFAKT_OF_REGENERATION,
SPL_FIREBALL = 4,
SPL_HAGEL,
SPL_RUSTWEAPON,
SPL_COMBATRUST,
SPL_TREEGROW,
SPL_HEALING,
SPL_HEALINGSONG,
SPL_BADDREAMS,
SPL_GOODDREAMS,
SPL_DREAMREADING,
SPL_SWEETDREAMS,
SPL_TIREDSOLDIERS,
SPL_PLAGUE,
SPL_MAGICBOOST,
SPL_CHAOSROW,
SPL_SONG_OF_CONFUSION,
SPL_FLEE,
SPL_SONG_OF_FEAR,
SPL_BERSERK,
SPL_BLOODTHIRST,
SPL_MAELSTROM,
SPL_BLESSEDHARVEST,
SPL_RAINDANCE,
SPL_TRANSFERAURA_DRUIDE,
SPL_TRANSFERAURA_BARDE,
SPL_TRANSFERAURA_CHAOS,
SPL_TRANSFERAURA_TRAUM,
SPL_TRANSFERAURA_ASTRAL,
SPL_STONEGOLEM,
SPL_IRONGOLEM,
SPL_SUMMONSHADOW,
SPL_SUMMONSHADOWLORDS,
SPL_REELING_ARROWS,
SPL_ANTIMAGICZONE,
LUASPL_CREATE_ANTIMAGICCRYSTAL,
SPL_KAELTESCHUTZ = 39,
SPL_STEALAURA,
SPL_SUMMONUNDEAD,
SPL_AURALEAK,
SPL_GREAT_DROUGHT,
SPL_STRONG_WALL,
SPL_HOMESTONE,
SPL_DROUGHT,
SPL_FOREST_FIRE,
LUASPL_STRENGTH,
SPL_SUMMONENT = 49,
SPL_DISTURBINGDREAMS,
SPL_DENYATTACK,
SPL_SLEEP,
SPL_EARTHQUAKE,
SPL_IRONKEEPER,
SPL_STORMWINDS,
SPL_GOODWINDS,
SPL_FLYING_SHIP,
SPL_SUMMON_ALP,
SPL_WINDSHIELD,
SPL_RAISEPEASANTS,
SPL_DEPRESSION,
SPL_HEADACHE,
LUASPL_ARTEFAKT_NIMBLEFINGERRING,
SPL_ENTERASTRAL = 64,
SPL_LEAVEASTRAL,
SPL_SHOWASTRAL,
SPL_VERSTEINERN,
SPL_TREEWALKENTER,
SPL_TREEWALKEXIT,
SPL_CHAOSSUCTION,
SPL_VIEWREALITY,
SPL_DISRUPTASTRAL,
SPL_SEDUCE,
SPL_PUMP,
SPL_CALM_MONSTER,
SPL_HERO,
SPL_FRIGHTEN,
SPL_MINDBLAST,
SPL_SPEED,
SPL_SPEED2,
SPL_FIREDRAGONODEM,
SPL_DRAGONODEM,
SPL_WYRMODEM, /* 83 */
SPL_MAGICSTREET,
SPL_REANIMATE,
SPL_RECRUIT,
SPL_GENEROUS,
SPL_PERMTRANSFER,
SPL_SONG_OF_PEACE,
SPL_MIGRANT,
SPL_RALLYPEASANTMOB,
SPL_RAISEPEASANTMOB,
SPL_ILL_SHAPESHIFT,
SPL_WOLFHOWL,
SPL_FOG_OF_CONFUSION,
SPL_DREAM_OF_CONFUSION,
SPL_RESISTMAGICBONUS,
SPL_KEEPLOOT,
SPL_SCHILDRUNEN,
SPL_SONG_RESISTMAGIC,
SPL_SONG_SUSCEPTMAGIC,
SPL_ANALYSEMAGIC,
SPL_ANALYSEDREAM,
SPL_UNIT_ANALYSESONG,
SPL_OBJ_ANALYSESONG,
SPL_TYBIED_DESTROY_MAGIC,
SPL_DESTROY_MAGIC,
SPL_METEORRAIN,
SPL_REDUCESHIELD,
SPL_ARMORSHIELD,
SPL_DEATHCLOUD,
SPL_ORKDREAM,
SPL_SUMMONDRAGON,
SPL_READMIND,
SPL_BABBLER,
SPL_MOVECASTLE,
SPL_BLESSSTONECIRCLE,
SPL_ILLAUN_FAMILIAR,
SPL_GWYRRD_FAMILIAR,
SPL_DRAIG_FAMILIAR,
SPL_CERDDOR_FAMILIAR,
SPL_TYBIED_FAMILIAR,
SPL_SONG_OF_ENSLAVE,
LUASPL_TRUESEEING_GWYRRD,
LUASPL_TRUESEEING_DRAIG,
LUASPL_TRUESEEING_ILLAUN,
LUASPL_TRUESEEING_CERDDOR,
LUASPL_TRUESEEING_TYBIED,
LUASPL_INVISIBILITY_GWYRRD,
LUASPL_INVISIBILITY_DRAIG,
LUASPL_INVISIBILITY_ILLAUN,
LUASPL_INVISIBILITY_CERDDOR,
LUASPL_INVISIBILITY_TYBIED,
LUASPL_ARTEFAKT_CHASTITYBELT,
LUASPL_ARTEFAKT_RUNESWORD,
SPL_FUMBLECURSE = 136,
SPL_ICASTLE,
SPL_GWYRRD_DESTROY_MAGIC,
SPL_DRAIG_DESTROY_MAGIC,
SPL_ILLAUN_DESTROY_MAGIC,
SPL_CERDDOR_DESTROY_MAGIC,
SPL_GWYRRD_ARMORSHIELD,
SPL_DRAIG_FUMBLESHIELD,
SPL_GWYRRD_FUMBLESHIELD,
SPL_CERRDOR_FUMBLESHIELD,
SPL_TYBIED_FUMBLESHIELD,
SPL_SHADOWKNIGHTS,
LUASPL_FIRESWORD,
LUASPL_CREATE_TACTICCRYSTAL,
SPL_ITEMCLOAK = 150,
SPL_FIREWALL,
SPL_WISPS,
SPL_SPARKLE_CHAOS,
SPL_SPARKLE_DREAM,
LUASPL_BAG_OF_HOLDING,
SPL_PULLASTRAL = 156,
SPL_FETCHASTRAL,
SPL_ILLAUN_EARN_SILVER,
SPL_GWYRRD_EARN_SILVER,
SPL_DRAIG_EARN_SILVER,
SPL_TYBIED_EARN_SILVER,
SPL_CERDDOR_EARN_SILVER,
SPL_SHOCKWAVE,
SPL_UNDEADHERO,
LUASPL_ARTEFAKT_SACK_OF_CONSERVATION,
SPL_BECOMEWYRM = 166,
SPL_ETERNIZEWALL,
SPL_PUTTOREST,
SPL_UNHOLYPOWER,
SPL_HOLYGROUND,
SPL_BLOODSACRIFICE,
SPL_MALLORN,
SPL_CLONECOPY,
SPL_DRAINODEM, /* 174? */
SPL_AURA_OF_FEAR, /* 175? */
SPL_SHADOWCALL, /* 176? */
SPL_MALLORNTREEGROW,
LUASPL_INVISIBILITY2_ILLAUN,
SPL_BIGRECRUIT = 179,
SPL_IMMOLATION,
SPL_FIREODEM, /* 181 */
SPL_ICEODEM,
SPL_ACIDODEM,
#ifdef WDW_PYRAMIDSPELL
SPL_WDWPYRAMID_TRAUM,
SPL_WDWPYRAMID_ASTRAL,
SPL_WDWPYRAMID_DRUIDE,
SPL_WDWPYRAMID_BARDE,
SPL_WDWPYRAMID_CHAOS,
#endif
};
#endif

View File

@ -925,6 +925,38 @@ add_items(equipment * eq, xmlNodeSetPtr nsetItems)
} }
} }
static void
add_spells(equipment * eq, xmlNodeSetPtr nsetItems)
{
if (nsetItems!=NULL && nsetItems->nodeNr>0) {
int i;
for (i=0;i!=nsetItems->nodeNr;++i) {
xmlNodePtr node = nsetItems->nodeTab[i];
xmlChar * property;
magic_t mtype = M_GRAU;
struct spell * sp;
property = xmlGetProp(node, BAD_CAST "school");
if (property!=NULL) {
for (mtype=0;mtype!=MAXMAGIETYP;++mtype) {
if (strcmp((const char*)property, magietypen[mtype])==0) break;
}
assert(mtype!=MAXMAGIETYP);
xmlFree(property);
}
property = xmlGetProp(node, BAD_CAST "name");
assert(property!=NULL);
sp = find_spell(mtype, (const char*)property);
assert(sp);
xmlFree(property);
if (sp!=NULL) {
equipment_addspell(eq, sp);
}
}
}
}
static void static void
add_skills(equipment * eq, xmlNodeSetPtr nsetSkills) add_skills(equipment * eq, xmlNodeSetPtr nsetSkills)
{ {
@ -1033,6 +1065,10 @@ parse_equipment(xmlDocPtr doc)
add_items(eq, xpathResult->nodesetval); add_items(eq, xpathResult->nodesetval);
xmlXPathFreeObject(xpathResult); xmlXPathFreeObject(xpathResult);
xpathResult = xmlXPathEvalExpression(BAD_CAST "spell", xpath);
add_spells(eq, xpathResult->nodesetval);
xmlXPathFreeObject(xpathResult);
xpathResult = xmlXPathEvalExpression(BAD_CAST "skill", xpath); xpathResult = xmlXPathEvalExpression(BAD_CAST "skill", xpath);
add_skills(eq, xpathResult->nodesetval); add_skills(eq, xpathResult->nodesetval);
xmlXPathFreeObject(xpathResult); xmlXPathFreeObject(xpathResult);
@ -1654,8 +1690,8 @@ register_xmlreader(void)
xml_register_callback(parse_buildings); /* requires resources */ xml_register_callback(parse_buildings); /* requires resources */
xml_register_callback(parse_ships); /* requires resources */ xml_register_callback(parse_ships); /* requires resources */
xml_register_callback(parse_equipment); /* requires resources */
xml_register_callback(parse_spells); /* requires resources */ xml_register_callback(parse_spells); /* requires resources */
xml_register_callback(parse_equipment); /* requires spells */
xml_register_callback(parse_races); /* requires spells */ xml_register_callback(parse_races); /* requires spells */
xml_register_callback(parse_calendar); xml_register_callback(parse_calendar);
} }

View File

@ -316,7 +316,7 @@ tower_init(void)
b->size = 10; b->size = 10;
if (i!=0) { if (i!=0) {
sprintf(buf, "Turm des %s", sprintf(buf, "Turm des %s",
LOC(default_locale, mkname("school", neue_gebiete[i]))); LOC(default_locale, mkname("school", magietypen[i])));
} }
else sprintf(buf, "Turm der Ahnungslosen"); else sprintf(buf, "Turm der Ahnungslosen");
set_string(&b->name, buf); set_string(&b->name, buf);

File diff suppressed because it is too large Load Diff

View File

@ -20,6 +20,18 @@ extern "C" {
extern void register_spells(void); extern void register_spells(void);
/* für Feuerwände: in movement muß das noch explizit getestet werden.
* besser wäre eine blcok_type::move() routine, die den effekt
* der Bewegung auf eine struct unit anwendet.
*/
extern struct border_type bt_chaosgate;
extern struct border_type bt_firewall;
typedef struct wall_data {
struct unit * mage;
int force;
boolean active;
} wall_data;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -27,6 +27,7 @@
#include <attributes/targetregion.h> #include <attributes/targetregion.h>
#include <modules/autoseed.h> #include <modules/autoseed.h>
#include <modules/xecmd.h> #include <modules/xecmd.h>
#include <spells/spells.h>
/* gamecode includes */ /* gamecode includes */
#include <gamecode/economy.h> #include <gamecode/economy.h>
@ -53,6 +54,7 @@
#include <kernel/ship.h> #include <kernel/ship.h>
#include <kernel/skill.h> #include <kernel/skill.h>
#include <kernel/spell.h> #include <kernel/spell.h>
#include <kernel/spellid.h>
#include <kernel/study.h> #include <kernel/study.h>
#include <kernel/teleport.h> #include <kernel/teleport.h>
#include <kernel/unit.h> #include <kernel/unit.h>

View File

@ -3,7 +3,9 @@
#include "list.h" #include "list.h"
// kernel includes // kernel includes
#include <kernel/equipment.h>
#include <kernel/magic.h> #include <kernel/magic.h>
#include <kernel/race.h>
#include <kernel/region.h> #include <kernel/region.h>
#include <kernel/spell.h> #include <kernel/spell.h>
#include <kernel/unit.h> #include <kernel/unit.h>
@ -31,13 +33,14 @@ call_spell(castorder *co)
{ {
const char * fname = co->sp->sname; const char * fname = co->sp->sname;
unit * mage = (unit*)co->magician; unit * mage = (unit*)co->magician;
int retval = -1;
if (co->familiar) { if (co->familiar) {
mage = co->familiar; mage = co->familiar;
} }
try { try {
return luabind::call_function<int>(luaState, fname, co->rt, mage, co->level, co->force); retval = luabind::call_function<int>(luaState, fname, co->rt, mage, co->level, co->force);
} }
catch (luabind::error& e) { catch (luabind::error& e) {
lua_State* L = e.state(); lua_State* L = e.state();
@ -47,9 +50,38 @@ call_spell(castorder *co)
lua_pop(L, 1); lua_pop(L, 1);
std::terminate(); std::terminate();
} }
return -1; return retval;
} }
static void
init_familiar(unit * u)
{
char fname[64];
snprintf(fname, sizeof(fname), "initfamiliar_%s", u->race->_name[0]);
luabind::object globals = luabind::get_globals(luaState);
luabind::object fun = globals.at(fname);
if (fun.is_valid()) {
if (fun.type()!=LUA_TFUNCTION) {
log_error(("Lua global object %s is not a function, type is %u\n", fname, fun.type()));
} else {
try {
luabind::call_function<int>(luaState, fname, u);
}
catch (luabind::error& e) {
lua_State* L = e.state();
const char* error = lua_tostring(L, -1);
log_error(("An exception occured while %s tried to call '%s': %s.\n",
unitname(u), fname, error));
lua_pop(L, 1);
std::terminate();
}
}
}
snprintf(fname, sizeof(fname), "%s_familiar", u->race->_name[0]);
equip_unit(u, get_equipment(fname));
}
void void
bind_spell(lua_State * L) bind_spell(lua_State * L)
@ -62,4 +94,5 @@ bind_spell(lua_State * L)
.property("school", &spell_getschool) .property("school", &spell_getschool)
]; ];
register_function((pf_generic)&call_spell, "luaspell"); register_function((pf_generic)&call_spell, "luaspell");
register_function((pf_generic)&init_familiar, "luafamiliar");
} }

View File

@ -58,12 +58,6 @@ public:
static spell * value(spell_list * node) { return node->data; } static spell * value(spell_list * node) { return node->data; }
}; };
static eressea::list<spell *, spell_list *, bind_spell_list>
unit_familiarspells(const unit& u) {
spell_list * spells = familiarspells(u.race);
return eressea::list<spell *, spell_list *, bind_spell_list>(spells);
}
class bind_orders { class bind_orders {
public: public:
static order * next(order * node) { return node->next; } static order * next(order * node) { return node->next; }
@ -581,7 +575,6 @@ bind_unit(lua_State * L)
.property("region", &unit_getregion, &unit_setregion) .property("region", &unit_getregion, &unit_setregion)
.property("is_familiar", &unit_isfamiliar) .property("is_familiar", &unit_isfamiliar)
.property("spells", &unit_spells, return_stl_iterator) .property("spells", &unit_spells, return_stl_iterator)
.property("familiarspells", &unit_familiarspells, return_stl_iterator)
.property("number", &unit_getnumber, &unit_setnumber) .property("number", &unit_getnumber, &unit_setnumber)
.property("race", &unit_getrace, &unit_setrace) .property("race", &unit_getrace, &unit_setrace)
.property("hp_max", &unit_hpmax) .property("hp_max", &unit_hpmax)

View File

@ -1,6 +1,131 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<equipment> <equipment>
<!-- equipment given to familiars -->
<set name="lynx_familiar">
<skill name="sk_espionage" level="1"/>
<skill name="sk_magic" level="1"/>
<skill name="sk_stealth" level="1"/>
<skill name="sk_perception" level="1"/>
</set>
<set name="tunnelworm_familiar">
<skill name="sk_magic" level="1"/>
<skill name="sk_mining" level="1"/>
<skill name="sk_forestry" level="1"/>
<skill name="sk_stamina" level="1"/>
</set>
<set name="eagle_familiar">
<skill name="sk_magic" level="1"/>
<skill name="sk_perception" level="1"/>
</set>
<set name="rat_familiar">
<skill name="sk_magic" level="1"/>
<skill name="sk_espionage" level="1"/>
<skill name="sk_stealth" level="1"/>
<skill name="sk_perception" level="1"/>
<skill name="sk_stamina" level="6"/>
</set>
<set name="songdragon_familiar">
<skill name="sk_magic" level="1"/>
<!-- spells -->
<spell name="flee" school="gray"/>
<spell name="sleep" school="gray"/>
<spell name="frighten" school="gray"/>
</set>
<set name="nymph_familiar">
<skill name="sk_magic" level="1"/>
<skill name="sk_bow" level="1"/>
<skill name="sk_herbalism" level="1"/>
<skill name="sk_training" level="1"/>
<skill name="sk_riding" level="1"/>
<skill name="sk_espionage" level="1"/>
<skill name="sk_stealth" level="1"/>
<skill name="sk_entertainment" level="1"/>
<skill name="sk_perception" level="1"/>
<!-- spells -->
<spell name="seduction" school="gray"/>
<spell name="calm_monster" school="gray"/>
<spell name="song_of_confusion" school="gray"/>
<spell name="appeasement" school="gray"/>
</set>
<set name="unicorn_familiar">
<skill name="sk_magic" level="1"/>
<skill name="sk_stealth" level="1"/>
<skill name="sk_perception" level="1"/>
<!-- spells -->
<spell name="resist_magic" school="gray"/>
<spell name="song_of_peace" school="gray"/>
<spell name="calm_monster" school="gray"/>
<spell name="heroic_song" school="gray"/>
<spell name="song_of_healing" school="gray"/>
<spell name="appeasement" school="gray"/>
</set>
<set name="direwolf_familiar">
<skill name="sk_magic" level="1"/>
<skill name="sk_perception" level="1"/>
</set>
<set name="ghost_familiar">
<skill name="sk_magic" level="1"/>
<!-- spells -->
<spell name="steal_aura" school="gray"/>
<spell name="frighten" school="gray"/>
<spell name="summonundead" school="gray"/>
</set>
<set name="imp_familiar">
<skill name="sk_magic" level="1"/>
<skill name="sk_espionage" level="1"/>
<skill name="sk_stealth" level="1"/>
<skill name="sk_perception" level="1"/>
<skill name="sk_taxation" level="1"/>
<!-- spells -->
<spell name="steal_aura" school="gray"/>
</set>
<set name="dreamcat_familiar">
<skill name="sk_magic" level="1"/>
<skill name="sk_espionage" level="1"/>
<skill name="sk_stealth" level="1"/>
<skill name="sk_perception" level="1"/>
<skill name="sk_taxation" level="1"/>
<!-- spells -->
<spell name="shapeshift" school="gray"/>
<spell name="transferauratraum" school="gray"/>
</set>
<set name="fairy_familiar">
<skill name="sk_magic" level="1"/>
<!-- spells -->
<spell name="appeasement" school="gray"/>
<spell name="calm_monster" school="gray"/>
<spell name="seduction" school="gray"/>
</set>
<set name="owl_familiar">
<skill name="sk_magic" level="1"/>
<skill name="sk_espionage" level="1"/>
<skill name="sk_stealth" level="1"/>
<skill name="sk_perception" level="1"/>
</set>
<set name="hellcat_familiar">
<skill name="sk_magic" level="1"/>
<skill name="sk_perception" level="1"/>
</set>
<set name="tiger_familiar">
<skill name="sk_magic" level="1"/>
<skill name="sk_perception" level="1"/>
</set>
<!-- one equipment-set per player-race for the first unit in a faction --> <!-- one equipment-set per player-race for the first unit in a faction -->
<set name="dwarf"> <set name="dwarf">
<item name="axe" amount="1"/> <item name="axe" amount="1"/>

View File

@ -93,7 +93,7 @@
</race> </race>
<race name="tiger" magres="0.000000" maxaura="0.000000" regaura="0.000000" recruitcost="50" weight="500" capacity="200" speed="1.000000" hp="30" damage="2d6" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="3" walk="yes" teach="no" giveitem="yes" getitem="yes"> <race name="tiger" magres="0.000000" maxaura="0.000000" regaura="0.000000" recruitcost="50" weight="500" capacity="200" speed="1.000000" hp="30" damage="2d6" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="3" walk="yes" teach="no" giveitem="yes" getitem="yes">
<ai splitsize="5000"/> <ai splitsize="5000"/>
<function name="initfamiliar" value="oldfamiliars"/> <function name="initfamiliar" value="luafamiliar"/>
<skill name="sk_alchemy" modifier="-99"/> <skill name="sk_alchemy" modifier="-99"/>
<skill name="sk_crossbow" modifier="-99"/> <skill name="sk_crossbow" modifier="-99"/>
<skill name="sk_mining" modifier="-99"/> <skill name="sk_mining" modifier="-99"/>
@ -123,7 +123,7 @@
</race> </race>
<race name="hellcat" magres="0.500000" maxaura="0.000000" regaura="0.000000" recruitcost="50" weight="500" capacity="200" speed="1.000000" hp="40" damage="2d6" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="4" walk="yes" teach="no" giveitem="yes" getitem="yes" resistpierce="yes"> <race name="hellcat" magres="0.500000" maxaura="0.000000" regaura="0.000000" recruitcost="50" weight="500" capacity="200" speed="1.000000" hp="40" damage="2d6" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="4" walk="yes" teach="no" giveitem="yes" getitem="yes" resistpierce="yes">
<ai splitsize="5000"/> <ai splitsize="5000"/>
<function name="initfamiliar" value="oldfamiliars"/> <function name="initfamiliar" value="luafamiliar"/>
<skill name="sk_perception" modifier="1"/> <skill name="sk_perception" modifier="1"/>
<skill name="sk_alchemy" modifier="-99"/> <skill name="sk_alchemy" modifier="-99"/>
<skill name="sk_crossbow" modifier="-99"/> <skill name="sk_crossbow" modifier="-99"/>
@ -153,7 +153,7 @@
</race> </race>
<race name="owl" magres="0.000000" maxaura="0.000000" regaura="0.000000" recruitcost="50" weight="500" capacity="200" speed="1.000000" hp="9" damage="1d4" unarmedattack="0" unarmeddefense="0" attackmodifier="2" defensemodifier="4" fly="yes" walk="yes" teach="no" giveitem="yes" getitem="yes"> <race name="owl" magres="0.000000" maxaura="0.000000" regaura="0.000000" recruitcost="50" weight="500" capacity="200" speed="1.000000" hp="9" damage="1d4" unarmedattack="0" unarmeddefense="0" attackmodifier="2" defensemodifier="4" fly="yes" walk="yes" teach="no" giveitem="yes" getitem="yes">
<ai splitsize="5000"/> <ai splitsize="5000"/>
<function name="initfamiliar" value="oldfamiliars"/> <function name="initfamiliar" value="luafamiliar"/>
<skill name="sk_espionage" modifier="1"/> <skill name="sk_espionage" modifier="1"/>
<skill name="sk_stealth" modifier="1"/> <skill name="sk_stealth" modifier="1"/>
<skill name="sk_perception" modifier="5"/> <skill name="sk_perception" modifier="5"/>
@ -184,7 +184,7 @@
</race> </race>
<race name="fairy" magres="0.800000" maxaura="1.000000" regaura="1.500000" recruitcost="50" weight="200" capacity="100" speed="1.000000" hp="6" damage="1d3" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="14" fly="yes" walk="yes" teach="no" giveitem="yes" getitem="yes" equipment="yes"> <race name="fairy" magres="0.800000" maxaura="1.000000" regaura="1.500000" recruitcost="50" weight="200" capacity="100" speed="1.000000" hp="6" damage="1d3" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="14" fly="yes" walk="yes" teach="no" giveitem="yes" getitem="yes" equipment="yes">
<ai splitsize="5000"/> <ai splitsize="5000"/>
<function name="initfamiliar" value="oldfamiliars"/> <function name="initfamiliar" value="luafamiliar"/>
<skill name="sk_stealth" modifier="5"/> <skill name="sk_stealth" modifier="5"/>
<skill name="sk_espionage" modifier="2"/> <skill name="sk_espionage" modifier="2"/>
<skill name="sk_perception" modifier="2"/> <skill name="sk_perception" modifier="2"/>
@ -219,7 +219,7 @@
</race> </race>
<race name="dreamcat" magres="0.500000" maxaura="1.000000" regaura="1.000000" recruitcost="50" weight="500" capacity="200" speed="1.000000" hp="10" damage="1d5" unarmedattack="0" unarmeddefense="0" attackmodifier="5" defensemodifier="6" fly="yes" walk="yes" teach="no" giveitem="yes" getitem="yes" invinciblenonmagic="yes"> <race name="dreamcat" magres="0.500000" maxaura="1.000000" regaura="1.000000" recruitcost="50" weight="500" capacity="200" speed="1.000000" hp="10" damage="1d5" unarmedattack="0" unarmeddefense="0" attackmodifier="5" defensemodifier="6" fly="yes" walk="yes" teach="no" giveitem="yes" getitem="yes" invinciblenonmagic="yes">
<ai splitsize="5000"/> <ai splitsize="5000"/>
<function name="initfamiliar" value="oldfamiliars"/> <function name="initfamiliar" value="luafamiliar"/>
<skill name="sk_magic" modifier="1"/> <skill name="sk_magic" modifier="1"/>
<skill name="sk_espionage" modifier="1"/> <skill name="sk_espionage" modifier="1"/>
<skill name="sk_stealth" modifier="1"/> <skill name="sk_stealth" modifier="1"/>
@ -250,7 +250,7 @@
</race> </race>
<race name="imp" magres="0.500000" maxaura="1.000000" regaura="1.000000" recruitcost="50" weight="500" capacity="200" speed="1.000000" hp="10" ac="1" damage="1d4" unarmedattack="0" unarmeddefense="0" attackmodifier="5" defensemodifier="4" fly="yes" walk="yes" teach="no" giveitem="yes" getitem="yes" equipment="yes"> <race name="imp" magres="0.500000" maxaura="1.000000" regaura="1.000000" recruitcost="50" weight="500" capacity="200" speed="1.000000" hp="10" ac="1" damage="1d4" unarmedattack="0" unarmeddefense="0" attackmodifier="5" defensemodifier="4" fly="yes" walk="yes" teach="no" giveitem="yes" getitem="yes" equipment="yes">
<ai splitsize="5000"/> <ai splitsize="5000"/>
<function name="initfamiliar" value="oldfamiliars"/> <function name="initfamiliar" value="luafamiliar"/>
<skill name="sk_alchemy" modifier="-99"/> <skill name="sk_alchemy" modifier="-99"/>
<skill name="sk_crossbow" modifier="-99"/> <skill name="sk_crossbow" modifier="-99"/>
<skill name="sk_mining" modifier="-99"/> <skill name="sk_mining" modifier="-99"/>
@ -283,7 +283,7 @@
</race> </race>
<race name="ghost" magres="0.800000" maxaura="0.500000" regaura="0.100000" recruitcost="50" weight="500" capacity="200" speed="1.000000" hp="30" ac="5" damage="2d6" unarmedattack="0" unarmeddefense="0" attackmodifier="5" defensemodifier="8" scarepeasants="yes" fly="yes" walk="yes" teach="no" giveitem="yes" getitem="yes" equipment="yes" invinciblenonmagic="yes"> <race name="ghost" magres="0.800000" maxaura="0.500000" regaura="0.100000" recruitcost="50" weight="500" capacity="200" speed="1.000000" hp="30" ac="5" damage="2d6" unarmedattack="0" unarmeddefense="0" attackmodifier="5" defensemodifier="8" scarepeasants="yes" fly="yes" walk="yes" teach="no" giveitem="yes" getitem="yes" equipment="yes" invinciblenonmagic="yes">
<ai splitsize="5000"/> <ai splitsize="5000"/>
<function name="initfamiliar" value="oldfamiliars"/> <function name="initfamiliar" value="luafamiliar"/>
<skill name="sk_alchemy" modifier="-99"/> <skill name="sk_alchemy" modifier="-99"/>
<skill name="sk_crossbow" modifier="-99"/> <skill name="sk_crossbow" modifier="-99"/>
<skill name="sk_mining" modifier="-99"/> <skill name="sk_mining" modifier="-99"/>
@ -344,7 +344,7 @@
</race> </race>
<race name="unicorn" magres="0.900000" maxaura="1.500000" regaura="1.500000" recruitcost="50" weight="5000" capacity="2000" speed="2.000000" hp="40" damage="2d4" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="4" walk="yes" teach="no" giveitem="yes" getitem="yes"> <race name="unicorn" magres="0.900000" maxaura="1.500000" regaura="1.500000" recruitcost="50" weight="5000" capacity="2000" speed="2.000000" hp="40" damage="2d4" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="4" walk="yes" teach="no" giveitem="yes" getitem="yes">
<ai splitsize="9999"/> <ai splitsize="9999"/>
<function name="initfamiliar" value="oldfamiliars"/> <function name="initfamiliar" value="luafamiliar"/>
<skill name="sk_alchemy" modifier="-99"/> <skill name="sk_alchemy" modifier="-99"/>
<skill name="sk_crossbow" modifier="-99"/> <skill name="sk_crossbow" modifier="-99"/>
<skill name="sk_mining" modifier="-99"/> <skill name="sk_mining" modifier="-99"/>
@ -375,7 +375,7 @@
</race> </race>
<race name="nymph" magres="0.900000" maxaura="1.000000" regaura="1.500000" recruitcost="50" weight="1000" capacity="540" speed="1.000000" hp="15" damage="1d4" unarmedattack="0" unarmeddefense="0" attackmodifier="3" defensemodifier="1" walk="yes" teach="no" giveitem="yes" getitem="yes" equipment="yes"> <race name="nymph" magres="0.900000" maxaura="1.000000" regaura="1.500000" recruitcost="50" weight="1000" capacity="540" speed="1.000000" hp="15" damage="1d4" unarmedattack="0" unarmeddefense="0" attackmodifier="3" defensemodifier="1" walk="yes" teach="no" giveitem="yes" getitem="yes" equipment="yes">
<ai splitsize="9999"/> <ai splitsize="9999"/>
<function name="initfamiliar" value="oldfamiliars"/> <function name="initfamiliar" value="luafamiliar"/>
<skill name="sk_mining" modifier="-99"/> <skill name="sk_mining" modifier="-99"/>
<skill name="sk_bow" modifier="2"/> <skill name="sk_bow" modifier="2"/>
<skill name="sk_building" modifier="-99"/> <skill name="sk_building" modifier="-99"/>
@ -405,7 +405,7 @@
</race> </race>
<race name="songdragon" magres="0.990000" maxaura="1.000000" regaura="1.000000" recruitcost="50" weight="1000" capacity="600" speed="1.500000" hp="40" ac="1" damage="2d4" unarmedattack="0" unarmeddefense="0" attackmodifier="3" defensemodifier="1" fly="yes" walk="yes" teach="no" giveitem="yes" getitem="yes"> <race name="songdragon" magres="0.990000" maxaura="1.000000" regaura="1.000000" recruitcost="50" weight="1000" capacity="600" speed="1.500000" hp="40" ac="1" damage="2d4" unarmedattack="0" unarmeddefense="0" attackmodifier="3" defensemodifier="1" fly="yes" walk="yes" teach="no" giveitem="yes" getitem="yes">
<ai splitsize="9999"/> <ai splitsize="9999"/>
<function name="initfamiliar" value="oldfamiliars"/> <function name="initfamiliar" value="luafamiliar"/>
<skill name="sk_alchemy" modifier="-99"/> <skill name="sk_alchemy" modifier="-99"/>
<skill name="sk_crossbow" modifier="-99"/> <skill name="sk_crossbow" modifier="-99"/>
<skill name="sk_mining" modifier="-99"/> <skill name="sk_mining" modifier="-99"/>
@ -437,7 +437,7 @@
</race> </race>
<race name="rat" magres="0.000000" maxaura="0.000000" regaura="0.000000" recruitcost="50" weight="100" capacity="50" speed="1.000000" hp="10" damage="1d4" unarmedattack="0" unarmeddefense="0" attackmodifier="1" defensemodifier="1" walk="yes" teach="no" giveitem="yes" getitem="yes"> <race name="rat" magres="0.000000" maxaura="0.000000" regaura="0.000000" recruitcost="50" weight="100" capacity="50" 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"/> <ai splitsize="9999"/>
<function name="initfamiliar" value="oldfamiliars"/> <function name="initfamiliar" value="luafamiliar"/>
<skill name="sk_espionage" modifier="5"/> <skill name="sk_espionage" modifier="5"/>
<skill name="sk_stealth" modifier="4"/> <skill name="sk_stealth" modifier="4"/>
<skill name="sk_perception" modifier="2"/> <skill name="sk_perception" modifier="2"/>
@ -469,7 +469,7 @@
</race> </race>
<race name="eagle" magres="0.000000" maxaura="0.000000" regaura="0.000000" recruitcost="50" weight="500" capacity="200" speed="1.500000" hp="15" damage="2d3" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="2" fly="yes" walk="yes" teach="no" giveitem="yes" getitem="yes"> <race name="eagle" magres="0.000000" maxaura="0.000000" regaura="0.000000" recruitcost="50" weight="500" capacity="200" speed="1.500000" hp="15" damage="2d3" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="2" fly="yes" walk="yes" teach="no" giveitem="yes" getitem="yes">
<ai splitsize="9999"/> <ai splitsize="9999"/>
<function name="initfamiliar" value="oldfamiliars"/> <function name="initfamiliar" value="luafamiliar"/>
<skill name="sk_alchemy" modifier="-99"/> <skill name="sk_alchemy" modifier="-99"/>
<skill name="sk_crossbow" modifier="-99"/> <skill name="sk_crossbow" modifier="-99"/>
<skill name="sk_mining" modifier="-99"/> <skill name="sk_mining" modifier="-99"/>
@ -499,7 +499,7 @@
</race> </race>
<race name="tunnelworm" magres="0.800000" maxaura="0.000000" regaura="0.000000" recruitcost="50" weight="30000" capacity="10000" speed="1.000000" hp="300" ac="6" damage="3d20" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="1" scarepeasants="yes" walk="yes" teach="no" giveitem="yes" getitem="yes"> <race name="tunnelworm" magres="0.800000" maxaura="0.000000" regaura="0.000000" recruitcost="50" weight="30000" capacity="10000" speed="1.000000" hp="300" ac="6" damage="3d20" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="1" scarepeasants="yes" walk="yes" teach="no" giveitem="yes" getitem="yes">
<ai splitsize="99999"/> <ai splitsize="99999"/>
<function name="initfamiliar" value="oldfamiliars"/> <function name="initfamiliar" value="luafamiliar"/>
<skill name="sk_alchemy" modifier="-99"/> <skill name="sk_alchemy" modifier="-99"/>
<skill name="sk_crossbow" modifier="-99"/> <skill name="sk_crossbow" modifier="-99"/>
<skill name="sk_mining" modifier="10"/> <skill name="sk_mining" modifier="10"/>
@ -532,7 +532,7 @@
</race> </race>
<race name="lynx" magres="0.000000" maxaura="0.000000" regaura="0.000000" recruitcost="50" weight="500" capacity="200" speed="1.000000" hp="20" damage="2d3" unarmedattack="0" unarmeddefense="0" attackmodifier="4" defensemodifier="5" walk="yes" teach="no" giveitem="yes" getitem="yes"> <race name="lynx" magres="0.000000" maxaura="0.000000" regaura="0.000000" recruitcost="50" weight="500" capacity="200" speed="1.000000" hp="20" damage="2d3" unarmedattack="0" unarmeddefense="0" attackmodifier="4" defensemodifier="5" walk="yes" teach="no" giveitem="yes" getitem="yes">
<ai splitsize="99999"/> <ai splitsize="99999"/>
<function name="initfamiliar" value="oldfamiliars"/> <function name="initfamiliar" value="luafamiliar"/>
<skill name="sk_alchemy" modifier="-99"/> <skill name="sk_alchemy" modifier="-99"/>
<skill name="sk_crossbow" modifier="-99"/> <skill name="sk_crossbow" modifier="-99"/>
<skill name="sk_mining" modifier="-99"/> <skill name="sk_mining" modifier="-99"/>
@ -562,6 +562,7 @@
<attack type="4" damage="2d3"/> <attack type="4" damage="2d3"/>
</race> </race>
<race name="direwolf" magres="0.000000" maxaura="0.000000" regaura="0.000000" recruitcost="50" weight="500" capacity="200" speed="1.000000" hp="20" damage="2d4" unarmedattack="0" unarmeddefense="0" attackmodifier="3" defensemodifier="1" walk="yes" teach="no" giveperson="yes"> <race name="direwolf" magres="0.000000" maxaura="0.000000" regaura="0.000000" recruitcost="50" weight="500" capacity="200" speed="1.000000" hp="20" damage="2d4" unarmedattack="0" unarmeddefense="0" attackmodifier="3" defensemodifier="1" walk="yes" teach="no" giveperson="yes">
<function name="initfamiliar" value="luafamiliar"/>
<ai splitsize="5000"/> <ai splitsize="5000"/>
<attack type="4" damage="2d4"/> <attack type="4" damage="2d4"/>
</race> </race>

View File

@ -7,8 +7,14 @@
</item> </item>
</resource> </resource>
<resource name="antimagic" appearance="amulet">
<item weight="0" score="2000">
<function name="use" value="use_antimagiccrystal"/>
</item>
</resource>
<resource name="wand_of_tears"> <resource name="wand_of_tears">
<item notlost="yes" weight="1" capacity="0"> <item notlost="yes" weight="1">
<function name="use" value="use_wand_of_tears"/> <function name="use" value="use_wand_of_tears"/>
</item> </item>
</resource> </resource>

View File

@ -24,6 +24,7 @@ end
function run_scripts() function run_scripts()
scripts = { scripts = {
"spells.lua", "spells.lua",
"familiars.lua",
"eternath.lua", "eternath.lua",
"wedding-jadee.lua", "wedding-jadee.lua",
"ponnuki.lua" "ponnuki.lua"

View File

@ -0,0 +1,3 @@
function initfamiliar_lynx(u)
print("a lynx is born :-)")
end

View File

@ -1,6 +1,7 @@
function run_scripts() function run_scripts()
scripts = { scripts = {
"spells.lua", "spells.lua",
"familiars.lua",
"hse-portals.lua", "hse-portals.lua",
"hse-stats.lua" "hse-stats.lua"
} }

View File

@ -1,6 +1,7 @@
function run_scripts() function run_scripts()
scripts = { scripts = {
"spells.lua", "spells.lua",
"familiars.lua",
"hse-portals.lua", "hse-portals.lua",
"hse-stats.lua" "hse-stats.lua"
} }

View File

@ -42,6 +42,7 @@ print("- Running wdw-run.lua")
scripts = { scripts = {
"spells.lua", "spells.lua",
"familiars.lua",
"wdw-sphinx.lua", "wdw-sphinx.lua",
"wdw-standings.lua" "wdw-standings.lua"
} }