Code:
Name: 'Mob Random Example', VNum: [ 61], RNum: [ 61]
Trigger Intended Assignment: Mobiles
Trigger Type: Random , Numeric Arg: 2, Arg list: None
Commands:
* By Rumble of The Builder Academy tbamud.com 9091
* With random triggers ACTOR is NOT defined. So set it.
set actor %random.char%
wait 1 sec
say Hey! You don't belong here!
emote mumbles, 'Now what was that spell...'
wait 1 sec
* Senile old guard casts random spells on intruders.
* Don't cast if incapacitated
if %self.hitp% > 0
switch %random.17%
case 1
dg_cast 'cure light' %actor%
break
case 2
dg_cast 'magic missile' %actor%
break
case 3
dg_cast 'detect invisibility'
break
case 4
dg_cast 'detect magic'
break
case 5
dg_cast 'bless' %actor%
break
case 6
dg_cast 'heal' %actor%
break
case 7
dg_cast 'infravision'
break
case 8
dg_cast 'invisibility' %actor%
break
case 9
dg_cast 'armor' %actor%
break
case 10
dg_cast 'strength' %actor%
break
case 11
dg_cast 'sleep' %actor%
break
case 12
dg_cast 'blindness' %actor%
break
case 13
dg_cast 'detect poison' %actor%
break
case 14
dg_cast 'curse' %actor%
break
case 15
dg_cast 'poison' %actor%
break
case 16
if %actor.align% > 0
dg_cast 'dispel good' %actor%
else
dg_cast 'dispel evil' %actor%
end
break
default
* Senile magi "almost" kills himself.
say That wasn't right...
%echo% A failed spell backfires on the mage!
%damage% %self% %self.hitp%
break
done
end
for TBA.