EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   Quest to remove unwanted buffs. (https://www.eqemulator.org/forums/showthread.php?t=35983)

Drakiyth 11-13-2012 02:03 AM

Quest to remove unwanted buffs.
 
I'm looking to create a quest that constantly removes unwanted buffs from players, but I have failed to come up with anything solid.

EDIT:

if ($client && $client->FindBuff(xxxx) && $ulevel <= (xxxx))

$client->BuffFadeAll(); is the syntax I'm using but can't seem to find a place to constantly check it. (This works)


Tried making this a player.pl in templates and can't get anything going. Tried sub EVENT_TARGET_CHANGE{ and a sub EVENT_TIMER so far but no luck.

Thanks all.

lerxst2112 11-13-2012 05:57 AM

Why not just remove the spells that cast those buffs if you don't want players to have them?

c0ncrete 11-13-2012 08:57 AM

EVENT_TIMER doesn't export the $client object, so your conditional never passes.

you can try to dynamically name the timer in player.pl like this:

Code:

quest::settimer('checkbuffs|' . $client->GetName(), 10);
and then split up the $timer name into parts so you can get the client in EVENT_TIMER like this:

Code:

if ( $timer =~ /^checkbuffs|/ ) {
    my ($timer, $name) = split(/\|/, $timer);
    my $client = $entity_list->GetClientByName($name);
    # do whatever with $client here
}

EDIT:
changed delimiter to pipe (|) instead of underscore (_), as some character names may have underscores to indicate spaces.
also, i'm not sure if you're going to have access to the entity list in global_player.pl, so you might have to use it in each zone's player.pl instead.

EDIT AGAIN:
sheesh... i'm having all sorts of syntax issues this morning. i blame the cold weather...

trevius 11-13-2012 10:02 AM

If you want to remove specific buffs and not just all, you can probably use one of the following:

Code:

  BuffFadeByEffect(effectid, skipslot= -1)
  BuffFadeBySlot(slot, iRecalcBonuses= true)
  BuffFadeBySpellID(spell_id)


c0ncrete 11-13-2012 12:38 PM

oops... i was wrong about the $client object not being exposed to EVENT_TIMER in player.pl... that would only apply to npc scripts.

i've also found that quests\templates\global_player.pl runs in addition to quests\<zone>\player.pl (global_player events fire off first if there are duplications).

i was under the impression the global script only ran if the zone-specific script didn't exist.

hooray for learning.

Drakiyth 11-13-2012 04:58 PM

Quote:

Originally Posted by lerxst2112 (Post 214279)
Why not just remove the spells that cast those buffs if you don't want players to have them?


They are only undesired at specific levels and the easy fix would be if the Effect: Min Level would actually work on spell creation. (Anybody know how to get this to actually work with Null's spell editor or even a navicat column/sql change?

I've decided to just make scripts for each buff; using the sub EVENT_SPELL_EFFECT_BUFF_TIC_CLIENT{ Checks for the level of the user and it works
like a charm.

Caryatis 11-13-2012 05:04 PM

Effect: Min Level is a focus effect which requires the spell being cast to be at least that level to be affected by the focus, not that target of a spell must be such a level.

Drakiyth 11-13-2012 06:49 PM

Thank you Caryatis, I appreciate the response. I have a fix for it so this thread is pretty much done now.

Thank you guys.

thepoetwarrior 11-19-2012 09:19 AM

I have a mount with extra HP which has a level required to click / mount, but how would I force the player to get off the mount (no more buff) while doing a delevel quest?

trevius 11-19-2012 09:29 AM

I think that spell line uses this effect (from zone/spdat.h):

http://code.google.com/p/projecteqem...r/zone/spdat.h
Code:

#define SE_SummonHorse                                  113    // implemented
So, the following should work:

Code:

$client->BuffFadeByEffect(113);

thepoetwarrior 11-19-2012 09:42 AM

Thanks much! :)

thepoetwarrior 11-19-2012 10:19 AM

Now I don't have to list every spell or other methods of getting creative.

The BuffFadeByEffect + list of ids on spdat.h was extremely useful.

Thanks again Trevius!


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

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