PDA

View Full Version : script help?


kimura
01-23-2014, 11:31 AM
im trying to make a boss at 35% become unattackable and change it's name temporarily when it spawns some adds...here is part of the script that isn't working and I cant figure out what to use...

the commented out part is the part not working...

if($hpevent == 35)
{
#$npc->SetTargetable(false);
#$npc->Tempname("custom name here");
quest::shout("blah blah");
quest::spawn2(1241,0,0,($x + 20),$y,$z,$h);
quest::spawn2(1241,0,0,$x,($y + 20),$z,$h);
quest::spawn2(1241,0,0,($x + 20),($y + 20),$z,$h);
quest::spawn2(1241,0,0,($x + -20),$y,$z,$h);
quest::spawn2(1241,0,0,$x,($y + -20),$z,$h);
quest::spawn2(1241,0,0,($x + -20),($y + -20),$z,$h);
}


I have a signal from the adds to make the boss go back to normal....obviously not working either...

sub EVENT_SIGNAL
{
if($signal == 1234)
{
#$npc->SetTargetable(true);
#$npc->Tempname();

}
}

any suggestions would be greatly appreciated!

Thanks,

Kimura

Township EQ
01-23-2014, 12:14 PM
im trying to make a boss at 35% become unattackable and change it's name temporarily when it spawns some adds...here is part of the script that isn't working and I cant figure out what to use...

the commented out part is the part not working...

if($hpevent == 35)
{
#$npc->SetTargetable(false);
#$npc->Tempname("custom name here");
quest::shout("blah blah");
quest::spawn2(1241,0,0,($x + 20),$y,$z,$h);
quest::spawn2(1241,0,0,$x,($y + 20),$z,$h);
quest::spawn2(1241,0,0,($x + 20),($y + 20),$z,$h);
quest::spawn2(1241,0,0,($x + -20),$y,$z,$h);
quest::spawn2(1241,0,0,$x,($y + -20),$z,$h);
quest::spawn2(1241,0,0,($x + -20),($y + -20),$z,$h);
}


I have a signal from the adds to make the boss go back to normal....obviously not working either...

sub EVENT_SIGNAL
{
if($signal == 1234)
{
#$npc->SetTargetable(true);
#$npc->Tempname();

}
}

any suggestions would be greatly appreciated!

Thanks,

Kimura

I got you.. I'll do it for you in a bit an post it here.

Township EQ
01-23-2014, 12:56 PM
K so.. what is actually going on here?

You want him untargetable for how long? until the adds are done spawning.. until players are done killing all the adds?

Also I'm not sure if SetTargetable is even a thing.. and TempName needs to have an uppercase N. Bodytype 11 is untargetable.


$npc->SetBodyType(11);
$npc->TempName("");

kimura
01-23-2014, 01:02 PM
I got it from here...wasn't sure of it would work though

http://img855.imageshack.us/img855/6007/ngm3.png

I want the boss to change back to normal after the adds are killed

didn't notice the caps N...thanks :P

Kimura

kimura
01-23-2014, 01:08 PM
I should be able to do it with the suggestions you showed me..thanks I will try them soon :P

kimura
01-23-2014, 01:39 PM
ok, TempName works fine.

the bodytype 11 seems to make him still targetable and he just ripostes all attacks...

I want to make him untargetable and also non aggro until adds are dead...I want him to just stand where he is when it triggers...

kimura
01-23-2014, 02:47 PM
Is there a way to add special_abilities 24,1^35,1 and then take it away with a script? without removing the ones already assigned?

I see some for NpcSpecialAttacks, but that's old, right? it doesn't work...

I'm sure there is a simple solution for this, I just cant find it lol

Dunge0nMastr
01-23-2014, 03:45 PM
quest::modifynpcstat("special_attacks","SERFTrMCNIL"); #example of course

using the table: http://www.eqemulator.net/wiki/wikka.php?wakka=NPCSpecialAttacks

Generally works - u can use the A/B to make him immune to melee/magic damage. Not sure the affect of making him immune to aggro might have mid fight cant say ive ever played with it.

I have a mob in an old custom event of mine that would port to a spot, and become rooted, (quest::modifynpcstat("runspeed","0.0");, then after X adds are killed, he jumps back into the fight, again modifying the npcstats and the runspeed. Can easily use this for just about any stat, and works great on making mobs immune/vulnerable to different attacks (again using A or B) or making them get harder as a fight goes on (Timers + counters for increased stats)

Dunge0nMastr
01-23-2014, 03:49 PM
I just noticed that the code was updated - Looks like table takes that into account (or db is old :P)

kimura
01-23-2014, 03:52 PM
the problem is when I add the letters in the npcspecialattks column, they do nothing...wasn't that disabled when they updated to special_abilities and the numbers?

Dunge0nMastr
01-23-2014, 04:25 PM
yeah im looking at that now and I htink you may be right, have you tried adding the Numbers instead of the Letters?

Like i said our DB is old and hasnt been updated in about 18months (too custom now to update lol).

kimura
01-23-2014, 04:37 PM
My db has both columns npcspecialattks and special_abilities

putting the numbers in the special_abilities column works, but I don't think there is a function or object that will put that in the special_abilities column from a script? or at least I am not aware of it at this time...

still researching lol

jdoran
01-23-2014, 05:48 PM
$npc -> NPCSpecialAttacks("values here", 0);

kimura
01-23-2014, 05:58 PM
I have tried that one...doesn't work with the new special_abilities column :(

as far as I can tell anyway.

jdoran
01-23-2014, 08:05 PM
Ah, sorry. I'm still using the NPCSpecialAttacks -- have an important project and don't want to change code bases.

Will $npc -> SetSpecialAbility(24,1) work? (to make mob immune from aggro)
Values are in common.h

Township EQ
01-24-2014, 01:26 AM
sub EVENT_SPAWN {
$npc->SetAppearance(3);
$npc->SetBodyType(11);
$npc->TempName("");
}

sub EVENT_COMBAT {
if($combat_state == 1) {
$npc->TempName("a_crypt_skeleton");
$npc->SetBodyType(3);
quest::me("a pile of bones springs to life.");
}
}

This is the entire script that I wrote for an NPC with a skeleton model. The actual name of the NPC is pileofbones. It tempnames to nothing and shows the skeleton "sitting" or as a pile of bones.. and it's on an aggressive faction. As soon as it goes into combat it stands up.. sets its bodytype to undead and tempnames to the name you see there.

I've never used special attack flags to make anything untargetable. I've just always used bodytype 11. Perhaps you can copy an paste this whole thing and see if it works? I recommend putting it on faction 623. As far as the SetTargetable thing.. try 0 for false.. 1 for true.