Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05-25-2011, 12:21 AM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
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.xplayer.y)) {
      if (
dist(player.x+1player.y+1.5pl2.x+1pl2.y+1.5) <= wdata[5].tokenize(",")[2]) {
            if(!(
pl2.account in clientr.party)){
              if(
pl2.account != player.account){
                if(
player.dir == 0){
                  if(
pl2.player.y+0.5){
                    
triggeraction(pl2.x+0.5pl2.y+0.5"Damage"this.effectsplayer.account, {temp.damagetemp.criton}, temp.accuracy"Physical"100temp.armorpiercetemp.attackerlevelaxayazad);
                    if(
client.showhits){
                      
triggerserver("gui"this.name"putnpc""testblock",pl2.x+0.5pl2.y+0.5);
                    }
                  }
                }
                elseif(
player.dir == 1){
                  if(
pl2.player.x+0.5){
                    
triggeraction(pl2.x+0.5pl2.y+0.5"Damage"this.effectsplayer.account, {temp.damagetemp.criton}, temp.accuracy"Physical"100temp.armorpiercetemp.attackerlevelaxayazad);
                    if(
client.showhits){
                      
triggerserver("gui"this.name"putnpc""testblock",pl2.x+0.5pl2.y+0.5);
                    }
                  }
                }
                elseif(
player.dir == 2){
                  if(
pl2.player.y+0.5){
                    
triggeraction(pl2.x+0.5pl2.y+0.5"Damage"this.effectsplayer.account, {temp.damagetemp.criton}, temp.accuracy"Physical"100temp.armorpiercetemp.attackerlevelaxayazad);
                    if(
client.showhits){
                      
triggerserver("gui"this.name"putnpc""testblock",pl2.x+0.5pl2.y+0.5);
                    }
                  }
                }
                elseif(
player.dir == 3){
                  if(
pl2.player.x+0.5){
                    
triggeraction(pl2.x+0.5pl2.y+0.5"Damage"this.effectsplayer.account, {temp.damagetemp.criton}, temp.accuracy"Physical"100temp.armorpiercetemp.attackerlevelaxayazad);
                    if(
client.showhits){
                      
triggerserver("gui"this.name"putnpc""testblock",pl2.x+0.5pl2.y+0.5);
                    }
                  }
                }
              }
            }
      } 
__________________
MY POSTS ARE PRONE TO EDITS!
Reply With Quote
 


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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 08:15 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.