ffc script Zora2{
void run(){
npc zora = Screen->CreateNPC(33);
while(zora->isValid()){
if(zora->Tile >= 2520){
for(int count = 1; count <= 10; count++){
eweapon fs = Screen->CreateEWeapon();
fs->X = zora->X;
fs->Y = zora->Y;
fs->Angle = findAngle(fs->X, fs->Y, Link->X, Link->Y);
fs->Damage = 8;
fs->Angular = true;
fs->Step = 300;
Game->PlaySound(13);
Waitframes(6);
}
}
Waitframe();
}
}
}
Okay, first of all... There is no way I could of done this without help from two very special people. Pkmnfrk and Joe123, thank you so much for helping me come this far on my scripting journey and for all your help and support. It's much appreciated. And thanks
Now let's get cracking shall we.
- You must have new enemy tiles enabled under quest rules.
- If you want it not to shoot fireballs, you'll have to disable them some how.
[INDENT]I changed the 33 under line 3 to a the ID of a enemy I made in the enemy editor that was a Zora clone with no weapon.[/INDENT] - If you're using different tiles then default tiles, then make sure you use the shooting tiles for the number in line 5.
[INDENT]That's animation row 5 & 6 by the way.[/INDENT]
I think that's pretty much everything you need to know. The Zora by itself won't breathe fire, so make sure you use the script under a ffc to place them and not the enemy editor.
Enjoy!
EDIT: Forgot to mention... You'll need to import advmath.zh from my sig by pkmnfrk to make it work.
Archangel wrote:two very special people.
I appreciate the mention, but it sounds like I'm your girlfriend or something.
Quite a nice script though.
:weird: That was the most awkward thing I've heard this morning...
Haha, don't worry about it =P
Okay, first of all... There is no way I could of done this without help from two very special people. Pkmnfrk and Joe123, thank you so much for helping me come this far on my scripting journey and for all your help and support. It's much appreciated. And thanks
lol. I read it more of an "accepting an award speech", which, indecently, you also forgot to thank Jesus and your mom. :P
Gleeok wrote:you also forgot to thank Jesus and your mom. :P
lol , that was funny. Nice zora btw.
For those of those you would like proper deflection here you go...
import "std.zh"
import "advmath.zh"ffc script Zora2{
void run(){
npc zora = Screen->CreateNPC(33);
while(zora->isValid()){
if(zora->Tile >= 2500){
for(int count = 1; count <= 10; count++){
eweapon fs = Screen->CreateEWeapon(140);
fs->X = zora->X;
fs->Y = zora->Y;
fs->Angle = findAngle(fs->X, fs->Y, Link->X, Link->Y);
fs->Damage = 8;
fs->Angular = true;
if(fs->Angle==-PI || fs->Angle==PI) fs->Dir=2;
else if(fs->Angle==-PI/2) fs->Dir=0;
else if(fs->Angle==PI/2) fs->Dir=1;
else if(fs->Angle==0) fs->Dir=3;
else if(fs->Angle<-PI/2) fs->Dir=4;
else if(fs->Angle<0) fs->Dir=5;
else if(fs->Angle>(PI/2)) fs->Dir=6;
else fs->Dir=7;
fs->Step = 300;
Game->PlaySound(13);
Waitframes(6);
}
}
Waitframe();
}
}
}
Same rules apply as above. And a techdemo!
test.qst
Hm, I detect a slight oversight -- when I killed it, the fire breath in progress wasn't cancelled, but instead the remainder of it gushed from the upper left corner (though the now-dead Zora didn't breathe again). -- Pteryx
That should be easy to fix, I'll try to get around to it after I'm done moving. 😊
if(!zora->isValid()) break;
Inside your for loop.
Alakazam your wishes are my command.
import "std.zh"
import "advmath.zh"ffc script Zora2{
void run(){
npc zora = Screen->CreateNPC(33);
while(zora->isValid()){
if(zora->Tile >= 2500){
for(int count = 1; count <= 10; count++){
if(!zora->isValid() break;
eweapon fs = Screen->CreateEWeapon(140);
fs->X = zora->X;
fs->Y = zora->Y;
fs->Angle = findAngle(fs->X, fs->Y, Link->X, Link->Y);
fs->Damage = 8;
fs->Angular = true;
if(fs->Angle==-PI || fs->Angle==PI) fs->Dir=2;
else if(fs->Angle==-PI/2) fs->Dir=0;
else if(fs->Angle==PI/2) fs->Dir=1;
else if(fs->Angle==0) fs->Dir=3;
else if(fs->Angle<-PI/2) fs->Dir=4;
else if(fs->Angle<0) fs->Dir=5;
else if(fs->Angle>(PI/2)) fs->Dir=6;
else fs->Dir=7;
fs->Step = 300;
Game->PlaySound(13);
Waitframes(6);
}
}
while(zora->tile >= 2500){
Waitframe();
}
Waitframe();
}
}
}
I tested this one, and it seems to work as it should.
Enjoy!