forked from github/server
add a spell for igjarjuk (WIP)
This commit is contained in:
parent
9586d970e8
commit
7bb882b15b
|
@ -304,6 +304,9 @@
|
||||||
<spell name="wolfhowl" rank="5" index="94" variable="true" combat="1">
|
<spell name="wolfhowl" rank="5" index="94" variable="true" combat="1">
|
||||||
<resource name="aura" amount="2" cost="level"/>
|
<resource name="aura" amount="2" cost="level"/>
|
||||||
</spell>
|
</spell>
|
||||||
|
<spell name="igjarjuk" rank="5" index="94" variable="true" combat="1">
|
||||||
|
<function name="cast" value="igjarjuk"/>
|
||||||
|
</spell>
|
||||||
<spell name="resist_magic" rank="2" index="97" parameters="u+" los="true" ship="true" variable="true">
|
<spell name="resist_magic" rank="2" index="97" parameters="u+" los="true" ship="true" variable="true">
|
||||||
<resource name="aura" amount="5" cost="level"/>
|
<resource name="aura" amount="5" cost="level"/>
|
||||||
</spell>
|
</spell>
|
||||||
|
|
|
@ -1699,7 +1699,7 @@ void do_combatmagic(battle * b, combatmagic_t was)
|
||||||
for (s = b->sides; s != b->sides + b->nsides; ++s) {
|
for (s = b->sides; s != b->sides + b->nsides; ++s) {
|
||||||
fighter *fig = 0;
|
fighter *fig = 0;
|
||||||
if (s->bf->attacker) {
|
if (s->bf->attacker) {
|
||||||
spell *sp = find_spell("wolfhowl");
|
spell *sp = find_spell("igjarjuk");
|
||||||
if (sp && fval(s->faction, FFL_CURSED)) {
|
if (sp && fval(s->faction, FFL_CURSED)) {
|
||||||
int si;
|
int si;
|
||||||
for (si = 0; s->enemies[si]; ++si) {
|
for (si = 0; s->enemies[si]; ++si) {
|
||||||
|
|
|
@ -6516,6 +6516,7 @@ static spelldata spell_functions[] = {
|
||||||
{ "stormwinds", sp_stormwinds, 0 },
|
{ "stormwinds", sp_stormwinds, 0 },
|
||||||
{ "homestone", sp_homestone, 0 },
|
{ "homestone", sp_homestone, 0 },
|
||||||
{ "wolfhowl", sp_wolfhowl, 0 },
|
{ "wolfhowl", sp_wolfhowl, 0 },
|
||||||
|
{ "igjarjuk", sp_igjarjuk, 0 },
|
||||||
{ "versteinern", sp_petrify, 0 },
|
{ "versteinern", sp_petrify, 0 },
|
||||||
{ "strongwall", sp_strong_wall, 0 },
|
{ "strongwall", sp_strong_wall, 0 },
|
||||||
{ "gwyrrddestroymagic", sp_destroy_magic, 0 },
|
{ "gwyrrddestroymagic", sp_destroy_magic, 0 },
|
||||||
|
|
|
@ -848,41 +848,59 @@ int sp_shadowcall(struct castorder * co)
|
||||||
return level;
|
return level;
|
||||||
}
|
}
|
||||||
|
|
||||||
int sp_wolfhowl(struct castorder * co)
|
static fighter *summon_allies(const fighter *fi, const race *rc, int number) {
|
||||||
|
attrib *a;
|
||||||
|
unit *mage = fi->unit;
|
||||||
|
side *si = fi->side;
|
||||||
|
battle *b = si->battle;
|
||||||
|
region *r = b->region;
|
||||||
|
unit *u =
|
||||||
|
create_unit(r, mage->faction, number, rc, 0, NULL, mage);
|
||||||
|
leave(u, true);
|
||||||
|
setstatus(u, ST_FIGHT);
|
||||||
|
|
||||||
|
u->hp = u->number * unit_max_hp(u);
|
||||||
|
|
||||||
|
if (fval(mage, UFL_ANON_FACTION)) {
|
||||||
|
fset(u, UFL_ANON_FACTION);
|
||||||
|
}
|
||||||
|
|
||||||
|
a = a_new(&at_unitdissolve);
|
||||||
|
a->data.ca[0] = 0;
|
||||||
|
a->data.ca[1] = 100;
|
||||||
|
a_add(&u->attribs, a);
|
||||||
|
|
||||||
|
return make_fighter(b, u, si, is_attacker(fi));
|
||||||
|
}
|
||||||
|
|
||||||
|
int sp_igjarjuk(castorder *co) {
|
||||||
|
fighter * fi = co->magician.fig;
|
||||||
|
const race *rc = get_race(RC_WYRM);
|
||||||
|
fi = summon_allies(fi, rc, 1);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int sp_wolfhowl(castorder * co)
|
||||||
{
|
{
|
||||||
fighter * fi = co->magician.fig;
|
fighter * fi = co->magician.fig;
|
||||||
int level = co->level;
|
int level = co->level;
|
||||||
double power = co->force;
|
double power = co->force;
|
||||||
battle *b = fi->side->battle;
|
battle *b = fi->side->battle;
|
||||||
region *r = b->region;
|
|
||||||
unit *mage = fi->unit;
|
unit *mage = fi->unit;
|
||||||
attrib *a;
|
|
||||||
message *msg;
|
message *msg;
|
||||||
int force = (int)(get_force(power, 3) / 2);
|
int force = (int)(get_force(power, 3) / 2);
|
||||||
const race * rc = get_race(RC_WOLF);
|
const race * rc = get_race(RC_WOLF);
|
||||||
if (force > 0) {
|
if (force > 0) {
|
||||||
unit *u =
|
unit *u;
|
||||||
create_unit(r, mage->faction, force, rc, 0, NULL, mage);
|
int skills = (int)(power/3);
|
||||||
leave(u, true);
|
fi = summon_allies(fi, rc, force);
|
||||||
setstatus(u, ST_FIGHT);
|
u = fi->unit;
|
||||||
|
set_level(u, SK_WEAPONLESS, skills);
|
||||||
set_level(u, SK_WEAPONLESS, (int)(power / 3));
|
set_level(u, SK_STAMINA, skills);
|
||||||
set_level(u, SK_STAMINA, (int)(power / 3));
|
|
||||||
u->hp = u->number * unit_max_hp(u);
|
|
||||||
|
|
||||||
if (fval(mage, UFL_ANON_FACTION)) {
|
|
||||||
fset(u, UFL_ANON_FACTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
a = a_new(&at_unitdissolve);
|
|
||||||
a->data.ca[0] = 0;
|
|
||||||
a->data.ca[1] = 100;
|
|
||||||
a_add(&u->attribs, a);
|
|
||||||
|
|
||||||
make_fighter(b, u, fi->side, is_attacker(fi));
|
|
||||||
}
|
}
|
||||||
msg =
|
msg =
|
||||||
msg_message("sp_wolfhowl_effect", "mage amount race", mage, force, rc);
|
msg_message("sp_wolfhowl_effect", "mage amount race",
|
||||||
|
mage, force, rc);
|
||||||
message_all(b, msg);
|
message_all(b, msg);
|
||||||
msg_release(msg);
|
msg_release(msg);
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,7 @@ extern "C" {
|
||||||
extern int sp_mindblast_temp(struct castorder * co);
|
extern int sp_mindblast_temp(struct castorder * co);
|
||||||
extern int sp_speed(struct castorder * co);
|
extern int sp_speed(struct castorder * co);
|
||||||
extern int sp_wolfhowl(struct castorder * co);
|
extern int sp_wolfhowl(struct castorder * co);
|
||||||
|
extern int sp_igjarjuk(struct castorder * co);
|
||||||
extern int sp_dragonodem(struct castorder * co);
|
extern int sp_dragonodem(struct castorder * co);
|
||||||
extern int sp_reduceshield(struct castorder * co);
|
extern int sp_reduceshield(struct castorder * co);
|
||||||
extern int sp_armorshield(struct castorder * co);
|
extern int sp_armorshield(struct castorder * co);
|
||||||
|
|
Loading…
Reference in New Issue