Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
scottgb
Newbie


Joined: 14 Jun 2003
Posts: 2

PostPosted: Sat Jun 14, 2003 9:56 pm   

yet another eq database question
 
I got this eq database working with the exception of a couple of lines. The ones that don't work are using variables in the addkey function, so I thought that might have something to do with it? It happens with "wear locations" and "extra flags", and one of two others.
I'd be really grateful if anyone can spot something that might be wrong. I've been trying to figure it out for a couple of days now and think I've reached a dead end.
I put red coloring on the ones I know don't work, but I think it's any of them that use the format of:
   #ADDKEY newrecord Field @some_variable


#CLASS {equip_id}
#VAR extraflags {magic|hum|glow|bless|nosave|anti-evil|anti-good|anti-neutral|burn-proof|nodrop|melt-drop|noremove|nodisarm}
#VAR tempextraflags {}
#VAR wearflags {light|finger|neck|body|head|legs|feet|hands|arms|shield|torso|waist|wrist|wield|hold|ears|ear|eyes|back|float}
#VAR tempwearflags {}
#VAR weaptypes {axe|dagger|flail|mace|polearm|spear|sword|whip|exotic}
#VAR tempweaptypes {}
#VAR weapflags {flaming|changing|frost|poison|sharp|shocking|vampiric|vorpal}
#VAR tempweapflags {}
#TRIGGER {^Object '(*)' is type (%w)$}
  {#VAR newrecord %null; #ADDKEY newrecord Name {%1};
  #ADDKEY newrecord Type %2; #TEMP {$}
  {#DBLOAD equip;
  #NEW All @newrecord;
  #DBRESET ; #UNVAR newrecord} }
#TRIGGER {^Extra flags: (*).$}
  {#VAR tempextraflags %null _nodef equip_id;#LOOP %numwords( %1)
  {#IF %ismember( %word( {%1}, %i), @extraflags)
  {#ADDITEM tempextraflags %word( {%1}, %i)}
  {#NOOP}};
  #ADDKEY newrecord Extra_flags @tempextraflags}

#TRIGGER {^Weight is (%d), value is (%d), level is (%d).$} {#ADDKEY newrecord Weight %1;#ADDKEY newrecord Value %2;#ADDKEY newrecord Level %3}
#TRIGGER {^Worn (*).$} {#VAR tempwearflags %null _nodef equip_id;#LOOP %numwords( %1) {#IF %ismember( %word( {%1}, %i), @wearflags) {#ADDITEM tempwearflags %word( {%1}, %i)} {#NOOP}};#ADDKEY newrecord Wear @tempwearflags}
#TRIGGER {^Armor class is (%d) pierce, (%d) bash, (%d) slash, and (%d) vs. magic.$} {#ADDKEY newrecord AC_pierce %1;#ADDKEY newrecord AC_bash %2;#ADDKEY newrecord AC_slash %3;#ADDKEY newrecord AC_magic %4}
#TRIGGER {^Weapon type is (*).$} {#VAR tempweaptypes %null _nodef equip_id;#LOOP %numwords( %1) {#IF %ismember( %word( {%1}, %i), @weaptypes) {#ADDITEM tempweaptypes %word( {%1}, %i)} {#NOOP}};#ADDKEY newrecord Weap_type @tempweaptypes}
#TRIGGER {^Damage is (%d)d(%d) ~(average (%d)~).$} {#ADDKEY newrecord Weap_numdice %1;#ADDKEY newrecord Weap_dicetype %2;#ADDKEY newrecord Weap_avgdam %3}
#TRIGGER {^Damage type is (*).$} {#ADDKEY newrecord Weapon_damage_type %1}
#TRIGGER {^Weapons flags: (*).$} {#VAR tempweapflags %null _nodef equip_id;#LOOP %numwords( %1) {#IF %ismember( %word( {%1}, %i), @weapflags) {#ADDITEM tempweapflags %word( {%1}, %i)} {#NOOP}};#ADDKEY newrecord Weap_flags @tempweapflags}
#TRIGGER {^Affects damage roll by (%d).$} {#ADDKEY newrecord AFF_dam %1}
#TRIGGER {^Affects hit roll by (%d).$} {#ADDKEY newrecord AFF_hit %1}
#TRIGGER {^Affects hp by (%d).$} {#ADDKEY newrecord AFF_hp %1}
#TRIGGER {^Affects mana by (%d).$} {#ADDKEY newrecord AFF_mana %1}
#TRIGGER {^Affects moves by (%d).$} {#ADDKEY newrecord AFF_moves %1}
#TRIGGER {^Affects armor class by (%d).$} {#ADDKEY newrecord AFF_AC %1}
#TRIGGER {^Affects strength by (%d).$} {#ADDKEY newrecord AFF_str %1}
#TRIGGER {^Affects intelligence by (%d).$} {#ADDKEY newrecord AFF_int %1}
#TRIGGER {^Affects wisdom by (%d).$} {#ADDKEY newrecord AFF_wis %1}
#TRIGGER {^Affects dexterity by (%d).$} {#ADDKEY newrecord AFF_dex %1}
#TRIGGER {^Affects constitution by (%d).$} {#ADDKEY newrecord AFF_con %1}
#TRIGGER {^Affects luck by (%d).$} {#ADDKEY newrecord AFF_luc %1}
#TRIGGER {^This item is from the halls of (*).$} {#ADDKEY newrecord Zone {%1}}
#TRIGGER {^Adds flying affect.$} {#ADDKEY newrecord AFF_flying}
#TRIGGER {^Adds sanctuary affect.$} {#ADDKEY newrecord AFF_sanc}
#TRIGGER {^Adds regeneration affect.$} {#ADDKEY newrecord AFF_regen}
#TRIGGER {^Adds haste affect.$} {#ADDKEY newrecord AFF_haste}
#TRIGGER {^Adds invis affect.$} {#ADDKEY newrecord AFF_invis}
#TRIGGER {^Adds resistance to magic.$} {#ADDKEY newrecord AFF_magicres}
#TRIGGER {^Adds underwater_breathing affect.$} {#ADDKEY newrecord AFF_underwater}
#TRIGGER {^Affects save vs spell by (%d).$} {#ADDKEY newrecord AFF_saves %1}
#CLASS 0
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5187

PostPosted: Sun Jun 15, 2003 6:11 am   
 
The ones you highlighted in red look likely to be a problem in the #IF syntax.

#IF (%ismember( %word( {%1}, %i), @wearflags)) {#ADDITEM tempwearflags %word( {%1}, %i)} {#NOOP}

I would reccommend using quotes instead of braces around the %1's, but both work in this case.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net