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 08-30-2014, 01:49 PM
bloatedseachicken
Fire Beetle
 
Join Date: Aug 2014
Posts: 6
Default affect only named mobs?

hi,

i need help with an if statement that will only select name mobs.

For example, i tried this, but it's not working

if ($mname =~ #) then blah blah.

What is the correct way?

Also tried this.

If ($mname->GetCleanName() =~/#/i) then blah blah.

Thanks
Reply With Quote
  #2  
Old 08-30-2014, 02:16 PM
demonstar55
Demi-God
 
Join Date: Apr 2008
Location: MA
Posts: 1,164
Default

You can do $mname =~ /^#/ I think? Might also help explain what your trying to accomplish. I assume you just want to do something with all named mobs in the global file?
Reply With Quote
  #3  
Old 08-30-2014, 02:17 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,595
Default

Try this:
Code:
sub EVENT_SPAWN {
    if (substr($npc->GetName(), 0, 1) eq "#") {
        blah;
    }
}
Reply With Quote
  #4  
Old 08-30-2014, 04:39 PM
bloatedseachicken
Fire Beetle
 
Join Date: Aug 2014
Posts: 6
Default

Yes, global file... thanks guys! Will try those out
Reply With Quote
  #5  
Old 08-30-2014, 10:32 PM
bloatedseachicken
Fire Beetle
 
Join Date: Aug 2014
Posts: 6
Default

hmm cant get either of those to work either :(

is there a way to recognize only named in a script? like how does named get singled out? they don't all have # in front right? I know with MQ2, you can /target named and it will locate and target the named mobs in zone...that may have nothing to do with this, but just made me think there may be a way to do it in perl?

thanks either way
Reply With Quote
  #6  
Old 08-31-2014, 12:51 AM
demonstar55
Demi-God
 
Join Date: Apr 2008
Location: MA
Posts: 1,164
Default

MQ2's function just excludes a bunch of spawn types then excludes ones that start with A or An, then excludes a bunch of other stuff, then checks if the first character is an upper case letter or #.
Reply With Quote
  #7  
Old 08-31-2014, 07:31 AM
bloatedseachicken
Fire Beetle
 
Join Date: Aug 2014
Posts: 6
Default

ok, so this works as long as the mob has # in the name

sub EVENT_SPAWN {
if (substr($npc->GetName(), 0, 1) eq "#") {
blah;
}
}

but...how can I make it pick out mobs with an upper case letter at the beginning of the name? I saw demonstar use this ^, is that the function needed? how to apply to the above if statement?

thanks so much guys!
Reply With Quote
  #8  
Old 08-31-2014, 11:48 AM
demonstar55
Demi-God
 
Join Date: Apr 2008
Location: MA
Posts: 1,164
Default

The '^' means front of the line
Reply With Quote
  #9  
Old 08-31-2014, 12:42 PM
bloatedseachicken
Fire Beetle
 
Join Date: Aug 2014
Posts: 6
Default

is there some way to use =~ /([A-Z])/ in there to select only Uppercase mobs?

im at a loss lol
Reply With Quote
  #10  
Old 08-31-2014, 12:59 PM
bloatedseachicken
Fire Beetle
 
Join Date: Aug 2014
Posts: 6
Default

woot this worked

if($mname =~ /([A-Z])/)

:P
Reply With Quote
Reply


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 09:35 PM.


 

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