Jump to content
Existing user? Sign In

Sign In



Sign Up

[RUSE] Dharok's Degrading.


Sanity

Recommended Posts

I decided not to add degrading armours so basically it's dead code I made a while back. If you wan't to use it enjoy.


CombatFactory:

Find:

/** PHOENIX NECK **/

Add all this above that line.

				/** DHAROKS DEGRADE START BY JAKE **/
				
				/** DHAROKS HELM **/
			else if(t2.getEquipment().getItems()[Equipment.HEAD_SLOT].getId() == 4716) {
				int recDamage = (int) (damage * 0.001);
				if (recDamage <= 0)
					return;
				if (recDamage > t2.getConstitution())
					recDamage = t2.getConstitution();
				attacker.dealDamage(new Hit(recDamage, Hitmask.RED, CombatIcon.DEFLECT));
					ItemDegrading.handleItemDegrading(t2, DegradingItem.DHAROKS_HELM);
				}
				/** DHAROKS HELM 100 **/
			else if(t2.getEquipment().getItems()[Equipment.HEAD_SLOT].getId() == 4880) {
				int recDamage = (int) (damage * 0.001);
				if (recDamage <= 0)
					return;
				if (recDamage > t2.getConstitution())
					recDamage = t2.getConstitution();
				attacker.dealDamage(new Hit(recDamage, Hitmask.RED, CombatIcon.DEFLECT));
					ItemDegrading.handleItemDegrading(t2, DegradingItem.DHAROKS_HELM_100);
				}
				/** DHAROKS HELM 75 **/
			else if(t2.getEquipment().getItems()[Equipment.HEAD_SLOT].getId() == 4881) {
				int recDamage = (int) (damage * 0.001);
				if (recDamage <= 0)
					return;
				if (recDamage > t2.getConstitution())
					recDamage = t2.getConstitution();
				attacker.dealDamage(new Hit(recDamage, Hitmask.RED, CombatIcon.DEFLECT));
					ItemDegrading.handleItemDegrading(t2, DegradingItem.DHAROKS_HELM_75);
				}
				/** DHAROKS HELM 50 **/
			else if(t2.getEquipment().getItems()[Equipment.HEAD_SLOT].getId() == 4882) {
				int recDamage = (int) (damage * 0.001);
				if (recDamage <= 0)
					return;
				if (recDamage > t2.getConstitution())
					recDamage = t2.getConstitution();
				attacker.dealDamage(new Hit(recDamage, Hitmask.RED, CombatIcon.DEFLECT));
					ItemDegrading.handleItemDegrading(t2, DegradingItem.DHAROKS_HELM_50);
				}
				/** DHAROKS HELM 25 **/
			else if(t2.getEquipment().getItems()[Equipment.HEAD_SLOT].getId() == 4883) {
				int recDamage = (int) (damage * 0.001);
				if (recDamage <= 0)
					return;
				if (recDamage > t2.getConstitution())
					recDamage = t2.getConstitution();
				attacker.dealDamage(new Hit(recDamage, Hitmask.RED, CombatIcon.DEFLECT));
					ItemDegrading.handleItemDegrading(t2, DegradingItem.DHAROKS_HELM_25);
				}
				
				/** DHAROKS PLATE **/
			else if(t2.getEquipment().getItems()[Equipment.BODY_SLOT].getId() == 4720) {
				int recDamage = (int) (damage * 0.001);
				if (recDamage <= 0)
					return;
				if (recDamage > t2.getConstitution())
					recDamage = t2.getConstitution();
				attacker.dealDamage(new Hit(recDamage, Hitmask.RED, CombatIcon.DEFLECT));
					ItemDegrading.handleItemDegrading(t2, DegradingItem.DHAROKS_BODY);
				}
				/** DHAROKS PLATE 100 **/
			else if(t2.getEquipment().getItems()[Equipment.BODY_SLOT].getId() == 4892) {
				int recDamage = (int) (damage * 0.001);
				if (recDamage <= 0)
					return;
				if (recDamage > t2.getConstitution())
					recDamage = t2.getConstitution();
				attacker.dealDamage(new Hit(recDamage, Hitmask.RED, CombatIcon.DEFLECT));
					ItemDegrading.handleItemDegrading(t2, DegradingItem.DHAROKS_BODY_100);
				}
				/** DHAROKS PLATE 75 **/
			else if(t2.getEquipment().getItems()[Equipment.BODY_SLOT].getId() == 4893) {
				int recDamage = (int) (damage * 0.001);
				if (recDamage <= 0)
					return;
				if (recDamage > t2.getConstitution())
					recDamage = t2.getConstitution();
				attacker.dealDamage(new Hit(recDamage, Hitmask.RED, CombatIcon.DEFLECT));
					ItemDegrading.handleItemDegrading(t2, DegradingItem.DHAROKS_BODY_75);
				}
				/** DHAROKS PLATE 50 **/
			else if(t2.getEquipment().getItems()[Equipment.BODY_SLOT].getId() == 4894) {
				int recDamage = (int) (damage * 0.001);
				if (recDamage <= 0)
					return;
				if (recDamage > t2.getConstitution())
					recDamage = t2.getConstitution();
				attacker.dealDamage(new Hit(recDamage, Hitmask.RED, CombatIcon.DEFLECT));
					ItemDegrading.handleItemDegrading(t2, DegradingItem.DHAROKS_BODY_50);
				}
				/** DHAROKS PLATE 25 **/
			else if(t2.getEquipment().getItems()[Equipment.BODY_SLOT].getId() == 4895) {
				int recDamage = (int) (damage * 0.001);
				if (recDamage <= 0)
					return;
				if (recDamage > t2.getConstitution())
					recDamage = t2.getConstitution();
				attacker.dealDamage(new Hit(recDamage, Hitmask.RED, CombatIcon.DEFLECT));
					ItemDegrading.handleItemDegrading(t2, DegradingItem.DHAROKS_BODY_25);
				}
				/** DHAROKS LEGS **/
			else if(t2.getEquipment().getItems()[Equipment.LEG_SLOT].getId() == 4722) {
				int recDamage = (int) (damage * 0.001);
				if (recDamage <= 0)
					return;
				if (recDamage > t2.getConstitution())
					recDamage = t2.getConstitution();
				attacker.dealDamage(new Hit(recDamage, Hitmask.RED, CombatIcon.DEFLECT));
					ItemDegrading.handleItemDegrading(t2, DegradingItem.DHAROKS_LEGS);
				}
				/** DHAROKS LEGS 100 **/
			else if(t2.getEquipment().getItems()[Equipment.LEG_SLOT].getId() == 4898) {
				int recDamage = (int) (damage * 0.001);
				if (recDamage <= 0)
					return;
				if (recDamage > t2.getConstitution())
					recDamage = t2.getConstitution();
				attacker.dealDamage(new Hit(recDamage, Hitmask.RED, CombatIcon.DEFLECT));
					ItemDegrading.handleItemDegrading(t2, DegradingItem.DHAROKS_LEGS_100);
				}
				/** DHAROKS LEGES 75 **/
			else if(t2.getEquipment().getItems()[Equipment.LEG_SLOT].getId() == 4899) {
				int recDamage = (int) (damage * 0.001);
				if (recDamage <= 0)
					return;
				if (recDamage > t2.getConstitution())
					recDamage = t2.getConstitution();
				attacker.dealDamage(new Hit(recDamage, Hitmask.RED, CombatIcon.DEFLECT));
					ItemDegrading.handleItemDegrading(t2, DegradingItem.DHAROKS_LEGS_75);
				}
				/** DHAROKS LEGS 50 **/
			else if(t2.getEquipment().getItems()[Equipment.LEG_SLOT].getId() == 4900) {
				int recDamage = (int) (damage * 0.001);
				if (recDamage <= 0)
					return;
				if (recDamage > t2.getConstitution())
					recDamage = t2.getConstitution();
				attacker.dealDamage(new Hit(recDamage, Hitmask.RED, CombatIcon.DEFLECT));
					ItemDegrading.handleItemDegrading(t2, DegradingItem.DHAROKS_LEGS_50);
				}
				/** DHAROKS LEGS 25 **/
			else if(t2.getEquipment().getItems()[Equipment.LEG_SLOT].getId() == 4901) {
				int recDamage = (int) (damage * 0.001);
				if (recDamage <= 0)
					return;
				if (recDamage > t2.getConstitution())
					recDamage = t2.getConstitution();
				attacker.dealDamage(new Hit(recDamage, Hitmask.RED, CombatIcon.DEFLECT));
					ItemDegrading.handleItemDegrading(t2, DegradingItem.DHAROKS_LEGS_25);
				}
				/** DHAROKS AXE **/
			else if(t2.getEquipment().getItems()[Equipment.WEAPON_SLOT].getId() == 4718) {
				int recDamage = (int) (damage * 0.001);
				if (recDamage <= 0)
					return;
				if (recDamage > t2.getConstitution())
					recDamage = t2.getConstitution();
				attacker.dealDamage(new Hit(recDamage, Hitmask.RED, CombatIcon.DEFLECT));
					ItemDegrading.handleItemDegrading(t2, DegradingItem.DHAROKS_AXE);
				}
				/** DHAROKS AXE 100 **/
			else if(t2.getEquipment().getItems()[Equipment.WEAPON_SLOT].getId() == 4886) {
				int recDamage = (int) (damage * 0.001);
				if (recDamage <= 0)
					return;
				if (recDamage > t2.getConstitution())
					recDamage = t2.getConstitution();
				attacker.dealDamage(new Hit(recDamage, Hitmask.RED, CombatIcon.DEFLECT));
					ItemDegrading.handleItemDegrading(t2, DegradingItem.DHAROKS_AXE_100);
				}
				/** DHAROKS AXE 75 **/
			else if(t2.getEquipment().getItems()[Equipment.WEAPON_SLOT].getId() == 4887) {
				int recDamage = (int) (damage * 0.001);
				if (recDamage <= 0)
					return;
				if (recDamage > t2.getConstitution())
					recDamage = t2.getConstitution();
				attacker.dealDamage(new Hit(recDamage, Hitmask.RED, CombatIcon.DEFLECT));
					ItemDegrading.handleItemDegrading(t2, DegradingItem.DHAROKS_AXE_75);
				}
				/** DHAROKS AXE 50 **/
			else if(t2.getEquipment().getItems()[Equipment.WEAPON_SLOT].getId() == 4888) {
				int recDamage = (int) (damage * 0.001);
				if (recDamage <= 0)
					return;
				if (recDamage > t2.getConstitution())
					recDamage = t2.getConstitution();
				attacker.dealDamage(new Hit(recDamage, Hitmask.RED, CombatIcon.DEFLECT));
					ItemDegrading.handleItemDegrading(t2, DegradingItem.DHAROKS_AXE_50);
				}
				/** DHAROKS AXE 25 **/
			else if(t2.getEquipment().getItems()[Equipment.WEAPON_SLOT].getId() == 4889) {
				int recDamage = (int) (damage * 0.001);
				if (recDamage <= 0)
					return;
				if (recDamage > t2.getConstitution())
					recDamage = t2.getConstitution();
				attacker.dealDamage(new Hit(recDamage, Hitmask.RED, CombatIcon.DEFLECT));
					ItemDegrading.handleItemDegrading(t2, DegradingItem.DHAROKS_AXE_25);
				}
				
				/** DHAROKS END BY JAKE **/

DegradingItem: (Under Ring of Wealth)

//Dharoks By Jake
		DHAROKS_HELM(4716, 4880, Equipment.HEAD_SLOT, 20),
		DHAROKS_HELM_100(4880, 4881, Equipment.HEAD_SLOT, 20),
		DHAROKS_HELM_75(4881, 4882, Equipment.HEAD_SLOT, 20),
		DHAROKS_HELM_50(4882, 4883, Equipment.HEAD_SLOT, 20),
		DHAROKS_HELM_25(4883, 0, Equipment.HEAD_SLOT, 20),
		DHAROKS_BODY(4720, 4892, Equipment.BODY_SLOT, 20),
		DHAROKS_BODY_100(4892, 4893, Equipment.BODY_SLOT, 20),
		DHAROKS_BODY_75(4893, 4894, Equipment.BODY_SLOT, 20),
		DHAROKS_BODY_50(4894, 4895, Equipment.BODY_SLOT, 20),
		DHAROKS_BODY_25(4895, 0, Equipment.BODY_SLOT, 20),
		DHAROKS_LEGS(4722, 4898, Equipment.LEG_SLOT, 20),
		DHAROKS_LEGS_100(4898, 4899, Equipment.LEG_SLOT, 20),
		DHAROKS_LEGS_75(4899, 4900, Equipment.LEG_SLOT, 20),
		DHAROKS_LEGS_50(4900, 4901, Equipment.LEG_SLOT, 20),
		DHAROKS_LEGS_25(4901, 0, Equipment.LEG_SLOT, 20),
		DHAROKS_AXE(4718, 4886, Equipment.WEAPON_SLOT, 20),
		DHAROKS_AXE_100(4886, 4887, Equipment.WEAPON_SLOT, 20),
		DHAROKS_AXE_75(4887, 4888, Equipment.WEAPON_SLOT, 20),
		DHAROKS_AXE_50(4888, 4889, Equipment.WEAPON_SLOT, 20),
		DHAROKS_AXE_25(4889, 0, Equipment.WEAPON_SLOT, 20),
Link to comment
Share on other sites

  • 2 years later...
  • 2 months later...
  • 5 weeks later...

This is a good attempt. I have a couple of ideas for improvement :)

 

 

int recDamage = (int) (damage * 0.001);
 if (recDamage <= 0)
    return;
 if (recDamage > t2.getConstitution())
 {
    recDamage = t2.getConstitution();
    attacker.dealDamage(new Hit(recDamage, Hitmask.RED, CombatIcon.DEFLECT));
    ItemDegrading.handleItemDegrading(t2, DegradingItem.DHAROKS_AXE_25);
 }

This is all reused code. You might consider turning this into a method and calling it for each case statement so that if you ever make changes to this code, you only need to do it in one place. For this to be possible, you'd need to dynamically map the broken barrows pieces together. You could do this in an enum which can dynamically handle changing the item ID in another method so that you don't have to explicitly hardcode it in these case statements.

Link to comment
Share on other sites

  • 3 years later...
  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Contact

[email protected]

astra.security

What is a RSPS?

A RSPS, also known as RuneScape private server, is an online game based on RuneScape, and controlled by independent individuals.

Popular RSPS Servers

Runewild Ikov RedemptionRSPS

Disclaimer

Runesuite is not affiliated with runescape, jagex in any way & exists solely for educational purposes.

×
×
  • Create New...