/* vi: set ts=2: +-------------------+ Christian Schlittchen | | Enno Rehling | Eressea PBEM host | Katja Zedel | (c) 1998 - 2003 | Henning Peters | | Ingo Wilken +-------------------+ Stefan Reich This program may not be used, modified or distributed without prior permission by the authors of Eressea. */ #include #include #if XECMD_MODULE #include "xecmd.h" #include #include "xecmd.h" /* kernel includes */ #include #include #include #include #include #include #include #include /* util includes */ #include #include #include /* libc includes */ #include #include static void xe_givelaen(unit *u, struct order * ord) { unit *u2 =getunitg(u->region, u->faction); if(!u2) { ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "feedback_unit_not_found", "")); return; } i_change(&u2->items, olditemtype[I_LAEN], 5); } static void xe_givepotion(unit *u, struct order *ord) { unit *u2 =getunitg(u->region, u->faction); if(!u2) { ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "feedback_unit_not_found", "")); return; } i_change(&u2->items, it_find("skillpotion"), 1); } static void xe_giveballon(unit *u, struct order *ord) { unit *u2 = getunitg(u->region, u->faction); ship *sh; if(!u2) { ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "feedback_unit_not_found", "")); return; } sh = new_ship(st_find("balloon"), u2->faction->locale, u2->region); sh->size = 5; free(sh->name); sh->name = strdup("Xontormia-Ballon"); leave(u2->region, u2); u2->ship = sh; fset(u2, UFL_OWNER); } int xecmd(unit * u, order * ord) { faction *f = u->faction; if (a_find(f->attribs, &at_xontormiaexpress)) { if (get_keyword(ord) == K_XE) { init_tokens(ord); skip_token(); switch(findparam(getstrtoken(),f->locale)) { case P_XEPOTION: xe_givepotion(u, ord); break; case P_XEBALLOON: xe_giveballon(u, ord); break; case P_XELAEN: xe_givelaen(u, ord); break; } } } return 0; } #endif