Skip to content

Commit

Permalink
Fix for specialization not taking. Add necromancer profiession option…
Browse files Browse the repository at this point in the history
…s. Initial checkin for de-engraving

Fix for specialization not taking.
Issue was an order problem. Specialization was being added out of
bounds.
Add necromancer profession options.
Initial checkin for de-engraving
  • Loading branch information
omnidecker committed Aug 9, 2023
1 parent 43c39a0 commit c26bbcd
Show file tree
Hide file tree
Showing 2 changed files with 148 additions and 2 deletions.
145 changes: 145 additions & 0 deletions vme/zone/midgaard.zon
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,134 @@ code
}
dilend /* wand_charge */

dilbegin deengrave();
var
pc : unitptr;
ting : unitptr;
pris : integer;
i : integer;
text : string;
olddescr : extraptr;
cash : string;
engrv : string;
engrvstr : stringlist;
newtitle : stringlist;
newdescr : stringlist;
code
{
heartbeat := PULSE_SEC*4;

:start:
wait(SFB_DONE,command("give")and(self == target));
if(not visible(self,medium))goto start;
if(not visible(self,activator))
{
exec("sigh",self);
exec("say How can I deal with someone I can't see?", self );
exec("drop"+medium.name,self);
goto start;
}
pc := activator;
ting := medium;
secure(pc,nopc);
secure(ting,ingenting);
dilcopy("busy@function(Please wait; I am working right now.)",self);

if((ting.type != UNIT_ST_OBJ)or(ting.objecttype == ITEM_LIGHT)
or(ting.objecttype == ITEM_SCROLL)or(ting.objecttype == ITEM_FOOD)
or(ting.objecttype == ITEM_BOOK)or(ting.objecttype == ITEM_SPELL)
or(MAT_CLOTH_STR in ting.extra)or(MAT_FIRE_STR in ting.extra)or
((ting.objecttype == ITEM_ARMOR)and(ting.value[0]==0)))
{
exec("say Sorry, it is beyond my ability to remove the engraving from this.",self);
:giveback:
unsecure(ting);
link(ting, pc);
act("$3n gives $2n to $1n.",A_SOMEONE,pc,ting,self,TO_REST);
act("$3n gives $2n to you.",A_SOMEONE,pc,ting,self,TO_CHAR);
i:=dildestroy("busy@function",self);
unsecure (pc);
goto start;
}

if(not("engraving" in ting.extra))
{
exec("say Hmm... this item doesn't have an engraving, "+pc.name+
".",self);
goto giveback;
}

pause;
pris := (5*PLATINUM_MULT)+((ting.rent)*3);
cash := moneystring(pris,TRUE);
exec("say Removing this engraving will cost you "+cash+".",self);
if(not transfermoney(pc,self,pris))
{
exec("say ...which you don't have apparently.",self);
exec("say Come back when you are richer, "+pc.name+".",self);
goto giveback;
}
engrvstr := split(ting.extra.["engraving"].descr, "It says ");
newtitle := split(ting.title, " (engraved: " + engrvstr.[1] + ")");

if (length(newtitle) == 2){
ting.title := newtitle.[0] + newtitle.[1];
}
else{
ting.title := newtitle.[0];
}
subextra(ting.extra, "engraving");
olddescr := "" in ting.extra;
log(olddescr.descr);
engrv := "<br/>" + engrvstr.[1] + " is engraved on it.";
log(engrv);
newdescr := split(olddescr.descr, engrv);
log(newdescr.[0]);
if (length(newdescr) == 2){
olddescr.descr := newdescr.[0] + newdescr.[1];
}
else{
olddescr.descr := newdescr.[0];
}

/*blah := "" in ting.extra;
if(blah)
{
blah.descr := blah.descr + "<br/>'" + text + "' is engraved on it.";
addextra( ting.extra, {"engraving"}, "It says '" + text + "'" );
}
else
{
addextra(ting.extra,{"dummy"},"You see nothing special.<br/>'"+text+
"' is engraved on it.");
blah := "dummy" in ting.extra;
substring( blah.names, "dummy" );

}
pause;
*/
exec("say There, hope you like it, " + pc.name + "!", self);
destroy(self.inside);
goto giveback;


:nopc:
exec("shrug ",self);
exec("drop "+ting.name,self);
i:=dildestroy("busy@function",self);
unsecure(pc);
unsecure(ting);
goto start;

:ingenting:
exec("say Huh? Where did that ting go?",self);
I:=dildestroy("busy@function",self);
unsecure(ting);
unsecure(pc);
goto start;

}
dilend

dilbegin engrave();
var
Expand Down Expand Up @@ -6043,6 +6171,23 @@ dilcopy engrave@midgaard();

end

reejay
names {"Reejay","deengraver"}
title "Reejay the deengraver"
descr "Reejay the deengraver sits at his table, hard at work."
extra {}
"A black-haired and dark-skinned woman, apparently not native to the city of
Midgaard. She is the best in his field and can offer you an engraving for
a reasonable price."
M_SHOP_KEEPER(47,SEX_FEMALE,RACE_HUMAN)
money 3 IRON_PIECE
flags {UNIT_FL_NO_TELEPORT}
weight -199
dilcopy deengrave@midgaard();

end


baker

names {"baker", "Barnie"}
Expand Down
5 changes: 3 additions & 2 deletions vme/zone/professions.zon
Original file line number Diff line number Diff line change
Expand Up @@ -372,9 +372,10 @@ code
pc.profession := newProf;

sl := {PROFESSION_STRINGS};
insert(exd.vals, length(exd.names), newProf);
addstring(exd.names, sl.[newProf]);
exd.descr := exd.descr + desc + "<br/>";
insert(exd.vals, length(exd.names), newProf);

return;
}
dilend
Expand Down Expand Up @@ -462,7 +463,7 @@ code
return;

:profok:
AddNonSpecProf(pc, newProf, "Non Specilization profession change."); // xxxx
AddNonSpecProf(pc, newProf, "Non-specialization profession change."); // xxxx
return;
}
dilend
Expand Down

0 comments on commit c26bbcd

Please sign in to comment.