Example #1
0
void CashNPC(int ClientID,int npcid)
{
	FILE *arquivo;
	
	char cash[1000];
	//char cash2[1000];
	//char  line[120], nome[100], msg[100]; // Retirar variáveis desnecessárias
	MOB *player = (MOB*)GetMobFromIndex(ClientID);
	MOB *vLogin = (MOB*)GetMobFromIndex(ClientID);
	int itenslot1 = GetFirstSlotSADD(ClientID,3394,64);
	if(itenslot1 != -1)
	{
		sprintf(cash,"DataBase\\Cash\\%s.txt",vLogin(ClientID));
	    
		if(file_exists(cash))
	    {
			arquivo = fopen(cash, "w");
			fputs("1000", arquivo);
			fclose(arquivo);
			SendSay(npcid,"Obrigado por nos ajudar. Agora você possui 1000 Cash");
			player->Inventory[itenslot1].Index = 0;
			SendInv(ClientID,itenslot1);
			SendCharList(ClientID);
			return;
		}
		else
		{
			arquivo = fopen(cash, "w");
			fputs("1000", arquivo);
			fclose(arquivo);
			SendSay(npcid,"Obrigado por nos ajudar. Agora você possui 1000 Cash");
			player->Inventory[itenslot1].Index = 0;
			SendInv(ClientID,itenslot1);
			SendCharList(ClientID);
			return;
		}
	}
	else
	{
		SendSay(npcid,"Nos Traga seu Vale Cash!");
		return;
	}
}
Example #2
0
	void Bert::SetOptions()
	{   
		if(m_direction) 
		{
			m_board.MaskSet(L_BIC, 0x02);
			m_board.Write(L_LBCR, 0x01);			
		}
		else
		{

			m_board.MaskClear(L_BIC, 0x02);
		}

		SendInv(m_sendInv);
		RecvInv(m_recvInv);
		
   		if (m_aIS) DisableAIS();
		m_board.MaskClear(L_BC1, 0x1c);      	
		m_board.MaskSet(L_BC1, 0x04);
	}
Example #3
0
//Requisição para entrar na pista
bool Pista0_0(int clientid)
{	
	int cMin = PInt(0x00A5EA414);
	MOB *player = (MOB*)GetMobFromIndex(clientid);
	int itemslot = GetFirstSlot(clientid,5134,0,0,0,0,0,0,64);
	int cParty = PInt(clientid * 0x0410 + 0x015C6CD0);

	if(cParty == -1)
	{
		SendClientMsg(clientid,"Acesso apenas em grupo.");
		return FALSE;
	}
	if(itemslot == -1)
	{
		SendClientMsg(clientid,"Você não possui a Pista de Runas.");
		return FALSE;
	}
	if(PartyCount > 1)
	{
		SendClientMsg(clientid,"Dois grupos já estão participando desta quest.");
		return FALSE;
	}
	if(0 == 0)//verificação do tempo
	{	
		if(PartyCount == 0)
		{
			lich1 = 0;
			GreenTimeMap(3384,1646,3343,1611,90);
			tempolich1 = clock() + 430 * CLOCKS_PER_SEC;
			for(int i = 0;i < 6;i++)
			{
				CreateMOB("PLich",3364,1628,"pista");
			}
			CreateMOB("PLich_",3364,1628,"pista");
			pista0 = TRUE;
			PTeleport(clientid,3348,1623);
			DoTeleport(clientid,3348,1623);
			Lider1 = clientid;
		}
		else if(PartyCount == 1)
		{
			lich2 = 0;
			GreenTimeMap(3438,1646,3397,1611,90);
			tempolich2 = clock() + 430 * CLOCKS_PER_SEC;
			for(int i = 0;i < 4;i++)
			{
				CreateMOB("_PLich",3416,1628,"pista");
			}
			CreateMOB("PLich1",3416,1628,"pista");
			PTeleport(clientid,3402,1623);
			DoTeleport(clientid,3402,1623);
			Lider2 = clientid;
		}
		else
		{
			PTeleport(clientid,3379,1635);
			DoTeleport(clientid,3379,1635);
		}
		player->Inventory[itemslot].Index = 0;
		SendInv(clientid,itemslot);
		PartyCount++;
		return TRUE;
	}
	else
	{
		SendClientMsg(clientid,"Apenas nos minutos 00,15,30 e 45.");
	}
	return FALSE;
}