- my ($amount,$ship,$value) = @_;
- $ship = "\%$ship\%";
- $amount = parseValue($amount);
- $value = parseValue($value);
- $value *= -1.5 if defined $value and $value < 0;
-
- my @ship = $ND::DBH->selectrow_array(q{
-SELECT name,target,"type",damage,metal+crystal+eonium,init,"class",guns,race
-FROM ship_stats WHERE name ILIKE ?
- }, undef, $ship);
- if (@ship){
- my $type = "kill";
- $type = "stun" if $ship[2] eq 'Emp';
- $type = "steal" if ($ship[2] eq 'Steal') or ($ship[2] eq 'Pod');
-
- $amount = int(($value*100/$ship[4])) if $amount eq 'value';
- $value = prettyValue(($amount*$ship[4]/100));
- my $text = "$amount $ship[0] ($ship[5]:$value) will $type:";
- my $st = $ND::DBH->prepare(q{
- SELECT name,"class","type",armor,metal+crystal+eonium,init,target,eres,race
- FROM ship_stats WHERE "class" = ?
- });
- $st->execute($ship[1]);
- while (my @target = $st->fetchrow()){
- my $dead = $ship[2] eq 'Emp' ? int($amount*$ship[7]*(100-$target[7])/100) : int($amount*$ship[3]/$target[3]);
- $value = prettyValue($dead*$target[4]/100);
- if (($target[6] eq $ship[6]) and ($target[5] <= $ship[5])){
- $target[5] = "${ND::C}04$target[5]$ND::C";
- }elsif(($target[6] eq $ship[6]) and ($target[5] > $ship[5])){
- $target[5] = "${ND::C}12$target[5]$ND::C";
- }
- $target[0] = "${ND::C}04$target[0]$ND::C" if $target[2] eq 'Norm' || $target[2] eq 'Cloak';
- $target[0] = "${ND::C}12$target[0]$ND::C" if $target[2] eq 'Emp';
- $target[0] = "${ND::C}13$target[0]$ND::C" if $target[2] eq 'Steal';
- $text .= " $ND::B$dead$ND::B $target[0] ($target[5]:$value),";
+ my ($msg,$command) = @_;
+ my ($amount,$ship,$value,$target);
+ my $eff = 1;
+ $eff = 0 if $command =~ /stop/;
+ if(defined $msg && $msg =~ /^(-?\d+(?:\.\d+)?[hkMG]?) (\w+)(?: (\w+))?/){
+ $ship = "\%$2\%";
+ $target = ($3 || '%');
+ my $am = $1;
+ if ($command =~ /^v.+$/){
+ $value = parseValue($am);
+ $value *= -1.5 if $value < 0;
+ my $feud = '';
+ }else{
+ $amount = parseValue($am);