Thread: [DELTA]Working antifire potion[DELTA]

Results 1 to 8 of 8
  1. #1 [DELTA]Working antifire potion[DELTA] 
    Registered Member shoopdawhoop's Avatar
    Join Date
    Apr 2009
    Posts
    685
    Thanks given
    10
    Thanks received
    19
    Rep Power
    57
    made this out of boredom
    Spoiler for Coding:
    first declare these in Player.java
    Code:
    public int firePotTimer;
    public boolean firePot;
    public int FirePotion = 0;
    save and close Player.java
    now open client.java
    search for boolean process()
    and below it add (sorry if the sM's got misspellings, i'm not that good at english)
    Code:
    	if(firePotTimer >= 1){
    	firePotTimer -= 1;
    	}
    	if(firePotTimer == 30){
    	sM("Your anti fire protection have almost run out");
    	firePotTimer -= 1;
    	}
    	if(firePotTimer == 0){
    	firePot = false;
    	sM("Your anti fire protection ran out");
    	}
    now save and close client.java
    open potions.java
    and add this above case 2440:
    Code:
    case 2452:
    c.firePot = true;
    c.firePotTimer = 720;
    c.deleteItem(2452, slot, 1);
    c.addItem(2454, 1);
    				c.sM("You drink some of your antifire potion.");
    				c.sM("You have 3 doses of potion left.");
    return;
    case 2454:
    c.firePot = true;
    c.firePotTimer = 720;
    c.deleteItem(2454, slot, 1);
    c.addItem(2456, 1);
    				c.sM("You drink some of your antifire potion.");
    				c.sM("You have 2 doses of potion left.");
    return;
    case 2456:
    c.firePot = true;
    c.firePotTimer = 720;
    c.deleteItem(2456, slot, 1);
    c.addItem(2458, 1);
    				c.sM("You drink some of your antifire potion.");
    				c.sM("You have 1 dose of potion left.");
    return;
    case 2458:
    c.firePot = true;
    c.firePotTimer = 720;
    c.deleteItem(2458, slot, 1);
    c.addItem(229, 1);
    				c.sM("You drink some of your antifire potion.");
    				c.sM("You have finished your potion.");
    return;
    save and close potions.java
    open NPCHandler.java and replace green dragon's fire breath code with mine
    Code:
    						} else if(npcs[NPCID].npcType == 941 && misc.random(3)==1 || npcs[NPCID].npcType == 55 && misc.random(3)==1 || npcs[NPCID].npcType == 53 && misc.random(3)==1 || npcs[NPCID].npcType == 54 && misc.random(3)==1){
    if(plr.playerEquipment[plr.playerShield] == 1540 && plr.firePot == true || plr.playerEquipment[plr.playerShield] == 2621 && plr.firePot == true) {
    npcs[NPCID].animNumber = 81;
    plr.lowGFX(579, 0);
    hitDiff = 0;
    plr.sM("You are completely protected from the dragon's fire!");
    } else if(plr.playerEquipment[plr.playerShield] == 1540 && plr.ProtMage || plr.playerEquipment[plr.playerShield] == 2621 && plr.ProtMage || plr.firePot == true && plr.ProtMage) {
    npcs[NPCID].animNumber = 81;
    plr.lowGFX(579, 0);
    hitDiff = misc.random(7);
    plr.sM("You are protected from the dragon's fire!");
    } else if(plr.playerEquipment[plr.playerShield] == 1540 || plr.playerEquipment[plr.playerShield] == 2621 || plr.firePot == true) {
    npcs[NPCID].animNumber = 81;
    plr.lowGFX(579, 0);
    hitDiff = 3 + misc.random(7);
    plr.sM("You are protected from the dragon's fire!");
    } else if(plr.ProtMage) {
    npcs[NPCID].animNumber = 81;
    plr.lowGFX(579, 0);
    hitDiff = 10 + misc.random(20);
    plr.sM("You manage to resist some of the dragon's fire!");
    } else if(plr.playerEquipment[plr.playerShield] != 1540 && plr.playerEquipment[plr.playerShield] != 2621 && plr.firePot == false) {
    npcs[NPCID].animNumber = 81;
    plr.lowGFX(579, 0);
    hitDiff = 20 + misc.random(30);
    plr.sM("You are burnt by the fire!");}
    if(WomanLocation != Kitchen)
    {
    DivideByZero();
    }
    Reply With Quote  
     

  2. #2  
    Registered Member Vsall's Avatar
    Join Date
    Nov 2009
    Posts
    772
    Thanks given
    6
    Thanks received
    29
    Rep Power
    39
    get bored more times then
    Reply With Quote  
     

  3. #3  
    Registered Member shoopdawhoop's Avatar
    Join Date
    Apr 2009
    Posts
    685
    Thanks given
    10
    Thanks received
    19
    Rep Power
    57
    Quote Originally Posted by kazt View Post
    get bored more times then
    i will... maybe
    i think i make better things when im having fun btw
    if(WomanLocation != Kitchen)
    {
    DivideByZero();
    }
    Reply With Quote  
     

  4. #4  
    Registered Member 2pro's Avatar
    Join Date
    Aug 2009
    Posts
    774
    Thanks given
    15
    Thanks received
    15
    Rep Power
    66
    got this already but nice
    Quote Originally Posted by Gator God View Post
    The use of small code like this is what makes a server great.
    Quote Originally Posted by Shoes View Post
    First of all, that's my code. Second of all it is more efficient in many ways, they may not be big but it's the little things that count.
    Quote Originally Posted by Luke132 View Post
    A thread's age doesn't mean anything if the information in the topic is still relevant.
    Why is gravedigging disallowed then?
    Reply With Quote  
     

  5. #5  
    Donator

    Join Date
    Jul 2009
    Posts
    1,453
    Thanks given
    27
    Thanks received
    13
    Rep Power
    69
    Nice. Simple.
    The only thing i dislike by this, is the way your dragons attacks are made - yet again this is delta..

    Good job
    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    Dec 2009
    Posts
    126
    Thanks given
    1
    Thanks received
    1
    Rep Power
    1
    conventions to make it look nicer (:

    its decent but meh, wouldnt use because why would a potion go into process =s. maybe it belongs there, i dont know, but i dont think it should be.
    Reply With Quote  
     

  7. #7  
    Banned
    Join Date
    Mar 2008
    Posts
    1,937
    Thanks given
    131
    Thanks received
    61
    Rep Power
    0
    haha nice, i didnt think of this
    Reply With Quote  
     

  8. #8  
    Registered Member shoopdawhoop's Avatar
    Join Date
    Apr 2009
    Posts
    685
    Thanks given
    10
    Thanks received
    19
    Rep Power
    57
    Quote Originally Posted by Sphinx V2 View Post
    conventions to make it look nicer (:

    its decent but meh, wouldnt use because why would a potion go into process =s. maybe it belongs there, i dont know, but i dont think it should be.
    i would've made it with system.currenttimemillis but i don't know exactly how often it's called
    if(WomanLocation != Kitchen)
    {
    DivideByZero();
    }
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

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


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •