|
|
 |
 |
 |
 |
|
 |
 |
|
 |
 |
|
 |
|
Quests::Q&A This is the quest support section |

01-12-2011, 04:57 PM
|
 |
Demi-God
|
|
Join Date: Nov 2007
Posts: 2,175
|
|
Kei Mgb
I am trying to modify the already written buff bot to do a KEI mass group every so often. I have all of this scripted and it is working well, all I need now is to make the npc cast the spell which I would had thought was the easiest part. I cannot seem to find out how to give the NPC the mass group aa, then maybe take it away right after or is there a special separate list of spells for MGB ?
|

01-12-2011, 05:14 PM
|
Dragon
|
|
Join Date: May 2009
Location: Milky Way
Posts: 539
|
|
Usually when you want to do something with NPCs that players can do with 1 button, you need to think behind the scenes. IE what code is run when the player uses that button, in this case MGB. That will usually give you a good idea of how to replicate it for NPCs.
In this case, I would get the client list from the entitylist, use a foreach loop to cycle through each client, do a distance check to mob and if close enough, cast the buff on the player(or make the player cast the buff on themselves).
|

01-12-2011, 05:16 PM
|
 |
Demi-God
|
|
Join Date: Nov 2007
Posts: 2,175
|
|
Wow, I thought it would had been simpler.
|

01-12-2011, 05:33 PM
|
 |
Demi-God
|
|
Join Date: Nov 2007
Posts: 2,175
|
|
It was not too bad, this did it.
Code:
my @clientlist = $entity_list->GetClientList();
foreach $ent (@clientlist)
{
$ent->CastSpell(2570, $ent);
}
my @npclist = $entity_list->GetNPCList();
foreach $ent (@npclist)
{
$ent->CastSpell(2570, $ent);
}
The only downside is that it looks like they are casting it themselves, which they are. This is the only way I figured for it to work. If you think of any other way let me know.
|

01-12-2011, 05:42 PM
|
Dragon
|
|
Join Date: May 2009
Location: Milky Way
Posts: 539
|
|
Keep in mind that atm you code will make every person and NPC in zone do that, might want to add some distance checks and maybe check for being a pet of a client or bot in the NPC loop. Also that doesnt work for bots(if you wanted to include them or not).
You could get the mob list and then only have to do one loop with all your logic for different cases inside that.
Also if you dont want them to actually cast the spell, use CastSpell(xxx, blah, 10, 0, 0); the 10 is slot(not really important except its not a spell gem), then its cast time and mana usage or vice versa.
|

01-12-2011, 05:43 PM
|
 |
Demi-God
|
|
Join Date: Nov 2007
Posts: 2,175
|
|
Yeah I just walked out of visual range of the NPC and saw that.
|

01-12-2011, 06:49 PM
|
 |
Demi-God
|
|
Join Date: Nov 2007
Posts: 2,175
|
|
Quote:
Originally Posted by Caryatis
Also if you dont want them to actually cast the spell, use CastSpell(xxx, blah, 10, 0, 0); the 10 is slot(not really important except its not a spell gem), then its cast time and mana usage or vice versa.
|
Not quite following you here. Are you saying
$ent->CastSpell(2570, $ent, 10, -1, -1)
or
$npc->CastSpell(2570, $ent, 10, -1, -1)
or
CastSpell(2570, $ent, 10, -1, -1)
Because the last does nothing for me.
|

01-14-2011, 04:08 PM
|
Hill Giant
|
|
Join Date: Oct 2010
Posts: 123
|
|
That was the case until Target Group Buff, in which case if you had a player in another group as your target, it would land on that group.
toggled with /tgb on/off , not an ability
TGB should probably be in the current emu code, I would think, but I don't know for sure. Not sure if this would have an effect.
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 03:09 PM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |