void PrisonerDied(uint64 guid)
 {
     if (PrisonersCell5.find(guid) != PrisonersCell5.end() && --PrisonerCounter5 <= 0)
         ActivateCell(DATA_PRISON_CELL6);
     else if (PrisonersCell6.find(guid) != PrisonersCell6.end() && --PrisonerCounter6 <= 0)
         ActivateCell(DATA_PRISON_CELL7);
     else if (PrisonersCell7.find(guid) != PrisonersCell7.end() && --PrisonerCounter7 <= 0)
         ActivateCell(DATA_PRISON_CELL8);
     else if (PrisonersCell8.find(guid) != PrisonersCell8.end() && --PrisonerCounter8 <= 0)
         ActivateCell(DATA_DOOR5);
 }
            bool SetBossState(uint32 type, EncounterState state) override
            {
                if (!InstanceScript::SetBossState(type, state))
                    return false;

                switch (type)
                {
                    case DATA_BROGGOK:
                        switch (state)
                        {
                            case IN_PROGRESS:
                                ActivateCell(DATA_PRISON_CELL5);
                                break;
                            case NOT_STARTED:
                                ResetPrisons();
                                if (GameObject* lever = instance->GetGameObject(BroggokLeverGUID))
                                    lever->Respawn();
                                break;
                            default:
                                break;
                        }
                        break;
                    default:
                        break;
                }

                return true;
            }
Esempio n. 3
0
File: mhcmd.c Progetto: yzh/yzhack
/*-------------------------------------------------------------------------*/
void onMouseUp(HWND hWnd, WPARAM wParam, LPARAM lParam)
{
	PNHCmdWindow data;

	/* release mouse capture */
	ReleaseCapture();

	/* get active display cell */
	data = (PNHCmdWindow)GetWindowLong(hWnd, GWL_USERDATA);
	if( data->active_cell == -1 ) return;

	ActivateCell(hWnd, data->active_cell);

	data->active_cell = -1;
}
 void UpdateBroggokEvent(uint32 data)
 {
     switch (data)
     {
         case IN_PROGRESS:
             ActivateCell(DATA_PRISON_CELL5);
             HandleGameObject(Door4GUID, false);
             break;
         case NOT_STARTED:
             ResetPrisons();
             HandleGameObject(Door5GUID, false);
             HandleGameObject(Door4GUID, true);
             if (GameObject* lever = instance->GetGameObject(BroggokLeverGUID))
                 lever->Respawn();
             break;
     }
 }
Esempio n. 5
0
File: mhcmd.c Progetto: yzh/yzhack
/* special keypad input handling for SmartPhone
   the phone keypad maps to VK_* as shown below.
   some keys might not be present, e.g. VK_TFLIP
    sofkey1     softkey2    VK_TSOFT1, VK_TSOFT2
            ^               VK_TUP
        <   +   >           VK_TLEFT, VK_TACTION, VK_TRIGHT
            v               VK_TDOWN
    home        back        VK_THOME, VK_TBACK
    talk        end         VK_TTALK, VK_TEND
    1       2       3       VK_T0..VK_T9
    4       5       6       ...
    7       8       9       ...
    *       0       #       VK_TSTAR, VK_TPOUND
   other buttons include
    VK_TRECORD
    VK_TPOWER, VK_TVOLUMEUP, VK_TVOLUMEDOWN
    VK_TFLIP
*/
BOOL NHSPhoneTranslateKbdMessage(WPARAM wParam, LPARAM lParam, BOOL keyDown)
{
	PNHCmdWindow data;
	int index = -1;

	/* get window data */
	data = (PNHCmdWindow)GetWindowLong(GetNHApp()->hCmdWnd, GWL_USERDATA);
	if( !data ) return FALSE;

	switch (wParam) {
    case VK_T0: 
		index = 10; 
	break;

    case VK_T1: 
		index = 0; 
	break;

    case VK_T2: 
		index = 1; 
	break;

    case VK_T3: 
		index = 2; 
	break;

    case VK_T4: 
		index = 3; 
	break;

    case VK_T5: 
		index = 4; 
	break;

    case VK_T6: 
		index = 5; 
	break;

    case VK_T7: 
		index = 6; 
	break;

    case VK_T8: 
		index = 7; 
	break;

    case VK_T9: 
		index = 8; 
	break;

	case VK_TSTAR:
		index = 9; 
	break;
	
	case VK_TPOUND: 
		index = 11;
	break;
	}

	if( index>=0 ) {
		HighlightCell(GetNHApp()->hCmdWnd, index, keyDown);
		if( keyDown ) ActivateCell(GetNHApp()->hCmdWnd, index);
		return TRUE;
	} else {
		return FALSE;
	}
}