Firerod

This goes in the level npc:

[CODE]// NPC made by 2ndwolf
if (playertouchsme) {
toweapons Firerod;
}

if(weaponfired){
setani firerod,;
putnpc ,fireinit.txt,playerx+vecx(playerdir)*2.5,playery+vecy(playerdir)*2.5;
}[/CODE]

These go in text files:

[CODE]
//fireinit.txt
if(created){
timeout = 0.05;
this.dir = playerdir;
this.firex = x+1;
this.firey = y+2;
dontblock;
if(testcompu(this.firex,this.firey)!=-1||onwall(x+1-vecx(this.dir)*2.5,y+1-vecy(this.dir)*1.5))this.a+=1;
}

if(timeout){
if(this.a==this.i||this.a-1==this.i){putnpc ,firethrown.txt,this.firex-1+vecx(this.dir)*2,this.firey-2+vecy(this.dir)*2;
}
else destroy;

if(!onwall(this.firex,this.firey)
&&!onwall(this.firex+vecx(this.dir),this.firey+vecy(this.dir))
&&!onwall(this.firex+vecx(this.dir)*2,this.firey+vecy(this.dir)*2)
&&!onwall(this.firex+vecx(this.dir)*3,this.firey+vecy(this.dir)*3)
&&!onwall(this.firex+vecx(this.dir)*4,this.firey+vecy(this.dir)*4)
&&this.a==this.i
&&testcompu(this.firex+vecx(this.dir)*4,this.firey+vecy(this.dir)*4)==-1){
this.i+=1;
}
else if(this.dir==0) this.i-=1;

this.a += 1;
this.firex += vecx(this.dir)*2;
this.firey += vecy(this.dir)*2;
timeout = 0.05;
}[/CODE]

[CODE]
//firethrown.txt
if(created) {
dontblock;
setcharani firethrown,;
this.staketiles = {
// STA,KE,TI,LES, ,REP,LAC,ETI,LES, ,DROPS?(-1 = No drop),LEAPS(-1 = no leaps)
0x2 ,0x3 ,0x12 ,0x13 , ,0x2A5,0x2A6,0x2B5,0x2B6, ,1,0 , // BUSH
0x1A4,0x1A5,0x1B4,0x1B5, ,0x2A7,0x2A8,0x2B7,0x2B8, ,1,1 , //GRASS
}

this.stake = -1;

for(this.checkx=x+1;this.checkx>=x-1;this.checkx-=1){
for(this.checky=y+2;this.checky>=y-1;this.checky-=1){
for (this.i=0;this.i<arraylen(this.staketiles);this.i++) {
if (tiles[this.checkx,this.checky] == this.staketiles[this.i*12]) {
this.stake = this.i;
break;
}
}
if(this.stake!=-1)break;
}
if(this.stake!=-1)break;
}

hitobjects 1,x+1,y+2;

callnpc testnpc(x+1,y+2),firerod;

ReplaceStake();
sleep 0.3;
destroy;
}

function ReplaceStake() {
for (i=0;i<4;i++) {
if (tiles[this.checkx+(i%2),this.checky+int(i/2)] != this.staketiles[this.stake12+i]) {
return;
}
}
for (i=0;i<4;i++) {
tiles[this.checkx+(i%2),this.checky+int(i/2)] = this.staketiles[5+this.stake
12+i];
}
if (this.staketiles[11+this.stake12] >= 0) putleaps this.staketiles[11+this.stake12],this.checkx,this.checky;
if (this.staketiles[10+this.stake*12] == 1){
this.random = random(0,20);
if (this.random<4){
lay2 greenrupee,this.checkx,this.checky;
}
else if (this.random<8){
lay2 bluerupee,this.checkx,this.checky;
}
else if (this.random<12){
lay2 bombs,this.checkx,this.checky;
}
else if (this.random<16){
lay2 darts,this.checkx,this.checky;
}
else if (this.random<19){
lay2 redrupee,this.checkx,this.checky;
}
}
updateboard this.checkx,this.checky,2,2;
} [/CODE]

Behaviour:
Kills bushes one by one and grass tiles in rows and drops items.
Attacks baddies and interacts with any npc which have if(firerod) in them.

Known bugs:
Can cast through single tile walls when next to them (I’ll consider it as a feature, since the only way I can think of is by patching and patching and patching… and patching is a bad habit)
The images still suck, if someone could make better looking images… :slight_smile:

Bush killing is mean.

looks like hes spitting a lil’ fire out of his own rod… :smiley:

hahaha yeah, the gfx suck… I’ll spend some more time on it once the bugs are cleared.

If I were you I’d try avoid using putnpc like this. Seems like it’ll easily bring down a server if spammed enough by multiple people.
However, it’s a nice idea so kudos to you for getting it done.

Bugs cleared, here’s something better for the rod’s looks:

Ooooo i didn’t think of it :frowning:

Would it be better if I used only one fire looping and going forward and putting little empty npcs as a trail?

I made a fire rod just then, orders of the mollusk, I think he’s just determined to show you up (I don’t know why…)

Nice, Tricxta. I have no doubts Phoenix will be epic once it is complete … if that day ever comes.

XD We already had an ice rod, 2ndwolf just inspired me to inspire you to make one. All we needed was to color swap the ice rod and you to script it - so I figured it’d be easy!
It was under Tricxta’s own prerogative that he show our firerod here. I don’t mean to steamroll 2ndwolf. I think he did a great job and applaud his developmental spirit.

Arcain, we are actually still working pretty hard on Phoenix and a little bit gets done everyday. We are working on releasing a Beta-version so players can not only get familiar with some of the map, but mostly to test our mechanics and try to break things. Beta is almost ready.

Plus my rod doesn’t have the same behaviour,:smiley: I meant it to be LTTPish.

Glad to be an inspiration lol.

I agree with tricxta, we had some bad experience with putnpc on Xialza. You should try using showimg, or showani instead. You could make the fire look like it was spreading by having it show multiple animations ahead of the player (or images, but animations are better because you can put scripts in them), all with different IDs, and having them disappear by hiding those once it was done.

// NPC made by Kondie if (playerenters){ toweapons Rod; } if (weaponfired){ this.i = 0; play fire.wav; freezeplayer .5; while (this.i < 4){ this.i ++; showimg 501 + this.i,block.png,playerx - (this.i),playery; changeimgzoom 501 + this.i,(this.i * .25); sleep .15; } hideimgs 501,505; }

Just something along the lines of this.

Very nice Tricxta, but why does it appear you have bombs equipped while using the fire rod?

In the screenshot he doesn’t have it as a weapon, technically. He’s got it bound to the “F” key so that he doesn’t have to delete the weapon each time he makes a change for testing purposes.

Master scr1ptz0r! Too bad that wont show globally. I had to cut back on my final version of my fire rod so the flame showed for everyone. It sucks how showani behaves…

That’s why it was an example. I wasn’t claiming to have superior knowledge of scripting, nor was I saying he should use that one at all, as it’s absolute shit. Especially because of how bulky he’d have to make it. :frowning:

I’ll update that (much) later as Legends of Arcainia seems to be discontinued :frowning: