Welcome to CWG Project Home
Search
Home · Topics · Downloads · Your Account · Forums · Top 10
 
 


 
 
Who is Online

There are currently, 135 guest(s) and 20 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
 
 

 
 
Modules

· Home
· Content
· Downloads
· FAQ
· Feedback
· Forums
· Journal
· Members List
· Private Messages
· Recommend Us
· Reviews
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Top 10
· Topics
· Web Links
· Your Account
 
 

 
 
Search



 
 

 
  cwg.lazuras.org :: View topic - disease script?
 Forum FAQForum FAQ   SearchSearch   UsergroupsUsergroups   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

disease script?

 
Post new topic   Reply to topic    cwg.lazuras.org Forum Index -> Builder Lounge
View previous topic :: View next topic  
Author Message
Nemmie
Quizzical N00b


Joined: Apr 11, 2007
Posts: 8

PostPosted: Fri Jun 29, 2007 8:26 am    Post subject: disease script? Reply with quote

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?
Back to top
View user's profile Send private message
Fizban
CWG - Honored Elder


Joined: Nov 26, 2005
Posts: 1390
Location: Shelby Township, Michigan

PostPosted: Fri Jun 29, 2007 6:19 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Mordecai
CWG - Honored Elder


Joined: Mar 31, 2004
Posts: 316
Location: New Zealand

PostPosted: Fri Jun 29, 2007 9:12 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Fizban
CWG - Honored Elder


Joined: Nov 26, 2005
Posts: 1390
Location: Shelby Township, Michigan

PostPosted: Fri Jun 29, 2007 10:18 pm    Post subject: Reply with quote

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


Attach all of these to object 57796:

Code:

Name: '!Inventory/!Drop',  VNum: [57749], RNum: [ 3782]
Trigger Intended Assignment: Objects
Trigger Type: Command , Numeric Arg: 2, Arg list: *
Commands:
if %cmd.mudcommand% == inventory
  eval roomnum %actor.room%
  eval roomstart %roomnum.vnum%
  remote roomstart %actor.id%
  %teleport% %actor% 0
elseif %cmd.mudcommand% == drop && %arg% /= %self.name%
else
  return 0
end


Code:

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

_________________

DG Script Reference Forum
4 Dimensions
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Molly
CWG - Member


Joined: Apr 14, 2007
Posts: 57

PostPosted: Sat Jun 30, 2007 2:29 am    Post subject: Reply with quote

*cough*
I don't think this is a really good idea.

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... Razz

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.
Back to top
View user's profile Send private message
Fizban
CWG - Honored Elder


Joined: Nov 26, 2005
Posts: 1390
Location: Shelby Township, Michigan

PostPosted: Fri Jun 20, 2008 4:14 pm    Post subject: Reply with quote

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

_________________

DG Script Reference Forum
4 Dimensions
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    cwg.lazuras.org Forum Index -> Builder Lounge All times are GMT - 4 Hours
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

Powered by phpBB © 2001, 2005 phpBB Group
 
 


 
 


All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest ? 2002 by me
You can syndicate our news using the file backend.php or ultramode.txt
PHP-Nuke Copyright © 2005 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.26 Seconds