Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Plugins & Mods

Quests::Plugins & Mods Completed plugins for public use as well as modifications.

Reply
 
Thread Tools Display Modes
  #1  
Old 01-26-2014, 05:22 AM
Township EQ
Hill Giant
 
Join Date: Sep 2013
Posts: 118
Default plugin::ScaleTrash

This is a very simple plugin used to set a mobs level within a range. Using this combined with Akka's scaling system can save so much time when making a zone. You can get his scaling system here.

This is an example from a default.pl I've been working on. This will set every mob in the zone that has "snake" in its name to 40-50 with a variance of 3. Akka's scaling system then takes over and scales that mob to its level. I hope this saves some of you a bit of time!

Example:

Code:
sub EVENT_SPAWN {
	$nn = $npc->GetCleanName();
	$nid = $npc->GetNPCTypeID();
	if($nn=~/snake/i) { 																
		plugin::ScaleTrash(40, 50, 3);
	}
}
Plugin:

Code:
#::: Usage: plugin::ScaleTrash(min_level, max_level, variance); 
sub ScaleTrash { 
     $npc = plugin::val('$npc'); 
     $npc->SetLevel(plugin::RandomRange($_[0] + plugin::RandomRange(0 - $_[2], $_[2]), $_[1] + plugin::RandomRange(0 - $_[2], $_[2])));
}
Reply With Quote
  #2  
Old 01-26-2014, 09:59 AM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,594
Default

Question?: Couldn't you use the 'level' and 'maxlevel' column in the database to set level rather than doing it every time a mob spawns?
Reply With Quote
  #3  
Old 01-26-2014, 10:29 AM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,497
Default

Not when, for example, you are dynamically creating zone spawns based off raid/group/player level in an instance.
Reply With Quote
  #4  
Old 01-26-2014, 10:49 AM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,594
Default

I guess, but that's not what's happening here, this is just what I said in Perl form.
Reply With Quote
  #5  
Old 01-26-2014, 11:15 AM
Township EQ
Hill Giant
 
Join Date: Sep 2013
Posts: 118
Default

Quote:
Originally Posted by Kingly_Krab View Post
Question?: Couldn't you use the 'level' and 'maxlevel' column in the database to set level rather than doing it every time a mob spawns?
Dunno.. never done it that way. Doesn't seem very practical either. With this you can edit it basically on the fly.. changing 2 variables at most instead of one db entry for every mob in the zone. As for what joligario said if you wanted to you could also get a group's average level (or a solo player).. store it in a qglobal.. define it and use it for min and the defined variable +whatever for the max with if checks based on npc names/ids to scale an entire zone.
Reply With Quote
  #6  
Old 01-26-2014, 11:22 AM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,594
Default

I guess if you're wanting your content to scale based around the player you can do it that way, but the way you're currently doing it can be done in the database then manipulated by Akkadius' scaling script; therefore, this is unnecessary without a scaling factor determining the level of the mobs. For example, if I were to go in Crushbone, I have a level of 1 on a mob, a max level of 5 on the same mob, he'll go between 1 and 5 and scale based upon the database scale rate, and if I have Akkadius' script, he'll scale with that. Now I could make it to where it checks the version of the zone and pulls the average level of a group in order to scale the zone to their specifications, but I don't see the necessity of scaling it based upon the level of the people in a group. With that you would only need one zone for content if they scaled based upon average group level, scaled through Akkadius' script, then had loot added to them according to level.
Reply With Quote
  #7  
Old 01-26-2014, 11:27 AM
Township EQ
Hill Giant
 
Join Date: Sep 2013
Posts: 118
Default

Quote:
Originally Posted by Kingly_Krab View Post
I guess if you're wanting your content to scale based around the player you can do it that way, but the way you're currently doing it can be done in the database then manipulated by Akkadius' scaling script; therefore, this is unnecessary without a scaling factor determining the level of the mobs. For example, if I were to go in Crushbone, I have a level of 1 on a mob, a max level of 5 on the same mob, he'll go between 1 and 5 and scale based upon the database scale rate, and if I have Akkadius' script, he'll scale with that. Now I could make it to where it checks the version of the zone and pulls the average level of a group in order to scale the zone to their specifications, but I don't see the necessity of scaling it based upon the level of the people in a group, with that you would only need one zone for content if they scaled based upon level, scaled through Akkadius' script, then had loot added to them according to level.
Then you're welcome to make your content that way man.. I can set an if check for the name "orc" and put in 1 and 5 to this and if I test it out and 1-5 isn't what I want i literally change the 5 to a different number. If you do it your way you're changing every entry of each different npc type that's an orc.. Which way is more practical?

The whole group thing was an example I used of what you can easily do with this. You using it or not is up to you lol.
Reply With Quote
  #8  
Old 01-26-2014, 11:32 AM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,594
Default

Actually, I'm not doing all Orcs, I do it by zone.

Code:
UPDATE npc_types n INNER JOIN spawnentry s ON n.id = s.npcID INNER JOIN spawn2 s2
ON s.spawngroupID = s2.spawngroupID SET n.CHANGEME = VALUE WHERE s2.zone = 'ZONENAME';
Code:
SELECT DISTINCT n.* FROM npc_types n INNER JOIN spawnentry s
ON n.id = s.npcID INNER JOIN spawn2 s2 ON s.spawngroupID = s2.spawngroupID WHERE s2.zone = 'ZONENAME'
ORDER BY `hp` DESC LIMIT 1000;
Reply With Quote
  #9  
Old 01-26-2014, 11:46 AM
Township EQ
Hill Giant
 
Join Date: Sep 2013
Posts: 118
Default

Quote:
Originally Posted by Kingly_Krab View Post
Actually, I'm not doing all Orcs, I do it by zone.

Code:
UPDATE npc_types n INNER JOIN spawnentry s ON n.id = s.npcID INNER JOIN spawn2 s2
ON s.spawngroupID = s2.spawngroupID SET n.CHANGEME = VALUE WHERE s2.zone = 'ZONENAME';
Code:
SELECT DISTINCT n.* FROM npc_types n INNER JOIN spawnentry s
ON n.id = s.npcID INNER JOIN spawn2 s2 ON s.spawngroupID = s2.spawngroupID WHERE s2.zone = 'ZONENAME'
ORDER BY `hp` DESC LIMIT 1000;
K well.. I'm not gonna have a dick-swinging contest with you. Do things your way. I shared this because I figured it would save some people a bit of time.
Reply With Quote
  #10  
Old 01-26-2014, 11:55 AM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,497
Default

Quote:
Originally Posted by Kingly_Krab View Post
I guess, but that's not what's happening here, this is just what I said in Perl form.
Yeah, I didn't mean his specific implementation.
Reply With Quote
  #11  
Old 01-26-2014, 11:57 AM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,594
Default

Quote:
Originally Posted by joligario View Post
Yeah, I didn't mean his specific implementation.
Okay, haha.
Reply With Quote
  #12  
Old 01-27-2014, 02:19 AM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,071
Default

Township does work with me directly, if his plugin didn't make sense from a practicality/use standpoint I would have been straight open and honest about it before it found its way here.

The DB field in npc_types only affects the inital spawn, this is only to scale on the fly via script to set the key for my scaling system.

It is a simple addition, to use or not to use is up to the end user.
Reply With Quote
  #13  
Old 01-17-2018, 05:02 PM
Aardil
Fire Beetle
 
Join Date: Jan 2018
Location: Mississippi
Posts: 27
Default

I am looking for a way to scale only certain NPC's. I dont want to scale the whole zone.

Is it possible?
if so how?

Aardil
Reply With Quote
  #14  
Old 01-17-2018, 06:31 PM
Splose's Avatar
Splose
Discordant
 
Join Date: Apr 2014
Posts: 279
Default

Quote:
Originally Posted by Aardil View Post
I am looking for a way to scale only certain NPC's. I dont want to scale the whole zone. Note that stats will stay the same unless using Akka's scaling system or adding a bit more code.

Is it possible?
if so how?

Aardil
yeah.. you can use default.pl to control any npc in the zone provided they don't already have their own script.

Here is a very simple example of doing that.

quests/zonesn/default.pl

Code:
sub EVENT_SPAWN {
	$nn = $npc->GetCleanName();	
	
	if($nn=~/skeleton/i) {
		$npc->SetLevel(60);		#:: Set all npcs in the zone with 'skeleton' in their name to level 60
	}
	
	if($nn eq "Fippy Darkpaw") {
		$npc->SetLevel(75);		#:: Set any npc with the name 'Fippy Darkpaw' to level 75
	}
}
Reply With Quote
  #15  
Old 01-17-2018, 06:55 PM
Splose's Avatar
Splose
Discordant
 
Join Date: Apr 2014
Posts: 279
Default

Quote:
Originally Posted by Aardil View Post
I am looking for a way to scale only certain NPC's. I dont want to scale the whole zone.

Is it possible?
if so how?

Aardil
yeah.. you can use default.pl to control any npc in the zone provided they don't already have their own script. Note that stats will stay the same unless using Akka's scaling system or adding a bit more code.

Here is a very simple example of doing that.

Code:
sub EVENT_SPAWN {
	$nn = $npc->GetCleanName();	
	
	if($nn=~/skeleton/i) {
		$npc->SetLevel(60);		#:: Set all npcs in the zone with 'skeleton' in their name to level 60
	}
	
	if($nn eq "Fippy Darkpaw") {
		$npc->SetLevel(75);		#:: Set any npc with the name 'Fippy Darkpaw' to level 75
	}
}
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 06:47 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