version 1.151 | | version 1.152 |
---|
| | |
/* | | /* |
* static char *rcsid_spell_effect_c = | | * static char *rcsid_spell_effect_c = |
* "$Id: spell_effect.c,v 1.151 2006/03/22 09:29:05 akirschbaum Exp $"; | | * "$Id: spell_effect.c,v 1.152 2006/04/06 21:18:36 tchize Exp $"; |
*/ | | */ |
| | |
| | |
| | |
esrv_del_item(op->contr, wand->count); | | esrv_del_item(op->contr, wand->count); |
remove_ob(wand); | | remove_ob(wand); |
free_object(wand); | | free_object(wand); |
tmp = get_archetype("fireball"); | | tmp = create_archetype("fireball"); |
tmp->stats.dam = (spell_ob->stats.dam + SP_level_dam_adjust(caster, spell_ob)) / 10; | | tmp->stats.dam = (spell_ob->stats.dam + SP_level_dam_adjust(caster, spell_ob)) / 10; |
if (!tmp->stats.dam) tmp->stats.dam = 1; | | if (!tmp->stats.dam) tmp->stats.dam = 1; |
tmp->stats.hp = tmp->stats.dam / 2; | | tmp->stats.hp = tmp->stats.dam / 2; |
| | |
missile_name); | | missile_name); |
return 0; | | return 0; |
} | | } |
missile = get_archetype(missile_name); | | missile = create_archetype(missile_name); |
| | |
if (stringarg) { | | if (stringarg) { |
/* If it starts with a letter, presume it is a description */ | | /* If it starts with a letter, presume it is a description */ |
| | |
return 1; | | return 1; |
} | | } |
| | |
dummy=get_archetype(FORCE_NAME); | | dummy=create_archetype(FORCE_NAME); |
if(dummy == NULL){ | | if(dummy == NULL){ |
new_draw_info(NDI_UNIQUE, 0,op,"Oops, program error!"); | | new_draw_info(NDI_UNIQUE, 0,op,"Oops, program error!"); |
LOG(llevError,"cast_word_of_recall: get_archetype(force) failed!\n"); | | LOG(llevError,"cast_word_of_recall: create_archetype(force) failed!\n"); |
return 0; | | return 0; |
} | | } |
time = spell_ob->duration - SP_level_duration_adjust(caster, spell_ob); | | time = spell_ob->duration - SP_level_duration_adjust(caster, spell_ob); |
| | |
*/ | | */ |
| | |
/* First step: killing existing town portals */ | | /* First step: killing existing town portals */ |
dummy=get_archetype(spell->race); | | dummy=create_archetype(spell->race); |
if(dummy == NULL){ | | if(dummy == NULL){ |
new_draw_info(NDI_UNIQUE, 0,op,"Oops, program error!"); | | new_draw_info(NDI_UNIQUE, 0,op,"Oops, program error!"); |
LOG(llevError,"get_object failed (force) in cast_create_town_portal for %s!\n",op->name); | | LOG(llevError,"get_object failed (force) in cast_create_town_portal for %s!\n",op->name); |
| | |
*/ | | */ |
| | |
snprintf (portal_name,1024,"%s's portal to %s",op->name,force->name); | | snprintf (portal_name,1024,"%s's portal to %s",op->name,force->name); |
dummy=get_archetype(spell->slaying); /*The portal*/ | | dummy=create_archetype(spell->slaying); /*The portal*/ |
if(dummy == NULL) { | | if(dummy == NULL) { |
new_draw_info(NDI_UNIQUE, 0,op,"Oops, program error!"); | | new_draw_info(NDI_UNIQUE, 0,op,"Oops, program error!"); |
LOG(llevError,"get_object failed (perm_magic_portal) in cast_create_town_portal for %s!\n",op->name); | | LOG(llevError,"get_object failed (perm_magic_portal) in cast_create_town_portal for %s!\n",op->name); |
| | |
* object, so on future castings, we can know that he has an active | | * object, so on future castings, we can know that he has an active |
* town portal. | | * town portal. |
*/ | | */ |
tmp=get_archetype(spell->race); | | tmp=create_archetype(spell->race); |
if(tmp == NULL){ | | if(tmp == NULL){ |
new_draw_info(NDI_UNIQUE, 0,op,"Oops, program error!"); | | new_draw_info(NDI_UNIQUE, 0,op,"Oops, program error!"); |
LOG(llevError,"get_object failed (force) in cast_create_town_portal for %s!\n",op->name); | | LOG(llevError,"get_object failed (force) in cast_create_town_portal for %s!\n",op->name); |
| | |
* where this portal goes to. | | * where this portal goes to. |
*/ | | */ |
snprintf (portal_name,1024,"%s's portal to %s",op->name,op->map->path); | | snprintf (portal_name,1024,"%s's portal to %s",op->name,op->map->path); |
dummy=get_archetype (spell->slaying); /*The portal*/ | | dummy=create_archetype (spell->slaying); /*The portal*/ |
if(dummy == NULL) { | | if(dummy == NULL) { |
new_draw_info(NDI_UNIQUE, 0,op,"Oops, program error!"); | | new_draw_info(NDI_UNIQUE, 0,op,"Oops, program error!"); |
LOG(llevError,"get_object failed (perm_magic_portal) in cast_create_town_portal for %s!\n",op->name); | | LOG(llevError,"get_object failed (perm_magic_portal) in cast_create_town_portal for %s!\n",op->name); |
| | |
/* Now we create another town portal marker that | | /* Now we create another town portal marker that |
* points back to the one we just made | | * points back to the one we just made |
*/ | | */ |
tmp=get_archetype(spell->race); | | tmp=create_archetype(spell->race); |
if(tmp == NULL){ | | if(tmp == NULL){ |
new_draw_info(NDI_UNIQUE, 0,op,"Oops, program error!"); | | new_draw_info(NDI_UNIQUE, 0,op,"Oops, program error!"); |
LOG(llevError,"get_object failed (force) in cast_create_town_portal for %s!\n",op->name); | | LOG(llevError,"get_object failed (force) in cast_create_town_portal for %s!\n",op->name); |
| | |
} | | } |
} | | } |
if(force==NULL) { | | if(force==NULL) { |
force=get_archetype(FORCE_NAME); | | force=create_archetype(FORCE_NAME); |
force->subtype = FORCE_CHANGE_ABILITY; | | force->subtype = FORCE_CHANGE_ABILITY; |
free_string(force->name); | | free_string(force->name); |
if (spell_ob->race) | | if (spell_ob->race) |
| | |
} | | } |
} | | } |
if(force==NULL) { | | if(force==NULL) { |
force=get_archetype(FORCE_NAME); | | force=create_archetype(FORCE_NAME); |
force->subtype = FORCE_CHANGE_ABILITY; | | force->subtype = FORCE_CHANGE_ABILITY; |
free_string(force->name); | | free_string(force->name); |
if (spell_ob->race) | | if (spell_ob->race) |
| | |
*/ | | */ |
weight_max = spell_ob->duration + +SP_level_duration_adjust(caster,spell_ob); | | weight_max = spell_ob->duration + +SP_level_duration_adjust(caster,spell_ob); |
weight_max *= 1000; | | weight_max *= 1000; |
small=get_archetype("smallnugget"), | | small=create_archetype("smallnugget"), |
large=get_archetype("largenugget"); | | large=create_archetype("largenugget"); |
small_value = query_cost(small, NULL, F_TRUE); | | small_value = query_cost(small, NULL, F_TRUE); |
large_value = query_cost(large, NULL, F_TRUE); | | large_value = query_cost(large, NULL, F_TRUE); |
| | |
| | |
new_draw_info(NDI_UNIQUE, 0, victim, "Your head explodes!"); | | new_draw_info(NDI_UNIQUE, 0, victim, "Your head explodes!"); |
| | |
/* Explodes a fireball centered at player */ | | /* Explodes a fireball centered at player */ |
tmp = get_archetype(EXPLODING_FIREBALL); | | tmp = create_archetype(EXPLODING_FIREBALL); |
tmp->dam_modifier = random_roll(1, caster_level, victim, PREFER_LOW)/5+1; | | tmp->dam_modifier = random_roll(1, caster_level, victim, PREFER_LOW)/5+1; |
tmp->stats.maxhp = random_roll(1, caster_level, victim, PREFER_LOW)/10+2; | | tmp->stats.maxhp = random_roll(1, caster_level, victim, PREFER_LOW)/10+2; |
tmp->x = victim->x; | | tmp->x = victim->x; |