'That pointer type does not have a variable type'
if ( it->Type == itemlist[e] ) {
Posted 22 July 2016 - 10:31 PM
'That pointer type does not have a variable type'
if ( it->Type == itemlist[e] ) {
Posted 23 July 2016 - 03:04 AM
const int NPC_MISC_HOLDING_ITEM = 12; ffc script BasicStealItem{ void run(int npc_ID, int stealsfx, float dragdur){ npc n; item i; int q; int w; int e; int r; itemdata it; if ( !dragdur ) dragdur = 1; int itemlist[]={ IC_RUPEE, IC_HEART, IC_ARROWAMMO, IC_MAGIC, IC_BOMBAMMO}; while(true){ for ( w = 1; w <= Screen->NumItems(); w++){ for ( q = 1; q <= Screen->NumNPCs(); q++) { n = Screen->LoadNPC(q); if ( n->isValid() ) { if ( n->ID == npc_ID && !n->Misc[NPC_MISC_HOLDING_ITEM]) { i = Screen->LoadItem(w); if ( i->isValid() ) { if ( __DistX(n,i,4) && __DistY(n,i,4) ){ it = Game->LoadItemData(i->ID); for ( e = 0; e < SizeOfArray(itemlist); e++){ if ( it->Family == itemlist[e] ) { n->Misc[NPC_MISC_HOLDING_ITEM] = 1; for ( r = 0; r < (dragdur * 60); r ++ ) { i->X = n->X; i->Y = n->Y; Waitframe(); } Game->PlaySound(stealsfx); Remove(i); n->Misc[NPC_MISC_HOLDING_ITEM] = 0; } } } } } } } } Waitframe(); } } bool __DistX(npc a, item b, int distance) { int dist; if ( a->X > b->X ) dist = a->X - b->X; else dist = b->X - a->X; return ( dist <= distance ); } bool __DistY(npc a, item b, int distance) { int dist; if ( a->Y > b->Y ) dist = a->Y - b->Y; else dist = b->Y - a->Y; return ( dist <= distance ); } }
Checked on the laptop. Compiles. Works. Demo.
Posted 23 July 2016 - 04:10 PM
yeah, works amazing! :D, but it is possible to make the enemy steals every item and not only the rupees, hearts, magic, arrow ammo and bomb ammo? :D
EDIT: I fixed the problem, now another question, it is possible this?
- If an enemy picks a clock Link's cannot move 5 seconds
Edited by Cereal Guy, 23 July 2016 - 05:23 PM.
Posted 23 July 2016 - 07:29 PM
yeah, works amazing! , but it is possible to make the enemy steals every item and not only the rupees, hearts, magic, arrow ammo and bomb ammo?
EDIT: I fixed the problem, now another question, it is possible this?
- If an enemy picks a clock Link's cannot move 5 seconds
Edited by ZoriaRPG, 24 July 2016 - 01:19 AM.
Posted 24 July 2016 - 06:59 AM
I added an autoghost version to my initial reply. It is untested (compiles, but unverified in operation).
Edited by ZoriaRPG, 24 July 2016 - 07:00 AM.
0 members, 1 guests, 0 anonymous users