Ejemplo n.º 1
0
void CCoupleHelper::PostItem( CCouple* pCouple )
{
	VCI& vItems	= CCoupleProperty::Instance()->GetItems( pCouple->GetLevel() );
	if( vItems.empty() )
		return;
	int nGenderFirst, nGenderSecond;
	nGenderFirst	= nGenderSecond	= SEX_SEXLESS;
	GetGender( pCouple, nGenderFirst, nGenderSecond );

	for( DWORD i = 0; i < vItems.size(); i++ )
	{
		if( vItems[i].nSex == SEX_SEXLESS || vItems[i].nSex == nGenderFirst )
			PostItem( pCouple->GetFirst(), vItems[i], pCouple->GetLevel() );
		if( vItems[i].nSex == SEX_SEXLESS || vItems[i].nSex == nGenderSecond )
			PostItem( pCouple->GetSecond(), vItems[i], pCouple->GetLevel() );
	}
}
/***************************************************************************
 * PrintAll
 * -------------------------------------------------------------------------
 * This method will print the attributes of the object
 *
 * Returns: none
 ***************************************************************************/
void Student::PrintAll() const
{
	const int WIDTH = 17;


	cout << fixed 			  << setprecision(2) << left;
	cout << "Student Information" << endl;
	cout << "-------------------" << endl;
	cout << setw(WIDTH)       << "Name: " 		    << GetName()    << endl;
	cout << setw(WIDTH)       << "ID: " 	        << GetId()      << endl;
	cout << setw(WIDTH)       << "Number: "         << GetNumber()  << endl;
	cout << setw(WIDTH)       << "Age: " 		    << GetAge()     << endl;
	cout << setw(WIDTH)       << "Gender: "	        << GetGender()  << endl;
	cout << setw(WIDTH)       << "Standing: "       << GetStanding()<< endl;
	cout << setw(WIDTH)       << "GPA: " 		    << GetGpa()     << endl;
	cout << setw(WIDTH)       << "Graduation Date: "<< GetDate()    << endl;
	cout << right;
}
Ejemplo n.º 3
0
void GetStatusText(MCONTACT hContact, WORD newStatus, WORD oldStatus, wchar_t *stzStatusText)
{
	if (opt.UseAlternativeText) {
		switch (GetGender(hContact)) {
		case GENDER_MALE:
			wcsncpy(stzStatusText, StatusList[Index(newStatus)].lpzMStatusText, MAX_STATUSTEXT);
			break;
		case GENDER_FEMALE:
			wcsncpy(stzStatusText, StatusList[Index(newStatus)].lpzFStatusText, MAX_STATUSTEXT);
			break;
		case GENDER_UNSPECIFIED:
			wcsncpy(stzStatusText, StatusList[Index(newStatus)].lpzUStatusText, MAX_STATUSTEXT);
			break;
		}
	}
	else
		wcsncpy(stzStatusText, StatusList[Index(newStatus)].lpzStandardText, MAX_STATUSTEXT);

	if (opt.ShowPreviousStatus) {
		wchar_t buff[MAX_STATUSTEXT];
		mir_snwprintf(buff, TranslateW(STRING_SHOWPREVIOUSSTATUS), StatusList[Index(oldStatus)].lpzStandardText);
		mir_wstrcat(mir_wstrcat(stzStatusText, L" "), buff);
	}
}
Ejemplo n.º 4
0
bool Client::CastDiscipline(uint8 disc_id, uint8 level_to_use)
{
    uint8 current_level = GetLevel();
    if(current_level > 60)
        current_level = 60;

    if(level_to_use > current_level || level_to_use == 0)
        return false;

    // reuse_timer is in seconds, ability_timer is in milliseconds.
    uint32 reuse_timer = 0, ability_timer = 0, string = 0;
    int16 spellid = 0;

    switch(disc_id)
    {
    case disc_aggressive:
        reuse_timer = 1620 - (current_level - level_to_use) * 60;
        ability_timer = 180000;
        spellid = 4498;
        string = DISCIPLINE_AGRESSIVE;

        break;
    case disc_precision:
        reuse_timer = 1800 - (current_level - level_to_use) * 60;
        ability_timer = 180000;
        spellid = 4501;
        string = DISCIPLINE_PRECISION;

        break;
    case disc_defensive:
        reuse_timer = 900 - (current_level - level_to_use) * 60;
        ability_timer = 180000;
        spellid = 4499;
        string = DISCIPLINE_DEFENSIVE;

        break;
    case disc_evasive:
        reuse_timer = 900 - (current_level - level_to_use) * 60;
        ability_timer = 180000;
        spellid = 4503;
        string = DISCIPLINE_EVASIVE;

        break;
    case disc_ashenhand:
        reuse_timer = 4320 - (current_level - level_to_use) * 60;
        spellid = 4508;
        string = DISCIPLINE_ASHENHAND;

        break;
    case disc_furious:
        reuse_timer = 3600 - (current_level - level_to_use) * 60;
        ability_timer = 9000;
        if(GetBaseClass() == WARRIOR)
            spellid = 4674;
        else if(GetBaseClass() == MONK)
            spellid = 4509;
        else if(GetBaseClass() == ROGUE)
            spellid = 4673;
        string = DISCIPLINE_FURIOUS;

        break;
    case disc_stonestance:
        reuse_timer = 720 - (current_level - level_to_use) * 60;
        ability_timer = 12000;
        if(GetBaseClass() == MONK)
            spellid = 4510;
        else if(GetBaseClass() == BEASTLORD)
            spellid = 4671;
        string = DISCIPLINE_STONESTANCE;

        break;
    case disc_thunderkick:
        reuse_timer = 420 - (current_level - level_to_use) * 60;
        spellid = 4511;
        string = DISCIPLINE_THUNDERKICK;

        break;
    case disc_fortitude:
        reuse_timer = 3600 - (current_level - level_to_use) * 60;
        ability_timer = 8000;
        if(GetBaseClass() == WARRIOR)
            spellid = 4670;
        else if(GetBaseClass() == MONK)
            spellid = 4502;
        string = DISCIPLINE_FORTITUDE;

        break;
    case disc_fellstrike:
        reuse_timer = 1800 - (current_level - level_to_use) * 60;
        ability_timer = 12000;
        if(GetBaseClass() == WARRIOR)
            spellid = 4675;
        else if(GetBaseClass() == MONK)
            spellid = 4512;
        else if(GetBaseClass() == ROGUE)
            spellid = 4676;
        else if(GetBaseClass() == BEASTLORD)
            spellid = 4678;
        string = DISCIPLINE_FELLSTRIKE;

        break;
    case disc_hundredfist:
        reuse_timer = 1800 - (current_level - level_to_use) * 60;
        ability_timer = 15000;
        if(GetBaseClass() == MONK)
            spellid = 4513;
        else if(GetBaseClass() == ROGUE)
            spellid = 4677;
        string = DISCIPLINE_HUNDREDFIST;

        break;
    case disc_charge:
        reuse_timer = 1800 - (current_level - level_to_use) * 60;
        ability_timer = 14000;
        if(GetBaseClass() == WARRIOR)
            spellid = 4672;
        else if(GetBaseClass() == ROGUE)
            spellid = 4505;
        string = DISCIPLINE_CHARGE;

        break;
    case disc_mightystrike:
        reuse_timer = 3600 - (current_level - level_to_use) * 60;
        ability_timer = 10000;
        spellid = 4514;
        string = DISCIPLINE_MIGHTYSTRIKE;

        break;
    case disc_nimble:
        reuse_timer = 1800 - (current_level - level_to_use) * 60;
        ability_timer = 12000;
        spellid = 4515;
        string = DISCIPLINE_NIMBLE;

        break;
    case disc_silentfist:
        reuse_timer = 540 - (current_level - level_to_use) * 60;
        spellid = 4507;
        if(GetRace() == IKSAR)
            string = DISCIPLINE_SILENTFIST_IKSAR;
        else
            string = DISCIPLINE_SILENTFIST;

        break;
    case disc_kinesthetics:
        reuse_timer = 1800 - (current_level - level_to_use) * 60;
        ability_timer = 18000;
        spellid = 4517;
        string = DISCIPLINE_KINESTHETICS;

        break;
    case disc_holyforge:
        reuse_timer = 4320 - (current_level - level_to_use) * 60;
        ability_timer = 120000;
        spellid = 4500;
        string = DISCIPLINE_HOLYFORGE;

        break;
    case disc_sanctification:
        reuse_timer = 4320 - (current_level - level_to_use) * 60;
        ability_timer = 10000;
        spellid = 4518;
        string = DISCIPLINE_SANCTIFICATION;

        break;
    case disc_trueshot:
        reuse_timer = 4320 - (current_level - level_to_use) * 60;
        ability_timer = 120000;
        spellid = 4506;
        string = DISCIPLINE_TRUESHOT;

        break;
    case disc_weaponshield:
        reuse_timer = 4320 - (current_level - level_to_use) * 60;
        ability_timer = 15000;
        spellid = 4519;
        if(GetGender() == 0)
            string = DISCIPLINE_WPNSLD_MALE;
        else if(GetGender() == 1)
            string = DISCIPLINE_WPNSLD_FEMALE;
        else
            string = DISCIPLINE_WPNSLD_MONSTER;

        break;
    case disc_unholyaura:
        reuse_timer = 4320 - (current_level - level_to_use) * 60;
        spellid = 4520;
        string = DISCIPLINE_UNHOLYAURA;

        break;
    case disc_leechcurse:
        reuse_timer = 4320 - (current_level - level_to_use) * 60;
        ability_timer = 15000;
        spellid = 4504;
        string = DISCIPLINE_LEECHCURSE;

        break;
    case disc_deftdance:
        reuse_timer = 4320 - (current_level - level_to_use) * 60;
        ability_timer = 10000;
        spellid = 4516;
        string = DISCIPLINE_DEFTDANCE;

        break;
    case disc_puretone:
        reuse_timer = 4320 - (current_level - level_to_use) * 60;
        ability_timer = 120000;
        spellid = 4586;
        string = DISCIPLINE_PURETONE;

        break;
    case disc_resistant:
        reuse_timer = 3600 - (current_level - level_to_use) * 60;
        ability_timer = 60000;
        spellid = 4585;
        string = DISCIPLINE_RESISTANT;

        break;
    case disc_fearless:
        reuse_timer = 3600 - (current_level - level_to_use) * 60;
        ability_timer = 11000;
        spellid = 4587;
        string = DISCIPLINE_FEARLESS;

        break;
    default:
        Log.Out(Logs::General, Logs::Discs, "Invalid disc id %d was passed to CastDiscipline.", disc_id);
        return false;
    }

    if(string > 0 && IsDisc(spellid))
    {
        entity_list.MessageClose_StringID(this, false, 50, CC_User_Disciplines, string, GetName());
        p_timers.Start(pTimerDisciplineReuseStart, reuse_timer);
        if(ability_timer > 0)
        {
            disc_ability_timer.SetTimer(ability_timer);
        }
        else
        {
            Log.Out(Logs::General, Logs::Discs, "Disc %d is an instant effect", disc_id);
        }

        SetActiveDisc(disc_id, spellid);
        SpellFinished(spellid, this);
    }
    else
    {
        Log.Out(Logs::General, Logs::Discs, "Disc: %d Invalid stringid or spellid specified.", disc_id);
        return false;
    }

    EQApplicationPacket *outapp = new EQApplicationPacket(OP_DisciplineChange, sizeof(ClientDiscipline_Struct));
    ClientDiscipline_Struct *d = (ClientDiscipline_Struct*)outapp->pBuffer;
    d->disc_id = disc_id;
    QueuePacket(outapp);
    safe_delete(outapp);

    return true;
}