EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Plugins & Mods (https://www.eqemulator.org/forums/forumdisplay.php?f=678)
-   -   Plugin: Persistent Nimbus (https://www.eqemulator.org/forums/showthread.php?t=37648)

Akkadius 12-24-2013 12:16 AM

Plugin: Persistent Nimbus
 
Purpose:

The purpose of this plugin was intended for setting Nimbus effects on NPC's persistently for all players. The problem with using any Nimbus is that the server does not always send Nimbus'es to new clients entering a zone, so this plugin is responsible for resending what the NPC has assigned to it.

When a client enters the zone after the nimbus was assigned to the NPC, it will only send the Nimbus packet to the client after an entity list iteration.


Name File: Akka_Custom.pl under plugins folder.

Code:

sub PersistentNimbus{
        $npc = plugin::val('$npc');
        $n = 0;
        while($_[$n]){
                $npc->SpellEffect($_[$n], 500, 0, 1, 3000, 1);
                $npc->SetEntityVariable("PersistentNimbus_" . $n, $_[$n]);
                $n++;
        }
}

HOW TO USE:

Under global_player.pl under the templates or 'global' folder, this section of code needs to be placed underneath EVENT_ENTERZONE:

* Note you can assign as many as you want, you simply add more Nimbus #'s

Code:

plugin::PersistentNimbus(1, 2, 4, 5, 6, 7, 8, 9, 10);
Code:

sub EVENT_ENTERZONE {
        ### Persistent Nimbus Plugin ###
        @nlist = $entity_list->GetNPCList();
        foreach my $NPC (@nlist){
                $n = 0;
                if($NPC->GetEntityVariable("PersistentNimbus_" . $n) > 0){
                        while($NPC->GetEntityVariable("PersistentNimbus_" . $n) > 0){
                                $NPC->SpellEffect($NPC->GetEntityVariable("PersistentNimbus_" . $n), 500, 0, 1, 3000, 1, $client);
                                $n++;
                        }
                }
        }
        ################################
}

Example Use, Assigning to an NPC:

This is an example of a default.pl for NPC's in a zone, this applies to many NPC's and has conditionals based on NPC name:

Code:

sub EVENT_SPAWN{
        $nn = $npc->GetCleanName();
        if($nn=~/pumpkin/i){ plugin::PersistentNimbus(550, 548, 611, 406); $npc->TempName(""); }
        if($nn=~/scare/i){ plugin::PersistentNimbus(550); }
        if($nn=~/zonein/i){ plugin::PersistentNimbus(445, 548, 516); $npc->TempName(""); }
        if($nn=~/ring/i){ plugin::PersistentNimbus(414); $npc->TempName(""); plugin::SetProx(25, 25); }
        if($nn=~/halloween orange/i){ plugin::PersistentNimbus(403); $npc->TempName(""); }
        if(($nn=~/minion of the underworld/i) && ($npc->GetRace() == 279)) { plugin::PersistentNimbus(473); } #Fairy thingie
        if(($nn=~/minion of the underworld/i) && ($npc->GetRace() == 293)) { plugin::PersistentNimbus(462); } #Imp
        if(($nn=~/minion of the underworld/i) && ($npc->GetRace() == 362)) { plugin::PersistentNimbus(319); } #Golem
        if(($nn=~/minion of the underworld/i) && ($npc->GetRace() == 270)) { plugin::PersistentNimbus(446); } #Undead
}

http://i.imgur.com/vLCRkV1.jpg

NatedogEZ 02-02-2014 03:09 AM

Some of these not possible to make permanent? I tried the example of 1 2 ect. up to 10 and they would all go off at once.. then they disappear.

Akkadius 02-02-2014 03:14 AM

Quote:

Originally Posted by NatedogEZ (Post 228059)
Some of these not possible to make permanent? I tried the example of 1 2 ect. up to 10 and they would all go off at once.. then they disappear.

It's used for spell effects that are nimbuses, some examples are

Code:

plugin::PersistentNimbus(405, 406, 368, 369);
Shows as below:

https://dl.dropboxusercontent.com/u/50023467/exampl.png

https://dl.dropboxusercontent.com/u/50023467/heaven.jpg

I use it all the time

NatedogEZ 02-02-2014 03:21 AM

Ah so can only use the nimbus type effects to stay permanently. Thank you sir :) This is a very nice plugin

Akkadius 02-02-2014 03:22 AM

Quote:

Originally Posted by NatedogEZ (Post 228061)
Ah so can only use the nimbus type effects to stay permanently. Thank you sir :) This is a very nice plugin

Thank you sir :)

roonibrice 03-02-2014 12:44 AM

Cool plugin can't wait to try :)

daerath 05-04-2016 02:16 PM

Lua equivalent for global_player
 
I'm not sure if you can have both a global_player.pl and global_player.lua, but if you're using the .lua version here is the equivalent code that goes in event_enter_zone in global_player.lua.

Code:

-- Persistent Nimbus Plugin
function event_enter_zone(e)
  nlist = eq.get_entity_list();
  if (npc_list ~= nil) then
    for NPC in nlist.entries do
      local n = 0;
      if (NPC.GetEntityVariable("PersistentNimbus_" .. n) > 0) then
        while NPC.GetEntityVariable("PersistentNimbus_" .. n) > 0 do
          NPC.SpellEffect(NPC.GetEntityVariable("PersistentNimbus_" .. n), 500, 0, 1, 3000, 1, e);
          n = n + 1;
        end
      end
    end
  end
end
-- End Persistent Nimbus Plugin


Liontooth 12-12-2020 07:09 AM

Is there a list of Nimbuses anywhere or do I just need to test 1 at a time to figure them all out? Searched the wiki but didnt see any info on them.


All times are GMT -4. The time now is 06:51 PM.

Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.