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.
[Item] Whistle Kill
#1
Posted 20 July 2016 - 02:01 PM
#2
Posted 21 July 2016 - 03:29 AM
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
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
Posted 21 July 2016 - 11:46 AM
Replace all instances of n->Class with n->Type
- Cukeman likes this
#5
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
Posted 22 July 2016 - 08:30 AM
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
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