PDA

View Full Version : Mass Weapon Model and Spell Viewer ($val issue)


freewind1
12-18-2014, 07:32 PM
So i been playing with this for a few days now and I'm trying to get this figured out, both the player and default script aren't working, by this i mean that the player.pl does nothing (tested it by using a "on zone in" script to shout so i know that my PL works and i didn't screw it up just the sub EVENT_TARGET_CHANGE isn't working.


As for the default.pl everything is working but the $val variable, by this i mean that it spawns npc's perfectly but no one gets equipped with weapons or spell effects.


Thanks you for your time!
Freewind

P.S. i am using instance version 1

Akkadius
12-18-2014, 09:03 PM
So i been playing with this for a few days now and I'm trying to get this figured out, both the player and default script aren't working, by this i mean that the player.pl does nothing (tested it by using a "on zone in" script to shout so i know that my PL works and i didn't screw it up just the sub EVENT_TARGET_CHANGE isn't working.


As for the default.pl everything is working but the $val variable, by this i mean that it spawns npc's perfectly but no one gets equipped with weapons or spell effects.


Thanks you for your time!
Freewind

P.S. i am using instance version 1

You really need to provide more information.

freewind1
12-18-2014, 10:25 PM
Sorry here is some more information

http://youtu.be/f-SuY7TWckM
is a video of what happens in game

this is placed in my default.pl

# This function generates random strings of a given length
sub generate_random_string
{
my $length_of_randomstring=shift;# the length of
# the random string to generate

my @chars=('a'..'z','A'..'Z','0'..'9','_');
my $random_string;
foreach (1..$length_of_randomstring)
{
# rand @chars will generate a random
# number between 0 and scalar @chars
$random_string.=$chars[rand @chars];
}
return $random_string;
}

sub RunDepop{
my @nlist = $entity_list->GetNPCList();
foreach $val (@nlist){
if($val->GetCleanName()=~/effect/i || $val->GetCleanName()=~/weapon/i){
$val->Depop();
$eid++;
}
}
}

sub EVENT_SPAWN{
$nn = $npc->GetCleanName();
if($instanceversion == 1){ }
if($instanceversion == 1 && $nn=~/effect/i){ quest::settimer("effectshow", 10); }
if($instanceversion == 1 && $nn=~/weapon/i){
$npc->TempName(generate_random_string(21)); quest::settimer("weaponshow", 10);
}
}

sub EVENT_SAY{
my $effect_npc = 999273;
my $mob_1 = 999264;
my $mob_2 = 999265;
my $mob_3 = 999266;
my $mob_4 = 999267;
my $mob_5 = 999268;
my $mob_6 = 999269;
my @arg = split(' ', $text); ### Break out arguements
$nn=$npc->GetCleanName();
if($nn=~/controller/i){
if($text=~/effects/i){
$eid = 50;
if($nn=~/controller/i){
my $sx = 1786;
my $sy = 3214;
$n=1;
for($i=1;$i<=700;$i++){
quest::spawn2($effect_npc, 0, 0, $sx, $sy, 50, 128);
$sx-=10;
$n++;
if($n == 20){
$sy-=60;
$sx = 1786;
$n=1;
}
}
quest::settimer("assigneffects", 5);
}
}
elsif($text=~/weapon/i){
$eid = $arg[1];
if($nn=~/controller/i){
RunDepop();
my $sx = 1786;
my $sy = 3214;
$n=1;
for($i=1;$i<=1000;$i++){
if($i <= 500){ $mobspawn = $mob_1; }
if($i >= 500 && $i<= 1000){ $mobspawn = $mob_2; }
if($i >= 1000 && $i<= 1500){ $mobspawn = $mob_3; }
if($i >= 1500 && $i<= 2000){ $mobspawn = $mob_4; }
if($i >= 2000 && $i<= 2500){ $mobspawn = $mob_5; }
if($i >= 2500 && $i<= 3000){ $mobspawn = $mob_6; }
quest::spawn2($mobspawn, 0, 0, $sx, $sy, -40, 128);
$sx-=10;
$n++;
if($n == 100){
$sy-=60;
$sx = 1786;
$n=1;
}
}
quest::settimer("assignweapons", 10);
}
}
elsif($text=~/depop/i){ RunDepop(); }
else{
$client->Message(15, "[" . quest::saylink("Effects", 1) . "]");
$client->Message(15, "[" . quest::saylink("Weapons", 1) . "] [" . quest::saylink("weapon 1 2000", 1, "1 - 2000") . "] [" . quest::saylink("weapon 10000 12000", 1, "10000 - 12000") . "] [" .
quest::saylink("weapon 12000 14000", 1, "12000 - 14000") . "] [" . quest::saylink("weapon 14000 16000", 1, "14000 - 16000") . "] [" . quest::saylink("weapon 16000 18000", 1, "16000 - 18000") . "] [" .
quest::saylink("weapon 20000 22000", 1, "20000 - 22000") . "] [" . quest::saylink("weapon 22000 24000", 1, "22000 - 24000") . "]");
}
}
}

sub EVENT_TIMER{
if($timer eq "effectshow"){
my $neid = $npc->GetEntityVariable("effectid");
$npc->SpellEffect($neid);
}
if($timer eq "weaponshow"){
my $neid = $npc->GetEntityVariable("weaponid");
quest::wearchange(7, $neid);
my $neidd = $npc->GetEntityVariable("weaponid2");
quest::wearchange(8, $neidd);
}
if($timer eq "assigneffects"){
quest::stoptimer("assigneffects");
my @nlist = $entity_list->GetNPCList();
foreach $val (@nlist){
if($val->GetCleanName()=~/effect/i){
if($eid == 167){ $eid++; }
else{
$val->SetEntityVariable("effectid", $eid);
$eid++;
}
}
}
}
if($timer eq "assignweapons"){
quest::stoptimer("assignweapons");
my @nlist = $entity_list->GetNPCList();
foreach $val (@nlist){
if($val->GetCleanName()=~/weapon/i){
$val->SetEntityVariable("weaponid", $eid);
$eid++;
$val->SetEntityVariable("weaponid2", $eid);
$eid++;
}
}
}
}this is my player.pl

sub EVENT_TARGET_CHANGE{
$CT = $client->GetTarget();
if($CT && $CT->IsNPC()){
if($CT->GetCleanName()=~/effect/i){
if($CT->GetEntityVariable("effectid")){
$client->Message(15, "[Effect ID]: " . $CT->GetEntityVariable("effectid"));
}
}
if($CT->GetCleanName()=~/weapon/i){
if($CT->GetEntityVariable("weaponid")){
$client->Message(15, "[Weapon 1]: " . $CT->GetEntityVariable("weaponid"));
$client->Message(15, "[Weapon 2]: " . $CT->GetEntityVariable("weaponid2"));
}
}
}
}




Both these are copies of http://www.eqemulator.org/forums/showthread.php?t=37652 minus the changes to $mob_1 $mob_2 $mob_3 $mob_4 $mob_5 $mob_6 and $effect_npc

Akkadius
12-18-2014, 10:38 PM
Name your weapon NPC's 'weapon' and your effects NPC's 'effects'