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
78
79
on:create {
	 if ((count("unit",72) + count_inrange("unit",79))==0) { //is there a worker? no
			local $c;
			$c+=count_inrange("unit",71,50,"unit",1);						//is there a female native in range?
			if ($c==1) {													//yes
				closemenu;
				play "woman_sigh.wav";
				areal_event "createworker", getx("unit",1), gety("unit",1), getz("unit",1), 50;
				event "workerbell","global";		
			}elseif ($c==0) {												//no
				local $c;
				$c+=count_inrange("unit",78,50,"unit",1);					//is there a male native in range?
				if ($c==1) {												//yes
					closemenu;
					play "man_sigh.wav";
					areal_event "createworker", getx("unit",1), gety("unit",1), getz("unit",1), 50;
					event "workerbell","global";
				}elseif ($c==0) {											//no
					local $id;
					$id=create("item",3592);
					store $id,"unit",1;										//at least you get your honey back
					speech "negative";
				}
			}
	 }elseif ((count("unit",72) + count("unit",79))==1) { 		//is there a worker? yes
			 if ((count("unit",89) + count("unit",90))==2) { 		//is there already 2 warriors? yes
				 local $id;
					$id=create("item",3592);
					store $id,"unit",1;										//at least you get your honey back
					speech "negative";
				}elseif ((count("unit",89) + count("unit",90))==1) { 		//is there already 2 warriors? no there is only 1
						local $c;
						$c+=count_inrange("unit",78,50,"unit",1);			//is there a male native in range?
						if ($c==1) {										//yes
							closemenu;
							play "man_sigh.wav";
							areal_event "createwarriorm", getx("unit",1), gety("unit",1), getz("unit",1), 50;
							event "warriorhorn","global";
						}elseif ($c==0) {									//no
							local $c;
							$c+=count_inrange("unit",71,50,"unit",1);		//is there a female native in range?
							if ($c==1) {									//yes
								closemenu;
								play "woman_sigh.wav";
								areal_event "createwarriorf", getx("unit",1), gety("unit",1), getz("unit",1), 50;
								event "warriorhorn","global";
							}elseif ($c==0) {								//no
								local $id;
								$id=create("item",3592);
								store $id,"unit",1;							//at least you get your honey back
								speech "negative";
							}
						}
			}elseif ((count("unit",89) + count("unit",90))==0) { 			//is there a warrior1? no
				local $c;
				$c+=count_inrange("unit",71,50,"unit",1);					//is there a female native in range?
				if ($c==1) {												//yes
					closemenu;
					play "woman_sigh.wav";
					areal_event "createwarriorf", getx("unit",1), gety("unit",1), getz("unit",1), 50;
					event "warriorhorn","global";		
				}elseif ($c==0) { 							//no
					local $c;
					$c+=count_inrange("unit",78,50,"unit",1);				//is there a male native in range?
					if ($c==1) {											//yes
						closemenu;
						play "man_sigh.wav";
						areal_event "createwarriorm", getx("unit",1), gety("unit",1), getz("unit",1), 50;
						event "warriorhorn","global";
					}elseif ($c==0) {										//no
						local $id;
						$id=create("item",3592);
						store $id,"unit",1;									//at least you get your honey back
						speech "negative";
					}
					}
				}
		}
	}