|
|
 |
 |
 |
 |
|
 |
 |
|
 |
 |
|
 |
|
Quests::Q&A This is the quest support section |

02-11-2012, 09:53 PM
|
 |
Developer
|
|
Join Date: Mar 2003
Posts: 1,498
|
|
Just a quick glance, but I would assume it has something to do with hardcoding 0 and 2000 rather than getting a true client count. Haven't done it in a while, but is there truly a client with ID of 0? Another thing to think of is what happens when you get beyond the actual list of clients.
|

02-11-2012, 10:00 PM
|
 |
Dragon
|
|
Join Date: Nov 2008
Location: GA
Posts: 904
|
|
Quote:
Originally Posted by joligario
Just a quick glance, but I would assume it has something to do with hardcoding 0 and 2000 rather than getting a true client count. Haven't done it in a while, but is there truly a client with ID of 0? Another thing to think of is what happens when you get beyond the actual list of clients.
|
Not sure why that would cause any issue, it never did before (and is how it was written by Kayen).
|

02-11-2012, 10:28 PM
|
Demi-God
|
|
Join Date: Aug 2010
Posts: 1,742
|
|
Something like this might work, and it'd be more efficient since it's not going to try and retrieve 2000 clients.
Code:
my @clientlist = $entity_list->GetClientList();
foreach $ent (@clientlist)
{
my $x = $npc->GetX();
my $y = $npc->GetY();
my $z = $npc->GetZ();
my $distanceCHK = $ent->CalculateDistance($x, $y, $z);
my $PLTarget = $npc->GetTarget();
my $TargID = $PLTarget->GetID();
my $ClID = $ent->GetID();
my $RampDamageVar = (int(rand($DamageVar ))) + (int($ShieldMinDam));
if (($distanceCHK <= 2000) && ($TargID != $ClID))
{
$ent->Damage($npc, $RampDamageVar, 7477, 1, true, -1, false);
$ent->Message(13, "$cmname hits YOU for $RampDamageVar points of damage!");
}
}
|
 |
|
 |

02-11-2012, 10:37 PM
|
 |
Dragon
|
|
Join Date: Nov 2008
Location: GA
Posts: 904
|
|
Quote:
Originally Posted by lerxst2112
Something like this might work, and it'd be more efficient since it's not going to try and retrieve 2000 clients.
Code:
my @clientlist = $entity_list->GetClientList();
foreach $ent (@clientlist)
{
my $x = $npc->GetX();
my $y = $npc->GetY();
my $z = $npc->GetZ();
my $distanceCHK = $ent->CalculateDistance($x, $y, $z);
my $PLTarget = $npc->GetTarget();
my $TargID = $PLTarget->GetID();
my $ClID = $ent->GetID();
my $RampDamageVar = (int(rand($DamageVar ))) + (int($ShieldMinDam));
if (($distanceCHK <= 2000) && ($TargID != $ClID))
{
$ent->Damage($npc, $RampDamageVar, 7477, 1, true, -1, false);
$ent->Message(13, "$cmname hits YOU for $RampDamageVar points of damage!");
}
}
|
Like this? (still doesn't get to the damage portion)
Code:
sub EVENT_TIMER
{
if ($timer eq "rampage")
{
quest::stoptimer("rampage");
my $TimeRA = quest::ChooseRandom(15);
quest::settimer("getclients", $TimeRA);
}
if ($timer eq "getclients")
{
$cmname = $npc->GetCleanName();
my $MaxDam = $npc->GetMaxDMG();
my $ShieldMaxDam = ($MaxDam * .80);
my $ShieldMinDam = $ShieldMaxDam / 2;
my $DamageVar = ($ShieldMaxDam - $ShieldMinDam);
$entity_list->MessageClose($npc, 1, 2000, 13, "$cmname SLAMS his hammer into the ground!");
my @clientlist = $entity_list->GetClientList();
foreach $ent (@clientlist)
{
my $x = $npc->GetX();
my $y = $npc->GetY();
my $z = $npc->GetZ();
my $distanceCHK = $ent->CalculateDistance($x, $y, $z);
my $PLTarget = $npc->GetTarget();
my $TargID = $PLTarget->GetID();
my $ClID = $ent->GetID();
my $RampDamageVar = (int(rand($DamageVar ))) + (int($ShieldMinDam));
if (($distanceCHK <= 2000) && ($TargID != $ClID))
{
$ent->Damage($npc, $RampDamageVar, 7477, 1, true, -1, false);
$ent->Message(13, "$cmname hits YOU for $RampDamageVar points of damage!");
}
}
}
}
|
 |
|
 |
Thread Tools |
|
Display Modes |
Hybrid Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 01:10 PM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |