I was bored, so I decided to rewrite a spec-proc an acquaintance had on their MUD with Trigedit.
You can find the original here
github.com/quixadhal/wileymud/blob/master/src/spec_procs.c
, it is called BerserkerAxe in that file.
To recreate it in trigedit is must be written as two separate scripts, one of type command, the other of type random.
Code:
Name: 'Berserker Axe', VNum: [13442], RNum: [ 1726]
Trigger Intended Assignment: Objects
Trigger Type: Command , Numeric Arg: 7, Arg list: *
Commands:
if %actor.level% > 30
return 0
halt
end
if %cmd.mudcommand% == flee
%echoaround% %actor% looks abashed and then seems taken by a sudden fury!
%send% %actor% You are suddenly furious at your cowardice... You fight on!
elseif %cmd.mudcommand% == remove
set stringcomparison 'druegar 'berserker 'axe
if !%stringcomparison.contains('%arg%)% || %arg.strlen% < 1
return 0
else
%echoaround% %actor% %actor.name% clutches a gigantic axe tightly and glares at you.
%send% %actor% You cannot bear to relinquish your weapon while you yet live!
end
elseif %cmd.mudcommand% == sell
set stringcomparison 'druegar 'berserker 'axe
if !%stringcomparison.contains('%arg%)% || %arg.strlen% < 1
return 0
else
%echoaround% %actor% %actor.name% clutches a gigantic axe tightly and glares at you.
%send% %actor% Not for all the gold in the world!
end
elseif %cmd.mudcommand% == junk
set stringcomparison 'druegar 'berserker 'axe
if !%stringcomparison.contains('%arg%)% || %arg.strlen% < 1
return 0
else
%echoaround% %actor% %actor.name% seems nervous and quickly looks over a giant axe.
%send% %actor% It hurts to even joke about destroying your weapon!
end
elseif %cmd.mudcommand% == sleep
%echoaround% %actor% %actor.name% suddenly snaps to attention and begins drooling.
%send% %actor% No time to sleep! There are too many things to kill!
elseif %cmd.mudcommand% == rest
%echoaround% %actor% %actor.name% sits down and fidgets.
%send% %actor% Just for a moment. There are things that must die!
return 0
elseif %cmd.mudcommand% == cast
%echoaround% %actor% %actor.name% sneers, 'A pox on all filthy magi and their weakling spells!
%send% %actor% You have no need for weakling tricks! FIGHT!
else
return 0
end
Code:
Name: 'Berserker Axe Random Stuff', VNum: [13443], RNum: [ 1727]
Trigger Intended Assignment: Objects
Trigger Type: Random , Numeric Arg: 100, Arg list: None
Commands:
if %self.carried_by.strlen% > 0
set actor %self.carried_by%
elseif %self.worn_by.strlen% > 0
set actor %self.worn_by%
else
halt
end
if %actor.level% > 32 || %actor.pos% == sleeping || %actor.room.roomflag(peaceful)% || %actor.fighting%
else
if %actor.pos% == resting
%echoaround% %actor% %actor.name% jumps up and stares all around with a savage grin!
%send% %actor% You can't stand sitting still any longer!
nop %actor.pos(standing)%
end
set person %actor.room.people%
if %random.99% < 80
set killsomeone 1
end
while %people%
set next %people.next_in_list%
if %people% == %actor% || %people.level% > 30 || (%actor.level% < 3 && %people.level% > 5)
else
eval doublelevel %actor.level% * 2
eval halflevel %actor.level% / 2
*TBA technically has no races, but if it did then race would be super trivial to add, so I'm just pretending that TBA has races
if %people.level% > %doublelevel% || %people.level% < %halflevel% || %people.race% == dwarf
else
if %people.race% == elf
%force% %actor% kill %people.name%
%echoaround% %actor% %actor.name% charges %people.name%, screaming 'DIE Filthy ELF!!!'
%send% %actor% Puny %people.name% is elven! You must KILL!!!!
halt
else
if %killsomeone%
%force% %actor% kill %people.name%
%echoaround% %actor% %actor.name% charges %people.name%, screaming 'You MUST DIE!!!'
%send% %actor% You cannot control your hatred of %people.name%, Arrrghh!
halt
else
%echoaround% %actor% %actor.name% stares at %people.name% with undisguised contempt.
end
end
end
end
set people %next%
done
end