Thread: full specials (smaller and neater version)

Page 1 of 5 123 ... LastLast
Results 1 to 10 of 43
  1. #1 full specials (smaller and neater version) 
    Registered Member
    killamess's Avatar
    Join Date
    Dec 2007
    Age
    30
    Posts
    1,508
    Thanks given
    51
    Thanks received
    284
    Rep Power
    1956
    server tested: devolution 7.0
    difficulty: 8/10
    purpose: to shorten your special codes.
    files modified: player.java, client.java
    features: smaller specials, neater, easier to add new weapons, does not over hit, proper placing of gfx, shows special bar for weapons that only have it, properly timed damaged delays.

    credits:
    20% to delta for his special.java file.
    80% to me for writing the tutorial and the scripts.

    note: i will not show how it works with your attacking methods, you guys got to experiment, but i will give a small demonstration.

    step 1) ADDING METHODS
    ok lets go ahead and declare these in client.java
    Code:
    	public void checkWeaponForSpecial() 
    	{
    		if (playerEquipment[playerWeapon] == 5698)  			
    		{
    			doubleHit = true;
    			getWeaponSpecialInformation(5698,1062, 25, 252);
    		}
    		if (playerEquipment[playerWeapon] == 5680)  	//dragon dagger p+
    		{
    			doubleHit = true;
    			getWeaponSpecialInformation(5680,1062, 25, 252);
    		}
    		if (playerEquipment[playerWeapon] == 1231)  	//dragon dagger p
    		{
    			doubleHit = true;
    			getWeaponSpecialInformation(1231,1062, 25, 252);
    		}
    		if (playerEquipment[playerWeapon] == 1215)  	//dragon dagger 
    		{
    			doubleHit = true;
    			getWeaponSpecialInformation(1215,1062, 25, 252);
    		}
    		if (playerEquipment[playerWeapon] == 1305) 	// dragon long
    		{ 
    			getWeaponSpecialInformation(1305,1058, 25, 248);
    		}
      		if (playerEquipment[playerWeapon] == 1434) 	// dragon mace
    		{
    			getWeaponSpecialInformation(1434,1060, 25, 251);
    		}
    	}
    in our attacking methods you must add checkWeaponForSpecial(); right under specOn or usingSpecial.
    its extremely important to make it look like
    Code:
    	if (usingSpecial || specOn) 
    	{
    		checkWeaponForSpecial();
    	} else {
    		//your normal attack part here
    	}
    now we need to add the method that actually tells the server to know what its doing, so we add.
    Code:
    	long lastRegain = 0; 
    	long damageDelay4 = 0;
    	long rehit = 0;
    	public boolean reHit = false;
    	public boolean doubleHit = false;
    	public void getWeaponSpecialInformation(int weapon, int animation99, int drain, int doGFX) 
    	{
    		arrowPullBack(doGFX);
    		weapon = playerEquipment[playerWeapon];
    		doActionSpecial(animation99);
    		if (specialAmount >= drain) 
    		{
    			specialAmount -= drain;
    		} else {
    			specOn = false;
    			sendMessage("You do not have enough special attack to use this.");
    			ResetAttackNPC();
    		}
    	}
    now once we add that we can see what each one of these does.
    now we add
    Code:
    	public void doActionSpecial(int i) {
           		startSpecialAnimations(i);
       	 }
    	public void damageNPC() 
    	{
    		int EnemyX = server.npcHandler.npcs[attacknpc].absX;
    		int EnemyY = server.npcHandler.npcs[attacknpc].absY;
    		int EnemyHP = server.npcHandler.npcs[attacknpc].HP;
    		int MAXHIT = misc.random(playerMaxHit);
    		if (MAXHIT > EnemyHP) 
    		{
    			MAXHIT = EnemyHP;
    		} 
    		if (EnemyHP < 1 )
    		{
    			server.npcHandler.npcs[attacknpc].hitDiff = 0;
    		}
    		server.npcHandler.npcs[attacknpc].Killing[playerId] += MAXHIT;
    		server.npcHandler.npcs[attacknpc].StartKilling = localId;
    		server.npcHandler.npcs[attacknpc].IsUnderAttack = true;
    		server.npcHandler.npcs[attacknpc].RandomWalk = false;
    		server.npcHandler.npcs[attacknpc].hitDiff = MAXHIT;
    		server.npcHandler.npcs[attacknpc].hit = true;
    		server.npcHandler.npcs[attacknpc].updateRequired = true;
    		server.npcHandler.npcs[attacknpc].hitUpdateRequired = true;
    		addSkillXP(MAXHIT * 200, SkillID);
    		addSkillXP(MAXHIT * 66, playerHitpoints);
    	}
    this tells the server to start the animation of the special (this will also time the damages)
    in the process we add
    Code:
    		if (System.currentTimeMillis() - lastRegain > 120000) {
    			lastRegain = System.currentTimeMillis();
    			if (specialAmount >= 100) {
    				specialAmount += 0;
    			} else {
    				specialAmount += 25;
    			}
    		}
    		server.special.loginSpec(this, playerEquipment[playerWeapon]);
    		if (specialAttack && (System.currentTimeMillis() - lastDamage4 > 0))
    		{
    			if(doubleHit){
    				rehit = System.currentTimeMillis();
    				doubleHit = true;
    			} 
    			specialAttack = false;
    			specOn = false;
    			specAttack();
    			damageNPC();	
    			
    		}
    		if (doubleHit && (System.currentTimeMillis() - rehit > 50)){
    			doubleHit = false;
    			damageNPC();
    		}
    now find you login messages like "welcome to blahblah"
    and add
    Code:
    		specAttack();
    		server.special.loginSpec(this, playerEquipment[playerWeapon]);
    this tells the server if the weapon is actually a weapon that has a special bar
    and it updates the special bar.
    now add these
    Code:
    	public void specAttack() {
    		server.special.specialAttacks(playerId);
    		server.special.specialAttacks2(playerId);
    		server.special.specialAttacks3(playerId);
    		server.special.specialAttacks4(playerId);
    		server.special.specialAttacks5(playerId);
    		server.special.specialAttacks6(playerId);
    		specialAmount = specialAmount;
    	}
    	public void removeSpec(int id) {
    		outStream.createFrame(171);
    		outStream.writeByte(1);
    		outStream.writeWord(id);
    		flushOutStream();
    	}
    now got to case 185: and under switch (actionButtonId) { add these
    Code:
    			case 29113://bows
    			case 33033://halberds
    			case 29163://swords
    			case 29138://dds
    			case 48023://whip
    				try {
    				if (specialAmount < 25) {
    					specOn = false;
    				}
    				if (specOn == true) {
    					specOn = false;
    				} else if (specOn == false) {
    					specOn = true;
    				}
    				specAttack();
    				} catch (Exception popo) {
    			}
    			break;
    now close client.java and open player.java
    add all these
    Code:
    	long lastDamage4 = 0;
    	public boolean specialAttack = false;
    	public boolean specOn = false;
    	public int specialAmount = 100;
    	public void arrowPullBack(int gfx) { 
    		mask100var1 = gfx;
    		mask100var2 = 6553600;
    		mask100update = true;
    		updateRequired = true;
    	} 
    	public void startSpecialAnimations(int animIdx)
    	{
    		animationRequest = animIdx;
    		animationWaitCycles = 0;
    		specialAttack = true;
    		lastDamage4 = System.currentTimeMillis();
    	}
    now close player.java and open server.java
    in server.java add this
    Code:
    	public static special special = null;
    then find
    Code:
    playerHandler = new PlayerHandler();
    under that ^
    add
    Code:
    special = new special();
    now close that.
    download my attachment and add it with the other server files
    then compile and it should work, post any errors apart from the 100 error messages, that just means you fail at copy and pasting



    other things - adding more weapon for the special attacks, in this method
    Code:
    	public void checkWeaponForSpecial() 
    	{
    		if (playerEquipment[playerWeapon] == 5698)  			
    		{
    			doubleHit = true;
               		getWeaponSpecialInformation(5698,1062, 25, 252);
    		}
    	}
    we add our weapons, example
    Code:
    if (playerEquipment[playerWeapon] == 5698)   //dds			
    		{
    			doubleHit = true; //if you want it to double hit or not
                                          //(weapon id)(animation)(specamount)(gfx)
               		getWeaponSpecialInformation(5698,1062, 25, 252);
    		}
    its that simple.
    Attached Files

    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    Jul 2008
    Posts
    2,056
    Thanks given
    26
    Thanks received
    98
    Rep Power
    0
    Hm...Very good, i spose it could be better, but this is alot better then what most people have, Good work
    Reply With Quote  
     

  3. #3  
    Old School Member

    Join Date
    Feb 2008
    Age
    26
    Posts
    2,163
    Thanks given
    372
    Thanks received
    40
    Rep Power
    687
    Great work none the less it's much better than pali's.


    Edit: Does this include full specials or just a base? cbf looking if all methods are there.

    Quote Originally Posted by Colby View Post
    Rofl, moron. They're ALL going to be null idiot. This is such complete bullshit, it makes me want to strangle you.
    Reply With Quote  
     

  4. #4  
    Registered Member
    killamess's Avatar
    Join Date
    Dec 2007
    Age
    30
    Posts
    1,508
    Thanks given
    51
    Thanks received
    284
    Rep Power
    1956
    Quote Originally Posted by xx k03d xx1 View Post
    Great work none the less it's much better than pali's.


    Edit: Does this include full specials or just a base? cbf looking if all methods are there.
    heres most of them
    Code:
    		if (playerEquipment[playerWeapon] == 5698)  	//dragon dagger p++
    		{
    			doubleHit = true;
               		getWeaponSpecialInformation(5698,1062, 25, 252);
    		}
    		if (playerEquipment[playerWeapon] == 5680)  	//dragon dagger p+
    		{
    			doubleHit = true;
               		getWeaponSpecialInformation(5680,1062, 25, 252);
    		}
    		if (playerEquipment[playerWeapon] == 1231)  	//dragon dagger p
    		{
    			doubleHit = true;
               		getWeaponSpecialInformation(1231,1062, 25, 252);
    		}
    		if (playerEquipment[playerWeapon] == 1215)  	//dragon dagger 
    		{
    			doubleHit = true;
               		getWeaponSpecialInformation(1215,1062, 25, 252);
    		}
    		if (playerEquipment[playerWeapon] == 1305) 	// dragon long
    		{ 
    			getWeaponSpecialInformation(1305,1058, 25, 248);
    		}
      		if (playerEquipment[playerWeapon] == 1434) 	// dragon mace
    		{
    			getWeaponSpecialInformation(1434,1060, 25, 251);
               	}

    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  5. #5  
    Old School Member

    Join Date
    Feb 2008
    Age
    26
    Posts
    2,163
    Thanks given
    372
    Thanks received
    40
    Rep Power
    687
    Quote Originally Posted by killamess View Post
    heres most of them
    Code:
    		if (playerEquipment[playerWeapon] == 5698)  			//dragon dagger p++
    		{
    			doubleHit = true;
               		getWeaponSpecialInformation(5698,1062, 25, 252);
    		}
    		if (playerEquipment[playerWeapon] == 5680)  			//dragon dagger p+
    		{
    			doubleHit = true;
               		getWeaponSpecialInformation(5680,1062, 25, 252);
    		}
    		if (playerEquipment[playerWeapon] == 1231)  			//dragon dagger p
    		{
    			doubleHit = true;
               		getWeaponSpecialInformation(1231,1062, 25, 252);
    		}
    		if (playerEquipment[playerWeapon] == 1215)  			//dragon dagger 
    		{
    			doubleHit = true;
               		getWeaponSpecialInformation(1215,1062, 25, 252);
    		}
    		if (playerEquipment[playerWeapon] == 1305) 			// dragon long
    		{ 
    			getWeaponSpecialInformation(1305,1058, 25, 248);
    		}
      		if (playerEquipment[playerWeapon] == 1434) 			 // dragon mace
    		{
    			getWeaponSpecialInformation(1434,1060, 25, 251);
               	}
    Ok isn't what i meant but ty.

    Good to see you back, your amazing.

    Quote Originally Posted by Colby View Post
    Rofl, moron. They're ALL going to be null idiot. This is such complete bullshit, it makes me want to strangle you.
    Reply With Quote  
     

  6. #6  
    Registered Member
    killamess's Avatar
    Join Date
    Dec 2007
    Age
    30
    Posts
    1,508
    Thanks given
    51
    Thanks received
    284
    Rep Power
    1956
    Quote Originally Posted by xx k03d xx1 View Post
    Ok isn't what i meant but ty.

    Good to see you back, your amazing.
    oh yes it is full specials

    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  7. #7  
    hmu

    Jakey's Avatar
    Join Date
    Sep 2007
    Age
    31
    Posts
    6,489
    Thanks given
    109
    Thanks received
    277
    Rep Power
    1218
    Great work killamess. Love the devo work.
    to contact me, PM me on rune-server.
    Reply With Quote  
     

  8. #8  
    Registered Member

    Join Date
    Jan 2008
    Age
    28
    Posts
    1,380
    Thanks given
    76
    Thanks received
    384
    Rep Power
    962
    There is much easier ways to do this.
    Reply With Quote  
     

  9. #9  
    Registered Member

    Join Date
    Jun 2008
    Posts
    734
    Thanks given
    8
    Thanks received
    14
    Rep Power
    148
    Quote Originally Posted by BFMV View Post
    There is much easier ways to do this.
    I agree but killamess is finally learning instead of leaching...

    Good try tough killamess.
    S Quare Quxx: Raul > paladin end of the story
    Reply With Quote  
     

  10. #10  
    Registered Member
    killamess's Avatar
    Join Date
    Dec 2007
    Age
    30
    Posts
    1,508
    Thanks given
    51
    Thanks received
    284
    Rep Power
    1956
    Quote Originally Posted by BFMV View Post
    There is much easier ways to do this.
    well this is a lot smaller than any other specials released.

    Quote Originally Posted by UltimateG View Post
    I agree but killamess is finally learning instead of leaching...

    Good try tough killamess.
    leaching? i don't leach. people always say to me your server is 90% delta yet delta used most of MY methods. ask him if you have to. seeing as all those methods that people say i leached were released before delta was.
    Last edited by killamess; 02-01-2009 at 10:41 AM. Reason: Double posting is not allowed!

    [Only registered and activated users can see links. ]
    Reply With Quote  
     

Page 1 of 5 123 ... LastLast

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
  •