This repository has been archived by the owner on Sep 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
align_dromedary.txt
77 lines (72 loc) · 2.59 KB
/
align_dromedary.txt
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
67
68
69
70
71
72
73
74
75
76
77
//===== rAthena Script =======================================
//= Align
//===== By: ==================================================
//= Capuche
//===== Current Version: =====================================
//= 1.0
//===== Compatible With: =====================================
//= rAthena SVN
//===== Description: =========================================
//= Align the dromedary in the same direction
//= to winning... well nothing for now. Just for fun.
//============================================================
prontera,150,170,6 script Align 742,{
npctalk "Force the dromedary to be in the same direction.";
if( getgmlevel() < 99 ) end;
goto OnTimer180000;
OnWin:
npctalk "Bravo ! You take "+ ( getnpctimer(0) / 1000 ) +" seconds!";
monster "prontera",155,172,"--ja--",1324,1;
.@win++;
sleep 5000;
OnTimer180000:
if( !.@win )
npctalk "You take to much time... to bad!";
stopnpctimer;
setnpctimer 0;
// .timer_play = 0;
OnInit:
setarray .direction, 2, 6, 2, 6, 6, 2, 6;
for( .@i = 0; .@i < 7; .@i++ ) {
// .direction[ .@i ] = rand(2) ? 2 : 6;
getmapxy .@map$, .@x, .@y, BL_NPC, "#npcswitch_1_"+ .@i;
movenpc "#npcswitch_1_"+ .@i, .@x, .@y, .direction[ .@i ];
}
end;
}
prontera,152,164,6 script #npcswitch_1_0 938,{
if( !getnpctimer( 0,"Align" ) ) {
initnpctimer "Align";
// set getvariableofnpc( .timer_play, "Align" ), gettimetick(2);
deletearray .tmp;
for( .@i = 0; .@i < 7; .@i++ )
.tmp[ .@i ] = getvariableofnpc( .direction[ .@i ], "Align" );
}
while ( .@i < 7 && strnpcinfo(0) != "#npcswitch_1_"+.@i ) .@i++;
switch( .@i ) {
case 0: setarray .@switch_[0], .@i, 1, 2; break;
case 1: setarray .@switch_[0], .@i, 3, 4; break;
case 2: setarray .@switch_[0], .@i, 5, 6; break;
case 3:
case 4: setarray .@switch_[0], .@i, 0, 2; break;
case 5:
case 6: setarray .@switch_[0], .@i, 0, 1;
}
for ( .@j = 0; .@j < getarraysize( .@switch_ ); .@j++ ) {
.tmp[ .@switch_[.@j] ] = ( .tmp[ .@switch_[.@j] ] == 2 ? 6 : 2 );
getmapxy .@map$, .@x, .@y, BL_NPC, "#npcswitch_1_"+ .@switch_[.@j];
movenpc "#npcswitch_1_"+ .@switch_[.@j], .@x, .@y, .tmp[ .@switch_[.@j] ];
}
while ( .@k < 6 && .tmp[.@k] == .tmp[.@k +1] ) .@k++;
if( .@k == 6 ) donpcevent "Align::OnWin";
end;
// 4 6
// 2 0 1
// 3 5
}
prontera,158,164,6 duplicate(#npcswitch_1_0) #npcswitch_1_1 938
prontera,146,164,6 duplicate(#npcswitch_1_0) #npcswitch_1_2 938
prontera,149,161,2 duplicate(#npcswitch_1_0) #npcswitch_1_3 938
prontera,149,167,2 duplicate(#npcswitch_1_0) #npcswitch_1_4 938
prontera,155,161,2 duplicate(#npcswitch_1_0) #npcswitch_1_5 938
prontera,155,167,2 duplicate(#npcswitch_1_0) #npcswitch_1_6 938