Exemple #1
0
void CCrywolf::SetState_END()
{
	this->m_dwCrywolfStartProcTick = 0;
	this->m_bChangeAI = FALSE;

	LogAdd( "[ Crywolf ] State (%d) -> END", this->m_iCrywolfState);

	if ( this->m_bTurnUpBoss != FALSE && CHECK_LIMIT(this->m_iBossIndex, OBJ_MAXMONSTER) )
	{
		if ( gObj[this->m_iBossIndex].Live != FALSE )
		{
			UTIL.SendCrywolfUserAnyMsg(2, "Balgass will be alive till the end of the battle");
			this->SetOccupationState(1);
		}
	}

	this->m_bTurnUpBoss = FALSE;
	this->SetCrywolfBossIndex(-1);

	if ( this->GetOccupationState() == 1 )
	{
		UTIL.SendMapServerGroupMsg("Defending has failed! The statue of holy wolf has been taken over by Balgass");
		this->SetOccupationState(1);

		LogAdd("[ Crywolf ][MVP] FAIL.......!!");
	}
	else
	{
		UTIL.SendMapServerGroupMsg("Defending has been successful! The statue of holy wolf has been protected.");
		this->SetOccupationState(0);

		LogAdd("[ Crywolf ][MVP] SUCCESS.......!!");
	}

	this->SetCrywolfState(CRYWOLF_STATE_END);
	this->SetCrywolfStateAppliedTime(CRYWOLF_STATE_END);
	this->NotifyCrywolfCurrentState();
	this->ChangeAI(0);
	
	for ( int iAltar = 205 ; iAltar <= 209 ; iAltar++)
	{
		int iUserIndex = g_CrywolfNPC_Altar.GetAltarUserIndex(iAltar);

		if ( iUserIndex != -1 )
		{
			this->CalcGettingScore(iUserIndex, -1, 6);

			if ( this->GetOccupationState() != 1 )
			{
				this->MakeRewardForAltarElf(iUserIndex);
			}
		}
	}

	g_CrywolfNPC_Altar.ResetAllAltar();
	this->NotifyCrywolfPersonalRank();
}
Exemple #2
0
void CCrywolf::SetState_END()
{
	this->m_dwCrywolfStartProcTick = 0;
	this->m_bChangeAI = FALSE;

	LogAddC(4, "[ Crywolf ] State (%d) -> END", this->m_iCrywolfState);

	if ( this->m_bTurnUpBoss != FALSE && CHECK_LIMIT(this->m_iBossIndex, OBJ_MAXMONSTER) )
	{
		if ( gObj[this->m_iBossIndex].Live != FALSE )
		{
			UTIL.SendCrywolfUserAnyMsg(2, lMsg.Get(MSGGET(12, 233)));
			this->SetOccupationState(1);
		}
	}

	this->m_bTurnUpBoss = FALSE;
	this->SetCrywolfBossIndex(-1);

	if ( this->GetOccupationState() == 1 )
	{
		UTIL.SendMapServerGroupMsg(lMsg.Get(MSGGET(12, 234)));
		this->SetOccupationState(1);

		LogAddTD("[ Crywolf ][MVP] FAIL.......!!");
	}
	else
	{
		UTIL.SendMapServerGroupMsg(lMsg.Get(MSGGET(12, 235)));
		this->SetOccupationState(0);

		LogAddTD("[ Crywolf ][MVP] SUCCESS.......!!");
	}

	this->SetCrywolfState(CRYWOLF_STATE_END);
	this->SetCrywolfStateAppliedTime(CRYWOLF_STATE_END);
	this->NotifyCrywolfCurrentState();
	this->ChangeAI(0);
	
	for ( int iAltar = 205 ; iAltar <= 209 ; iAltar++)
	{
		int iUserIndex = g_CrywolfNPC_Altar.GetAltarUserIndex(iAltar);

		if ( iUserIndex != -1 )
		{
			this->CalcGettingScore(iUserIndex, -1, 6);

			if ( this->GetOccupationState() != 1 )
			{
				this->MakeRewardForAltarElf(iUserIndex);
			}
		}
	}

	g_CrywolfNPC_Altar.ResetAllAltar();
	this->NotifyCrywolfPersonalRank();
}
Exemple #3
0
void CCrywolf::ProcState_NOTIFY_1()
{
	if ( (GetTickCount() - this->m_dwCrywolfNotifyMsgStartTick) > 70000 )
	{
		UTIL.SendMapServerGroupMsg("Balgass joined forces with Kundun's army and now prepares to attack Crywolf Fortress");
		this->m_dwCrywolfNotifyMsgStartTick = GetTickCount();
	}
}
Exemple #4
0
void CCrywolf::ProcState_NOTIFY_1()
{
	if ( (GetTickCount() - this->m_dwCrywolfNotifyMsgStartTick) > 70000 )
	{
		UTIL.SendMapServerGroupMsg(lMsg.Get(MSGGET(12, 228)));
		this->m_dwCrywolfNotifyMsgStartTick = GetTickCount();
	}
}
Exemple #5
0
void CCrywolf::SetState_NOTIFY_1()
{
	UTIL.SendMapServerGroupMsg("Balgass joined forces with Kundun's army and now prepares to attack Crywolf Fortress");
	LogAdd( "[ Crywolf ] State (%d) -> NOTIFY_1", this->m_iCrywolfState);

	this->SetCrywolfState(CRYWOLF_STATE_NOTIFY_1);
	this->SetCrywolfStateAppliedTime(CRYWOLF_STATE_NOTIFY_1);
	this->m_dwCrywolfNotifyMsgStartTick = GetTickCount();
}
Exemple #6
0
void CCrywolf::SetState_NOTIFY_1()
{
	UTIL.SendMapServerGroupMsg(lMsg.Get(MSGGET(12, 228)));
	LogAddC(4, "[ Crywolf ] State (%d) -> NOTIFY_1", this->m_iCrywolfState);

	this->SetCrywolfState(CRYWOLF_STATE_NOTIFY_1);
	this->SetCrywolfStateAppliedTime(CRYWOLF_STATE_NOTIFY_1);
	this->m_dwCrywolfNotifyMsgStartTick = GetTickCount();
}
Exemple #7
0
void CCrywolf::ProcState_NOTIFY_2()
{
	if ( (GetTickCount() - this->m_dwCrywolfNotifyMsgStartTick) > 70000 )
	{
		int iTime = ( this->m_StateTimeInfo[this->GetCrywolfState()].GetLeftTime() / 1000 ) / 60;

		if ( iTime == 0 )
		{
			iTime = ( this->m_StateTimeInfo[this->GetCrywolfState()].GetLeftTime() / 1000 );

			UTIL.SendMapServerGroupMsg("Elf's can make contract in the wolf altar in %d Seconds.", iTime);
		}
		else
		{
			UTIL.SendMapServerGroupMsg("Elf's can make contract in the wolf altar in %d Minutes.", iTime);
		}

		this->m_dwCrywolfNotifyMsgStartTick = GetTickCount();
	}
}
Exemple #8
0
void CCrywolf::ProcState_NOTIFY_2()
{
	if ( (GetTickCount() - this->m_dwCrywolfNotifyMsgStartTick) > 70000 )
	{
		int iTime = ( this->m_StateTimeInfo[this->GetCrywolfState()].GetLeftTime() / 1000 ) / 60;

		if ( iTime == 0 )
		{
			iTime = ( this->m_StateTimeInfo[this->GetCrywolfState()].GetLeftTime() / 1000 );

			UTIL.SendMapServerGroupMsg(lMsg.Get(MSGGET(12, 236)), iTime);
		}
		else
		{
			UTIL.SendMapServerGroupMsg(lMsg.Get(MSGGET(12, 237)), iTime);
		}

		this->m_dwCrywolfNotifyMsgStartTick = GetTickCount();
	}
}
Exemple #9
0
void CCrywolf::ProcState_READY()
{
	this->NotifyCrywolfStatueAndAltarInfo();

	if ( (GetTickCount() - this->m_dwCrywolfNotifyMsgStartTick) > 70000 )
	{
		int iTime = ( this->m_StateTimeInfo[this->GetCrywolfState()].GetLeftTime() / 1000 ) / 60;

		if ( iTime == 0 )
		{
			iTime = ( this->m_StateTimeInfo[this->GetCrywolfState()].GetLeftTime() / 1000 );

			UTIL.SendMapServerGroupMsg("Balgass's army will attack in %d seconds", iTime);
		}
		else
		{
			UTIL.SendMapServerGroupMsg("Balgass's army will attack in %d minutes", iTime);
		}

		this->m_dwCrywolfNotifyMsgStartTick = GetTickCount();
	}
}
Exemple #10
0
void CCrywolf::SetState_NOTIFY_2()
{
	UTIL.SendMapServerGroupMsg("The army of Balgass is ready to attack Crywolf Fortress");
	LogAdd( "[ Crywolf ] State (%d) -> NOTIFY_2", this->m_iCrywolfState);

	this->SetCrywolfState(CRYWOLF_STATE_NOTIFY_2);
	this->SetCrywolfStateAppliedTime(CRYWOLF_STATE_NOTIFY_2);
	this->SetOccupationState(2);
	this->SetCrywolfCommonNPC(2);
	this->SetCrywolfMapAttr(2);
	this->RemoveCrywolfCommonMonster();
	this->m_dwCrywolfNotifyMsgStartTick = GetTickCount();
}
Exemple #11
0
void CCrywolf::ProcState_READY()
{
	this->NotifyCrywolfStatueAndAltarInfo();

	if ( (GetTickCount() - this->m_dwCrywolfNotifyMsgStartTick) > 70000 )
	{
		int iTime = ( this->m_StateTimeInfo[this->GetCrywolfState()].GetLeftTime() / 1000 ) / 60;

		if ( iTime == 0 )
		{
			iTime = ( this->m_StateTimeInfo[this->GetCrywolfState()].GetLeftTime() / 1000 );

			UTIL.SendMapServerGroupMsg(lMsg.Get(MSGGET(12, 238)), iTime);
		}
		else
		{
			UTIL.SendMapServerGroupMsg(lMsg.Get(MSGGET(12, 239)), iTime);
		}

		this->m_dwCrywolfNotifyMsgStartTick = GetTickCount();
	}
}
Exemple #12
0
void CCrywolf::SetState_NOTIFY_2()
{
	UTIL.SendMapServerGroupMsg(lMsg.Get(MSGGET(12, 229)));
	LogAddC(4, "[ Crywolf ] State (%d) -> NOTIFY_2", this->m_iCrywolfState);

	this->SetCrywolfState(CRYWOLF_STATE_NOTIFY_2);
	this->SetCrywolfStateAppliedTime(CRYWOLF_STATE_NOTIFY_2);
	this->SetOccupationState(2);
	this->SetCrywolfCommonNPC(2);
	this->SetCrywolfMapAttr(2);
	this->RemoveCrywolfCommonMonster();
	this->m_dwCrywolfNotifyMsgStartTick = GetTickCount();
}
Exemple #13
0
void CCrywolf::SetState_START()
{
	UTIL.SendMapServerGroupMsg("The army of Balgass is marching towards Crywolf Fortress");
	LogAdd( "[ Crywolf ] State (%d) -> START", this->m_iCrywolfState);

	this->SetCrywolfState(CRYWOLF_STATE_START);
	this->SetCrywolfStateAppliedTime(CRYWOLF_STATE_START);

	if ( g_CrywolfNPC_Altar.GetContractedAltarCount() == 0 )
	{
		UTIL.SendCrywolfUserAnyMsg(2, "Without the protection of the Muses, the statue of holy wolf will be stolen");
		this->SetOccupationState(1);
		this->SetState(CRYWOLF_STATE_END);

		return;
	}

	for ( int n=0;n<this->m_iMonsterGroupNumberCount;n++)
	{
		int iLeaderIndex = TMonsterAIGroup::FindGroupLeader(this->m_iMonsterGroupNumberArray[n]);

		if ( !CHECK_LIMIT(iLeaderIndex, OBJ_MAXMONSTER) )
			continue;

		if ( gObj[iLeaderIndex].Class != 340 )
			continue;

		LPOBJ lpObj = &gObj[iLeaderIndex];

		for ( int i=0;i<MAX_VIEWPORT_MONSTER;i++)
		{
			if ( lpObj->VpPlayer2[i].state )
			{
				int number = lpObj->VpPlayer2[i].number;

				if ( OBJMAX_RANGE(number) != FALSE )
				{
					if ( gObj[number].Type == OBJ_USER )
					{
						gObjBackSpring2(&gObj[number], lpObj, 3);
					}
				}
			}
		}
	}

	this->ChangeAI(1);
	this->m_dwCrywolfStartProcTick = GetTickCount();
	this->m_bTurnUpBoss = FALSE;
	this->m_bChangeAI = FALSE;
}
Exemple #14
0
void CCrywolf::SetState_START()
{
	UTIL.SendMapServerGroupMsg(lMsg.Get(MSGGET(12, 231)));
	LogAddC(4, "[ Crywolf ] State (%d) -> START", this->m_iCrywolfState);

	this->SetCrywolfState(CRYWOLF_STATE_START);
	this->SetCrywolfStateAppliedTime(CRYWOLF_STATE_START);

	if ( g_CrywolfNPC_Altar.GetContractedAltarCount() == 0 )
	{
		UTIL.SendCrywolfUserAnyMsg(2, lMsg.Get(MSGGET(12, 232)));
		this->SetOccupationState(1);
		this->SetState(CRYWOLF_STATE_END);

		return;
	}

	for ( int n=0;n<this->m_iMonsterGroupNumberCount;n++)
	{
		int iLeaderIndex = TMonsterAIGroup::FindGroupLeader(this->m_iMonsterGroupNumberArray[n]);

		if ( !CHECK_LIMIT(iLeaderIndex, OBJ_MAXMONSTER) )
			continue;

		if ( gObj[iLeaderIndex].Class != 340 )
			continue;

		LPOBJ lpObj = &gObj[iLeaderIndex];

		for ( int i=0;i<MAX_VIEWPORT_MONSTER;i++)
		{
			if ( lpObj->VpPlayer2[i].state )
			{
				int number = lpObj->VpPlayer2[i].number;

				if ( OBJMAX_RANGE(number) != FALSE )
				{
					if ( gObj[number].Type == OBJ_USER )
					{
						gObjBackSpring2(&gObj[number], lpObj, 3);
					}
				}
			}
		}
	}

	this->ChangeAI(1);
	this->m_dwCrywolfStartProcTick = GetTickCount();
	this->m_bTurnUpBoss = FALSE;
	this->m_bChangeAI = FALSE;
}
Exemple #15
0
void CCrywolf::SetState_READY()
{
	UTIL.SendMapServerGroupMsg("The army of Balgass is marching towards Crywolf Fortress");
	LogAdd( "[ Crywolf ] State (%d) -> READY", this->m_iCrywolfState);

	this->SetCrywolfState(CRYWOLF_STATE_READY);
	this->SetCrywolfStateAppliedTime(CRYWOLF_STATE_READY);
	this->SetOccupationState(2);
	this->SetCrywolfCommonNPC(2);
	this->SetCrywolfMapAttr(2);
	this->RemoveCrywolfCommonMonster();
	g_CrywolfNPC_Altar.SetAllAltarObjectIndex();
	g_CrywolfNPC_Altar.SetAllAltarViewState(0x10000);

	for ( int n=0;n<this->m_iMonsterGroupNumberCount;n++)
	{
		TMonsterAIGroup::Init(this->m_iMonsterGroupNumberArray[n]);
	}

	this->m_dwCrywolfNotifyMsgStartTick = GetTickCount();
	this->ResetAllUserMVPScore();
}