All pastes #1451601 Raw Edit

Unnamed

public text v1 · immutable
#1451601 ·published 2009-06-08 07:45 UTC
rendered paste body
//

011-5.gat,37,58,0	script	SnakeLord	0,20,22{

onTouch:
	if ($@SNAKELORD_LEVEL == 0) goto L_CLEAN_UP;
	end;

onStartBattle:
	set $@SNAKELORD_TICK_DAMAGE, -50;
	set $@SNAKELORD_TIMER, 0;
	set $@SNAKELORD_PLAYER_COUNT, -1;
	set $@SNAKELORD_PLAYER_LAST_COUNT, -1;
	set $@SNAKELORD_ROOM_A, 0;
	set $@SNAKELORD_ROOM_B, 0;
	set $@SNAKELORD_ROOM_C, 0;
	set $@SNAKELORD_ROOM_D, 0;
	setnpctimer 0;
	startnpctimer;
	monster "011-5.gat", 44, 74, "", 1023, 1, "SnakeLord::onWin";
	end;

onTick:
	if(isdead(0)) end;
	set $@SNAKELORD_PLAYER_COUNT, ($@SNAKELORD_PLAYER_COUNT + 1);
	specialeffect2 6;
	heal $@SNAKELORD_TICK_DAMAGE, 0;
	end;

onRandomRoom:
	if (isdead(0) == 1 || rand(10) != 0) end;
	areaannounce "011-5.gat", 0, 0, 100, 100, "Snake Lord: Go play with my pets!", 0;
	set @TEMP_RAND, rand(4);
	if(@TEMP_RAND == 0) goto L_SEND_ROOM_A;
	if(@TEMP_RAND == 1) goto L_SEND_ROOM_B;
	if(@TEMP_RAND == 2) goto L_SEND_ROOM_C;
	if(@TEMP_RAND == 3) goto L_SEND_ROOM_D;


L_SEND_ROOM_A:
	warp "011-5.gat", 22, 54;
	// Grass
	monster "011-5.gat", 22, 57, "", 1034, 2, "SnakeLord::onRoomA";
	set $@SNAKELORD_ROOM_A, ($@SNAKELORD_ROOM_A + 2);
	end;

L_SEND_ROOM_B:
	warp "011-5.gat", 38, 54;
	// Mountain
	monster "011-5.gat", 38, 57, "", 1026, 3, "SnakeLord::onRoomB";
	set $@SNAKELORD_ROOM_B, ($@SNAKELORD_ROOM_B + 3);
	end;

L_SEND_ROOM_C:
	warp "011-5.gat", 52, 54;
	// Snake
	monster "011-5.gat", 52, 57, "", 1010, 4, "SnakeLord::onRoomC";
	set $@SNAKELORD_ROOM_C, ($@SNAKELORD_ROOM_C + 4);
	end;

L_SEND_ROOM_D:
	warp "011-5.gat", 52, 39;
	// Cave
	monster "011-5.gat", 52, 42, "", 1021, 5, "SnakeLord::onRoomD";
	set $@SNAKELORD_ROOM_D, ($@SNAKELORD_ROOM_D + 5);
	end;

onRoomA:
	set $@SNAKELORD_ROOM_A, ($@SNAKELORD_ROOM_A - 1);
	if ($@SNAKELORD_ROOM_A > 0) end;
	areawarp "011-5.gat", 19, 53, 25, 59, "011-5.gat", 42, 68;
	end;

onRoomB:
	set $@SNAKELORD_ROOM_B, ($@SNAKELORD_ROOM_B - 1);
	if ($@SNAKELORD_ROOM_B > 0) end;
	areawarp "011-5.gat", 34, 50, 42, 60, "011-5.gat", 42, 68;
	end;

onRoomC:
	set $@SNAKELORD_ROOM_C, ($@SNAKELORD_ROOM_C - 1);
	if ($@SNAKELORD_ROOM_C > 0) end;
	areawarp "011-5.gat", 48, 50, 57, 60, "011-5.gat", 42, 68;
	end;

onRoomD:
	set $@SNAKELORD_ROOM_D, ($@SNAKELORD_ROOM_D - 1);
	if ($@SNAKELORD_ROOM_D > 0) end;
	areawarp "011-5.gat", 48, 36, 57, 54, "011-5.gat", 42, 68;
	end;

OnTimer5000:
	set $@SNAKELORD_TIMER, ($@SNAKELORD_TIMER + 5);

	if (($@SNAKELORD_PLAYER_COUNT < 1 && $@SNAKELORD_PLAYER_COUNT != -1)
		|| $@SNAKELORD_TIMER >= 420) goto YOU_LOSE;
	if ($@SNAKELORD_TIMER >= 300) goto L_ENRAGED;
L_TIMER_A:
	if (rand(15) == 0) goto L_PETS;
L_TIMER_B:

	goto L_DEATH_CHECK;
L_TIMER_C:
	set $@SNAKELORD_PLAYER_LAST_COUNT, $@SNAKELORD_PLAYER_COUNT;
	set $@SNAKELORD_PLAYER_COUNT, 0;

	areatimer "011-5.gat", 17, 36, 57, 80, 10, "SnakeLord::onTick";
	areatimer "011-5.gat", 39, 64, 53, 80, 20, "SnakeLord::onRandomRoom";
	setnpctimer 0;
	end;

L_ENRAGED:
	set $@SNAKELORD_TICK_DAMAGE, ($@SNAKELORD_TICK_DAMAGE - 50);
	if ($@SNAKELORD_LEVEL == 2) goto L_TIMER_A;
	areaannounce "011-5.gat", 0, 0, 100, 100, "Snake Lord: You are starting to become bothersome!", 0;
	set $@SNAKELORD_LEVEL, 2;
	goto L_TIMER_A;

L_PETS:
	areaannounce "011-5.gat", 0, 0, 100, 100, "Snake Lord: Come to me my pets!", 0;
	monster "011-5.gat", 42, 69, "", 1034, 2, "SnakeLord::onPetDeath";  // Grass
	monster "011-5.gat", 42, 75, "", 1026, 2, "SnakeLord::onPetDeath";  // Mountain
	monster "011-5.gat", 48, 75, "", 1010, 3, "SnakeLord::onPetDeath";  // Snake
	monster "011-5.gat", 46, 71, "", 1021, 3, "SnakeLord::onPetDeath";  // Cave
	set $@SNAKELORD_TICK_DAMAGE, ($@SNAKELORD_TICK_DAMAGE - 100);
	goto L_TIMER_B;

L_DEATH_CHECK:
	if ($@SNAKELORD_PLAYER_COUNT == -1 || $@SNAKELORD_PLAYER_LAST_COUNT == -1) goto L_TIMER_C;
	if ($@SNAKELORD_PLAYER_COUNT >= $@SNAKELORD_PLAYER_LAST_COUNT) goto L_TIMER_C;
	set $@SNAKELORD_PLAYER_LAST_COUNT, ($@SNAKELORD_PLAYER_LAST_COUNT - 1);
	set $@SNAKELORD_TICK_DAMAGE, ($@SNAKELORD_TICK_DAMAGE - 50);
	areaannounce "011-5.gat", 0, 0, 100, 100, "Snake Lord: Your soul gives me more POWER!", 0;
	goto L_DEATH_CHECK;

onPetDeath:
	set $@SNAKELORD_TICK_DAMAGE, ($@SNAKELORD_TICK_DAMAGE + 10);
	end;

onWin:
	areaannounce "011-5.gat", 0, 0, 100, 100, "Snake Lord: What!?! How could this had happend!", 0;
	goto L_CLEAN_UP;

YOU_LOSE:
	areaannounce "011-5.gat", 0, 0, 100, 100, "Snake Lord: My pets will feed for weeks!", 0;
	goto L_CLEAN_UP;

L_CLEAN_UP:
	stopnpctimer;
	set $@SNAKELORD_LEVEL, 0;
	killmonster "011-5.gat", "SnakeLord::onWin";
	killmonster "011-5.gat", "SnakeLord::onPetDeath";
	killmonster "011-5.gat", "SnakeLord::onRoomA";
	killmonster "011-5.gat", "SnakeLord::onRoomB";
	killmonster "011-5.gat", "SnakeLord::onRoomC";
	killmonster "011-5.gat", "SnakeLord::onRoomD";
	areawarp "011-5.gat", 17, 36, 57, 80, "011-5.gat", 25, 23;
	end;

onInit:
	initnpctimer;
	stopnpctimer;
}