View Single Post
  #8  
Old 11-01-2012, 07:39 PM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
If you didn't find a Clientside solution yet and onWasHit is being invoked by all forms of damage, you could try:

PHP Code:
function onWasHit(){
  
//receive original x and y from before first frame of recoil movement
  
temp.player.player.hurtdx;
  
temp.player.player.hurtdy;
  
temp.plist findnearestplayers(temp.xtemp.y);
  for(
temp.pl temp.plist){
    if(
temp.pl.ani.name == "sword"){
      
temp.bx temp.pl.0.5 + (vecx(temp.pl.dir) * 2);
      
temp.by temp.pl.+ (vecy(temp.pl.dir) * 2);
      if(
        
temp.0.5 <= temp.bx &&
        
temp.2.5 >= temp.bx &&
        
temp.<= temp.by &&
        
temp.>= temp.by
      
){
        
this.playerSlashed(temp.pl);
        return;
      }
    }
  }

Reply With Quote