Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Walking Dead (tv) type zombies
Author Message
Capes
Journeyman
*

Posts: 57
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Mar 2018
Reputation: 0



Post: #1
Walking Dead (tv) type zombies
Here's a quick infectious zombie script. These zombies inflict an infection on players & npc's. The infection rots the person away (no cure) and when they die - they turn to zombies too. You can prevent the corpse from turning if you drop a lit torch on it.

0.56d version using newest version of old client.

PHP Code:
/////////////////////////////////////////////////////////////////////////////////
////  Zombie Infection script
////    by Capes 2018-5-10
/////////////////////////////////////////////////////////////////////////////////
[COMMENT zombie_infection_info]
An infected zombie 
    
moves faster
    
npc's & player's hit by them must pass a 50check else they become infected (A permanent buff).
    - 
when that npc/player dies it's corpse becomes an infected zombie, with all the inventory on them
    - once infected there is no cure
    - dropping a lit torch on an infected corpse will destroy this infection

[DEFNAME infection_settings]
CORPSE_to_ZOMBIE_delay = 120 //2 mins
INFECTION_rate = 10    //10 secs
INFECTION_chance = 50 //% 1-100

/////////////////////////////////////////////////////////////////////////////////    
[EVENTS e_zInfection]    
ON=@Timer
    //not infected quit
    if !(<src.tag0._is_infected>)
        return
    endif
    //inform player their rotting away
    src.sysmessage @33 Your flesh is rotting!
    
    //we are infected so slowly take 10 damage (player starts to turn)
    src.damage= 10 (<DEF.dam_poison>)
    
    //run timer again
    src.timerf <def.INFECTION_rate> f_infection_timer
    
ON=@Hit
    //only run if this is an infected zombie
    if !(<defname>==c_infected_zombie)
        return
    endif
    
    //if target already infected quit
    if (<src.tag0._is_infected>)
        return
    endif
    
    //disease check else infect them
    if (<eval RAND(100)+1> <= <def.INFECTION_chance>)
        return
    endif
    
    //set infected flag
    src.tag0._is_infected = 1
    
    //add infected event
    src.events +e_zInfection
    src.sysmessage @30 You have been infected.
    
    //add buf icon if player
    if (<src.isplayer>)
        src.addbuff 1017,3010160,1053096,0,
    endif
    
    //start timer for rotting
    src.timerf <def.INFECTION_rate> f_infection_timer
    
ON=@DeathCorpse 
    //quit if c_infected_zombie
    if (<defname>==c_infected_zombie)
        return
    end
    
    //we died while infected so turn corpse into zombie in x amount of time
    argo.timerf <def.CORPSE_to_ZOMBIE_delay> f_turn_to_infected <src.name>
    
    //remove this infection from player
    src.events -e_zInfection
    src.tag0._is_infected =
    
    //remove buf icon if player
    if (<src.isplayer>)
        src.removebuff 1017
    endif
    
    //remove f_infection_timer
    src.timerf STOP,f_infection_timer

ON=@Logout
    //we are infected and logging out
        //stop timer
    timerf STOP,f_infection_timer
    
ON=@Login 
    //since this is triggering, we are infected and loging in
        //add the infection buf & fire timer if not present
    addbuff 1017,3010160,1053096,0,
    timerf <def.INFECTION_rate> f_infection_timer

/////////////////////////////////////////////////////////////////////////////////
[FUNCTION f_turn_to_infected]    
    //we died while infected so turn corpse into infected zombie
        //transfer all possessions & name to new zombie
    SERV.newnpc c_infected_zombie
    new.name = The infected corpse of <args>
    new.p = <p>
    FORCONT <uid> 0  //we don'
t need to search in the subcontainersjust grab them.
        
//serv.log <name>
            
new.bounce <uid>
    ENDFOR
    
//remove corpse
    
remove
    
new.updatex
    
/////////////////////////////////////////////////////////////////////////////////    
[FUNCTION f_infection_timer]
    
I.trigger @timer
    
    

/////////////////////////////////////////////////////////////////////////////////        
[CHARDEF c_infected_zombie]
ID=c_zombie
NAME
=infected zombie
ICON
=i_pet_zombie
SOUND
=snd_monster_zombie1
CAN
=MT_WALK|MT_RUN
DAM
=3,7
ARMOR
=18
DESIRES
=r_graveyards,t_coin,t_gold,t_gem,t_potion
AVERSIONS
=t_trap,r_civilization
RESOURCES
=1 i_reag_bone
TAG
.SlayerGroup=UNDEAD
TEVENTS
=e_undead
TEVENTS
=e_carnivores
TEVENTS
=e_zInfection
MOVERATE
={180 240}
CATEGORY=Monsters
SUBSECTION
=Undead
DESCRIPTION
=Zombie
ON
=@Create
   NPC
=brain_monster
   FAME
=600
   KARMA
=-600
   STR
={45 70}
   
DEX={30 50}
   
INT={25 40}
   
MAXHITS={30 45}
   
WRESTLING={35.1 50.0}
   
TACTICS={35.1 50.0}
   
MAGICRESISTANCE={15.1 40.0}
   
RESPHYSICAL={15 20}
   
RESFIRE=0
   RESCOLD
={20 30}
   
RESPOISON={5 10}
   
RESENERGY=0
ON
=@NPCRestock
   
//ITEM=loot_zombie    
    
/////////////////////////////////////////////////////////////////////////////////    
[ITEMDEF 0a12]
DEFNAME=i_torch_lit
TYPE
=t_light_lit
TDATA3
=i_torch
FLIP
=1
CATEGORY
=Decoration Lightsources
SUBSECTION
=Torches
DESCRIPTION
=Torch (Lit)
DUPELIST=0a13,0a14
ON
=@Create
   MOREZ
=2
ON
=@DropOn_Item 

    
//set corpse on fire & remove infection if any
    
if (<argo.baseid> == i_corpse
    
        
//place fire effect & play sound
        
serv.newitem i_fire
        
new.= <argo.p>
        new.
attr = 08010
        new.
timerf 10,remove
        sfx 054
        
        
//turn corpse black (charring)
        
argo.color 1899
        argo
.timerf STOP,f_turn_to_infected
        
        
//add scorch marks
        
serv.newitem 0f34
        
new.name scorch marks
        
new.attr = 08010
        new.
color 1
        
new.= <argo.p>
        new.
timerf 20,remove
        
        src
.sysmessage You burn the corpse.
        return 
1
    
endif 

Capes
(This post was last modified: 05-11-2018 04:25 AM by Capes.)
05-11-2018 02:14 AM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,646
Likes Given: 229
Likes Received: 152 in 143 posts
Joined: Mar 2012
Reputation: 33



Post: #2
RE: Walking Dead (tv) type zombies
For the buff, i think you need to add an additional trigger (@Login) to resend it when the player quit and re-enter, that's because custom buff get removed after logging out / closing the client.

Also, i think you can avoid the tag src._is_infected and just check if the events/tevents are installed by using isevent.e_zInfection and istevent.e_zInfection
05-11-2018 02:46 AM
Find all posts by this user Like Post Quote this message in a reply
Capes
Journeyman
*

Posts: 57
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Mar 2018
Reputation: 0



Post: #3
RE: Walking Dead (tv) type zombies
Thanks darksun84! I did not know the buffs cleared with a logout.
I updated the above to reflect your login/logout suggestion.
Although the isevent.e_zInfection was not working so I left the src._is_infected as it was.

Thanks
Capes
05-11-2018 04:29 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

This forum uses Lukasz Tkacz MyBB addons.