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);
}
}
}