Jump to content

Photo

[Item] Whistle Kill


  • Please log in to reply
6 replies to this topic

#1 Cukeman

Cukeman

    "Tra la la, look for Sahasrahla. ... ... ..."

  • Banned
  • Location:Hyrule/USA

Posted 20 July 2016 - 02:01 PM

Hello, I'd like to request an item script for the Whistle that kills enemy IDs listed in the arguments. Thank you for any help.



#2 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 21 July 2016 - 03:29 AM

Args D0 to D7: Set to a positive number to affect an enemy by ID, or a negative number to affect an entire npc class (-5 would be class 5). Set WHISTLE_KIL_HP to -9999 to remove the enemy with no death effects.

const int WHISTLE_KILL_HP = -1; //Set to -9999 for 'silent removal)

item script WhistleKill{
	void run(int a, int b, int c, int d, int e, int f, int g, int h){
		int q; npc n;
		for ( q = 1; q <= Screen->NumNPCs(); q++ ) {
			n = Screen->LoadNPC(q);
			if ( a > 0 && n->ID == a ) n->HP = WHISTLE_KILL_HP;
			if ( a < 0 && n->Class == a * -1 ) n->HP = WHISTLE_KILL_HP;

			if ( b > 0 && n->ID == b ) n->HP = WHISTLE_KILL_HP;
			if ( b < 0 && n->Class == b *-1 ) n->HP = WHISTLE_KILL_HP;

			if ( c > 0 && n->ID == c ) n->HP = WHISTLE_KILL_HP;
			if ( c < 0 && n->Class == c * -1 ) n->HP = WHISTLE_KILL_HP;

			if ( d > 0 && n->ID == d ) n->HP = WHISTLE_KILL_HP;
			if ( d < 0 && n->Class == d * -1 ) n->HP = WHISTLE_KILL_HP;

			if ( e > 0 && n->ID == e ) n->HP = WHISTLE_KILL_HP;
			if ( e < 0 && n->Class == e * -1 ) n->HP = WHISTLE_KILL_HP;

			if ( f > 0 && n->ID == f ) n->HP = WHISTLE_KILL_HP;
			if ( f < 0 && n->Class == f * -1 ) n->HP = WHISTLE_KILL_HP;

			if ( g > 0 && n->ID == g ) n->HP = WHISTLE_KILL_HP;
			if ( g < 0 && n->Class == g * -1 ) n->HP = WHISTLE_KILL_HP;

			if ( h > 0 && n->ID == h ) n->HP = WHISTLE_KILL_HP;
			if ( h < 0 && n->Class == h * -1 ) n->HP = WHISTLE_KILL_HP;
		}
	}
}

  • Cukeman likes this

#3 Cukeman

Cukeman

    "Tra la la, look for Sahasrahla. ... ... ..."

  • Banned
  • Location:Hyrule/USA

Posted 21 July 2016 - 05:03 AM

line 9

that pointer type does not have a variable class

 

const int WHISTLE_KILL_HP = -1; //Set to -9999 for 'silent removal)

item script WhistleKill{
	void run(int a, int b, int c, int d, int e, int f, int g, int h){
		int q; npc n;
		for ( q = 1; q <= Screen->NumNPCs(); q++ ) {
			n = Screen->LoadNPC(q);
			if ( a > 0 && n->ID == a ) n->HP = WHISTLE_KILL_HP;
			if ( a < 0 && n->Class == a * -1 ) n->HP = WHISTLE_KILL_HP;

			if ( b > 0 && n->ID == b ) n->HP = WHISTLE_KILL_HP;
			if ( b < 0 && n->Class == b *-1 ) n->HP = WHISTLE_KILL_HP;

			if ( c > 0 && n->ID == c ) n->HP = WHISTLE_KILL_HP;
			if ( c < 0 && n->Class == c * -1 ) n->HP = WHISTLE_KILL_HP;

			if ( d > 0 && n->ID == d ) n->HP = WHISTLE_KILL_HP;
			if ( d < 0 && n->Class == d * -1 ) n->HP = WHISTLE_KILL_HP;

			if ( e > 0 && n->ID == e ) n->HP = WHISTLE_KILL_HP;
			if ( e < 0 && n->Class == e * -1 ) n->HP = WHISTLE_KILL_HP;

			if ( f > 0 && n->ID == f ) n->HP = WHISTLE_KILL_HP;
			if ( f < 0 && n->Class == f * -1 ) n->HP = WHISTLE_KILL_HP;

			if ( g > 0 && n->ID == g ) n->HP = WHISTLE_KILL_HP;
			if ( g < 0 && n->Class == g * -1 ) n->HP = WHISTLE_KILL_HP;

			if ( h > 0 && n->ID == h ) n->HP = WHISTLE_KILL_HP;
			if ( h < 0 && n->Class == h * -1 ) n->HP = WHISTLE_KILL_HP;
		}
	}
}


#4 coolgamer012345

coolgamer012345

    🔸

  • Members
  • Location:Indiana, USA

Posted 21 July 2016 - 11:46 AM

Replace all instances of n->Class with n->Type


  • Cukeman likes this

#5 Cukeman

Cukeman

    "Tra la la, look for Sahasrahla. ... ... ..."

  • Banned
  • Location:Hyrule/USA

Posted 21 July 2016 - 02:30 PM

Thank you ZoriaRPG and TheBlueTophat :)

 

EDIT: I also cut lines 23-30 and arguments f-h


Edited by Cukeman, 22 July 2016 - 03:06 PM.


#6 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 22 July 2016 - 08:30 AM

I have no idea, when, or why I got it stuck in me head that ->Class was proper.

Removing those lines...that does absolutely nothing, except remove the option to affect multiple enemies/types per ffc. I'd day that's silly. Did you need those data fields for something else?

Edited by ZoriaRPG, 22 July 2016 - 08:31 AM.


#7 Cukeman

Cukeman

    "Tra la la, look for Sahasrahla. ... ... ..."

  • Banned
  • Location:Hyrule/USA

Posted 22 July 2016 - 12:15 PM

I have no idea, when, or why I got it stuck in me head that ->Class was proper.

Removing those lines...that does absolutely nothing, except remove the option to affect multiple enemies/types per ffc. I'd day that's silly. Did you need those data fields for something else?

 

I removed them so I could use those arguments for an Item Pickup script I'm also using (which I'd forgotten about when I made the request).


Edited by Cukeman, 22 July 2016 - 12:16 PM.



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users