[ScryMUD] SVN Commit Info r943 - trunk/mud/grrmud/server
scrymud at wanfear.com
scrymud at wanfear.com
Sun Jun 10 19:12:12 PDT 2007
Author: eroper
Date: 2007-06-10 19:12:11 -0700 (Sun, 10 Jun 2007)
New Revision: 943
Added:
trunk/mud/grrmud/server/necromancer.cc
trunk/mud/grrmud/server/necromancer.h
Modified:
trunk/mud/grrmud/server/Makefile
trunk/mud/grrmud/server/batl_prc.cc
trunk/mud/grrmud/server/battle.cc
trunk/mud/grrmud/server/command2.cc
trunk/mud/grrmud/server/command3.cc
trunk/mud/grrmud/server/command4.cc
trunk/mud/grrmud/server/commands.cc
trunk/mud/grrmud/server/const.h
trunk/mud/grrmud/server/critter.cc
trunk/mud/grrmud/server/critter.h
trunk/mud/grrmud/server/ez_spll.cc
trunk/mud/grrmud/server/grrmud.cc
trunk/mud/grrmud/server/login.cc
trunk/mud/grrmud/server/misc.cc
trunk/mud/grrmud/server/olc2.cc
trunk/mud/grrmud/server/pet_spll.cc
trunk/mud/grrmud/server/pet_spll.h
trunk/mud/grrmud/server/spec_prc.cc
trunk/mud/grrmud/server/spells.cc
trunk/mud/grrmud/server/spells.h
trunk/mud/grrmud/server/spells2.cc
trunk/mud/grrmud/server/spells2.h
trunk/mud/grrmud/server/trv_spll.cc
Log:
Removed the #define's for HP_MAX, MA_MAX, MV_MAX. {get,set,adj}MovMax(),
{get,set,adj}HP_MAX() and {get,set,adj}ManaMax() are now called instead.
Split several necromancer skills off into their own files: necromancer.{cc,h}
setHP, adjHP, setMana, adjMana, setMov, adjMov, setHP_MAX, adjHP_MAX,
setManaMax, adjManaMax, setMovMax, adjMovMax now return the new value that was
set. (this is because you can request a change that gets capped)
Added critter::lost_concentration(int spell_num)
Added rituals, blood ritual, spirit ritual, stamina ritual, and ritual of
power to the skills enum. These are currently being implemented. I've started
on cast_blood_ritual but I got sidetracked making all the other changes. I'm
committing now as much been touched.
get_mana_cost now treats the supplied critter as const.
Modified: trunk/mud/grrmud/server/Makefile
===================================================================
--- trunk/mud/grrmud/server/Makefile 2007-06-10 22:15:12 UTC (rev 942)
+++ trunk/mud/grrmud/server/Makefile 2007-06-11 02:12:11 UTC (rev 943)
@@ -22,7 +22,7 @@
script.o SkillSpell.o zone.o rm_parse.o rm_cmds.o obj_parse.o \
obj_cmds.o BuildInfo.o BugEntry.o MudStats.o clients.o ServerConfig.o \
mapper.o regex.o protocol_handler.o telnet_handler.o hegemon_handler.o \
-pfile_maint.o weather.o
+pfile_maint.o weather.o necromancer.o
grrmud_TARG = grrmud
Modified: trunk/mud/grrmud/server/batl_prc.cc
===================================================================
--- trunk/mud/grrmud/server/batl_prc.cc 2007-06-10 22:15:12 UTC (rev 942)
+++ trunk/mud/grrmud/server/batl_prc.cc 2007-06-11 02:12:11 UTC (rev 943)
@@ -50,6 +50,7 @@
#include "social2.h"
#include "ar_skll.h"
#include <PtrArray.h>
+#include "necromancer.h"
void do_entered_room_procs(critter& pc, door* dr, const char* from_dir,
@@ -265,7 +266,7 @@
do_cast_sanctuary(pc, pc, FALSE, 0);
}//if
else {
- if ((pc.HP + 300) < pc.HP_MAX) {
+ if ((pc.getHP() + 300) < pc.getHP_MAX()) {
do_cast_restore(pc, pc, FALSE, 0);
}//if
}//else
@@ -290,7 +291,7 @@
critter* weakest = find_weakest(pc.IS_FIGHTING);
do_cast_blindness(*weakest, pc, FALSE, 0);
}//if
- else if ((chance > 6) && ((pc.HP + 300) < pc.HP_MAX)) {
+ else if ((chance > 6) && ((pc.getHP() + 300) < pc.getHP_MAX())) {
if (cls == CLERIC) {
do_cast_restore(pc, pc, FALSE, 0);
}//if
@@ -298,12 +299,12 @@
do_cast_teleport(pc, pc, FALSE, 0);
}//else
}//if
- else if ((chance > 4) && ((pc.HP + 100) < pc.HP_MAX)) {
+ else if ((chance > 4) && ((pc.getHP() + 100) < pc.getHP_MAX())) {
spellHarm.onCast(*primary_targ, pc, FALSE, 0);
}//if
}//if not so violent
else if (violence >= 0) {
- if ((chance > 7) && ((pc.HP + 300) < pc.HP_MAX)) {
+ if ((chance > 7) && ((pc.getHP() + 300) < pc.getHP_MAX())) {
do_cast_restore(pc, pc, FALSE, 0);
}//if
else if (chance > 4) {
@@ -453,7 +454,7 @@
do_cast_armor(pc, pc, FALSE, 0);
}//if
else {
- if ((pc.HP + 100) < pc.HP_MAX) {
+ if ((pc.getHP() + 100) < pc.getHP_MAX()) {
do_cast_heal(pc, pc, FALSE, 0);
}//if
}//else
@@ -477,7 +478,7 @@
critter* weakest = find_weakest(pc.IS_FIGHTING);
do_cast_blindness(*weakest, pc, FALSE, 0);
}//if
- else if ((chance > 6) && ((pc.HP + 100) < pc.HP_MAX)) {
+ else if ((chance > 6) && ((pc.getHP() + 100) < pc.getHP_MAX())) {
if (cls == CLERIC) {
do_cast_heal(pc, pc, FALSE, 0);
}//if
@@ -490,7 +491,7 @@
}//if
}//if not so violent
else if (violence >= 0) {
- if ((chance > 7) && ((pc.HP + 100) < pc.HP_MAX)) {
+ if ((chance > 7) && ((pc.getHP() + 100) < pc.getHP_MAX())) {
do_cast_heal(pc, pc, FALSE, 0);
}//if
else if (chance > 4) {
@@ -603,7 +604,7 @@
}//if
}//if not so violent
else if (violence >= 0) {
- if ((chance > 9) && ((pc.HP + 10) < pc.HP_MAX)) {
+ if ((chance > 9) && ((pc.getHP() + 10) < pc.getHP_MAX())) {
do_cast_cure_serious(pc, pc, FALSE, 0);
}//if
}//if not so violent
Modified: trunk/mud/grrmud/server/battle.cc
===================================================================
--- trunk/mud/grrmud/server/battle.cc 2007-06-10 22:15:12 UTC (rev 942)
+++ trunk/mud/grrmud/server/battle.cc 2007-06-11 02:12:11 UTC (rev 943)
@@ -1153,9 +1153,9 @@
crit.LEVEL++;
crit.PRACS += d(2, (int)((float)(crit.getINT(true))/6.0)) + 1;
- crit.MA_MAX += mana_gain;
- crit.setHP_MAX(crit.getHP_MAX() + hp_gain);
- crit.MV_MAX += d(1, crit.getDEX(true));
+ crit.adjManaMax(mana_gain);
+ crit.adjHP_MAX(hp_gain);
+ crit.adjMovMax(d(1,crit.getDEX(true)));
crit.show("You rise a level.\n");
if ( crit.isAvian() ) {
Modified: trunk/mud/grrmud/server/command2.cc
===================================================================
--- trunk/mud/grrmud/server/command2.cc 2007-06-10 22:15:12 UTC (rev 942)
+++ trunk/mud/grrmud/server/command2.cc 2007-06-11 02:12:11 UTC (rev 943)
@@ -2263,17 +2263,17 @@
if (ok_to_do_action(NULL, "mFP", 0, pc, pc.getCurRoom(), NULL, TRUE)) {
if (i == 1) {
- Sprintf(buf, cstr(CS_WIMPY_SET, pc), pc.WIMPY);
+ Sprintf(buf, cstr(CS_WIMPY_SET, pc), pc.getWimpy());
show(buf, pc);
}//if
else if (i <= 0) {
- pc.WIMPY = 0;
+ pc.setWimpy(0);
}//if
- else if (i > pc.HP_MAX / 2) {
- pc.WIMPY = pc.HP_MAX / 2;
+ else if (i > pc.getHP_MAX() / 2) {
+ pc.setWimpy(pc.getHP_MAX() / 2);
}//if
else {
- pc.WIMPY = i;
+ pc.setWimpy(i);
}//else
pc.show(CS_OK);
return 0;
@@ -2451,12 +2451,12 @@
/* done through 18 */
Sprintf(buf2,
"lvl: %i Home_Town: %i wimpy: %i Prac: %i Hmx: %i Mmx: %i\n",
- crit_ptr->LEVEL, crit_ptr->getHomeTown(), crit_ptr->WIMPY,
- crit_ptr->PRACS, crit_ptr->HP_MAX, crit_ptr->MA_MAX);
+ crit_ptr->getLevel(), crit_ptr->getHomeTown(), crit_ptr->getWimpy(),
+ crit_ptr->PRACS, crit_ptr->getHP_MAX(), crit_ptr->getManaMax());
show(buf2, pc);
Sprintf(buf2, "Vmx: %i CRITTER_TYPE: %i dam_rec_mod: %i DAM_GIV_MOD: %i\n",
- crit_ptr->MV_MAX, crit_ptr->CRITTER_TYPE,
+ crit_ptr->getMovMax(), crit_ptr->CRITTER_TYPE,
crit_ptr->DAM_REC_MOD, crit_ptr->DAM_GIV_MOD);
show(buf2, pc);
Modified: trunk/mud/grrmud/server/command3.cc
===================================================================
--- trunk/mud/grrmud/server/command3.cc 2007-06-10 22:15:12 UTC (rev 942)
+++ trunk/mud/grrmud/server/command3.cc 2007-06-11 02:12:11 UTC (rev 943)
@@ -1916,8 +1916,8 @@
while ((ptr = cll.next())) {
Sprintf(buf, "%S%P30 %s(%i)%P45 %i/%i %P54 %i/%i %P66 %i/%i\n",
name_of_crit(*ptr, pc.SEE_BIT), class_of_crit(*ptr),
- ptr->LEVEL, ptr->HP, ptr->HP_MAX,
- ptr->MANA, ptr->MA_MAX, ptr->MOV, ptr->MV_MAX);
+ ptr->getLevel(), ptr->getHP(), ptr->getHP_MAX(),
+ ptr->getMana(), ptr->getManaMax(), ptr->getMov(), ptr->getMovMax());
buf.Cap();
show(buf, pc);
}//while
Modified: trunk/mud/grrmud/server/command4.cc
===================================================================
--- trunk/mud/grrmud/server/command4.cc 2007-06-10 22:15:12 UTC (rev 942)
+++ trunk/mud/grrmud/server/command4.cc 2007-06-11 02:12:11 UTC (rev 943)
@@ -2734,13 +2734,13 @@
}//if
else if (strncasecmp(*targ, "mana_max", max(len1, 5)) == 0) {
if (check_l_range(new_val, 0, 32000, pc, TRUE)) {
- ptr->MA_MAX = new_val;
+ ptr->setManaMax(new_val);
flag = TRUE;
}//if
}//if
else if (strncasecmp(*targ, "mov_max", max(len1, 5)) == 0) {
if (check_l_range(new_val, 0, 32000, pc, TRUE)) {
- ptr->MV_MAX = new_val;
+ ptr->setMovMax(new_val);
flag = TRUE;
}//if
}//if
Modified: trunk/mud/grrmud/server/commands.cc
===================================================================
--- trunk/mud/grrmud/server/commands.cc 2007-06-10 22:15:12 UTC (rev 942)
+++ trunk/mud/grrmud/server/commands.cc 2007-06-11 02:12:11 UTC (rev 943)
@@ -48,6 +48,7 @@
#include "Filters.h"
#include "clients.h"
#include "weather.h"
+#include "necromancer.h"
int inventory(critter& pc) {
String buf(100);
@@ -755,7 +756,7 @@
show("\n\n", pc);
show((crit_ptr->long_desc), pc);
- int cond = (int) (((float)crit_ptr->HP / (float)crit_ptr->HP_MAX) *
+ int cond = (int) (((float)crit_ptr->getHP() / (float)crit_ptr->getHP_MAX()) *
9.0);
cond = cond < 0?0:cond; // Take care of critters with negative hp.
if (!check_l_range(cond, 0, 9, pc, FALSE)) {
Modified: trunk/mud/grrmud/server/const.h
===================================================================
--- trunk/mud/grrmud/server/const.h 2007-06-10 22:15:12 UTC (rev 942)
+++ trunk/mud/grrmud/server/const.h 2007-06-11 02:12:11 UTC (rev 943)
@@ -1194,10 +1194,13 @@
REMOVE_KARMA_SKILL_NUM,
SANCTUM_OF_THE_VICTIM_SKILL_NUM,
FEAR_SKILL_NUM,
- NECROPHILIA_SKILL_NUM;
-
+ NECROPHILIA_SKILL_NUM,
+ RITUALS_SKILL_NUM,
+ BLOOD_RITUAL_SKILL_NUM,
+ SPIRIT_RITUAL_SKILL_NUM,
+ STAMINA_RITUAL_SKILL_NUM,
+ RITUAL_OF_POWER_SKILL_NUM;
-
// Ripped off from some PennMUSH code someone posted to the
// mud-dev list.
@@ -1660,9 +1663,6 @@
#define IN_ROOM cur_stats[2]
#define WIMPY short_cur_stats[21]
#define PRACS short_cur_stats[22]
-#define HP_MAX getHP_MAX()
-#define MA_MAX short_cur_stats[24]
-#define MV_MAX short_cur_stats[25]
#define CRITTER_TYPE short_cur_stats[26] /* was SMOB */
#define DAM_REC_MOD short_cur_stats[27]
#define DAM_GIV_MOD short_cur_stats[28]
Modified: trunk/mud/grrmud/server/critter.cc
===================================================================
--- trunk/mud/grrmud/server/critter.cc 2007-06-10 22:15:12 UTC (rev 942)
+++ trunk/mud/grrmud/server/critter.cc 2007-06-11 02:12:11 UTC (rev 943)
@@ -2612,7 +2612,7 @@
}
if (rm.haveCritter(ptr)) {
if (ptr->doesRemember(*this) && ptr->canDetect(*this)) {
- if (ptr->HP >= (ptr->WIMPY*2 < ptr->HP_MAX*.75?ptr->WIMPY*2:ptr->HP_MAX*.75)) {
+ if (ptr->HP >= (ptr->WIMPY*2 < ptr->getHP_MAX()*.75?ptr->WIMPY*2:ptr->getHP_MAX()*.75)) {
say("There you are!!", *ptr, *(ptr->getCurRoom()));
try_hit(*this, *ptr);
}
@@ -2629,7 +2629,7 @@
}
if (rm.haveCritter(ptr)) { //make sure we're still there
if (doesRemember(*ptr) && canDetect(*ptr)) {
- if (HP >= (WIMPY*2 < HP_MAX*.75?WIMPY*2:HP_MAX*.75)) {
+ if (HP >= (WIMPY*2 < getHP_MAX()*.75?WIMPY*2:getHP_MAX()*.75)) {
say("I've found you now!!", *this, *(getCurRoom()));
try_hit(*ptr, *this);
}
@@ -4309,26 +4309,41 @@
}
}
-void critter::setHP(int i) {
+int critter::setHP(int i) {
if (i < 0)
i = 0;
if (i > 32000)
i = 32000;
HP = i;
+ return(HP);
}
-void critter::setMana(int i) {
+int critter::adjHP(int i) {
+ return(setHP(getHP() + i));
+}
+
+int critter::setMana(int i) {
if (i > 32000)
i = 32000;
MANA = i;
+ return i;
}
-void critter::setMov(int i) {
+int critter::adjMana(int i) {
+ return(setMana(getMana() + i));
+}
+
+int critter::setMov(int i) {
if (i > 32000)
i = 32000;
MOV = i;
+ return(i);
}
+int critter::adjMov(int i) {
+ return(setMov(getMov() +i));
+}
+
void critter::show(const char* msg, hilite_type hl_type) const {
::show(msg, *this, hl_type);
}
@@ -4344,30 +4359,45 @@
return English;
}
-void critter::setHP_MAX(int i) {
+int critter::setHP_MAX(int i) {
if (i < 0)
i = 0;
if (i > 32000)
i = 32000;
short_cur_stats[23] = i; //MAX_HP of course...
+ return(i);
}
-void critter::setManaMax(int i) {
+int critter::adjHP_MAX(int i) {
+ return(setHP_MAX(getHP_MAX() + i));
+}//critter::adjHP_MAX()
+
+int critter::setManaMax(int i) {
if (i < 0)
i = 0;
if (i > 32000)
i = 32000;
short_cur_stats[24] = i;
+ return(i);
}
-void critter::setMovMax(int i) {
+int critter::adjManaMax(int i) {
+ return(setManaMax(getManaMax() + i));
+}//critter::adjManaMax()
+
+int critter::setMovMax(int i) {
if (i < 0)
i = 0;
if (i > 32000)
i = 32000;
short_cur_stats[25] = i;
+ return(i);
}
+int critter::adjMovMax(int i) {
+ return(setMovMax(getMovMax() + i));
+}//critter::adjMovMax()
+
// set in_room to zero
void critter::doLeaveRoom() {
room_list[IN_ROOM].removeCritter(this);
@@ -4456,25 +4486,25 @@
targ.Append("\n");
break;
case 'h': /* cur hp */
- targ.Append(HP);
+ targ.Append(getHP());
break;
case 'H': /* max hp */
- targ.Append(HP_MAX);
+ targ.Append(getHP_MAX());
break;
case 'v': /* cur mov */
- targ.Append(MOV);
+ targ.Append(getMov());
break;
case 'V': /* max mov */
- targ.Append(MV_MAX);
+ targ.Append(getMovMax());
break;
case 'm': /* cur mana */
- targ.Append(MANA);
+ targ.Append(getMana());
break;
case 'M': /* max mana */
- targ.Append(MA_MAX);
+ targ.Append(getManaMax());
break;
case 'a': /* align */
- targ.Append(ALIGN);
+ targ.Append(getAlignment());
break;
case 'p': /* pracs */
targ.Append(PRACS);
@@ -5226,7 +5256,7 @@
}//if
// Let critters rest a bit before they hunt
- if (HP <= ((WIMPY * 2 < HP_MAX * .75) ? (WIMPY*2) : (HP_MAX*.75))) {
+ if (HP <= ((WIMPY * 2 < getHP_MAX() * .75) ? (WIMPY*2) : (getHP_MAX()*.75))) {
return;
}
@@ -6062,4 +6092,14 @@
}
}
+bool critter::lost_concentration(int spell_num) const {
+ int percent_lrned = 0, i;
+ SKILLS_KNOWN.Find(spell_num, percent_lrned);
+
+ i = (int)(((float)percent_lrned / 50.0) *
+ (float)(getWIS(true) + getINT(true) + getLevel() + 130));
+
+ return (d(1, 100) >= d(1, i));
+}//critter::lost_concentration()
+
Modified: trunk/mud/grrmud/server/critter.h
===================================================================
--- trunk/mud/grrmud/server/critter.h 2007-06-10 22:15:12 UTC (rev 942)
+++ trunk/mud/grrmud/server/critter.h 2007-06-11 02:12:11 UTC (rev 943)
@@ -934,12 +934,18 @@
void setNakedWeight(int i) { short_cur_stats[41] = i; }
void setIdNum(int i);
void setDoPrompt(int i) { PC_FLAGS.set(10, i); }
- void setHP(int i);
- void setMana(int i);
- void setMov(int i);
- void setHP_MAX(int i);
- void setManaMax(int i);
- void setMovMax(int i);
+ int setHP(int i);
+ int adjHP(int i);
+ int setMana(int i);
+ int adjMana(int i);
+ int setMov(int i);
+ int adjMov(int i);
+ int setHP_MAX(int i);
+ int adjHP_MAX(int i);
+ int setManaMax(int i);
+ int adjManaMax(int i);
+ int setMovMax(int i);
+ int adjMovMax(int i);
void setMode(PcMode val);
void setImmLevel(int i);
void setCurRoomNum(int i); //assign in_roomtoo
@@ -1171,6 +1177,7 @@
bool canSee(door& dr) const;
bool isUnaware() const;
bool hasLight() const;
+ bool lost_concentration(int spell_num) const;
};//class critter
Modified: trunk/mud/grrmud/server/ez_spll.cc
===================================================================
--- trunk/mud/grrmud/server/ez_spll.cc 2007-06-10 22:15:12 UTC (rev 942)
+++ trunk/mud/grrmud/server/ez_spll.cc 2007-06-11 02:12:11 UTC (rev 943)
@@ -1830,8 +1830,8 @@
if (do_effects) {
vict.HP += (short)(((float)(10 + d(1,15)) / spell_objs_ratio(spell_num)));
- if (vict.HP > vict.HP_MAX)
- vict.HP = vict.HP_MAX;
+ if (vict.getHP() > vict.getHP_MAX())
+ vict.setHP(vict.getHP_MAX());
}//if
}//do_cast_cure_serious
@@ -1911,8 +1911,8 @@
if (do_effects) {
vict.HP += (20 + d(1, lvl));
- if (vict.HP > vict.HP_MAX)
- vict.HP = vict.HP_MAX;
+ if (vict.getHP() > vict.getHP_MAX())
+ vict.setHP(vict.getHP_MAX());
}//if
}//do_cast_cure_critical
@@ -1991,8 +1991,8 @@
if (do_effects) {
vict.HP += (d(4, lvl) + 150);
- if (vict.HP > vict.HP_MAX)
- vict.HP = vict.HP_MAX;
+ if (vict.getHP() > vict.getHP_MAX())
+ vict.setHP(vict.getHP_MAX());
}//if
}//do_cast_heal
@@ -2074,12 +2074,12 @@
agg.PAUSE = 1;
if (do_effects) {
- vict.HP += (d(7, 100) + 2 * lvl);
- if (vict.HP > vict.HP_MAX)
- vict.HP = vict.HP_MAX;
- vict.MOV += (d(7,100) + 2 * lvl);
- if (vict.MOV > vict.MV_MAX)
- vict.MOV = vict.MV_MAX;
+ vict.adjHP(d(7, 100) + 2 * lvl);
+ if (vict.getHP() > vict.getHP_MAX())
+ vict.setHP(vict.getHP_MAX());
+ vict.adjMov(d(7,100) + 2 * lvl);
+ if (vict.getMov() > vict.getMovMax())
+ vict.setMov(vict.getMovMax());
}//if
}//do_cast_restore
Modified: trunk/mud/grrmud/server/grrmud.cc
===================================================================
--- trunk/mud/grrmud/server/grrmud.cc 2007-06-10 22:15:12 UTC (rev 942)
+++ trunk/mud/grrmud/server/grrmud.cc 2007-06-11 02:12:11 UTC (rev 943)
@@ -375,7 +375,12 @@
REMOVE_KARMA_SKILL_NUM,
SANCTUM_OF_THE_VICTIM_SKILL_NUM,
FEAR_SKILL_NUM,
- NECROPHILIA_SKILL_NUM;
+ NECROPHILIA_SKILL_NUM,
+ RITUALS_SKILL_NUM,
+ BLOOD_RITUAL_SKILL_NUM,
+ SPIRIT_RITUAL_SKILL_NUM,
+ STAMINA_RITUAL_SKILL_NUM,
+ RITUAL_OF_POWER_SKILL_NUM;
/* end of global variables */
Modified: trunk/mud/grrmud/server/login.cc
===================================================================
--- trunk/mud/grrmud/server/login.cc 2007-06-10 22:15:12 UTC (rev 942)
+++ trunk/mud/grrmud/server/login.cc 2007-06-11 02:12:11 UTC (rev 943)
@@ -734,9 +734,9 @@
pc.LEVEL = 1; //level
pc.setCurRoomNum(config.newbieRoom); //starting room
pc.PRACS = (pc.WIS / 3); //wis dependent, practices
- pc.setHP_MAX(pc.HP); //hp_max
- pc.MA_MAX = pc.MANA; // mana_max
- pc.MV_MAX = pc.MOV; // mov_max
+ pc.setHP_MAX(pc.getHP()); //hp_max
+ pc.setManaMax(pc.getMana()); // mana_max
+ pc.setMovMax(pc.getMov());
pc.CRITTER_TYPE = 0; // 0 is pc, 1 is smob, 2 is mob
pc.DAM_GIV_MOD = 100; // > 100 = hit harder
pc.DAM_REC_MOD = 100; // < 100 = get hit less hard
Modified: trunk/mud/grrmud/server/misc.cc
===================================================================
--- trunk/mud/grrmud/server/misc.cc 2007-06-10 22:15:12 UTC (rev 942)
+++ trunk/mud/grrmud/server/misc.cc 2007-06-11 02:12:11 UTC (rev 943)
@@ -508,7 +508,7 @@
// if we are affected by remove hope we get no hp
if ( ! (is_affected_by(REMOVE_HOPE_SKILL_NUM, *crit_ptr)) ) {
crit_ptr->HP += (int)((((((float)(crit_ptr->CON) + 5.0) / 15.0) *
- (((float)(crit_ptr->HP_MAX)) / 9.0) *
+ (((float)(crit_ptr->getHP_MAX())) / 9.0) *
posn_mod * (((float)(crit_ptr->HP_REGEN)) / 100.0)
* adj + 10.0)/6.0)*env_mod+1.0);
}
@@ -526,7 +526,7 @@
crit_ptr->MANA += (int)(((((((float)(crit_ptr->INT)) + 5.0) / 16.0) *
posn_mod *
- (((float)(crit_ptr->MA_MAX)) / 7.0) *
+ (((float)(crit_ptr->getManaMax())) / 7.0) *
(((float)(crit_ptr->MA_REGEN)) / 100.0) *
align_mod *
adj + 4.0)/6.0)*env_mod+1.0);
@@ -542,7 +542,7 @@
int tmp_mov;
tmp_mov = (int)(((((((float)(crit_ptr->DEX)) + 5.0) / 16.0) *
posn_mod * adj *
- (((float)(crit_ptr->MV_MAX)) / 3.0) *
+ (((float)(crit_ptr->getMovMax())) / 3.0) *
(((float)(crit_ptr->MV_REGEN)) / 100.0) + 3.0)/6.0)*env_mod+1.0);
crit_ptr->MOV += tmp_mov;
@@ -556,26 +556,26 @@
// }
//}
- if ( (crit_ptr->HP > crit_ptr->HP_MAX) ) {
- crit_ptr->HP = crit_ptr->HP_MAX;
+ if ( (crit_ptr->getHP() > crit_ptr->getHP_MAX()) ) {
+ crit_ptr->setHP(crit_ptr->getHP_MAX());
}
- if (crit_ptr->MANA > crit_ptr->MA_MAX)
- crit_ptr->MANA = crit_ptr->MA_MAX;
- if (crit_ptr->MOV > crit_ptr->MV_MAX)
- crit_ptr->MOV = crit_ptr->MV_MAX;
- if (crit_ptr->HP < 0)
- crit_ptr->HP = 0;
- if (crit_ptr->MANA < 0)
- crit_ptr->MANA = 0;
- if (crit_ptr->MOV < 0)
- crit_ptr->MOV = 0;
+ if (crit_ptr->getMana() > crit_ptr->getManaMax())
+ crit_ptr->setMana(crit_ptr->getManaMax());
+ if (crit_ptr->getMov() > crit_ptr->getMovMax())
+ crit_ptr->setMov(crit_ptr->getMovMax());
+ if (crit_ptr->getHP() < 0)
+ crit_ptr->setHP(0);
+ if (crit_ptr->getMana() < 0)
+ crit_ptr->setMana(0);
+ if (crit_ptr->getMov() < 0)
+ crit_ptr->setMov(0);
- if ((crit_ptr->HP > 1) && (crit_ptr->isStunned())) {
+ if ((crit_ptr->getHP() > 1) && (crit_ptr->isStunned())) {
wake(*crit_ptr);
stand(*crit_ptr);
}
- if ((((float)(crit_ptr->HP)) / (float)(crit_ptr->HP_MAX)) > 0.80) {
+ if ((((float)(crit_ptr->getHP())) / (float)(crit_ptr->getHP_MAX())) > 0.80) {
stat_spell_cell* ssptr =
is_affected_by(BIND_WOUND_SKILL_NUM, *crit_ptr);
if (ssptr) {
@@ -608,7 +608,7 @@
if ( ! (is_affected_by(REMOVE_HOPE_SKILL_NUM, *crit_ptr)) ) {
crit_ptr->HP +=
(int)(((((crit_ptr->CON + 5.0) / 15.0) *
- (crit_ptr->HP_MAX / 9.0) *
+ (crit_ptr->getHP_MAX() / 9.0) *
posn_mod * (crit_ptr->HP_REGEN / 100.0) * adj + 10.0)/6.0)+1.0);
}
@@ -616,24 +616,24 @@
if ( ! (is_affected_by(REMOVE_KARMA_SKILL_NUM, *crit_ptr)) ) {
crit_ptr->MANA +=
(int)(((((crit_ptr->INT + 5.0) / 16.0) * posn_mod *
- (crit_ptr->MA_MAX / 7.0) * (crit_ptr->MA_REGEN / 100.0) * adj +
+ (crit_ptr->getManaMax() / 7.0) * (crit_ptr->MA_REGEN / 100.0) * adj +
4.0)/6.0)+1.0);
}
crit_ptr->MOV +=
(int)(((((crit_ptr->DEX + 5.0) / 16.0) * posn_mod *
adj *
- (crit_ptr->MV_MAX / 2.0) * (crit_ptr->MV_REGEN / 100.0) +
+ (crit_ptr->getMovMax() / 2.0) * (crit_ptr->MV_REGEN / 100.0) +
5.0)/6.0)+1.0);
- if (crit_ptr->HP > crit_ptr->HP_MAX)
- crit_ptr->HP = crit_ptr->HP_MAX;
- if (crit_ptr->MANA > crit_ptr->MA_MAX)
- crit_ptr->MANA = crit_ptr->MA_MAX;
- if (crit_ptr->MOV > crit_ptr->MV_MAX)
- crit_ptr->MOV = crit_ptr->MV_MAX;
-
- if (((float)crit_ptr->HP / (float)crit_ptr->HP_MAX) > 0.80) {
+ if (crit_ptr->getHP() > crit_ptr->getHP_MAX())
+ crit_ptr->setHP(crit_ptr->getHP_MAX());
+ if (crit_ptr->getMana() > crit_ptr->getManaMax())
+ crit_ptr->setMana(crit_ptr->getManaMax());
+ if (crit_ptr->getMov() > crit_ptr->getMovMax())
+ crit_ptr->setMov(crit_ptr->getMovMax());
+
+ if (((float)crit_ptr->getHP() / (float)crit_ptr->getHP_MAX()) > 0.80) {
stat_spell_cell* ssptr =
is_affected_by(BIND_WOUND_SKILL_NUM, *crit_ptr);
if (ssptr) {
Added: trunk/mud/grrmud/server/necromancer.cc
===================================================================
--- trunk/mud/grrmud/server/necromancer.cc (rev 0)
+++ trunk/mud/grrmud/server/necromancer.cc 2007-06-11 02:12:11 UTC (rev 943)
@@ -0,0 +1,777 @@
+// $Id$
+
+//
+//ScryMUD Server Code
+//Copyright (C) 2007 Edward Roper
+//
+//This program is free software; you can redistribute it and/or
+//modify it under the terms of the GNU General Public License
+//as published by the Free Software Foundation; either version 2
+//of the License, or (at your option) any later version.
+//
+//This program is distributed in the hope that it will be useful,
+//but WITHOUT ANY WARRANTY; without even the implied warranty of
+//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+//GNU General Public License for more details.
+//
+//You should have received a copy of the GNU General Public License
+//along with this program; if not, write to the Free Software
+//Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+//
+//To contact the maintainer, Edward Roper: edro+scrymud [at] wanfear.net
+//
+
+#include "necromancer.h"
+#include "skills.h"
+#include "spells.h"
+#include "misc.h"
+#include "misc2.h"
+#include "load_wld.h" //for recursive_init_loads()
+
+void do_cast_rust(critter &vict, critter &agg, int is_canned, int lvl)
+{
+ String buf(100);
+ int spell_num = RUST_SKILL_NUM;
+ int spell_mana = get_mana_cost(spell_num, agg);
+
+ int lost_con = FALSE;
+
+ if (!is_canned)
+ lvl = agg.getLevel();
+
+ // Time to rock n' roll.
+ if ( is_canned || !(lost_con = lost_concentration(agg, spell_num))) {
+
+ stat_spell_cell *ptr = is_affected_by(spell_num, vict);
+
+ if ( ! is_canned )
+ agg.adjMana(-spell_mana);
+
+ if ( ptr ) {
+ ptr->bonus_duration += lvl / 2;
+ } else {
+ vict.affected_by.append(new stat_spell_cell(spell_num, lvl));
+ vict.AC += RUST_EFFECT;
+
+ // Cast on self
+ if ( &vict == &agg ) {
+ vict.show("You have rusted your own armor.", HL_DEF);
+ } else {
+ Sprintf(buf, "You rust %S's armor!\n",
+ name_of_crit(vict, agg.SEE_BIT));
+ agg.show(buf, HL_DEF);
+ Sprintf(buf, "Your armor rusts before your very eyes!\n",
+ name_of_crit(agg, vict.SEE_BIT));
+ buf.Cap();
+ vict.show(buf, HL_DEF);
+ Sprintf(buf, "armor rusts before your very eyes.\n",
+ name_of_crit(vict, ~0));
+ pemote(buf, vict, room_list[agg.getCurRoomNum()], TRUE, &vict);
+ }
+ }
+ }// end of "if - it - worked"
+ else { // !canned && lost concentration
+ agg.show(LOST_CONCENTRATION_MSG_SELF, HL_DEF);
+ Sprintf(buf, "seems to have lost %s concentration.", get_his_her(agg));
+ emote(buf, agg, room_list[agg.getCurRoomNum()], TRUE);
+ if ( ! is_canned )
+ agg.adjMana(-spell_mana/2);
+ }
+
+}
+
+void cast_rust(int i_th, const String *victim, critter &pc)
+{
+ critter *vict = NULL;
+ int spell_num = RUST_SKILL_NUM;
+
+ vict = ROOM.haveCritNamed(i_th, victim, pc);
+
+ if (!vict) {
+ pc.show("Whose armor do you wish to rust?", HL_DEF);
+ return;
+ }
+
+ if (vict->isMob()) {
+ vict = mob_to_smob(*vict, pc.getCurRoomNum(), TRUE, i_th, victim, pc.SEE_BIT);
+ } // if
+
+ if (!ok_to_do_action(vict, "KMVN", spell_num, pc)) {
+ return;
+ }
+
+ do_cast_rust(*vict, pc, FALSE, 0);
+}
+
+void do_cast_disfavor(critter &vict, critter &agg, int is_canned, int lvl)
+{
+ String buf(100);
+ int spell_num = DISFAVOR_SKILL_NUM;
+ int spell_mana = get_mana_cost(spell_num, agg);
+
+ int lost_con = FALSE;
+
+ if (!is_canned)
+ lvl = agg.getLevel();
+
+ // Time to rock n' roll.
+ if ( is_canned || !(lost_con = lost_concentration(agg, spell_num))) {
+
+ stat_spell_cell *ptr = is_affected_by(spell_num, vict);
+
+ if ( ! is_canned )
+ agg.adjMana(-spell_mana);
+
+ if ( ptr ) {
+ ptr->bonus_duration += lvl / 2;
+ } else {
+ vict.affected_by.append(new stat_spell_cell(spell_num, lvl));
+ vict.HEAT_RESIS += DISFAVOR_EFFECT;
+ vict.COLD_RESIS += DISFAVOR_EFFECT;
+ vict.ELEC_RESIS += DISFAVOR_EFFECT;
+ vict.SPEL_RESIS += DISFAVOR_EFFECT;
+
+ // Cast on self
+ if ( &vict == &agg ) {
+ vict.show(
+ "You call the spirits of the underworld to plague yourself.",
+ HL_DEF);
+ } else {
+ Sprintf(buf, "You call the spirits of the underworld to plague %S.\n",
+ name_of_crit(vict, agg.SEE_BIT));
+ agg.show(buf, HL_DEF);
+ Sprintf(buf, "You feel plagued by the spirits of the underworld.\n",
+ name_of_crit(agg, vict.SEE_BIT));
+ buf.Cap();
+ vict.show(buf, HL_DEF);
+ Sprintf(buf, "seems bothered.\n",
+ name_of_crit(vict, ~0));
+ emote(buf, vict, room_list[agg.getCurRoomNum()], TRUE, &vict);
+ }
+ }
+ }// end of "if - it - worked"
+ else { // !canned && lost concentration
+ agg.show(LOST_CONCENTRATION_MSG_SELF, HL_DEF);
+ Sprintf(buf, "seems to have lost %s concentration.", get_his_her(agg));
+ emote(buf, agg, room_list[agg.getCurRoomNum()], TRUE);
+ if ( ! is_canned )
+ agg.adjMana(-spell_mana/2);
+ }
+
+}
+
+void cast_disfavor(int i_th, const String *victim, critter &pc)
+{
+ critter *vict = NULL;
+ int spell_num = DISFAVOR_SKILL_NUM;
+
+ vict = ROOM.haveCritNamed(i_th, victim, pc);
+
+ if (!vict) {
+ pc.show("Who do you wish to plague?", HL_DEF);
+ return;
+ }
+
+ if (vict->isMob()) {
+ vict = mob_to_smob(*vict, pc.getCurRoomNum(), TRUE, i_th, victim, pc.SEE_BIT);
+ } // if
+
+ if (!ok_to_do_action(vict, "KMVN", spell_num, pc)) {
+ return;
+ }
+
+ do_cast_disfavor(*vict, pc, FALSE, 0);
+}
+
+void do_cast_remove_soul(critter &vict, critter &agg, int is_canned, int lvl)
+{
+ String buf(100);
+ int spell_num = REMOVE_SOUL_SKILL_NUM;
+ int spell_mana = get_mana_cost(spell_num, agg);
+
+ int lost_con = FALSE;
+
+ if (!is_canned)
+ lvl = agg.getLevel();
+
+ // Time to rock n' roll.
+ if ( is_canned || !(lost_con = lost_concentration(agg, spell_num))) {
+
+ stat_spell_cell *ptr = is_affected_by(spell_num, vict);
+
+ if ( ! is_canned )
+ agg.adjMana(-spell_mana);
+
+ if ( ptr ) {
+ ptr->bonus_duration += lvl / 2;
+ } else {
+ vict.affected_by.append(new stat_spell_cell(spell_num, lvl));
+ vict.SPEL_RESIS += REMOVE_SOUL_EFFECT;
+
+ // Cast on self
+ if ( &vict == &agg ) {
+ vict.show(
+ "Ok.",
+ HL_DEF);
+ } else {
+ Sprintf(buf,
+ "You cause %S to scream in agony as their soul wretches.\n",
+ name_of_crit(vict, agg.SEE_BIT));
+ agg.show(buf, HL_DEF);
+ Sprintf(buf,
+ "You scream in agony as your soul wretches.\n",
+ name_of_crit(agg, vict.SEE_BIT));
+ buf.Cap();
+ vict.show(buf, HL_DEF);
+ Sprintf(buf, "screams in agony as %s soul wretches.\n",
+ get_his_her(vict));
+ emote(buf, vict, room_list[agg.getCurRoomNum()], TRUE, &vict);
+ }
+ }
+ }// end of "if - it - worked"
+ else { // !canned && lost concentration
+ agg.show(LOST_CONCENTRATION_MSG_SELF, HL_DEF);
+ Sprintf(buf, "seems to have lost %s concentration.", get_his_her(agg));
+ emote(buf, agg, room_list[agg.getCurRoomNum()], TRUE);
+ if ( ! is_canned )
+ agg.adjMana(-spell_mana/2);
+ }
+
+}
+
+void cast_remove_soul(int i_th, const String *victim, critter &pc)
+{
+ critter *vict = NULL;
+ int spell_num = REMOVE_SOUL_SKILL_NUM;
+
+ vict = ROOM.haveCritNamed(i_th, victim, pc);
+
+ if (!vict) {
+ pc.show("Who's soul do you wish to remove?", HL_DEF);
+ return;
+ }
+
+ if (vict->isMob()) {
+ vict = mob_to_smob(*vict, pc.getCurRoomNum(), TRUE, i_th, victim, pc.SEE_BIT);
+ } // if
+
+ if (!ok_to_do_action(vict, "KMVN", spell_num, pc)) {
+ return;
+ }
+
+ do_cast_remove_soul(*vict, pc, FALSE, 0);
+}
+
+void do_cast_remove_hope(critter &vict, critter &agg, int is_canned, int lvl)
+{
+ String buf(100);
+ int spell_num = REMOVE_HOPE_SKILL_NUM;
+ int spell_mana = get_mana_cost(spell_num, agg);
+
+ int lost_con = FALSE;
+
+ if (!is_canned)
+ lvl = agg.getLevel();
+
+ // Time to rock n' roll.
+ if ( is_canned || !(lost_con = lost_concentration(agg, spell_num))) {
+
+ stat_spell_cell *ptr = is_affected_by(spell_num, vict);
+
+ if ( ! is_canned )
+ agg.adjMana(-spell_mana);
+
+ // Dont let the duration accumulate.
+ if ( ptr ) {
+ agg.show("You can do no more.", HL_DEF);
+ } else {
+ // Hardcoded in this lasts for 4 ticks.
+ vict.affected_by.append(new stat_spell_cell(spell_num, 4));
+
+ // Cast on self
+ if ( &vict == &agg ) {
+ vict.show("You become hopeless.", HL_DEF);
+ } else {
+ Sprintf(buf, "You are overcome with a feeling of hopelessness.\n");
+ vict.show(buf, HL_DEF);
+ Sprintf(buf,
+ "quivers and drops to %s knees with a frail cry of hopelessness.\n",
+ get_his_her(vict));
+ emote(buf, vict, room_list[agg.getCurRoomNum()], TRUE, &vict);
+ }
+ }
+ }// end of "if - it - worked"
+ else { // !canned && lost concentration
+ agg.show(LOST_CONCENTRATION_MSG_SELF, HL_DEF);
+ Sprintf(buf, "seems to have lost %s concentration.", get_his_her(agg));
+ emote(buf, agg, room_list[agg.getCurRoomNum()], TRUE);
+ if ( ! is_canned )
+ agg.adjMana(-spell_mana/2);
+ }
+
+}
+
+void cast_remove_hope(int i_th, const String *victim, critter &pc)
+{
+ critter *vict = NULL;
+ int spell_num = REMOVE_HOPE_SKILL_NUM;
+
+ vict = ROOM.haveCritNamed(i_th, victim, pc);
+
+ if (!vict) {
+ pc.show("Who do you want to psychologically destroy?", HL_DEF);
+ return;
+ }
+
+ if (vict->isMob()) {
+ vict = mob_to_smob(*vict, pc.getCurRoomNum(), TRUE, i_th, victim, pc.SEE_BIT);
+ } // if
+
+ if (!ok_to_do_action(vict, "KMVN", spell_num, pc)) {
+ return;
+ }
+
+ do_cast_remove_hope(*vict, pc, FALSE, 0);
+}
+
+void do_cast_remove_karma(critter &vict, critter &agg, int is_canned, int lvl)
+{
+ String buf(100);
+ int spell_num = REMOVE_KARMA_SKILL_NUM;
+ int spell_mana = get_mana_cost(spell_num, agg);
+
+ int lost_con = FALSE;
+
+ if (!is_canned)
+ lvl = agg.getLevel();
+
+ // Time to rock n' roll.
+ if ( is_canned || !(lost_con = lost_concentration(agg, spell_num))) {
+
+ stat_spell_cell *ptr = is_affected_by(spell_num, vict);
+
+ if ( ! is_canned )
+ agg.adjMana(-spell_mana);
+
+ // Dont let the duration accumulate.
+ if ( ptr ) {
+ agg.show("You can do no more.", HL_DEF);
+ } else {
+ // Hardcoded in this lasts for 4 ticks.
+ vict.affected_by.append(new stat_spell_cell(spell_num, 4));
+
+ // Cast on self
+ if ( &vict == &agg ) {
+ vict.show("You remove your ability to gain mana.", HL_DEF);
+ } else {
+ Sprintf(buf, "You feel a cold sensation as your skin glows briefly.\n");
+ vict.show(buf, HL_DEF);
+ Sprintf(buf, "glows a faint blue and then returns to normal.\n");
+ emote(buf, vict, room_list[agg.getCurRoomNum()], TRUE, &vict);
+ }
+ }
+ }// end of "if - it - worked"
+ else { // !canned && lost concentration
+ agg.show(LOST_CONCENTRATION_MSG_SELF, HL_DEF);
+ Sprintf(buf, "seems to have lost %s concentration.", get_his_her(agg));
+ emote(buf, agg, room_list[agg.getCurRoomNum()], TRUE);
+ if ( ! is_canned )
+ agg.adjMana(-spell_mana/2);
+ }
+
+}
+
+void cast_remove_karma(int i_th, const String *victim, critter &pc)
+{
+ critter *vict = NULL;
+ int spell_num = REMOVE_KARMA_SKILL_NUM;
+
+ vict = ROOM.haveCritNamed(i_th, victim, pc);
+
+ if (!vict) {
+ pc.show("Who do you to mentally destroy?", HL_DEF);
+ return;
+ }
+
+ if (vict->isMob()) {
+ vict = mob_to_smob(*vict, pc.getCurRoomNum(), TRUE, i_th, victim, pc.SEE_BIT);
+ } // if
+
+ if (!ok_to_do_action(vict, "KMVN", spell_num, pc)) {
+ return;
+ }
+
+ do_cast_remove_karma(*vict, pc, FALSE, 0);
+}
+
+void do_cast_sanctum_of_the_victim(critter &vict, critter &agg, int is_canned, int lvl)
+{
+ String buf(100);
+ int spell_num = SANCTUM_OF_THE_VICTIM_SKILL_NUM;
+ int spell_mana = get_mana_cost(spell_num, agg);
+
+ int lost_con = FALSE;
+
+ if (!is_canned)
+ lvl = agg.getLevel();
+
+ // Time to rock n' roll.
+ if ( is_canned || !(lost_con = lost_concentration(agg, spell_num))) {
+
+ stat_spell_cell *ptr = is_affected_by(spell_num, vict);
+
+ if ( ! is_canned )
+ agg.adjMana(-spell_mana);
+
+ if ( ptr ) {
+ ptr->bonus_duration += 1;
+ } else {
+ vict.affected_by.append(new stat_spell_cell(spell_num, lvl));
+ vict.DAM_REC_MOD += SANCTUM_EFFECT;
+
+ // Cast on self
+ if ( &vict == &agg ) {
+ vict.show("You have made yourself frail.", HL_DEF);
+ } else {
+ Sprintf(buf, "You make %S frail!\n",
+ name_of_crit(vict, agg.SEE_BIT));
+ agg.show(buf, HL_DEF);
+ Sprintf(buf, "You feel frail!\n",
+ name_of_crit(agg, vict.SEE_BIT));
+ buf.Cap();
+ vict.show(buf, HL_DEF);
+ }
+ }
+ }// end of "if - it - worked"
+ else { // !canned && lost concentration
+ agg.show(LOST_CONCENTRATION_MSG_SELF, HL_DEF);
+ Sprintf(buf, "seems to have lost %s concentration.", get_his_her(agg));
+ emote(buf, agg, room_list[agg.getCurRoomNum()], TRUE);
+ if ( ! is_canned )
+ agg.adjMana(-spell_mana/2);
+ }
+
+}
+
+void cast_sanctum_of_the_victim(int i_th, const String *victim, critter &pc)
+{
+ critter *vict = NULL;
+ int spell_num = SANCTUM_OF_THE_VICTIM_SKILL_NUM;
+
+ vict = ROOM.haveCritNamed(i_th, victim, pc);
+
+ if (!vict) {
+ pc.show("Who is your victim?", HL_DEF);
+ return;
+ }
+
+ if (vict->isMob()) {
+ vict = mob_to_smob(*vict, pc.getCurRoomNum(), TRUE, i_th, victim, pc.SEE_BIT);
+ } // if
+
+ if (!ok_to_do_action(vict, "KMVN", spell_num, pc)) {
+ return;
+ }
+
+ do_cast_sanctum_of_the_victim(*vict, pc, FALSE, 0);
+}
+
+void do_cast_fear(critter &vict, critter &agg, int is_canned, int lvl)
+{
+ String buf(100);
+ int spell_num = FEAR_SKILL_NUM;
+ int spell_mana = get_mana_cost(spell_num, agg);
+
+ int lost_con = FALSE;
+
+ if (!is_canned)
+ lvl = agg.getLevel();
+
+ // Time to rock n' roll.
+ if ( is_canned || !(lost_con = lost_concentration(agg, spell_num))) {
+
+ if ( ! is_canned )
+ agg.adjMana(-spell_mana);
+
+ vict.MOV = 0;
+
+ // Cast on self
+ if ( &vict == &agg ) {
+ vict.show("You idiot, now you can't move.", HL_DEF);
+ } else {
+ Sprintf(buf, "You put fear into the heart of %S\n",
+ name_of_crit(vict, agg.SEE_BIT));
+ agg.show(buf, HL_DEF);
+ Sprintf(buf, "Your face turns a pale white. You are afraid.\n",
+ name_of_crit(agg, vict.SEE_BIT));
+ buf.Cap();
+ vict.show(buf, HL_DEF);
+ Sprintf(buf, "face turns a pale white.\n");
+ pemote(buf, vict, room_list[agg.getCurRoomNum()], TRUE, &vict);
+ }
+ }// end of "if - it - worked"
+ else { // !canned && lost concentration
+ agg.show(LOST_CONCENTRATION_MSG_SELF, HL_DEF);
+ Sprintf(buf, "seems to have lost %s concentration.", get_his_her(agg));
+ emote(buf, agg, room_list[agg.getCurRoomNum()], TRUE);
+ if ( ! is_canned )
+ agg.adjMana(-spell_mana/2);
+ }
+
+}
+
+void cast_fear(int i_th, const String *victim, critter &pc)
+{
+ critter *vict = NULL;
+ int spell_num = FEAR_SKILL_NUM;
+
+ vict = ROOM.haveCritNamed(i_th, victim, pc);
+
+ if (!vict) {
+ pc.show("In whom do you wish to instill fear?", HL_DEF);
+ return;
+ }
+
+ if (vict->isMob()) {
+ vict = mob_to_smob(*vict, pc.getCurRoomNum(), TRUE, i_th, victim, pc.SEE_BIT);
+ } // if
+
+ if (!ok_to_do_action(vict, "KMVN", spell_num, pc)) {
+ return;
+ }
+
+ do_cast_fear(*vict, pc, FALSE, 0);
+}
+
+void do_cast_weaken(critter& vict, critter& agg, int is_canned, int lvl) {
+ String buf(100);
+ short did_hit = TRUE;
+ int spell_num = WEAKEN_SKILL_NUM;
+ int spell_mana = get_mana_cost(spell_num, agg);
+
+ int lost_con = FALSE;
+
+ if (!is_canned) {
+ lvl = agg.getLevel();
+ }
+
+ if ((is_canned && (did_hit =
+ did_spell_hit(agg, CRONIC, vict, lvl, TRUE))) ||
+ (!is_canned && !(lost_con = lost_concentration(agg, spell_num)) &&
+ (did_hit = did_spell_hit(agg, CRONIC, vict)))) {
+
+ stat_spell_cell* ptr = is_affected_by(spell_num, vict);
+
+ if (!is_canned) {
+ agg.adjMana(-spell_mana);
+ }
+
+ if (ptr) {
+ ptr->bonus_duration += d(1,3);
+ agg.show("Ok.\n");
+ }//if
+ else {
+ // -10% of unmodified strength for 1-5 ticks.
+ int weaken_by_value = (int)( - ( 0.10 * vict.getSTR(false) ) );
+ vict.affected_by.append(new stat_spell_cell(spell_num, d(1,5), weaken_by_value ) );
+ vict.STR += weaken_by_value;
+
+ if (vict.pc) {
+ if (vict.STR > 20) {
+ if (d(1,13) == 5) { //ouch, lost some CON!!
+ vict.show("You feel even worse than normal!\n");
+ vict.STR--;
+ }
+ }//if
+ else if (vict.DEX > 20) {
+ if (d(1,13) == 7) { //ouch, lost some CON!!
+ vict.show("You feel even worse than normal!\n");
+ vict.DEX--;
+ }
+ }//if
+ else if (vict.CON > 20) {
+ if (d(1,13) == 7) { //ouch, lost some DAMCON!!
+ vict.show("You feel even worse than normal!\n");
+ vict.CON--;
+ }
+ }//if
+ }
+
+
+ if (&vict == &agg) {
+ show("You feel weaker!\n", agg);
+ }//if
+ else {
+ Sprintf(buf, "You drain some of %S's strength!\n",
+ name_of_crit(vict, agg.SEE_BIT));
+ show(buf, agg);
+ Sprintf(buf, "%S drains your strength!\n",
+ name_of_crit(agg, vict.SEE_BIT));
+ buf.Cap();
+ show(buf, vict);
+ Sprintf(buf, "drains %S's strength!",
+ name_of_crit(vict, ~0));
+ emote(buf, agg, room_list[agg.getCurRoomNum()], TRUE, &vict);
+ }//else
+ }//else
+ }//if worked
+ else if (!did_hit) {
+ Sprintf(buf, "You fail to drain some of %S's strength!\n",
+ name_of_crit(vict, agg.SEE_BIT));
+ show(buf, agg);
+ Sprintf(buf, "%S fails to drain your strength!\n",
+ name_of_crit(agg, vict.SEE_BIT));
+ buf.Cap();
+ show(buf, vict);
+ Sprintf(buf, "fails to drain %S's strength!",
+ name_of_crit(vict, ~0));
+ emote(buf, agg, room_list[agg.getCurRoomNum()], TRUE, &vict);
+ }//did_hit
+ else { //not canned && LOST concentration
+ show(LOST_CONCENTRATION_MSG_SELF, agg);
+ emote("feels a little weak in the head!", agg,
+ room_list[agg.getCurRoomNum()], TRUE);
+ if (!is_canned)
+ agg.adjMana(-spell_mana/2);
+ }//else lost concentration
+ agg.PAUSE = 1;
+}//do_cast_weaken
+
+void cast_weaken(int i_th, const String* victim, critter& pc) {
+ critter* vict = NULL;
+ int spell_num = WEAKEN_SKILL_NUM;
+
+ vict = ROOM.haveCritNamed(i_th, victim, pc);
+
+ if (!vict) {
+ show("Whom do you wish to weaken??\n", pc);
+ return;
+ }//if
+
+ if (vict->isMob()) {
+ vict = mob_to_smob(*vict, pc.getCurRoomNum(), TRUE, i_th,
+ victim, pc.SEE_BIT);
+ }//if
+
+ if (!ok_to_do_action(vict, "KMSVN", spell_num, pc)) {
+ return;
+ }//if
+
+ do_cast_weaken(*vict, pc, FALSE, 0);
+}//do_cast_weaken
+
+void do_cast_raise_undead(critter& pc, int is_canned, int lvl) {
+ String buf(100);
+ int spell_num = RAISE_UNDEAD_SKILL_NUM;
+ int spell_mana = get_mana_cost(spell_num, pc);
+
+ if (!is_canned)
+ lvl = pc.getLevel();
+
+ int lost_con = FALSE;
+
+ object* corpse = NULL;
+ critter* pet = NULL;
+
+ if (!(corpse = have_obj_numbered(*(ROOM.getInv()), 1, config.corpseObject,
+ pc.SEE_BIT, ROOM))) {
+ show("You need a corpse in order to animate it!\n", pc);
+ return;
+ }//if
+
+ if (is_canned || !(lost_con = lost_concentration(pc, spell_num))) {
+
+ if (!mob_list[config.walkingCorpseMob].isInUse()) {
+ mudlog.log(ERROR, "ERROR: need to create a RAISED_CORPSE_MOB.\n");
+ return;
+ }//if
+
+ pet = mob_to_smob(mob_list[config.walkingCorpseMob], pc.getCurRoomNum(), TRUE);
+ pet->mob->setDisolvable(TRUE);
+ pet->mob->setTicksTillFreedom(pc.getCharisma() + d(1, pc.getLevel()));
+ pet->setHomeTown(ROOM.getZoneNum()); //belong to current zone
+ ROOM.gainCritter(pet);
+
+ recursive_init_loads(*pet);
+
+ pet->inv = corpse->inv; //transfer inventory
+ corpse->inv.clear();
+
+ ROOM.loseInv(corpse);
+ corpse->decrementCurInGame(); //no recursive unload, stuff transferred
+
+ if (corpse->IN_LIST) { //this should be true in most cases btw
+ delete corpse;
+ }//if
+ corpse = NULL; //completely shed of it
+
+ if (!is_canned)
+ pc.adjMana(-spell_mana);
+
+ if (pc.PETS.size() >= (pc.CHA/4 +1)) {
+ show("Your monster stands, but shows no interest in following you!\n",
+ pc);
+ return;
+ }//if
+
+ show("You breathe a twisted form of life back into the corpse!\n", pc);
+ emote("conjures life back into a gruesome corpse!", pc,
+ ROOM, TRUE);
+
+ /* not figure out it's strength, and HP */
+ pet->setHP(d(4, lvl * 4));
+ pet->setHP_MAX(pet->HP);
+ pet->STR = d(2,2) + (lvl / 2);
+ pet->setLevel(pc.getLevel());
+ pet->ALIGN = pc.getAlignment();
+
+ /* now it follows and is a pet of the person */
+ pc.PETS.append(pet);
+ pet->MASTER = &pc;
+
+ pet->doFollow(pc); // golem starts following caster
+ }//if canned or didn't lose concentration
+ else { //not canned AND lost concentration
+ show(LOST_CONCENTRATION_MSG_SELF, pc);
+ emote("mutters something about necrophilia and blushes!\n", pc, ROOM,
+ TRUE);
+ if (!is_canned)
+ pc.adjMana(-(spell_mana/2));
+ }//else lost concentration
+ pc.PAUSE = 1;
+}//do_cast_raise_undead
+
+void cast_raise_undead(critter& pc) {
+ int spell_num = RAISE_UNDEAD_SKILL_NUM;
+
+ if (!ok_to_do_action(NULL, "KMSNBb", spell_num, pc)) {
+ return;
+ }//if
+
+ do_cast_raise_undead(pc, FALSE, 0);
+}//cast_raise_undead
+
+//TODO: cast_blood_ritual is incomplete.
+void cast_blood_ritual(critter& agg) {
+ int spell_num = BLOOD_RITUAL_SKILL_NUM;
+ int mana_cost = get_mana_cost(spell_num, agg);
+
+ if (!ok_to_do_action(NULL, "KMSNBb", spell_num, agg)) {
+ return;
+ }
+
+ bool lost_con = agg.lost_concentration(spell_num);
+
+ if ( lost_con ) {
+ agg.show(LOST_CONCENTRATION_MSG_SELF);
+ agg.adjMana(-mana_cost/2);
+ return;
+ }
+
+ int adj_value = agg.getMana();
+ agg.adjHP(adj_value);
+ agg.setMana(0);
+
+ //agg.affected_by.append(new stat_spell_cell(spell_num, 3,
+}//cast_blood_ritual()
+
Added: trunk/mud/grrmud/server/necromancer.h
===================================================================
--- trunk/mud/grrmud/server/necromancer.h (rev 0)
+++ trunk/mud/grrmud/server/necromancer.h 2007-06-11 02:12:11 UTC (rev 943)
@@ -0,0 +1,67 @@
+// $Id$
+
+//
+//ScryMUD Server Code
+//Copyright (C) 2007 Edward Roper
+//
+//This program is free software; you can redistribute it and/or
+//modify it under the terms of the GNU General Public License
+//as published by the Free Software Foundation; either version 2
+//of the License, or (at your option) any later version.
+//
+//This program is distributed in the hope that it will be useful,
+//but WITHOUT ANY WARRANTY; without even the implied warranty of
+//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+//GNU General Public License for more details.
+//
+//You should have received a copy of the GNU General Public License
+//along with this program; if not, write to the Free Software
+//Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+//
+//To contact the maintainer, Edward Roper: edro+scrymud [at] wanfear.net
+//
+
+#ifndef GRRMUD_NECROMANCER
+#include "critter.h"
+
+#define RUST_EFFECT 25 /* a/c */
+#define DISFAVOR_EFFECT 20 /* all resistances */
+#define REMOVE_SOUL_EFFECT 100 /* spell resistance */
+#define SANCTUM_EFFECT 30 /* dam receive mod */
+
+void cast_rust(int i_th, const String* vict, critter& agg);
+void do_cast_rust(critter& vict, critter& agg, int is_canned, int lvl);
+
+void cast_disfavor(int i_th, const String* vict, critter& agg);
+void do_cast_disfavor(critter& vict, critter& agg, int is_canned, int lvl);
+
+void cast_remove_soul(int i_th, const String* vict, critter& agg);
+void do_cast_remove_soul(critter& vict, critter& agg, int is_canned, int lvl);
+
+void cast_remove_hope(int i_th, const String* vict, critter& agg);
+void do_cast_remove_hope(critter& vict, critter& agg, int is_canned, int lvl);
+
+void cast_remove_karma(int i_th, const String* vict, critter& agg);
+void do_cast_remove_karma(critter& vict, critter& agg, int is_canned, int lvl);
+
+void cast_sanctum_of_the_victim(int i_th, const String* vict, critter& agg);
+void do_cast_sanctum_of_the_victim(critter& vict, critter& agg, int is_canned, int lvl);
+
+void cast_fear(int i_th, const String* vict, critter& agg);
+void do_cast_fear(critter& vict, critter& agg, int is_canned, int lvl);
+
+void cast_weaken(int i_th, const String* vict, critter& agg);
+void do_cast_weaken(critter& vict, critter& agg, int is_canned, int lvl);
+
+void cast_raise_undead(critter& agg);
+void do_cast_raise_undead(critter& pc, int is_canned, int lvl);
+
+void cast_blood_ritual(critter& agg);
+/*TODO: these need to be implemented
+void cast_spirit_ritual(critter& agg);
+void cast_stamina_ritual(critter& agg);
+void cast_ritual_of_power(critter& agg);
+*/
+
+#define GRRMUD_NECROMANCER
+#endif
Modified: trunk/mud/grrmud/server/olc2.cc
===================================================================
--- trunk/mud/grrmud/server/olc2.cc 2007-06-10 22:15:12 UTC (rev 942)
+++ trunk/mud/grrmud/server/olc2.cc 2007-06-11 02:12:11 UTC (rev 943)
@@ -436,9 +436,11 @@
crit.RACE = bound(1, 14, crit.RACE);
crit.LEVEL = bound(1, 40, crit.LEVEL);
crit.setNativeZoneNum(bound(0, NUMBER_OF_ZONES, crit.getNativeZoneNum()));
- crit.setHP_MAX(bound(1, 32000, crit.HP_MAX));
+ /* shouldn't be necessary with set*Max()
+ crit.setHP_MAX(bound(1, 32000, crit.HP_MAX()));
crit.MV_MAX = bound(1, 32000, crit.MV_MAX);
crit.MA_MAX = bound(1, 32000, crit.MA_MAX);
+ */
crit.DAM_REC_MOD = bound(1, 1000, crit.DAM_REC_MOD);
crit.DAM_GIV_MOD = bound(1, 1000, crit.DAM_GIV_MOD);
Modified: trunk/mud/grrmud/server/pet_spll.cc
===================================================================
--- trunk/mud/grrmud/server/pet_spll.cc 2007-06-10 22:15:12 UTC (rev 942)
+++ trunk/mud/grrmud/server/pet_spll.cc 2007-06-11 02:12:11 UTC (rev 943)
@@ -218,8 +218,8 @@
default: mudlog.log(DBG, "DEBUG: Default Golem in: do_cast_greater_golem:pet_spll.cc, setting golem stats");
}//switch
- golem->setHP_MAX(golem->HP);
- golem->MA_MAX = golem->MANA;
+ golem->setHP_MAX(golem->getHP());
+ golem->setManaMax(golem->getMana());
/* now it follows and is a pet of the person */
pc.PETS.append(golem);
golem->MASTER = &pc;
@@ -418,100 +418,6 @@
}//while
}//do_cast_mass_charm
-
-void do_cast_raise_undead(critter& pc, int is_canned, int lvl) {
- String buf(100);
- int spell_num = RAISE_UNDEAD_SKILL_NUM;
- int spell_mana = get_mana_cost(spell_num, pc);
-
- if (!is_canned)
- lvl = pc.LEVEL;
-
- int lost_con = FALSE;
-
- object* corpse = NULL;
- critter* pet = NULL;
-
- if (!(corpse = have_obj_numbered(*(ROOM.getInv()), 1, config.corpseObject,
- pc.SEE_BIT, ROOM))) {
- show("You need a corpse in order to animate it!\n", pc);
- return;
- }//if
-
- if (is_canned || !(lost_con = lost_concentration(pc, spell_num))) {
-
- if (!mob_list[config.walkingCorpseMob].isInUse()) {
- mudlog.log(ERROR, "ERROR: need to create a RAISED_CORPSE_MOB.\n");
- return;
- }//if
-
- pet = mob_to_smob(mob_list[config.walkingCorpseMob], pc.getCurRoomNum(), TRUE);
- pet->mob->setDisolvable(TRUE);
- pet->mob->setTicksTillFreedom(pc.getCharisma() + d(1, pc.getLevel()));
- pet->setHomeTown(ROOM.getZoneNum()); //belong to current zone
- ROOM.gainCritter(pet);
-
- recursive_init_loads(*pet);
-
- pet->inv = corpse->inv; //transfer inventory
- corpse->inv.clear();
-
- ROOM.loseInv(corpse);
- corpse->decrementCurInGame(); //no recursive unload, stuff transferred
-
- if (corpse->IN_LIST) { //this should be true in most cases btw
- delete corpse;
- }//if
- corpse = NULL; //completely shed of it
-
- if (!is_canned)
- pc.MANA -= spell_mana;
-
- if (pc.PETS.size() >= (pc.CHA/4 +1)) {
- show("Your monster stands, but shows no interest in following you!\n",
- pc);
- return;
- }//if
-
- show("You breathe a twisted form of life back into the corpse!\n", pc);
- emote("conjures life back into a gruesome corpse!", pc,
- ROOM, TRUE);
-
- /* not figure out it's strength, and HP */
- pet->HP = d(4, lvl * 4);
- pet->setHP_MAX(pet->HP);
- pet->STR = d(2,2) + (lvl / 2);
- pet->LEVEL = pc.LEVEL;
- pet->ALIGN = pc.ALIGN;
-
- /* now it follows and is a pet of the person */
- pc.PETS.append(pet);
- pet->MASTER = &pc;
-
- pet->doFollow(pc); // golem starts following caster
- }//if canned or didn't lose concentration
- else { //not canned AND lost concentration
- show(LOST_CONCENTRATION_MSG_SELF, pc);
- emote("mutters something about necrophilia and blushes!\n", pc, ROOM,
- TRUE);
- if (!is_canned)
- pc.MANA -= spell_mana / 2;
- }//else lost concentration
- pc.PAUSE = 1;
-}//do_cast_raise_undead
-
-
-void cast_raise_undead(critter& pc) {
- int spell_num = RAISE_UNDEAD_SKILL_NUM;
-
- if (!ok_to_do_action(NULL, "KMSNBb", spell_num, pc)) {
- return;
- }//if
-
- do_cast_raise_undead(pc, FALSE, 0);
-}//cast_raise_undead
-
-
void do_cast_create_golem(critter& pc, int is_canned, int lvl) {
String buf(100);
int spell_num = CREATE_GOLEM_SKILL_NUM;
Modified: trunk/mud/grrmud/server/pet_spll.h
===================================================================
--- trunk/mud/grrmud/server/pet_spll.h 2007-06-10 22:15:12 UTC (rev 942)
+++ trunk/mud/grrmud/server/pet_spll.h 2007-06-11 02:12:11 UTC (rev 943)
@@ -60,9 +60,6 @@
void cast_create_light(critter& agg);
void do_cast_create_light(critter& pc, int is_canned, int lvl);
-void cast_raise_undead(critter& agg);
-void do_cast_raise_undead(critter& pc, int is_canned, int lvl);
-
void cast_conjure_minion(critter& agg);
void do_cast_conjure_minion(critter& pc, int is_canned, int lvl);
Modified: trunk/mud/grrmud/server/spec_prc.cc
===================================================================
--- trunk/mud/grrmud/server/spec_prc.cc 2007-06-10 22:15:12 UTC (rev 942)
+++ trunk/mud/grrmud/server/spec_prc.cc 2007-06-11 02:12:11 UTC (rev 943)
@@ -53,6 +53,7 @@
#include <PtrArray.h>
#include "load_wld.h"
#include "SkillSpell.h"
+#include "necromancer.h"
Modified: trunk/mud/grrmud/server/spells.cc
===================================================================
--- trunk/mud/grrmud/server/spells.cc 2007-06-10 22:15:12 UTC (rev 942)
+++ trunk/mud/grrmud/server/spells.cc 2007-06-11 02:12:11 UTC (rev 943)
@@ -46,6 +46,7 @@
#include <PtrArray.h>
#include "SkillSpell.h"
#include "clients.h"
+#include "necromancer.h"
//deal with the Spell class stuff first
@@ -295,7 +296,7 @@
return SSCollection::instance().getSS(spell_num).getManaCost();
}
-int get_mana_cost(int spell_num, critter& pc) {
+int get_mana_cost(int spell_num, const critter& pc) {
float pl, mana_cost=SSCollection::instance().getSS(spell_num).getManaCost();
if (pc.isPc() && ((pl = (float)get_percent_lrnd(MANA_SKILL_NUM, pc)) > -1))
Modified: trunk/mud/grrmud/server/spells.h
===================================================================
--- trunk/mud/grrmud/server/spells.h 2007-06-10 22:15:12 UTC (rev 942)
+++ trunk/mud/grrmud/server/spells.h 2007-06-11 02:12:11 UTC (rev 943)
@@ -97,7 +97,7 @@
short lost_concentration(critter& agg, int spell_num);
int get_mana_cost(int spell_num);
-int get_mana_cost(int spell_num, critter& pc);
+int get_mana_cost(int spell_num, const critter& pc);
//int get_mana_cost(const char* name);
int get_number_of_scroll(int spell_num); //returns -1 if !exist
Modified: trunk/mud/grrmud/server/spells2.cc
===================================================================
--- trunk/mud/grrmud/server/spells2.cc 2007-06-10 22:15:12 UTC (rev 942)
+++ trunk/mud/grrmud/server/spells2.cc 2007-06-11 02:12:11 UTC (rev 943)
@@ -1393,127 +1393,6 @@
do_cast_blindness(*vict, pc, FALSE, 0);
}//cast_blindness
-
-void do_cast_weaken(critter& vict, critter& agg, int is_canned, int lvl) {
- String buf(100);
- short did_hit = TRUE;
- int spell_num = WEAKEN_SKILL_NUM;
- int spell_mana = get_mana_cost(spell_num, agg);
-
- int lost_con = FALSE;
-
- if (!is_canned) {
- lvl = agg.LEVEL;
- }
-
- if ((is_canned && (did_hit =
- did_spell_hit(agg, CRONIC, vict, lvl, TRUE))) ||
- (!is_canned && !(lost_con = lost_concentration(agg, spell_num)) &&
- (did_hit = did_spell_hit(agg, CRONIC, vict)))) {
-
- stat_spell_cell* ptr = is_affected_by(spell_num, vict);
-
- if (!is_canned) {
- agg.MANA -= spell_mana;
- }
-
- if (ptr) {
- ptr->bonus_duration += d(1,3);
- agg.show("Ok.\n");
- }//if
- else {
- // -10% of unmodified strength for 1-5 ticks.
- int weaken_by_value = (int)( - ( 0.10 * vict.getSTR(false) ) );
- vict.affected_by.append(new stat_spell_cell(spell_num, d(1,5), weaken_by_value ) );
- vict.STR += weaken_by_value;
-
- if (vict.pc) {
- if (vict.STR > 20) {
- if (d(1,13) == 5) { //ouch, lost some CON!!
- vict.show("You feel even worse than normal!\n");
- vict.STR--;
- }
- }//if
- else if (vict.DEX > 20) {
- if (d(1,13) == 7) { //ouch, lost some CON!!
- vict.show("You feel even worse than normal!\n");
- vict.DEX--;
- }
- }//if
- else if (vict.CON > 20) {
- if (d(1,13) == 7) { //ouch, lost some DAMCON!!
- vict.show("You feel even worse than normal!\n");
- vict.CON--;
- }
- }//if
- }
-
-
- if (&vict == &agg) {
- show("You feel weaker!\n", agg);
- }//if
- else {
- Sprintf(buf, "You drain some of %S's strength!\n",
- name_of_crit(vict, agg.SEE_BIT));
- show(buf, agg);
- Sprintf(buf, "%S drains your strength!\n",
- name_of_crit(agg, vict.SEE_BIT));
- buf.Cap();
- show(buf, vict);
- Sprintf(buf, "drains %S's strength!",
- name_of_crit(vict, ~0));
- emote(buf, agg, room_list[agg.getCurRoomNum()], TRUE, &vict);
- }//else
- }//else
- }//if worked
- else if (!did_hit) {
- Sprintf(buf, "You fail to drain some of %S's strength!\n",
- name_of_crit(vict, agg.SEE_BIT));
- show(buf, agg);
- Sprintf(buf, "%S fails to drain your strength!\n",
- name_of_crit(agg, vict.SEE_BIT));
- buf.Cap();
- show(buf, vict);
- Sprintf(buf, "fails to drain %S's strength!",
- name_of_crit(vict, ~0));
- emote(buf, agg, room_list[agg.getCurRoomNum()], TRUE, &vict);
- }//did_hit
- else { //not canned && LOST concentration
- show(LOST_CONCENTRATION_MSG_SELF, agg);
- emote("feels a little weak in the head!", agg,
- room_list[agg.getCurRoomNum()], TRUE);
- if (!is_canned)
- agg.MANA -= spell_mana / 2;
- }//else lost concentration
- agg.PAUSE = 1;
-}//do_cast_weaken
-
-
-void cast_weaken(int i_th, const String* victim, critter& pc) {
- critter* vict = NULL;
- int spell_num = WEAKEN_SKILL_NUM;
-
- vict = ROOM.haveCritNamed(i_th, victim, pc);
-
- if (!vict) {
- show("Whom do you wish to weaken??\n", pc);
- return;
- }//if
-
- if (vict->isMob()) {
- vict = mob_to_smob(*vict, pc.getCurRoomNum(), TRUE, i_th,
- victim, pc.SEE_BIT);
- }//if
-
- if (!ok_to_do_action(vict, "KMSVN", spell_num, pc)) {
- return;
- }//if
-
- do_cast_weaken(*vict, pc, FALSE, 0);
-}//do_cast_weaken
-
-
-
void do_cast_fly(critter& vict, critter& agg, int is_canned, int lvl) {
String buf(100);
int spell_num = FLY_SKILL_NUM;
@@ -2665,517 +2544,3 @@
}//do_cast_sober
-void do_cast_rust(critter &vict, critter &agg, int is_canned, int lvl)
-{
- String buf(100);
- int spell_num = RUST_SKILL_NUM;
- int spell_mana = get_mana_cost(spell_num, agg);
-
- int lost_con = FALSE;
-
- if (!is_canned)
- lvl = agg.LEVEL;
-
- // Time to rock n' roll.
- if ( is_canned || !(lost_con = lost_concentration(agg, spell_num))) {
-
- stat_spell_cell *ptr = is_affected_by(spell_num, vict);
-
- if ( ! is_canned )
- agg.MANA -= spell_mana;
-
- if ( ptr ) {
- ptr->bonus_duration += lvl / 2;
- } else {
- vict.affected_by.append(new stat_spell_cell(spell_num, lvl));
- vict.AC += RUST_EFFECT;
-
- // Cast on self
- if ( &vict == &agg ) {
- vict.show("You have rusted your own armor.", HL_DEF);
- } else {
- Sprintf(buf, "You rust %S's armor!\n",
- name_of_crit(vict, agg.SEE_BIT));
- agg.show(buf, HL_DEF);
- Sprintf(buf, "Your armor rusts before your very eyes!\n",
- name_of_crit(agg, vict.SEE_BIT));
- buf.Cap();
- vict.show(buf, HL_DEF);
- Sprintf(buf, "armor rusts before your very eyes.\n",
- name_of_crit(vict, ~0));
- pemote(buf, vict, room_list[agg.getCurRoomNum()], TRUE, &vict);
- }
- }
- }// end of "if - it - worked"
- else { // !canned && lost concentration
- agg.show(LOST_CONCENTRATION_MSG_SELF, HL_DEF);
- Sprintf(buf, "seems to have lost %s concentration.", get_his_her(agg));
- emote(buf, agg, room_list[agg.getCurRoomNum()], TRUE);
- if ( ! is_canned )
- agg.MANA -= spell_mana / 2;
- }
-
-}
-
-void cast_rust(int i_th, const String *victim, critter &pc)
-{
- critter *vict = NULL;
- int spell_num = RUST_SKILL_NUM;
-
- vict = ROOM.haveCritNamed(i_th, victim, pc);
-
- if (!vict) {
- pc.show("Whose armor do you wish to rust?", HL_DEF);
- return;
- }
-
- if (vict->isMob()) {
- vict = mob_to_smob(*vict, pc.getCurRoomNum(), TRUE, i_th, victim, pc.SEE_BIT);
- } // if
-
- if (!ok_to_do_action(vict, "KMVN", spell_num, pc)) {
- return;
- }
-
- do_cast_rust(*vict, pc, FALSE, 0);
-}
-
-void do_cast_disfavor(critter &vict, critter &agg, int is_canned, int lvl)
-{
- String buf(100);
- int spell_num = DISFAVOR_SKILL_NUM;
- int spell_mana = get_mana_cost(spell_num, agg);
-
- int lost_con = FALSE;
-
- if (!is_canned)
- lvl = agg.LEVEL;
-
- // Time to rock n' roll.
- if ( is_canned || !(lost_con = lost_concentration(agg, spell_num))) {
-
- stat_spell_cell *ptr = is_affected_by(spell_num, vict);
-
- if ( ! is_canned )
- agg.MANA -= spell_mana;
-
- if ( ptr ) {
- ptr->bonus_duration += lvl / 2;
- } else {
- vict.affected_by.append(new stat_spell_cell(spell_num, lvl));
- vict.HEAT_RESIS += DISFAVOR_EFFECT;
- vict.COLD_RESIS += DISFAVOR_EFFECT;
- vict.ELEC_RESIS += DISFAVOR_EFFECT;
- vict.SPEL_RESIS += DISFAVOR_EFFECT;
-
- // Cast on self
- if ( &vict == &agg ) {
- vict.show(
- "You call the spirits of the underworld to plague yourself.",
- HL_DEF);
- } else {
- Sprintf(buf, "You call the spirits of the underworld to plague %S.\n",
- name_of_crit(vict, agg.SEE_BIT));
- agg.show(buf, HL_DEF);
- Sprintf(buf, "You feel plagued by the spirits of the underworld.\n",
- name_of_crit(agg, vict.SEE_BIT));
- buf.Cap();
- vict.show(buf, HL_DEF);
- Sprintf(buf, "seems bothered.\n",
- name_of_crit(vict, ~0));
- emote(buf, vict, room_list[agg.getCurRoomNum()], TRUE, &vict);
- }
- }
- }// end of "if - it - worked"
- else { // !canned && lost concentration
- agg.show(LOST_CONCENTRATION_MSG_SELF, HL_DEF);
- Sprintf(buf, "seems to have lost %s concentration.", get_his_her(agg));
- emote(buf, agg, room_list[agg.getCurRoomNum()], TRUE);
- if ( ! is_canned )
- agg.MANA -= spell_mana / 2;
- }
-
-}
-
-void cast_disfavor(int i_th, const String *victim, critter &pc)
-{
- critter *vict = NULL;
- int spell_num = DISFAVOR_SKILL_NUM;
-
- vict = ROOM.haveCritNamed(i_th, victim, pc);
-
- if (!vict) {
- pc.show("Who do you wish to plague?", HL_DEF);
- return;
- }
-
- if (vict->isMob()) {
- vict = mob_to_smob(*vict, pc.getCurRoomNum(), TRUE, i_th, victim, pc.SEE_BIT);
- } // if
-
- if (!ok_to_do_action(vict, "KMVN", spell_num, pc)) {
- return;
- }
-
- do_cast_disfavor(*vict, pc, FALSE, 0);
-}
-
-void do_cast_remove_soul(critter &vict, critter &agg, int is_canned, int lvl)
-{
- String buf(100);
- int spell_num = REMOVE_SOUL_SKILL_NUM;
- int spell_mana = get_mana_cost(spell_num, agg);
-
- int lost_con = FALSE;
-
- if (!is_canned)
- lvl = agg.LEVEL;
-
- // Time to rock n' roll.
- if ( is_canned || !(lost_con = lost_concentration(agg, spell_num))) {
-
- stat_spell_cell *ptr = is_affected_by(spell_num, vict);
-
- if ( ! is_canned )
- agg.MANA -= spell_mana;
-
- if ( ptr ) {
- ptr->bonus_duration += lvl / 2;
- } else {
- vict.affected_by.append(new stat_spell_cell(spell_num, lvl));
- vict.SPEL_RESIS += REMOVE_SOUL_EFFECT;
-
- // Cast on self
- if ( &vict == &agg ) {
- vict.show(
- "Ok.",
- HL_DEF);
- } else {
- Sprintf(buf,
- "You cause %S to scream in agony as their soul wretches.\n",
- name_of_crit(vict, agg.SEE_BIT));
- agg.show(buf, HL_DEF);
- Sprintf(buf,
- "You scream in agony as your soul wretches.\n",
- name_of_crit(agg, vict.SEE_BIT));
- buf.Cap();
- vict.show(buf, HL_DEF);
- Sprintf(buf, "screams in agony as %s soul wretches.\n",
- get_his_her(vict));
- emote(buf, vict, room_list[agg.getCurRoomNum()], TRUE, &vict);
- }
- }
- }// end of "if - it - worked"
- else { // !canned && lost concentration
- agg.show(LOST_CONCENTRATION_MSG_SELF, HL_DEF);
- Sprintf(buf, "seems to have lost %s concentration.", get_his_her(agg));
- emote(buf, agg, room_list[agg.getCurRoomNum()], TRUE);
- if ( ! is_canned )
- agg.MANA -= spell_mana / 2;
- }
-
-}
-
-void cast_remove_soul(int i_th, const String *victim, critter &pc)
-{
- critter *vict = NULL;
- int spell_num = REMOVE_SOUL_SKILL_NUM;
-
- vict = ROOM.haveCritNamed(i_th, victim, pc);
-
- if (!vict) {
- pc.show("Who's soul do you wish to remove?", HL_DEF);
- return;
- }
-
- if (vict->isMob()) {
- vict = mob_to_smob(*vict, pc.getCurRoomNum(), TRUE, i_th, victim, pc.SEE_BIT);
- } // if
-
- if (!ok_to_do_action(vict, "KMVN", spell_num, pc)) {
- return;
- }
-
- do_cast_remove_soul(*vict, pc, FALSE, 0);
-}
-
-void do_cast_remove_hope(critter &vict, critter &agg, int is_canned, int lvl)
-{
- String buf(100);
- int spell_num = REMOVE_HOPE_SKILL_NUM;
- int spell_mana = get_mana_cost(spell_num, agg);
-
- int lost_con = FALSE;
-
- if (!is_canned)
- lvl = agg.LEVEL;
-
- // Time to rock n' roll.
- if ( is_canned || !(lost_con = lost_concentration(agg, spell_num))) {
-
- stat_spell_cell *ptr = is_affected_by(spell_num, vict);
-
- if ( ! is_canned )
- agg.MANA -= spell_mana;
-
- // Dont let the duration accumulate.
- if ( ptr ) {
- agg.show("You can do no more.", HL_DEF);
- } else {
- // Hardcoded in this lasts for 4 ticks.
- vict.affected_by.append(new stat_spell_cell(spell_num, 4));
-
- // Cast on self
- if ( &vict == &agg ) {
- vict.show("You become hopeless.", HL_DEF);
- } else {
- Sprintf(buf, "You are overcome with a feeling of hopelessness.\n");
- vict.show(buf, HL_DEF);
- Sprintf(buf,
- "quivers and drops to %s knees with a frail cry of hopelessness.\n",
- get_his_her(vict));
- emote(buf, vict, room_list[agg.getCurRoomNum()], TRUE, &vict);
- }
- }
- }// end of "if - it - worked"
- else { // !canned && lost concentration
- agg.show(LOST_CONCENTRATION_MSG_SELF, HL_DEF);
- Sprintf(buf, "seems to have lost %s concentration.", get_his_her(agg));
- emote(buf, agg, room_list[agg.getCurRoomNum()], TRUE);
- if ( ! is_canned )
- agg.MANA -= spell_mana / 2;
- }
-
-}
-
-void cast_remove_hope(int i_th, const String *victim, critter &pc)
-{
- critter *vict = NULL;
- int spell_num = REMOVE_HOPE_SKILL_NUM;
-
- vict = ROOM.haveCritNamed(i_th, victim, pc);
-
- if (!vict) {
- pc.show("Who do you want to psychologically destroy?", HL_DEF);
- return;
- }
-
- if (vict->isMob()) {
- vict = mob_to_smob(*vict, pc.getCurRoomNum(), TRUE, i_th, victim, pc.SEE_BIT);
- } // if
-
- if (!ok_to_do_action(vict, "KMVN", spell_num, pc)) {
- return;
- }
-
- do_cast_remove_hope(*vict, pc, FALSE, 0);
-}
-
-void do_cast_remove_karma(critter &vict, critter &agg, int is_canned, int lvl)
-{
- String buf(100);
- int spell_num = REMOVE_KARMA_SKILL_NUM;
- int spell_mana = get_mana_cost(spell_num, agg);
-
- int lost_con = FALSE;
-
- if (!is_canned)
- lvl = agg.LEVEL;
-
- // Time to rock n' roll.
- if ( is_canned || !(lost_con = lost_concentration(agg, spell_num))) {
-
- stat_spell_cell *ptr = is_affected_by(spell_num, vict);
-
- if ( ! is_canned )
- agg.MANA -= spell_mana;
-
- // Dont let the duration accumulate.
- if ( ptr ) {
- agg.show("You can do no more.", HL_DEF);
- } else {
- // Hardcoded in this lasts for 4 ticks.
- vict.affected_by.append(new stat_spell_cell(spell_num, 4));
-
- // Cast on self
- if ( &vict == &agg ) {
- vict.show("You remove your ability to gain mana.", HL_DEF);
- } else {
- Sprintf(buf, "You feel a cold sensation as your skin glows briefly.\n");
- vict.show(buf, HL_DEF);
- Sprintf(buf, "glows a faint blue and then returns to normal.\n");
- emote(buf, vict, room_list[agg.getCurRoomNum()], TRUE, &vict);
- }
- }
- }// end of "if - it - worked"
- else { // !canned && lost concentration
- agg.show(LOST_CONCENTRATION_MSG_SELF, HL_DEF);
- Sprintf(buf, "seems to have lost %s concentration.", get_his_her(agg));
- emote(buf, agg, room_list[agg.getCurRoomNum()], TRUE);
- if ( ! is_canned )
- agg.MANA -= spell_mana / 2;
- }
-
-}
-
-void cast_remove_karma(int i_th, const String *victim, critter &pc)
-{
- critter *vict = NULL;
- int spell_num = REMOVE_KARMA_SKILL_NUM;
-
- vict = ROOM.haveCritNamed(i_th, victim, pc);
-
- if (!vict) {
- pc.show("Who do you to mentally destroy?", HL_DEF);
- return;
- }
-
- if (vict->isMob()) {
- vict = mob_to_smob(*vict, pc.getCurRoomNum(), TRUE, i_th, victim, pc.SEE_BIT);
- } // if
-
- if (!ok_to_do_action(vict, "KMVN", spell_num, pc)) {
- return;
- }
-
- do_cast_remove_karma(*vict, pc, FALSE, 0);
-}
-
-void do_cast_sanctum_of_the_victim(critter &vict, critter &agg, int is_canned, int lvl)
-{
- String buf(100);
- int spell_num = SANCTUM_OF_THE_VICTIM_SKILL_NUM;
- int spell_mana = get_mana_cost(spell_num, agg);
-
- int lost_con = FALSE;
-
- if (!is_canned)
- lvl = agg.LEVEL;
-
- // Time to rock n' roll.
- if ( is_canned || !(lost_con = lost_concentration(agg, spell_num))) {
-
- stat_spell_cell *ptr = is_affected_by(spell_num, vict);
-
- if ( ! is_canned )
- agg.MANA -= spell_mana;
-
- if ( ptr ) {
- ptr->bonus_duration += 1;
- } else {
- vict.affected_by.append(new stat_spell_cell(spell_num, lvl));
- vict.DAM_REC_MOD += SANCTUM_EFFECT;
-
- // Cast on self
- if ( &vict == &agg ) {
- vict.show("You have made yourself frail.", HL_DEF);
- } else {
- Sprintf(buf, "You make %S frail!\n",
- name_of_crit(vict, agg.SEE_BIT));
- agg.show(buf, HL_DEF);
- Sprintf(buf, "You feel frail!\n",
- name_of_crit(agg, vict.SEE_BIT));
- buf.Cap();
- vict.show(buf, HL_DEF);
- }
- }
- }// end of "if - it - worked"
- else { // !canned && lost concentration
- agg.show(LOST_CONCENTRATION_MSG_SELF, HL_DEF);
- Sprintf(buf, "seems to have lost %s concentration.", get_his_her(agg));
- emote(buf, agg, room_list[agg.getCurRoomNum()], TRUE);
- if ( ! is_canned )
- agg.MANA -= spell_mana / 2;
- }
-
-}
-
-void cast_sanctum_of_the_victim(int i_th, const String *victim, critter &pc)
-{
- critter *vict = NULL;
- int spell_num = SANCTUM_OF_THE_VICTIM_SKILL_NUM;
-
- vict = ROOM.haveCritNamed(i_th, victim, pc);
-
- if (!vict) {
- pc.show("Who is your victim?", HL_DEF);
- return;
- }
-
- if (vict->isMob()) {
- vict = mob_to_smob(*vict, pc.getCurRoomNum(), TRUE, i_th, victim, pc.SEE_BIT);
- } // if
-
- if (!ok_to_do_action(vict, "KMVN", spell_num, pc)) {
- return;
- }
-
- do_cast_sanctum_of_the_victim(*vict, pc, FALSE, 0);
-}
-
-void do_cast_fear(critter &vict, critter &agg, int is_canned, int lvl)
-{
- String buf(100);
- int spell_num = FEAR_SKILL_NUM;
- int spell_mana = get_mana_cost(spell_num, agg);
-
- int lost_con = FALSE;
-
- if (!is_canned)
- lvl = agg.LEVEL;
-
- // Time to rock n' roll.
- if ( is_canned || !(lost_con = lost_concentration(agg, spell_num))) {
-
- if ( ! is_canned )
- agg.MANA -= spell_mana;
-
- vict.MOV = 0;
-
- // Cast on self
- if ( &vict == &agg ) {
- vict.show("You idiot, now you can't move.", HL_DEF);
- } else {
- Sprintf(buf, "You put fear into the heart of %S\n",
- name_of_crit(vict, agg.SEE_BIT));
- agg.show(buf, HL_DEF);
- Sprintf(buf, "Your face turns a pale white. You are afraid.\n",
- name_of_crit(agg, vict.SEE_BIT));
- buf.Cap();
- vict.show(buf, HL_DEF);
- Sprintf(buf, "face turns a pale white.\n");
- pemote(buf, vict, room_list[agg.getCurRoomNum()], TRUE, &vict);
- }
- }// end of "if - it - worked"
- else { // !canned && lost concentration
- agg.show(LOST_CONCENTRATION_MSG_SELF, HL_DEF);
- Sprintf(buf, "seems to have lost %s concentration.", get_his_her(agg));
- emote(buf, agg, room_list[agg.getCurRoomNum()], TRUE);
- if ( ! is_canned )
- agg.MANA -= spell_mana / 2;
- }
-
-}
-
-void cast_fear(int i_th, const String *victim, critter &pc)
-{
- critter *vict = NULL;
- int spell_num = FEAR_SKILL_NUM;
-
- vict = ROOM.haveCritNamed(i_th, victim, pc);
-
- if (!vict) {
- pc.show("In whom do you wish to instill fear?", HL_DEF);
- return;
- }
-
- if (vict->isMob()) {
- vict = mob_to_smob(*vict, pc.getCurRoomNum(), TRUE, i_th, victim, pc.SEE_BIT);
- } // if
-
- if (!ok_to_do_action(vict, "KMVN", spell_num, pc)) {
- return;
- }
-
- do_cast_fear(*vict, pc, FALSE, 0);
-}
Modified: trunk/mud/grrmud/server/spells2.h
===================================================================
--- trunk/mud/grrmud/server/spells2.h 2007-06-10 22:15:12 UTC (rev 942)
+++ trunk/mud/grrmud/server/spells2.h 2007-06-11 02:12:11 UTC (rev 943)
@@ -44,12 +44,7 @@
#define PRISMATIC_GLOBE_EFFECT_MOV -50
#define MAGIC_SHIELD_AC_EFFECT -10
#define MAGIC_SHIELD_SAC_EFFECT -50 /* spell resistance */
-#define RUST_EFFECT 25 /* a/c */
-#define DISFAVOR_EFFECT 20 /* all resistances */
-#define REMOVE_SOUL_EFFECT 100 /* spell resistance */
-#define SANCTUM_EFFECT 30 /* dam receive mod */
-
void cast_blindness(int i_th, const String* dr, critter& agg);
void do_cast_blindness(critter& targ, critter& pc, int is_canned, int lvl);
@@ -100,9 +95,6 @@
void do_cast_bind_wound(critter& vict, critter& agg, int is_canned,
int lvl);
-void cast_weaken(int i_th, const String* vict, critter& agg);
-void do_cast_weaken(critter& vict, critter& agg, int is_canned, int lvl);
-
void cast_remove_curse(int i_th, const String* vict, critter& agg);
void do_cast_remove_curse(critter& vict, critter& agg, int is_canned, int lvl);
void do_cast_remove_curse(critter& vict, object& agg, int is_canned, int lvl);
@@ -142,28 +134,6 @@
void cast_sober(int i_th, const String* vict, critter& agg);
void do_cast_sober(critter& vict, critter& agg, int is_canned, int lvl);
-// new for Necromancer class
-void cast_rust(int i_th, const String* vict, critter& agg);
-void do_cast_rust(critter& vict, critter& agg, int is_canned, int lvl);
-
-void cast_disfavor(int i_th, const String* vict, critter& agg);
-void do_cast_disfavor(critter& vict, critter& agg, int is_canned, int lvl);
-
-void cast_remove_soul(int i_th, const String* vict, critter& agg);
-void do_cast_remove_soul(critter& vict, critter& agg, int is_canned, int lvl);
-
-void cast_remove_hope(int i_th, const String* vict, critter& agg);
-void do_cast_remove_hope(critter& vict, critter& agg, int is_canned, int lvl);
-
-void cast_remove_karma(int i_th, const String* vict, critter& agg);
-void do_cast_remove_karma(critter& vict, critter& agg, int is_canned, int lvl);
-
-void cast_sanctum_of_the_victim(int i_th, const String* vict, critter& agg);
-void do_cast_sanctum_of_the_victim(critter& vict, critter& agg, int is_canned, int lvl);
-
-void cast_fear(int i_th, const String* vict, critter& agg);
-void do_cast_fear(critter& vict, critter& agg, int is_canned, int lvl);
-
///************** auxillary functions *************///
#endif
Modified: trunk/mud/grrmud/server/trv_spll.cc
===================================================================
--- trunk/mud/grrmud/server/trv_spll.cc 2007-06-10 22:15:12 UTC (rev 942)
+++ trunk/mud/grrmud/server/trv_spll.cc 2007-06-11 02:12:11 UTC (rev 943)
@@ -86,8 +86,8 @@
}//if
ptr->HP += (d(8, (40 + lvl/2)));
- if (ptr->HP > ptr->HP_MAX)
- ptr->HP = ptr->HP_MAX;
+ if (ptr->getHP() > ptr->getHP_MAX())
+ ptr->setHP(ptr->getHP_MAX());
Sprintf(buf, "%S heals you and your companions.\n",
name_of_crit(agg, ptr->SEE_BIT));
More information about the ScryMUD
mailing list