Benjiboyyy
July 1st, 2010, 02:30
Alot of people were having problems with Nintendo/X Fbi's Multibarrage method,
and since I don't give a fuck about my delta source anymore, i'll post the method that
works with everyone's Delta.
public void multiBarrage(final client casualty) {
final client parent = this;
/**
* Calls Event Manager
*/
EventManager.getSingleton().addEvent(new Event() {
public void execute(EventContainer container) {
for(Player player : PlayerHandler.players) {
client p = (client) player;
boolean splash = true;
/**
* Ensures player is in multi
*/
if(!multiCombat() || p == null || p == casualty || p == parent) {
continue;
}
/**
* Ensures player level difference is correct
*/
if(Math.abs(p.combatLevel - combatLevel) > wildyLevel && !isInPitGame()) {
continue;
}
/**
* Cheap Hax for MageAtk method :P
*/
if(Math.abs(p.absX - casualty.absX) < 2 && Math.abs(p.absY - casualty.absY) < 2) {
if (misc.random((playerLevel[6]) + misc.random(playerBonus[6])) > misc.random(20)){
splash = false;
} else {
splash = true;
}
if ((casualty == null) || (p == null) || p.tStage > 0 || p.currentHealth == 0 || !p.multiCombat() || p.deathStage > 0) {
return;
}
if (!splash) {
p.lowGFX(369,0);
p.hitID = parent.playerId;
p.inCombat = true;
p.lastCombat = System.currentTimeMillis();
if (!p.ProtMage) {
p.hitDiff2 = misc.random(40);
} else {
/**
* The random hit, this is shit way of calculating the hit, but w/e
*/
p.hitDiff2 = misc.random(30);
}
p.hitUpdateRequired2 = true;
p.updateRequired = true;
p.dealDamage(p.hitDiff2);
p.KilledBy[playerId] += p.hitDiff2;
p.hitID = playerId;
p.offTimer = System.currentTimeMillis();
p.KillerId = playerId;
}
else if (splash) {
p.specGFX(85);
p.hitID = parent.playerId;
p.inCombat = true;
p.lastCombat = System.currentTimeMillis();
}
if (p.vengon && p.hitDiff2 != 0 && !splash) {
hitDiff = (int)(hitDiff * .83);
currentHealth -= (int)(hitDiff * .83);
hitUpdateRequired = true;
updateRequired = true;
appearanceUpdateRequired = true;
p.vengon = false;
p.plrText = "Taste vengeance!";
p.plrTextUpdateRequired = true;
}
if(System.currentTimeMillis() - p.lastEntangle > p.entangleDelay && !splash){
p.lastEntangle = System.currentTimeMillis();
p.entangleDelay = 20000;
p.sM("You have been frozen!");
}
}
} container.stop();
}
}, 1200);
}
this code is incredibly long and inefficient, but w.e
if this gives you errors, go die in a hole, thanks.
and since I don't give a fuck about my delta source anymore, i'll post the method that
works with everyone's Delta.
public void multiBarrage(final client casualty) {
final client parent = this;
/**
* Calls Event Manager
*/
EventManager.getSingleton().addEvent(new Event() {
public void execute(EventContainer container) {
for(Player player : PlayerHandler.players) {
client p = (client) player;
boolean splash = true;
/**
* Ensures player is in multi
*/
if(!multiCombat() || p == null || p == casualty || p == parent) {
continue;
}
/**
* Ensures player level difference is correct
*/
if(Math.abs(p.combatLevel - combatLevel) > wildyLevel && !isInPitGame()) {
continue;
}
/**
* Cheap Hax for MageAtk method :P
*/
if(Math.abs(p.absX - casualty.absX) < 2 && Math.abs(p.absY - casualty.absY) < 2) {
if (misc.random((playerLevel[6]) + misc.random(playerBonus[6])) > misc.random(20)){
splash = false;
} else {
splash = true;
}
if ((casualty == null) || (p == null) || p.tStage > 0 || p.currentHealth == 0 || !p.multiCombat() || p.deathStage > 0) {
return;
}
if (!splash) {
p.lowGFX(369,0);
p.hitID = parent.playerId;
p.inCombat = true;
p.lastCombat = System.currentTimeMillis();
if (!p.ProtMage) {
p.hitDiff2 = misc.random(40);
} else {
/**
* The random hit, this is shit way of calculating the hit, but w/e
*/
p.hitDiff2 = misc.random(30);
}
p.hitUpdateRequired2 = true;
p.updateRequired = true;
p.dealDamage(p.hitDiff2);
p.KilledBy[playerId] += p.hitDiff2;
p.hitID = playerId;
p.offTimer = System.currentTimeMillis();
p.KillerId = playerId;
}
else if (splash) {
p.specGFX(85);
p.hitID = parent.playerId;
p.inCombat = true;
p.lastCombat = System.currentTimeMillis();
}
if (p.vengon && p.hitDiff2 != 0 && !splash) {
hitDiff = (int)(hitDiff * .83);
currentHealth -= (int)(hitDiff * .83);
hitUpdateRequired = true;
updateRequired = true;
appearanceUpdateRequired = true;
p.vengon = false;
p.plrText = "Taste vengeance!";
p.plrTextUpdateRequired = true;
}
if(System.currentTimeMillis() - p.lastEntangle > p.entangleDelay && !splash){
p.lastEntangle = System.currentTimeMillis();
p.entangleDelay = 20000;
p.sM("You have been frozen!");
}
}
} container.stop();
}
}, 1200);
}
this code is incredibly long and inefficient, but w.e
if this gives you errors, go die in a hole, thanks.