Hazard to Graal
|
 |
Join Date: Apr 2009
Posts: 343
|
|
Arc hitbox system for weapons triggering three times per swing.
Alright, so I incorporated this thing maybe a few months ago, and while testing something, I realized that it was triggering three times every attack. Oddly enough, it doesn't deal damage three times, but it interferes with things that trigger every time onDamage() is triggered. Weapons that do not have "arc" in the data do not use this system and therefore do not cause this problem. After some testing, I've concluded that the problem definately lies in this script, and is not caused by the initial key input nor post-onDamage() portions of the system.
Any idea as to what could be causing the issue?
PHP Code:
if(wdata[5].tokenize(",")[1] == "arc"){
for (temp.pl2 : findNearestPlayers(player.x, player.y)) {
if (dist(player.x+1, player.y+1.5, pl2.x+1, pl2.y+1.5) <= wdata[5].tokenize(",")[2]) {
if(!(pl2.account in clientr.party)){
if(pl2.account != player.account){
if(player.dir == 0){
if(pl2.y < player.y+0.5){
triggeraction(pl2.x+0.5, pl2.y+0.5, "Damage", this.effects, player.account, {temp.damage, temp.criton}, temp.accuracy, "Physical", 100, temp.armorpierce, temp.attackerlevel, ax, ay, az, ad);
if(client.showhits){
triggerserver("gui", this.name, "putnpc", "testblock",pl2.x+0.5, pl2.y+0.5);
}
}
}
elseif(player.dir == 1){
if(pl2.x < player.x+0.5){
triggeraction(pl2.x+0.5, pl2.y+0.5, "Damage", this.effects, player.account, {temp.damage, temp.criton}, temp.accuracy, "Physical", 100, temp.armorpierce, temp.attackerlevel, ax, ay, az, ad);
if(client.showhits){
triggerserver("gui", this.name, "putnpc", "testblock",pl2.x+0.5, pl2.y+0.5);
}
}
}
elseif(player.dir == 2){
if(pl2.y > player.y+0.5){
triggeraction(pl2.x+0.5, pl2.y+0.5, "Damage", this.effects, player.account, {temp.damage, temp.criton}, temp.accuracy, "Physical", 100, temp.armorpierce, temp.attackerlevel, ax, ay, az, ad);
if(client.showhits){
triggerserver("gui", this.name, "putnpc", "testblock",pl2.x+0.5, pl2.y+0.5);
}
}
}
elseif(player.dir == 3){
if(pl2.x > player.x+0.5){
triggeraction(pl2.x+0.5, pl2.y+0.5, "Damage", this.effects, player.account, {temp.damage, temp.criton}, temp.accuracy, "Physical", 100, temp.armorpierce, temp.attackerlevel, ax, ay, az, ad);
if(client.showhits){
triggerserver("gui", this.name, "putnpc", "testblock",pl2.x+0.5, pl2.y+0.5);
}
}
}
}
}
}
|
__________________
MY POSTS ARE PRONE TO EDITS!
|
|