コード例 #1
0
long instf_creature_cast_spell(struct Thing *creatng, long *param)
{
    struct CreatureControl *cctrl;
    struct Thing *trthing;
    struct SpellInfo *spinfo;
    long spl_idx;
    TRACE_THING(creatng);
    cctrl = creature_control_get_from_thing(creatng);
    spl_idx = *param;
    spinfo = get_magic_info(spl_idx);
    if (spinfo->cast_at_thing)
    {
        trthing = thing_get(cctrl->targtng_idx);
        if (!thing_is_invalid(trthing))
        {
            creature_cast_spell_at_thing(creatng, trthing, spl_idx, cctrl->explevel);
            return 0;
        }
    }
    creature_cast_spell(creatng, spl_idx, cctrl->explevel, cctrl->targtstl_x, cctrl->targtstl_y);
    return 0;
}
コード例 #2
0
long instf_creature_cast_spell(struct Thing *creatng, long *param)
{
    struct CreatureControl *cctrl;
    struct Thing *trthing;
    struct SpellInfo *spinfo;
    long spl_idx;
    TRACE_THING(creatng);
    cctrl = creature_control_get_from_thing(creatng);
    spl_idx = *param;
    spinfo = get_magic_info(spl_idx);
    SYNCDBG(8,"The %s index %d casts %s",thing_model_name(creatng),(int)creatng->index,spell_code_name(spl_idx));
    if (spinfo->cast_at_thing)
    {
        trthing = thing_get(cctrl->targtng_idx);
        if (!thing_is_invalid(trthing))
        {
            creature_cast_spell_at_thing(creatng, trthing, spl_idx, cctrl->explevel);
            return 0;
        }
    }
    creature_cast_spell(creatng, spl_idx, cctrl->explevel, cctrl->targtstl_x, cctrl->targtstl_y);
    return 0;
}