-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathIslandPortal14.cpp
66 lines (56 loc) · 1.45 KB
/
IslandPortal14.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#pragma hdrstop
#include "IslandPortal14.h"
IslandPortal14::IslandPortal14()
{}
IslandPortal14::~IslandPortal14()
{}
extern NPCstructure::NPC IslandPortalNPC;
void IslandPortal14::Create( ){
npc = IslandPortalNPC;
SET_NPC_NAME( "[7396]A shimmering portal" );
npc.InitialPos.X = 3001;
npc.InitialPos.Y = 2841;
npc.InitialPos.world = 0;
}
void IslandPortal14::OnAttacked( UNIT_FUNC_PROTOTYPE ){
{}
}
void IslandPortal14::OnInitialise( UNIT_FUNC_PROTOTYPE ){
NPCstructure::OnInitialise( UNIT_FUNC_PARAM );
WorldPos wlPos = { 0,0,0 };
self->SetDestination( wlPos );
self->Do( nothing );
self->SetCanMove( FALSE );
}
void IslandPortal14::OnTalk( UNIT_FUNC_PROTOTYPE )
{
InitTalk
Begin
""
IF(CheckGlobalFlag(__GLOBAL_FLAG_ISLAND_MAZE_PRESET) == 1)
IF (IsInRange(4))
TELEPORT( 2826, 2780, 0)
ELSE
PRIVATE_SYSTEM_MESSAGE(INTL( 7349, "You must step closer to the portal to activate it."))
ENDIF
ELSE
IF (IsInRange(4))
UseC
BYTE bPositionWorld = (target->ViewFlag(__FLAG_DEATH_LOCATION) & 0xFF);
WORD wPositionY = (target->ViewFlag(__FLAG_DEATH_LOCATION) & 0xFFF00) >> 8;
WORD wPositionX = (target->ViewFlag(__FLAG_DEATH_LOCATION) & 0xFFF00000) >> 20;
IF(target->ViewFlag(__FLAG_DEATH_LOCATION) != 0)
TELEPORT( wPositionX, wPositionY, bPositionWorld)
ELSE
TELEPORT(2941, 1062, 0)
ENDIF
ELSE
PRIVATE_SYSTEM_MESSAGE(INTL( 7349, "You must step closer to the portal to activate it."))
ENDIF
ENDIF
BREAK
Default
""
BREAK
EndTalk
}