|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Quests::Q&A This is the quest support section |
06-23-2008, 03:28 AM
|
Sarnak
|
|
Join Date: Oct 2005
Posts: 45
|
|
NPC reseting aggro for a quest
Okay, here is what I am trying to do...
My event begins and when npc1 reaches 75% he spawns 4 adds. I want to make it so that npc1 stops attacking and is unable to be targeted until the 4 adds are killed. Once they are dead i want him to start attacking again.
Anyone able to help me set this portion of the quest up? I have everything else running right, just dont know the commands to make a npc non aggro and untargetable.
|
06-23-2008, 05:03 AM
|
|
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
The only way to do that is to have multiple versions of the same spawn and then depop the main one and pop him again as the untargetable/non-agro version. Then, once the adds are dead, set it to spawn the main one again, but have it spawn with lower health than before (maybe 70%).
|
06-23-2008, 03:24 PM
|
Hill Giant
|
|
Join Date: Jun 2006
Location: San Jo, Cali
Posts: 180
|
|
Here is the full list... I just pulled it from the wiki... READ THE WIKI <3
ABILITY CODE
Summon S
Enrage E
Rampage R
Flurry F
Tripple Attack T
Quad Attack Q
Unslowable U
Unmezable M
Uncharmable C
Unstunable N
Unsnareable/Unrootable I
Unfearable D
Immune to Melee A
Immune to Magic B
Immune to Fleeing f
Immune to non-bane damage O
Immune to non-magical damage W
Will never aggro H
__________________
Tinimus Minimus Da Captain - Warrior of MMOs
Lead Admin and Server Op of Da Pirate's Cove, a Custom Classic Legit Progression Server
|
06-23-2008, 06:35 PM
|
|
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
For untargetable, you have to set body_type to 11 in the NPC_Types table (or in GeorgeS' NPC Loot Editor).
|
06-25-2008, 03:18 AM
|
Sarnak
|
|
Join Date: Oct 2005
Posts: 45
|
|
Aye, I knew all of that. I was just curious if there was a command i was missing that would set a npc to become untargetable without having a to depop it and respawn a new one.
Thanks Trev =)
|
06-25-2008, 04:23 AM
|
|
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
Ya, I always love when new quest commands get added. I think it would be awesome if there was one that could change any NPC stat realtime like a quest version of NPC edit that didn't require a repop. Then, you could have an NPC that started off hitting low and ended hitting for massive amounts, or slow then fast, or change run speed, etc etc. It would be nice if you could make an NPC vulnerable to certain types of damage during different parts of a fight as well.
Anything that adds more variety is what I am always looking for. In the mean time, I just try to come up with new ways to use the same old commands.
|
|
|
|
06-30-2008, 05:44 PM
|
Sarnak
|
|
Join Date: Aug 2006
Posts: 60
|
|
I think I tried to bodytype adjustment before with no luck. So, you'll pretty much have to use a different npc that is untargetable.
Your best bet is to have the npc spawn the adds via his quest script and add top player on hate list to their hate list. With them, also spawn a non-targetable version of your encounter npc. Then, run a perl script on untargetable npc. Set a time when he spawns. Have it check for their npc ids in the timer. And if they are not there(thus all dead), he triggers a targetable version of himself. Then use a:
Code:
sub EVENT_SPAWN {
$npc->SetHP($npc->GetMaxHP()*75);
}
You could accomplish this with two versions of the npc, but I'd use 3 to keep things cleaner.
As far as the adjustments mid fight, I've used spells and special abilities to do similar when I was hoping to be able to run my project full time. While this script admittedly rough around the edges and could use work, here goes:
Code:
sub EVENT_SPAWN {
my $x;
my $y;
my $z;
my $h;
$x = $npc->GetX();
$y = $npc->GetY();
$z = $npc->GetZ();
$h = $npc->GetHeading();
$stancetype = undef;
$stancetimer = 0;
$raid = 0;
quest::stoptimer("stance");
$stancetimer = int(rand(10 - 5)) + 5;
}
sub EVENT_AGGRO {
if ($raid == 0) {
$clientencounter = $client->GetName();
quest::shout("You stupid fools!");
quest::settimer("stance",$stancetimer);
quest::settimer("checkengaged",2);
$raid = 1;
}
}
sub EVENT_ATTACK {
if ($raid == 0) {
$clientencounter = $client->GetName();
quest::shout("You stupid fools!");
quest::settimer("stance",$stancetimer);
quest::settimer("checkengaged",2);
$raid = 1;
}
}
sub EVENT_DEATH {
quest::shout("How could a myrmidon fall to you?!");
}
sub EVENT_TIMER {
my $check = undef;
if ($timer eq "checkengaged") {
if (!$npc->IsEngaged()) {
$raid = 0;
$npc->SetHP($npc->GetMaxHP());
$stancetype = undef;
$stancetimer = 0;
quest::stoptimer("stance");
$stancetimer = int(rand(5 - 1)) + 1;
quest::stoptimer("checkengaged");
}
}
elsif ($timer eq "stance") {
$npc->NPCSpecialAttacks(0, 0);
$stancetype = undef;
$stancetimer = 0;
$stancetimer = int(rand(70 - 50)) + 50;
quest::settimer("stance",$stancetimer);
$stancetype = quest::ChooseRandom("MyrmidonStance","MeleeInvul","SpellInvul","MyrmidonStance","SpellInvul","MyrmidonStance","MeleeInvul","Strong","MyrmidonStance","Combat","Defense","Riposte");
if ($stancetype eq "MeleeInvul") {
$npc->NPCSpecialAttacks(A, 0); #Removes Current Special Attacks and adds A, spell invul.
quest::ze(4, "Arhiles has developed affinity for melee and is no longer able to be harmed by melee");
}
elsif ($stancetype eq "SpellInvul") {
$npc->NPCSpecialAttacks(B, 0); #Removes Current Special Attacks and adds B, spell invul.
quest::ze(4, "Arhiles develops affinity for all magic."); #quick reference for ze-zone emote. Not available in current build
}
elsif ($stancetype eq "MyrmidonStance") {
$entid1 = quest::spawn2(58084,0,0,$x+30,$y+30,$z,$h);
$entid2 = quest::spawn2(58085,0,0,$x+30,$y-30,$z,$h);
$entid3 = quest::spawn2(58086,0,0,$x-30,$y-30,$z,$h);
$entid4 = quest::spawn2(58087,0,0,$x-30,$y+30,$z,$h);
$entid5 = quest::spawn2(58088,0,0,$x-10,$y+10,$z,$h);
$mob1 = $entity_list->GetMobID($entid1);
$mob2 = $entity_list->GetMobID($entid2);
$mob3 = $entity_list->GetMobID($entid3);
$mob4 = $entity_list->GetMobID($entid4);
$mob5 = $entity_list->GetMobID($entid5);
$mobnpc1 = $mob1->CastToNPC();
$mobnpc2 = $mob2->CastToNPC();
$mobnpc3 = $mob3->CastToNPC();
$mobnpc4 = $mob4->CastToNPC();
$mobnpc5 = $mob5->CastToNPC();
$mobnpc1->AddToHateList($npc->GetHateTop(),1);
$mobnpc2->AddToHateList($npc->GetHateTop(),1);
$mobnpc3->AddToHateList($npc->GetHateTop(),1);
$mobnpc4->AddToHateList($npc->GetHateTop(),1);
$mobnpc5->AddToHateList($npc->GetHateTop(),1);
quest::ze(4, "Arhiles has received shielding from fellow myrmidons.");
$npc->NPCSpecialAttacks(AB, 0); #Melee and spell invulnerability until adds dead.
quest::settimer("myrmidoncheck",1);
quest::stoptimer("stance");
}
elsif ($stancetype eq "Strong") {
$npc->CastSpell(8755,$mobid); #selfcasts str buff
$npc->NPCSpecialAttacks(U, 0);
quest::ze(4, "Arhiles develops affinity for your frailness becomes immune to combat slowing!");
}
elsif ($stancetype eq "Combat") {
$npc->NPCSpecialAttacks(QRF, 0);
$npc->CastSpell(8752,$mobid); #selfcasts combat boosts
quest::ze(4, "Arhiles has developed combat focus and swings with great speed and accuracy!");
}
elsif ($stancetype eq "Defense") {
$npc->CastSpell(8753,$mobid); #selfcasts AC buffs
quest::ze(4, "Arhiles has crouched into a defensive stance!");
}
elsif ($stancetype eq "Riposte") {
$npc->CastSpell(8754,$mobid); #selfcats riposte buff
quest::ze(4, "Arhiles has mastered your melee technique and is able to predict each attack!");
}
}
elsif ($timer eq "myrmidoncheck") {
$check = 0;
#quest::shout("Check!");
my $first_mob = $entity_list->GetMobByNpcTypeID(58084);
my $second_mob = $entity_list->GetMobByNpcTypeID(58085);
my $third_mob = $entity_list->GetMobByNpcTypeID(58086);
my $fourth_mob = $entity_list->GetMobByNpcTypeID(58087);
my $fifth_mob = $entity_list->GetMobByNpcTypeID(58088);
if ($first_mob) {
$check++;
}
if ($second_mob) {
$check++;
}
if ($third_mob) {
$check++;
}
if ($fourth_mob) {
$check++;
}
if ($fifth_mob) {
$check++;
}
if (!$check) {
quest::stoptimer("myrmidoncheck");
$npc->NPCSpecialAttacks(0, 0);
quest::settimer("stance",$stancetimer);
}
}
}
That is most of the code. Several different "stances". Spawning adds and becoming invulnerable. Switching to defensive mode, offensive mode, and switching immunities.
I have 10-20 of these scripts I was running on my raid encounters on my server. Similar atleast! However, just have not been able to find a stable host/project manager to take over:/
|
|
|
|
|
|
|
07-03-2008, 01:30 AM
|
Developer
|
|
Join Date: Mar 2007
Location: Ohio
Posts: 648
|
|
Quote:
Originally Posted by Weldarr
My event begins and when npc1 reaches 75% he spawns 4 adds. I want to make it so that npc1 stops attacking and is unable to be targeted until the 4 adds are killed. Once they are dead i want him to start attacking again.
|
If the main idea is to make the NPC stop attacking and not able to be attacked until the 4 adds are killed, I think you can do this with $npc->NPCSpecialAttacks, like Striat is using. The mob would still be targetable, but it couldn't be attacked and wouldn't attack back. Using the NPC Special Attack list from the Wiki, you could use this command:
Code:
$npc->NPCSpecialAttacks(UMCNIDABfOWH, 0);
Then, once the other 4 mobs are dead, change the special attacks back to what they should be normally (depending on your mob), set the HP back to 75% (since it will probably have regenerated some by then), and he should start attacking again. I'm not sure if running the command clears the hate list, but if not, you can always do so manually if you want:
Code:
$mob->WhipeHateList();
Hope this helps.
|
|
|
|
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 08:01 AM.
|
|
|
|
|
|
|
|
|
|
|
|
|