PDA

View Full Version : Checking how many Rupees Link has



Joe123
09-28-2007, 01:53 PM
How do I do this? After looking through std.zh, I tried using the Itemclass-> command, but I'm not sure of the syntax.

EDIT: Ah ok, Matthew at PureZC told me. Also:


ffc script real_npc_heal_ammo { //open script
void run(int s, int f, int d, int def_dir, int l, int m, int n, int o) { //open void run

int d_x;
int d_y;
int a_x;
int a_y;
int orig_d = this->Data;

if(d == 0) d = 48;


while(true) { //open while loop
d_x = this->X - Link->X;
d_y = this->Y - Link->Y;
a_x = Abs(d_x);
a_y = Abs(d_y);

if(f != 0) { //open if
if(a_x < d && a_y < d) { //open if
if(a_x <= a_y) { // open if
if(d_y >= 0) { //open if
this->Data = orig_d + DIR_UP;
} else { //close if open else
this->Data = orig_d + DIR_DOWN;
} // close else
} else { //close if open else
if(d_x >= 0) { //open if
this->Data = orig_d + DIR_LEFT;
} else { //close if open else
this->Data = orig_d + DIR_RIGHT;
} //close else
} //close if
} else { //close if open else
this->Data = orig_d + def_dir;
} //close if
} //close if

if(Link->InputL && a_x < 24 && a_y < 24) {

if(Link->HP <=64){ //open if 1 (HP)
Link->HP = Link->HP +80;
Link->MP = Link->MP +256;
if(s != 0) Game->PlaySound(s);
Screen->Message(l);
Link->InputL = false;
} //close if 1
else{ //open else 1
if(Game->Counter[1] == 0){ //open if 2 (Rupees)
Game->Counter[1] = Game->Counter[1] +10;
Link->MP = Link->MP +256;
if(s != 0) Game->PlaySound(s);
Screen->Message(m);
Link->InputL = false;
} //close if 2
else{ //open else 2
if(Link->HP <=64 && Game->Counter[1] == 0){ //open if 3 (HP & Rupees)
Game->Counter[1] = 10;
Link->HP = Link->HP +80;
Link->MP = Link->MP +256;
if(s != 0) Game->PlaySound(s);
Screen->Message(n);
Link->InputL = false;
} //close if 3
else{ //open else 3
Link->MP = Link->MP +256;
if(s != 0) Game->PlaySound(s);
Screen->Message(o);
Link->InputL = false;
} //close else 1
} //close else 2
} //close else 3
} // close if

Waitframe();
} // close while loop
} //close void run
} //close script

Oh yeah :D

C-Dawg
09-29-2007, 12:48 PM
Good job, happy scripting.