void main()
{// Tosses reward based on hitting player's rush count
// 10 : Apple
// 15 : Money
// 20 : Gold
void self = getlocalvar("self"); //Get calling entity
void attacker = getlocalvar("attacker");
int Rush = getentityproperty(attacker, "rush_count");
switch(Rush){
case 9: // 10-1
shooter2("Apple",0,10,0, 3, 2, 0);
break;
case 14: // 15-1
shooter2("Money",0,10,0, 3, 2, 0);
break;
case 19: // 20-1
shooter2("Gold",0,10,0, 3, 2, 0);
break;
default:
break;
}
}
void spawn01(void vName, float fX, float fY, float fZ)
{
//spawn01 (Generic spawner)
//Damon Vaughn Caskey
//07/06/2007
//
//Spawns entity next to caller.
//
//vName: Model name of entity to be spawned in.
//fX: X location adjustment.
//fY: Y location adjustment.
//fZ: Z location adjustment.
void self = getlocalvar("self"); //Get calling entity.
void vSpawn; //Spawn object.
int iDirection = getentityproperty(self, "direction");
clearspawnentry(); //Clear current spawn entry.
setspawnentry("name", vName); //Acquire spawn entity by name.
if (iDirection == 0){ //Is entity facing left?
fX = -fX; //Reverse X direction to match facing.
}
fX = fX + getentityproperty(self, "x"); //Get X location and add adjustment.
fY = fY + getentityproperty(self, "a"); //Get Y location and add adjustment.
fZ = fZ + getentityproperty(self, "z"); //Get Z location and add adjustment.
vSpawn = spawn(); //Spawn in entity.
changeentityproperty(vSpawn, "position", fX, fZ, fY); //Set spawn location.
changeentityproperty(vSpawn, "direction", iDirection); //Set direction.
return vSpawn; //Return spawn.
}
void shooter2(void vName, float fX, float fY, float fZ, float Vx, float Vy, float Vz)
{//Spawns projectile next to caller
//vName: Model name of entity to be spawned in
//fX: X location adjustment
//fZ: Y location adjustment
//fY: Z location adjustment
//Vx: X speed
//Vy: Y speed
//Vz: Z speed
void self = getlocalvar("self"); //Get calling entity
int Direction = getentityproperty(self, "direction");
void vSpawn; //Spawn object.
vSpawn = spawn01(vName, fX, fY, fZ); //Spawn in projectile
if (Direction == 0){ //Is entity facing left?
Vx = -Vx; //Reverse Vx direction to match facing
}
changeentityproperty(vSpawn, "velocity", Vx, Vz, Vy);
}