Thread: [tut]Poison Npcs (With green splat)..

Results 1 to 10 of 10
  1. #1 [tut]Poison Npcs (With green splat).. 
    Registered Member
    Join Date
    Jul 2006
    Age
    35
    Posts
    487
    Thanks given
    0
    Thanks received
    0
    Rep Power
    56
    Open up your NPC.java and add these:
    Code:
    public int poisonTimer, poisonDelay;
    public boolean poisonDmg;
    Now find this line:
    Code:
    protected void appendHitUpdate(stream str) {
    Replace that void with this:
    Code:
    protected void appendHitUpdate(stream str) {		
    		try {
    			HP -= hitDiff;
    			if (HP <= 0) {
    				IsDead = true;
    			}
    			str.writeByteC(hitDiff); // What the npc got 'hit' for
    			if (hitDiff > 0 && !poisonDmg) {
    				str.writeByteS(1); // 0: red hitting - 1: blue hitting
    			} else if (hitDiff > 0 && poisonDmg) {
    				str.writeByteS(2); // 0: red hitting - 1: blue hitting
    			} else {
    				str.writeByteS(0); // 0: red hitting - 1: blue hitting
    			}
    			str.writeByteS(HP); // Their current hp, for HP bar
    			str.writeByteC(MaxHP); // Their max hp, for HP bar
                poisonDmg = false;
    		} catch(Exception e) {
    			e.printStackTrace();
    		}
    	}
    Now open your npcHandler.java and add this void:
    Code:
    public void poisonNpc(int index)
    	{
    		npcs[index].poisonDmg = true;
    		npcs[index].poisonDelay = misc.random(60);
    		npcs[index].hitDiff = misc.random(5);
    		npcs[index].hitDiff = npcs[index].hitDiff;
    		npcs[index].updateRequired = true;
    		npcs[index].hitUpdateRequired = true;
    	}
    Then add this in process:
    Code:
    if (npcs[i].poisonTimer > 0) {
    					npcs[i].poisonTimer--;
    				}
    				if (npcs[i].poisonTimer == 0) {
    					npcs[i].poisonDmg = false;
    					npcs[i].poisonDelay = -1;
    				}
    				if (npcs[i].poisonDelay > 0) {
    					npcs[i].poisonDelay--;
    				}
    				if (npcs[i].poisonTimer > 0 && npcs[i].poisonDelay == 0){
    					poisonNpc(i);
    				}
    Now when you want to poison an npc you use it like this:
    Code:
    if (server.npcHandler.npcs[index].poisonTimer <= 0)
    	{
    		server.npcHandler.npcs[index].poisonTimer = 120; //120 = (60 * 2) [60 =  30 seconds]
    		server.npcHandler.npcs[index].poisonDmg = true;
    		server.npcHandler.poisonNpc(index);
    	}
    - Mr. Brightside
     

  2. #2  
    my rep is h4x0r3d


    Join Date
    Dec 2006
    Posts
    1,760
    Thanks given
    10
    Thanks received
    8
    Rep Power
    207
    Please make the magehandler i need before i go to bed
    Quote Originally Posted by super_ View Post
    this is shit. you are shit. gtfo retard.
     

  3. #3  
    Registered Member
    Join Date
    Jul 2006
    Age
    35
    Posts
    487
    Thanks given
    0
    Thanks received
    0
    Rep Power
    56
    Stop asking, it'll be done when it's done.
     

  4. #4  
    my rep is h4x0r3d


    Join Date
    Dec 2006
    Posts
    1,760
    Thanks given
    10
    Thanks received
    8
    Rep Power
    207
    Im so desperate it sounds so good. Geuss i'll check in the morning. Night
    Quote Originally Posted by super_ View Post
    this is shit. you are shit. gtfo retard.
     

  5. #5  
    project-rs owner
    Join Date
    Sep 2006
    Age
    32
    Posts
    914
    Thanks given
    4
    Thanks received
    4
    Rep Power
    49
    good job i love your tuts "
    rep
     

  6. #6  
    I'm unique


    Join Date
    Oct 2006
    Age
    32
    Posts
    708
    Thanks given
    0
    Thanks received
    1
    Rep Power
    82
    Great tut mr bright. I love it. Thanks for making it.
    rep++
    ~Simox
    Sincerly yours,
    Simox.
     

  7. #7  
    Community Veteran


    Join Date
    Jul 2006
    Posts
    789
    Thanks given
    31
    Thanks received
    80
    Rep Power
    177
    love your tuts. Thanks Again
     

  8. #8  
    Version
    Guest
    Thanks for the Tut it was useful!
     

  9. #9  
    bee hind u
    Guest
    umm lol it says it cant find variable i on the process part..
     

  10. #10  
    Banned

    Join Date
    Oct 2006
    Age
    31
    Posts
    777
    Thanks given
    24
    Thanks received
    95
    Rep Power
    0
    4 out of 6 posts on this thread were meant to suck up...

    but nice tut i wont use..
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Poison hitsplat is not turning green.
    By 4markie in forum Help
    Replies: 2
    Last Post: 12-21-2010, 02:32 AM
  2. poison via npcs?
    By sexyrussian in forum Help
    Replies: 4
    Last Post: 04-09-2010, 02:51 AM
  3. New hit splat sprites
    By Zachhh in forum Requests
    Replies: 2
    Last Post: 01-29-2010, 08:59 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •