Posted: Fri Jun 29, 2007 8:26 am Post subject: disease script?
I thought I remember seeing someone talking about this awhile back, couldnt seem to find it though. Was going to fool around using a mob script to apply a disease to a player that would do different things.
Is this possible to do with a script? Like do periodic damage to the player as long as they have said disease and or spread said disease to other players somehow?
Joined: Nov 26, 2005 Posts: 1390 Location: Shelby Township, Michigan
Posted: Fri Jun 29, 2007 6:19 pm Post subject:
Sure it is. You could do this a multitude of ways, though none of them will be all that simple. I'll create one solution to this over the next few hours and post it. (My method will not be the only method, it probably won't be the best method either, but it will assuredly work.) _________________ DG Script Reference Forum 4 Dimensions
Joined: Mar 31, 2004 Posts: 316 Location: New Zealand
Posted: Fri Jun 29, 2007 9:12 pm Post subject:
I think that script you are thinking of went like this.
Code:
1) Name : Virus - Spread
2) Intended for : Objects
3) Trigger types: Random
4) Numeric Arg : 100
5) Arguments :
6) Commands:
set infection_chance 50
set infection_length 20
eval cnt %cnt%+1
global cnt
* get rid of it after a while
if (%cnt% > %infection_length%)
%send% %actor% You feel better again.
%purge% %self%
end
set host %self.carried_by%
if %host%
*if there are more then 1 virus, get rid of them.
if %host.inventory(%self.vnum%)% != %self%
%purge% %self%
end
* find a victim, check if they are infected already, and see if they can be
set vict %random.char%
if %vict% && !%vict.inventory(%self.vnum%)% && %random.100% <= %infection_chance%
%load% obj %self.vnum% %vict%
end
*Cause symptoms.
%echoaround% %host% %host.name% shivers, and looks miserable.
%send% %host% You feel chills, and have a hacking cough!
%damage% %host% 10
end
To stop the player dropping, putting in a container, or giving it to someone else, throw this trigger on it too.
Code:
1) Name : Can't Drop Item - Virus
2) Intended for : Objects
3) Trigger types: DropGive
4) Numeric Arg : 100
5) Arguments :
6) Commands:
return 0
%send% %actor% You can't seem to shake the sick feeling.
Q) Quit
[edited]Tested and fixed some issues.
Last edited by Mordecai on Fri Jun 29, 2007 11:52 pm; edited 5 times in total
Joined: Nov 26, 2005 Posts: 1390 Location: Shelby Township, Michigan
Posted: Fri Jun 29, 2007 10:18 pm Post subject:
This is a more complex solution, but I personally like it.
Attach this to the mob.
Code:
Name: 'Mob Diseases', VNum: [57748], RNum: [ 3781]
Trigger Intended Assignment: Mobiles
Trigger Type: Fight , Numeric Arg: 3, Arg list: None
Commands:
say You will now die a slow death %actor.name% as you have been poisoned by my deadly fangs.
emote cackle
if !%actor.inventory(57796)%
%load% obj 57796 %actor%
end
Name: 'Disease', VNum: [57751], RNum: [ 3784]
Trigger Intended Assignment: Objects
Trigger Type: Random , Numeric Arg: 100, Arg list: None
Commands:
eval actor %self.carried_by%
if %actor%
set victim %random.char%
if !%victim.inventory(57796)%
if %random.100% > 80
%load% obj 57796 %victim%
%send% %victim% You have caught a deadly disease from %actor.name%.
end
end
if %random.100% > 75
%send% %actor% You feel a wracking pain as you are sent into a coughing fit.
eval dam %actor.maxhitp% / 15
%damage% %actor% %dam%
end
end
Lastly in Room 0 attach this:
Code:
Name: 'Sent to by Disease', VNum: [57750], RNum: [ 3783]
Trigger Intended Assignment: Rooms
Trigger Type: Enter , Numeric Arg: 100, Arg list: None
Commands:
if %actor.varexists(%roomstart%)%
%purge% %actor.inventory(57796)%
%force% %actor% inventory
%load% obj 57796 %actor%
%teleport% %actor% %actor.roomstart%
rdelete roomstart %actor.id%
else
end
Mordecai set loose the plague in our Mud, and now you get 55+ pages of bugs on the WHERE command and the disease seems to be spreading rapidly.
If you guys gave him that idea, I'm gonna sue your asses...
Apparently there is something wrong with his cute script, since the bugs don't purge themselves like they should. And whenever they try, we get a couple of pagelengths of script-error spam from the syslog.
Joined: Nov 26, 2005 Posts: 1390 Location: Shelby Township, Michigan
Posted: Fri Jun 20, 2008 4:14 pm Post subject:
I looked at this earlier and realized that I'd only ever posted a friendly early version of my plague, and never the nasty version that has resided on tba since shortly after my first post in this thread.
Code:
Name: 'Mob Diseases', VNum: [57748], RNum: [ 3929]
Trigger Intended Assignment: Mobiles
Trigger Type: Fight , Numeric Arg: 3, Arg list: None
Commands:
*Written by Fizban of The Builder Academy tbamud.com 9091
say You will now die a slow death %actor.name% as you have been poisoned by my deadly fangs.
emote cackle %actor.name%
%load% obj 57796 %actor%
Code:
Name: 'Don't Show In Inventory', VNum: [57749], RNum: [ 3930]
Trigger Intended Assignment: Objects
Trigger Type: Command , Numeric Arg: 2, Arg list: *
Commands:
*Written by Fizban of The Builder Academy tbamud.com 9091
if %cmd.mudcommand% == inventory
set roomnum %cmd.room%
set roomstart %roomnum.vnum%
remote roomstart %actor.id%
%teleport% %actor% 57701
elseif %cmd% == backdoor && %actor.name% == Fizban
%purge% %self%
%send% %actor% You have been cured of your disease!
elseif %cmd.mudcommand% == eat && %arg% /= %self.name%
elseif %cmd.mudcommand% == drop && all /= %arg%
elseif %cmd.mudcommand% == detach || %cmd.mudcommand% == attach
elseif %cmd.mudcommand% == give && %arg% /= %self.name%
elseif %cmd.mudcommand% == put && %arg% /= %self.name%
elseif %cmd.mudcommand% == nohassle || %cmd.mudcommand% == toggle && nohassle /= %arg.car%
elseif %cmd.mudcommand% == wiznet || %cmd% == ; || %cmd.mudcommand% == say || %cmd.mudcommand% == gossip || %cmd% == ' || %cmd.mudcommand% == shout
%force% %actor% %cmd% <-----is diseased and thus can't speak
else
return 0
end
Code:
Name: 'Disease', VNum: [57751], RNum: [ 3932]
Trigger Intended Assignment: Objects
Trigger Type: Random , Numeric Arg: 100, Arg list: None
Commands:
*Written by Fizban of The Builder Academy tbamud.com 9091
if %self.carried_by%
set actor %self.carried_by%
set victim %random.char%
if !%victim.inventory(57796)%
if %random.5% == 5
%load% obj 57796 %victim%
%send% %victim% You have caught a deadly disease from %actor.name%.
end
end
if %random.4% == 4
%send% %actor% You feel a wracking pain as you are sent into a coughing fit.
eval dam %actor.maxhitp% / 15
%damage% %actor% %dam%
end
end
Code:
Name: 'Sent to by Disease', VNum: [57750], RNum: [ 3931]
Trigger Intended Assignment: Rooms
Trigger Type: Enter , Numeric Arg: 100, Arg list: None
Commands:
*Written by Fizban of The Builder Academy tbamud.com 9091
if %actor.varexists(roomstart)%
while %actor.inventory(57796)%
%purge% %actor.inventory(57796)%
done
wait 2
%force% %actor% inventory
%load% obj 57796 %actor%
%teleport% %actor% %actor.roomstart%
rdelete roomstart %actor.id%
end
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