Exemplo n.º 1
0
void main()
{
	write("Static Memery Test Initlizing value = 3\n");
//	write('\n');
	while (a<10)
	{
		a=Breath();
		write(a);
		write('\n');
	}
}
Exemplo n.º 2
0
void cCharStuff::cDragonAI::DoAI(P_CHAR pc_i, int currenttime)
{
	int randvalue;
	int distance;
	if ( pc_i == NULL ) return;
	if (pc_i->war)
	{
		npctalkall(pc_i, "Who dares disturbe me?!?!", 1);
		cRegion::RegionIterator4Chars ri(pc_i->pos);
		for (ri.Begin(); !ri.atEnd(); ri++)
		{
			P_CHAR pc = ri.GetData();
			if (pc != NULL)
			{
				distance = chardist(pc_i, pc);
				if (!pc->npc && !online(pc))	// no offline players (Duke)
					continue;
				if (!(pc->dead))
				{
					if (distance>4)
					{
						randvalue = RandomNum(0, 4);
						switch (randvalue)
						{
							case 1:				Breath(pc_i, currenttime);				break;
							case 3:				HarmMagic(pc_i, currenttime, pc);		break;
							case 4:				HealMagic(pc_i, currenttime);			break;
						}
					}
					else
						HarmMagic(pc_i, currenttime, pc);
				}
				HealMagic(pc_i, currenttime);
			}
		}
	}
	else
		HealMagic(pc_i, currenttime);
	return;
}