本文整理汇总了C++中CCrywolfUtil::SendCrywolfUserAnyMsg方法的典型用法代码示例。如果您正苦于以下问题:C++ CCrywolfUtil::SendCrywolfUserAnyMsg方法的具体用法?C++ CCrywolfUtil::SendCrywolfUserAnyMsg怎么用?C++ CCrywolfUtil::SendCrywolfUserAnyMsg使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCrywolfUtil
的用法示例。
在下文中一共展示了CCrywolfUtil::SendCrywolfUserAnyMsg方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CrywolfStatueAct
void CCrywolfStatue::CrywolfStatueAct(int iIndex)
{
if ( !gObjIsConnected(iIndex))
return;
if ( gObj[iIndex].Type != OBJ_NPC || CHECK_CLASS(204, gObj[iIndex].Class) == FALSE )
return;
LPOBJ lpObj = &gObj[iIndex];
int iContractedAlterCount = g_CrywolfNPC_Altar.GetContractedAltarCount();
int iPriestHPSum = g_CrywolfNPC_Altar.GetPriestHPSum();
int iPriestMaxHPSum = g_CrywolfNPC_Altar.GetPriestMaxHPSum();
if ( iContractedAlterCount == 0 || this->m_Shield.m_iShieldHP == 0 )
{
if ( this->m_Shield.m_iShieldState == 1 )
{
UTIL.SendCrywolfUserAnyMsg(2, lMsg.Get(MSGGET(13, 5)));
this->m_Shield.m_iShieldState = 0;
this->m_Shield.m_iShieldHP = 0;
this->m_Shield.m_iShieldMaxHP = 0;
this->m_Shield.m_iPriestNumber = iContractedAlterCount;
lpObj->m_ViewSkillState[this->GetStatueViewState(iContractedAlterCount)] = 1;
GCStateInfoSend(lpObj, 1, this->GetStatueViewState(iContractedAlterCount));
}
else if ( this->m_Shield.m_iPriestNumber != iContractedAlterCount )
{
this->m_Shield.m_iShieldState = 1;
this->m_Shield.m_iShieldHP = iPriestHPSum;
this->m_Shield.m_iShieldMaxHP = iPriestMaxHPSum;
this->m_Shield.m_iPriestNumber = iContractedAlterCount;
UTIL.SendCrywolfUserAnyMsg(2, lMsg.Get(MSGGET(13, 6)), iContractedAlterCount, iPriestHPSum);
lpObj->m_ViewSkillState[this->GetStatueViewState(iContractedAlterCount)] = 1;
GCStateInfoSend(lpObj, 1, this->GetStatueViewState(iContractedAlterCount));
}
return;
}
else if ( this->m_Shield.m_iShieldState == 0 )
{
UTIL.SendCrywolfUserAnyMsg(2, lMsg.Get(MSGGET(13, 7)));
lpObj->m_ViewSkillState[this->GetStatueViewState(iContractedAlterCount)] = 1;
GCStateInfoSend(lpObj, 1, this->GetStatueViewState(iContractedAlterCount));
}
else if ( this->m_Shield.m_iPriestNumber != iContractedAlterCount )
{
UTIL.SendCrywolfUserAnyMsg(2, lMsg.Get(MSGGET(13, 6)), iContractedAlterCount, iPriestHPSum);
lpObj->m_ViewSkillState[this->GetStatueViewState(iContractedAlterCount)] = 1;
GCStateInfoSend(lpObj, 1, this->GetStatueViewState(iContractedAlterCount));
}
this->m_Shield.m_iShieldState = 1;
this->m_Shield.m_iShieldHP = iPriestHPSum;
this->m_Shield.m_iShieldMaxHP = iPriestMaxHPSum;
this->m_Shield.m_iPriestNumber = iContractedAlterCount;
}
示例2: CrywolfStatueAct
void CCrywolfStatue::CrywolfStatueAct(int iIndex)
{
if ( !gObjIsConnected(iIndex))
return;
if ( gObj[iIndex].Type != OBJ_NPC || CHECK_CLASS(204, gObj[iIndex].Class) == FALSE )
return;
LPOBJ lpObj = &gObj[iIndex];
int iContractedAlterCount = g_CrywolfNPC_Altar.GetContractedAltarCount();
int iPriestHPSum = g_CrywolfNPC_Altar.GetPriestHPSum();
int iPriestMaxHPSum = g_CrywolfNPC_Altar.GetPriestMaxHPSum();
if ( iContractedAlterCount == 0 || this->m_Shield.m_iShieldHP == 0 )
{
if ( this->m_Shield.m_iShieldState == 1 )
{
UTIL.SendCrywolfUserAnyMsg(2, "The barrier of the holy wolf statue has disappeared");
this->m_Shield.m_iShieldState = 0;
this->m_Shield.m_iShieldHP = 0;
this->m_Shield.m_iShieldMaxHP = 0;
this->m_Shield.m_iPriestNumber = iContractedAlterCount;
lpObj->m_ViewSkillState |= this->GetStatueViewState(iContractedAlterCount);
GCStateInfoSend(lpObj, 1, lpObj->m_ViewSkillState);
}
else if ( this->m_Shield.m_iPriestNumber != iContractedAlterCount )
{
this->m_Shield.m_iShieldState = 1;
this->m_Shield.m_iShieldHP = iPriestHPSum;
this->m_Shield.m_iShieldMaxHP = iPriestMaxHPSum;
this->m_Shield.m_iPriestNumber = iContractedAlterCount;
UTIL.SendCrywolfUserAnyMsg(2, "Stats of Muses in the holy wolf statue's barrier is %d, HP: %d", iContractedAlterCount, iPriestHPSum);
lpObj->m_ViewSkillState |= this->GetStatueViewState(iContractedAlterCount);
GCStateInfoSend(lpObj, 1, lpObj->m_ViewSkillState);
}
return;
}
else if ( this->m_Shield.m_iShieldState == 0 )
{
UTIL.SendCrywolfUserAnyMsg(2, "The barrier of the holy wolf statue has been created.");
lpObj->m_ViewSkillState |= this->GetStatueViewState(iContractedAlterCount);
GCStateInfoSend(lpObj, 1, lpObj->m_ViewSkillState);
}
else if ( this->m_Shield.m_iPriestNumber != iContractedAlterCount )
{
UTIL.SendCrywolfUserAnyMsg(2, "Stats of Muses in the holy wolf statue's barrier is %d, HP: %d", iContractedAlterCount, iPriestHPSum);
lpObj->m_ViewSkillState |= this->GetStatueViewState(iContractedAlterCount);
GCStateInfoSend(lpObj, 1, lpObj->m_ViewSkillState);
}
this->m_Shield.m_iShieldState = 1;
this->m_Shield.m_iShieldHP = iPriestHPSum;
this->m_Shield.m_iShieldMaxHP = iPriestMaxHPSum;
this->m_Shield.m_iPriestNumber = iContractedAlterCount;
}
示例3: ProcState_START
void CCrywolf::ProcState_START()
{
if ( g_CrywolfNPC_Altar.GetContractedAltarCount() == 0 )
{
UTIL.SendCrywolfUserAnyMsg(2, lMsg.Get(MSGGET(12, 240)));
this->SetOccupationState(1);
this->SetState(CRYWOLF_STATE_END);
return;
}
this->NotifyCrywolfStatueAndAltarInfo();
this->NotifyCrywolfBossMonsterInfo();
this->NotifyCrywolfStateLeftTime();
// VERIFICAR
if ( (int)(GetTickCount() - this->m_dwCrywolfStartProcTick) > (this->m_iBossTurnUpTime * 1000) &&
!this->m_bTurnUpBoss )
{
this->m_bTurnUpBoss = TRUE;
UTIL.SendCrywolfUserAnyMsg(2, lMsg.Get(MSGGET(12, 241)));
this->TurnUpBoss();
LogAddTD("[ Crywolf ][MVP] Barlgars TurnUp !!!");
}
// VERIFICAR
if ( (int)(GetTickCount() - this->m_dwCrywolfStartProcTick) > (this->m_iMonsterGroupChangeAITime * 1000) &&
!this->m_bChangeAI )
{
this->m_bChangeAI = TRUE;
UTIL.SendCrywolfUserAnyMsg(2, lMsg.Get(MSGGET(12, 242)));
this->ChangeAI(2);
LogAddTD("[ Crywolf ][MVP] Start Monster Rush !!!");
}
if ( this->m_bTurnUpBoss != FALSE && CHECK_LIMIT(this->m_iBossIndex, OBJ_MAXMONSTER) != FALSE )
{
if ( gObj[this->m_iBossIndex].Live == FALSE )
{
UTIL.SendCrywolfUserAnyMsg(2, lMsg.Get(MSGGET(12, 243)));
this->SetOccupationState(0);
this->SetState(CRYWOLF_STATE_END);
}
}
}
示例4: CrywolfMonsterDieProc
void CCrywolf::CrywolfMonsterDieProc(int iMonIndex, int iKillerIndex)
{
LPOBJ lpMonObj = &gObj[iMonIndex];
LPOBJ lpKillerObj = &gObj[iKillerIndex];
BOOL bExistKiller = gObjIsConnected(iKillerIndex);
if ( g_Crywolf.GetCrywolfState() == CRYWOLF_STATE_START )
{
if ( lpMonObj->MapNumber == MAP_INDEX_CRYWOLF_FIRSTZONE )
{
if ( lpMonObj->m_iCurrentAI != 0 )
{
if ( lpMonObj->Class == 349 )
{
if ( bExistKiller )
{
UTIL.SendCrywolfUserAnyMsg(2, "Balgass has been killed by %s!", lpKillerObj->Name);
LogAdd("[ Crywolf ][MVP] [Balgass Dead] by [%s][%s]",
lpKillerObj->AccountID, lpKillerObj->Name);
}
else
{
UTIL.SendCrywolfUserAnyMsg(2, "Balgass is dead");
LogAdd("[ Crywolf ][MVP] [Balgass Dead] by Unknown User");
}
}
if ( lpMonObj->Class == 340 )
{
if ( bExistKiller )
{
UTIL.SendCrywolfUserAnyMsg(2, "The darkelf leader [%d] of Balgass's army has been killed by %s!",
lpMonObj->m_iGroupNumber, lpKillerObj->Name);
LogAdd("[ Crywolf ][MVP] [DarkElf Dead] by [%s][%s]",
lpKillerObj->AccountID, lpKillerObj->Name);
}
}
int iScore = this->CalcGettingScore(iKillerIndex, iMonIndex, 100);
if ( iScore != -1 )
{
MsgOutput(iKillerIndex, "Current MvP point is : %d", iScore);
}
}
}
}
}
示例5: CrywolfMonsterDieProc
void CCrywolf::CrywolfMonsterDieProc(int iMonIndex, int iKillerIndex)
{
LPOBJ lpMonObj = &gObj[iMonIndex];
LPOBJ lpKillerObj = &gObj[iKillerIndex];
BOOL bExistKiller = gObjIsConnected(iKillerIndex);
if ( g_Crywolf.GetCrywolfState() == CRYWOLF_STATE_START )
{
if ( lpMonObj->MapNumber == MAP_INDEX_CRYWOLF_FIRSTZONE )
{
if ( lpMonObj->m_iCurrentAI != 0 )
{
if ( lpMonObj->Class == 349 )
{
if ( bExistKiller )
{
UTIL.SendCrywolfUserAnyMsg(2, lMsg.Get(MSGGET(12, 247)), lpKillerObj->Name);
LogAddTD("[ Crywolf ][MVP] [Balgars Dead] by [%s][%s]",
lpKillerObj->AccountID, lpKillerObj->Name);
}
else
{
UTIL.SendCrywolfUserAnyMsg(2, lMsg.Get(MSGGET(12, 248)));
LogAddTD("[ Crywolf ][MVP] [Balgars Dead] by Unknown User");
}
}
if ( lpMonObj->Class == 340 )
{
if ( bExistKiller )
{
UTIL.SendCrywolfUserAnyMsg(2, lMsg.Get(MSGGET(12, 249)),
lpMonObj->m_iGroupNumber, lpKillerObj->Name);
LogAddTD("[ Crywolf ][MVP] [DarkElf Dead] by [%s][%s]",
lpKillerObj->AccountID, lpKillerObj->Name);
}
}
int iScore = this->CalcGettingScore(iKillerIndex, iMonIndex, 100);
if ( iScore != -1 )
{
MsgOutput(iKillerIndex, lMsg.Get(MSGGET(12, 250)), iScore);
}
}
}
}
}
示例6: ProcState_START
void CCrywolf::ProcState_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;
}
this->NotifyCrywolfStatueAndAltarInfo();
this->NotifyCrywolfBossMonsterInfo();
this->NotifyCrywolfStateLeftTime();
if ( int(GetTickCount() - this->m_dwCrywolfStartProcTick) > (this->m_iBossTurnUpTime * 1000) &&
!this->m_bTurnUpBoss )
{
this->m_bTurnUpBoss = TRUE;
UTIL.SendCrywolfUserAnyMsg(2, "Balgass is coming! Protect the statue of holy wolf");
this->TurnUpBoss();
LogAdd("[ Crywolf ][MVP] Balgass TurnUp !!!");
}
if ( int(GetTickCount() - this->m_dwCrywolfStartProcTick) > (this->m_iMonsterGroupChangeAITime * 1000) &&
!this->m_bChangeAI )
{
this->m_bChangeAI = TRUE;
UTIL.SendCrywolfUserAnyMsg(2, "Balgass's army starts attacking the statue of holy wolf");
this->ChangeAI(2);
LogAdd("[ Crywolf ][MVP] Start Monster Rush !!!");
}
if ( this->m_bTurnUpBoss != FALSE && CHECK_LIMIT(this->m_iBossIndex, OBJ_MAXMONSTER) != FALSE )
{
if ( gObj[this->m_iBossIndex].Live == FALSE )
{
UTIL.SendCrywolfUserAnyMsg(2, "Balgass has been defeated with the help of heroes");
this->SetOccupationState(0);
this->SetState(CRYWOLF_STATE_END);
}
}
}
示例7: SetState_END
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();
}
示例8: SetState_END
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();
}
示例9: SetAltarUserIndex
BOOL CCrywolfAltar::SetAltarUserIndex(int iAltarObjIndex, int iClass, int iUserIndex)
{
int iAltarNumber = this->GetAlatarNumber(iClass);
CCrywolfAltarInfo * AltarInfo = &this->m_AltarInfo[iAltarNumber];
DWORD dwCurrentTime = GetTickCount();
if ( gObjIsConnected(AltarInfo->m_iUserIndex) != FALSE )
{
MsgOutput(iUserIndex, lMsg.Get(MSGGET(12, 253)), iAltarNumber);
return FALSE;
}
if ( (dwCurrentTime-AltarInfo->m_dwLastValidContractTime) < 10000 )
{
MsgOutput(iUserIndex, lMsg.Get(MSGGET(12, 254)), iAltarNumber);
return FALSE;
}
if ( AltarInfo->m_iContractCount > MAX_ALTAR_CONTRACTS )
{
MsgOutput(iUserIndex, lMsg.Get(MSGGET(12, 255)), iAltarNumber);
return FALSE;
}
if ( abs(gObj[iAltarObjIndex].Y - gObj[iUserIndex].Y) > 0 || abs(gObj[iAltarObjIndex].X - gObj[iUserIndex].X) > 0 )
{
MsgOutput(iUserIndex, lMsg.Get(MSGGET(13, 0)), iAltarNumber);
return FALSE;
}
AltarInfo->SetAltarState(2);
AltarInfo->m_iUserIndex = iUserIndex;
AltarInfo->m_dwAppliedContractTime = dwCurrentTime;
AltarInfo->m_dwValidContractTime = dwCurrentTime + 5000; // It Get Active after 5 Seconds
AltarInfo->m_dwLastValidContractTime = dwCurrentTime;
AltarInfo->m_iContractCount++;
memset(gObj[iAltarObjIndex].m_ViewSkillState, 0, sizeof(gObj[iAltarObjIndex].m_ViewSkillState));
gObj[iAltarObjIndex].m_ViewSkillState[eVS_ALTAR_ATTEMP_CONTRACT] = 1;
GCStateInfoSend(&gObj[iAltarObjIndex], 1, eVS_ALTAR_VALID_CONTRACT);
UTIL.SendCrywolfUserAnyMsg(2, lMsg.Get(MSGGET(13, 1)), gObj[AltarInfo->m_iUserIndex].Name, iAltarNumber);
CLog.LogAdd("[ Crywolf ][Altar Op.] [%s][%s] Attempt to contract Altar[%d]",
gObj[AltarInfo->m_iUserIndex].AccountID, gObj[AltarInfo->m_iUserIndex].Name,
iAltarNumber);
MsgOutput(iUserIndex, lMsg.Get(MSGGET(13, 2)));
MsgOutput(iUserIndex, lMsg.Get(MSGGET(13, 3)));
return TRUE;
}
示例10: SetState_START
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;
}
示例11: SetState_START
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;
}
示例12: SetAltarUserIndex
BOOL CCrywolfAltar::SetAltarUserIndex(int iAltarObjIndex, int iClass, int iUserIndex)
{
int iAltarNumber = this->GetAlatarNumber(iClass);
CCrywolfAltarInfo * AltarInfo = &this->m_AltarInfo[iAltarNumber];
DWORD dwCurrentTime = GetTickCount();
if ( gObjIsConnected(AltarInfo->m_iUserIndex) != FALSE )
{
MsgOutput(iUserIndex, lMsg.Get(MSGGET(12, 253)), iAltarNumber);
return FALSE;
}
if ( (dwCurrentTime-AltarInfo->m_dwLastValidContractTime) < 10000 )
{
MsgOutput(iUserIndex, lMsg.Get(MSGGET(12, 254)), iAltarNumber);
return FALSE;
}
if ( AltarInfo->m_iContractCount > MAX_ALTAR_CONTRACTS )
{
MsgOutput(iUserIndex, lMsg.Get(MSGGET(12, 255)), iAltarNumber);
return FALSE;
}
if ( abs(gObj[iAltarObjIndex].Y - gObj[iUserIndex].Y) > 0 || abs(gObj[iAltarObjIndex].X - gObj[iUserIndex].X) > 0 )
{
MsgOutput(iUserIndex, lMsg.Get(MSGGET(13, 0)), iAltarNumber);
return FALSE;
}
AltarInfo->SetAltarState(2);
AltarInfo->m_iUserIndex = iUserIndex;
AltarInfo->m_dwAppliedContractTime = dwCurrentTime;
AltarInfo->m_dwValidContractTime = dwCurrentTime + 5000;
AltarInfo->m_dwLastValidContractTime = dwCurrentTime;
AltarInfo->m_iContractCount++;
gObjAddBuffEffect(&gObj[iAltarObjIndex], AT_CW_ALTAR_ATTEMPT, 0, 0, 0, 0, -10);
UTIL.SendCrywolfUserAnyMsg(2, lMsg.Get(MSGGET(13, 1)), gObj[AltarInfo->m_iUserIndex].Name, iAltarNumber);
LogAddTD("[ Crywolf ][Altar Op.] [%s][%s] Attempt to contract Altar[%d]", gObj[AltarInfo->m_iUserIndex].AccountID, gObj[AltarInfo->m_iUserIndex].Name, iAltarNumber);
MsgOutput(iUserIndex, lMsg.Get(MSGGET(13, 2)));
MsgOutput(iUserIndex, lMsg.Get(MSGGET(13, 3)));
return TRUE;
}
示例13: SetAltarValidContract
void CCrywolfAltar::SetAltarValidContract(int iAltarObjIndex, int iClass)
{
int iAltarNumber = this->GetAlatarNumber(iClass);
CCrywolfAltarInfo * AltarInfo = &this->m_AltarInfo[iAltarNumber];
if ( AltarInfo->GetAltarState() != 2 )
return;
if ( AltarInfo->m_dwValidContractTime < (int)GetTickCount() )
{
MsgOutput(AltarInfo->m_iUserIndex, lMsg.Get(MSGGET(12, 251)), iAltarNumber);
UTIL.SendCrywolfUserAnyMsg(2, lMsg.Get(MSGGET(12, 252)), gObj[AltarInfo->m_iUserIndex].Name, iAltarNumber);
CLog.LogAdd("[ Crywolf ][Altar Op.] [%s][%s] Set Valid Contract Altar[%d]",
gObj[AltarInfo->m_iUserIndex].AccountID, gObj[AltarInfo->m_iUserIndex].Name, iAltarNumber);
AltarInfo->SetAltarState(1);
memset(gObj[iAltarObjIndex].m_ViewSkillState,0, sizeof(gObj[iAltarObjIndex].m_ViewSkillState));
gObj[iAltarObjIndex].m_ViewSkillState[eVS_ALTAR_VALID_CONTRACT] = 1;
GCStateInfoSend(&gObj[iAltarObjIndex], 1, eVS_ALTAR_VALID_CONTRACT);
}
}
示例14: SetAltarValidContract
void CCrywolfAltar::SetAltarValidContract(int iAltarObjIndex, int iClass)
{
int iAltarNumber = this->GetAlatarNumber(iClass);
CCrywolfAltarInfo * AltarInfo = &this->m_AltarInfo[iAltarNumber];
if ( AltarInfo->GetAltarState() != 2 )
{
return;
}
if ( AltarInfo->m_dwValidContractTime < GetTickCount() )
{
MsgOutput(AltarInfo->m_iUserIndex, lMsg.Get(MSGGET(12, 251)), iAltarNumber);
UTIL.SendCrywolfUserAnyMsg(2, lMsg.Get(MSGGET(12, 252)), gObj[AltarInfo->m_iUserIndex].Name, iAltarNumber);
LogAddTD("[ Crywolf ][Altar Op.] [%s][%s] Set Valid Contract Altar[%d]", gObj[AltarInfo->m_iUserIndex].AccountID, gObj[AltarInfo->m_iUserIndex].Name, iAltarNumber);
AltarInfo->SetAltarState(1);
gObjAddBuffEffect(&gObj[iAltarObjIndex], AT_CW_ALTAR_STATUS, 0, 0, 0, 0, -10);
}
}