Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

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

Reply
 
Thread Tools Display Modes
  #1  
Old 12-18-2014, 07:32 PM
freewind1
Fire Beetle
 
Join Date: Dec 2009
Posts: 6
Default Mass Weapon Model and Spell Viewer ($val issue)

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
Reply With Quote
  #2  
Old 12-18-2014, 09:03 PM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,071
Default

Quote:
Originally Posted by freewind1 View Post
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.
Reply With Quote
  #3  
Old 12-18-2014, 10:25 PM
freewind1
Fire Beetle
 
Join Date: Dec 2009
Posts: 6
Default

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

Code:
# 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

Code:
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
Reply With Quote
  #4  
Old 12-18-2014, 10:38 PM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,071
Default

Name your weapon NPC's 'weapon' and your effects NPC's 'effects'
Reply With Quote
Reply

Thread Tools
Display Modes

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 -4. The time now is 02:27 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3