Go Back   EQEmulator Home > EQEmulator Forums > Support > Spell Support

Spell Support Broken Spells? Want them Fixed? Request it here.

Reply
 
Thread Tools Display Modes
  #1  
Old 04-19-2013, 02:02 PM
Riklin
Hill Giant
 
Join Date: May 2003
Location: Tacoma, WA
Posts: 225
Default Buffing NPC - Casting Several Spells

I have been working on making npc's in the guild lobby that buff players. The problem I have run into is dealing with casting spells with enough duration to be usable.

The following code works, but doesn't work well. The spells duration is only about 3 minutes, due to the way selfcast works (duration involves level, I know). In the case of a new character, I opted for not casting temperance, because that's too powerful, but cast 3 lower level cleric spells instead. symbol of transal, valor and guard. It works, but the durations are only like 3 minutes, because I can only get it to work with selfcast. I have tried using $npc->CastSpell(4053, $userid); with the 3 spells, but only the first one casts. I have looked for some kind of a delay in order to wait for the spell to be cast and recovery time, then cast another, but have not been successful in finding that kind of command.

How can I set this up to buff a new low level character, without dieing during the casting, with the duration being say 45 minutes, for 2 or more spells?

I've thought about temporarily upping the characters level to 70 so that the duration will increase, then reset the level after the spells are selfcast, that's the only thing I have considered. What other options are there?


Thanks,
Riklin


sub EVENT_SAY
{
if ($text=~/hail/i)
{
quest::say("Hello $name. I cast Cleric buffs. Which buff would you like? [HitPoints], [SpellHaste], [Healing] or [Curing]?");
}
elsif($text=~/hitpoints/i)
{
if ($ulevel >= 1 and $ulevel < 35)
{
quest::selfcast(312);
quest::selfcast(485);
quest::selfcast(1;
}
if ($ulevel > 34 and $ulevel < 61)
{
$npc->CastSpell(4053, $userid);
}
if ($ulevel > 60)
{
$npc->CastSpell(9811, $userid);
}
}
}
Reply With Quote
  #2  
Old 04-19-2013, 03:07 PM
Zamthos
Discordant
 
Join Date: Jan 2013
Posts: 284
Default

Spell Duration has nothing to do with the quest::selfcast as far as I am aware, you could try adjusting the duration of the spell in the spells table? Also, when you post code you may want to put it in code blocks. You know you can also use saylinks so they click a purple 'link' and it says the text before them? Your script is re-written below using them. The , 1 after the "whatever" makes it so that the text within the saylink isn't said out loud. Also, you can use plugin::Whisper, case-sensitive, to whisper the text to the player rather than say it out loud, however, if you want to send a message to a player in a 'whisper' from something other than an NPC you have to use a $client->Message or it will not work, I hope I helped. ~Harbinger Zamthos

Code:
sub EVENT_SAY 
{
	my $hp = quest::saylink("Hit Points", 1);
	my $haste = quest::saylink("Spell Haste", 1);
	my $healing = quest::saylink("Healing", 1);
	my $curing = quest::saylink("Curing", 1);
	
	if($text=~/Hail/i)
	{
		plugin::Whisper("Hello $name. I cast Cleric buffs. Which buff would you like? [$hp], [$haste], [$healing] or [$curing]?");
	}
	elsif($text=~/Hit Points/i)	
	{	
		if($ulevel >= 1 && $ulevel < 35)
		{
			quest::selfcast(312);
			quest::selfcast(485);
			quest::selfcast(1);	
		}	
		if($ulevel > 34 && $ulevel < 61) 
		{
			$npc->CastSpell(4053, $userid);
		}
		if($ulevel > 60) 
		{
			$npc->CastSpell(9811, $userid);
		}
	}
}
Reply With Quote
  #3  
Old 04-19-2013, 04:47 PM
Riklin
Hill Giant
 
Join Date: May 2003
Location: Tacoma, WA
Posts: 225
Default

Level DOES affect the duration of spells. IT's a SIMPLE thing to test. take a level 1 GM level character and type #cast 312. This will cast Valor with around a 3 minute duration. Then type the GM command #level 70 and set your test character to level 70. NOW type #cast 312. The spell lasts for a duration of 54 minutes 6 sec.

Level has been a known entity in spell duration for as long as I have played EQ.

Selfcast uses your stats when it casts the spell you have requested. Level is a key part of determining how long the spell will last (duration). That simple test proves it...

The thing I'm trying to get some answers on is how to increase the duration of a "selfcast" spell. "castspell" works perfectly, but it only works for casting a single spell. It does not work, at least I cannot get it to work, for cases where you want to cast 2 or more spells back to back...

Rick
Reply With Quote
  #4  
Old 04-19-2013, 05:52 PM
Maceblade
Hill Giant
 
Join Date: Jun 2010
Posts: 231
Default

I have been playing around with this for about 30 minutes now trying to help you out and im on one last hope that I figured it out but its doubtful.

I used:
Code:
 UPDATE spells_new set buffdurationformula = 11 where buffgroup = 32
spell group 32 seems to be associated with all cleric HP buffs like Aegolism, Courage and Temerity. buffdurationformula 11 is supposed to set the formula to = the entire duration yet seems to not over power the level scaling. Spell group 32 does not change every cleric HP buff its random ones, like tenacity is spell group 1032.

If I knew the buffs I wanted to change the formula for I would do it this way;
Code:
UPDATE spells_new set buffdurationformula = 11 where id = 9820 and id = etc etc etc
... you get the point.


*I stand corrected I did get it using that code, however I would do more research on the exact "spell group" before doing it as I did, or perhaps put all the spells you want into a spell group and then you can change them together if you do not like the results. You can effecitvely cast Temerity rk 3 on a lvl 1 using buff bot for a 2 hour duration.

Last edited by Maceblade; 04-19-2013 at 06:02 PM.. Reason: findings...
Reply With Quote
  #5  
Old 04-19-2013, 06:14 PM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,742
Default

Changing the formula used for a bunch of spells seems like the backward way to solve this issue.

Use SpellFinished instead of CastSpell.
Reply With Quote
  #6  
Old 04-19-2013, 06:21 PM
Riklin
Hill Giant
 
Join Date: May 2003
Location: Tacoma, WA
Posts: 225
Default

What makes this even more frustrating is I've tried having an NPC use the castspell command with group type buffs. The problem is that it seems the NPCS do not have "/tgb ON" set, so they cannot cast their group buffs on groups. They only self buff the NPC.

Right now, I have figured out how to cast buffs that do not last for more than 3-4 minutes. Cast spells on a single target only (not the group or pets or mercs. Cast group spells on the NPC, but not the group itself.

It seems like this should not be as hard as I'm making it, but there don't seem to be many options.

One thing that DID work is to temporarily set level to say level 70, then selfcast, then set level back to what it was before. That causes the duration to work perfectly. The problem with this is obvious. Sooner or later the level setting code will fail and someone will be left at level 70...
Reply With Quote
  #7  
Old 04-19-2013, 06:34 PM
sorvani
Dragon
 
Join Date: May 2010
Posts: 965
Default

Jut give everyone items with click effects
Reply With Quote
  #8  
Old 04-19-2013, 06:48 PM
Riklin
Hill Giant
 
Join Date: May 2003
Location: Tacoma, WA
Posts: 225
Default

Clicky effect items? That's a possibility, but I think a common gathering place, such as the guild lobby for buffage, etc. is a good thing for the game overall. I like the illusion of people caring and buffing others to help them in their goals. That to me, is a better thing than the idea of everything being based on money and merchants, even if the buff "merchants" don't charge for their clicky items...

Rick
Reply With Quote
  #9  
Old 04-19-2013, 06:59 PM
Riklin
Hill Giant
 
Join Date: May 2003
Location: Tacoma, WA
Posts: 225
Default

I cannot find any reference to "SpellFinished" anywhere. I did try replacing CastSpell with SpellFinished, but it does not do anything. No casting at all.
Reply With Quote
  #10  
Old 04-19-2013, 07:20 PM
Maceblade
Hill Giant
 
Join Date: Jun 2010
Posts: 231
Default

I use selfcast myself and it seems to cast group buffs on the entire group and bots. I do know if you buff the pet with an NPC the owner gets the buffs as well.

My problem with the level increase/decrease is what you already stated with the "oops" factor.

If youre using the tutorial maybe just set the zone to suspend buffs. By the time they leave that area they will get higher duration buffs anyway.

Also another thing I havent tested is wether or not setting the formula to the "duration" or 11 setting is if it has a focus item check first.
Reply With Quote
  #11  
Old 04-19-2013, 07:37 PM
Riklin
Hill Giant
 
Join Date: May 2003
Location: Tacoma, WA
Posts: 225
Default

Selfcast works very well, except for the duration of the spells. You have to be up over say level 40 before spells cast with selfcast have enough duration to be useful. On my server, we're trying to use ingame travel and not use GM commands. This means that at lower levels, selfcast spells won't last long enough to get you to your hunting grounds, let alone a battle or three...
Reply With Quote
  #12  
Old 04-19-2013, 07:53 PM
NatedogEZ's Avatar
NatedogEZ
Developer
 
Join Date: Dec 2012
Posts: 515
Default

Spell duration is based on the player that CAST the spell. (This is pulled from the spell duration formula int he spells_new table)

So if you have an NPC casting the spell ON you... it will last longer if they are a high level NPC.

My low level spells are cast by the NPC and last full duration on a level one. I only have that for grouped players currently... but I have Mercs enabled so most players SHOULD be grouped at low level.
Reply With Quote
  #13  
Old 04-19-2013, 08:00 PM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,742
Default

Quote:
Originally Posted by Riklin View Post
I cannot find any reference to "SpellFinished" anywhere. I did try replacing CastSpell with SpellFinished, but it does not do anything. No casting at all.
http://www.eqemulator.net/wiki/wikka...a=QuestObjects

You can also look at plugins/group_utility.pl in CastOnGroup for an example.
Reply With Quote
  #14  
Old 04-19-2013, 08:49 PM
Zamthos
Discordant
 
Join Date: Jan 2013
Posts: 284
Default

$Group->CastGroupSpell Can cast spells on a group, and I never said that duration didn't have to do with level, just that the quest::selfcast had nothing to do with it, and it doesn't, the spell itself is influenced once cast, not by the quest::selfcast itself. You can also do something like the below.

Code:
sub EVENT_SAY
{
	my $Group = $client->GetGroup();
	
	if($text=~/Hail/i)
	{
		if($Group)
		{
			$Group->CastGroupSpell(6428);
		}
		else
		{
			quest::selfcast(6428);
		}
	}
}
The functionality of this would be to buff a whole group IF there is one, where as, if they're alone, they would receive the buffs in a singular form, rather than a MGB, 6428 is a Gamemaster 3M HP Buff and was just used as an example, if cast using quest::selfcast it has a singular target, where as with $Group->CastGroupSpell makes it have multiple targets, and makes it buff other people, or bots, within your party.
Reply With Quote
  #15  
Old 04-19-2013, 09:32 PM
Maceblade
Hill Giant
 
Join Date: Jun 2010
Posts: 231
Default

Quote:
Originally Posted by NatedogEZ View Post
Spell duration is based on the player that CAST the spell. (This is pulled from the spell duration formula int he spells_new table)

So if you have an NPC casting the spell ON you... it will last longer if they are a high level NPC.

My low level spells are cast by the NPC and last full duration on a level one. I only have that for grouped players currently... but I have Mercs enabled so most players SHOULD be grouped at low level.
That only works by PC characters buffing. NPC characters still abide by the rules of the level of the client being buffed. I thought the same thing so I kept changing the level of the buffer to see if it changed and it did not.
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 06:08 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