id=481
name=Schmelzofen
group=forge
icon=gfxforgeiconsSchmelzofen_ohne.bmp
model=gfxforgeSchmelzofen_ohne.b3d
health=500
scale=1.5
mat=stone
script=start
on:use {
local $x, $y, $z, $yaw;
local $melt, $id1, $id2, $use_m, $schmelzofen_unit, $schmelzofen_object;
$x=getx("self");
$z=getz("self");
$y=gety("self");
$yaw=getyaw("self");
if($melt==0) {
if((getplayerweapon()==121) && (count_stored("unit",1,121)>=1)) {
freestored "unit",1,121,1;
msg "Gut, jetzt muss ich nur noch Feuer machen.";
$melt=1;
}
else {
msg "Ich brauche Kohle um ein Feuer zu entzünden.";
speech "negative";
}
}
elseif($melt==1) {
if((getplayerweapon()==22) && (count_stored("unit",1,22)>=2)) {
msg "Jetzt kann ich das Eisen reinlegen.";
$id1=create("info",30,$x,$z);
addstate "info",$id1,"eternalfire";
rpos "info",$id1,"self",10,10,"self",$yaw,"self";
$melt=2;
} elseif((getplayerweapon()==111) && (count_stored("unit",1,111)>=1)) {
msg "Jetzt kann ich das Eisen reinlegen.";
$id1=create("info",30,$x,$z);
addstate "info",$id1,"eternalfire";
rpos "info",$id1,"self",10,10,"self",$yaw,"self";
$melt=2;
} else {
msg "Ich brauche 2 Feuersteine oder eine Fackel um Feuer zu machen.";
speech "negative";
}
}
elseif($melt==2) {
if ((getplayerweapon()==124) && (count_stored("unit",1,124)>=1)) {
freestored "unit",1,223,1;
model "gfx/forge/Schmelzofen_leer.b3d";
scale 1,1,1;
$melt=3;
}
else {
msg "Ich brauche eine Form ...";
speech "negative";
}
}
elseif($melt==3) {
if((getplayerweapon()==85) && (count_stored("unit",1,85)>=1)) {
$id2=create("info",30,$x,$z);
rpos "info",$id2,"self",40,-10,"self",$yaw,"self";
addstate "info",$id2,"smoke";
freestored "unit",1,85,1;
$schmelzofen_unit=create("unit",50,$x,$z);
setrot "unit",$schmelzofen_unit,"self",$yaw,"self";
alpha 0,"object",currentid();
timer "self",25000,1,"melt1";
$use_m=1;
$melt=4;
} else {
msg "Ich muss erst Eisen in den Schmelzofen legen.";
speech "negative";
}
}
if($use_m==1) {
msg "Ich muss warten, bis das Eisen geschmolzen ist.";
speech "negative";
}
elseif($use_m==2) {
$schmelzofen_object=currentid();
setlocal "unit",$schmelzofen_unit,$schmelzofen_object,$schmelzofen_object;
animate $schmelzofen_unit,1,24,0.05,3;
$use_m=3;
}
elseif($use_m==3) {
msg "Heiß!!!";
}
elseif($use_m==4) {
find 125,1;
model "gfx/forge/Schmelzofen_ohne.b3d";
scale 1,1,1;
$melt=3;
$use_m=0;
}
}
on:melt1 {
$use_m=2;
}
on:melt2 {
model "gfx/forge/Schmelzofen_fluessig.b3d";
alpha 1,"object",currentid();
scale 1,1,1;
free "unit",$schmelzofen_unit;
timer "self",12000,1,"melt3";
free "info",$id2;
$id2=create("info",30,$x,$z);
rpos "info",$id2,"self",10,-45,"self",$yaw,"self";
addstate "info",$id2,"smoke";
}
on:melt3 {
model "gfx/forge/Schmelzofen_hart.b3d";
scale 1,1,1;
freetimers "self";
free "info",$id2;
$use_m=4;
}
on:changeday {
if($melt==0) {
$melt=0;
}
else {
$melt=1;
}
free "info",$id1;
free "info",$id2;
free "unit",$schmelzofen;
$use_m=0;
}
on:load {
îf (($melt==3) && ($use_m!=0)) {
model "gfx/forge/Schmelzofen_leer.b3d";
scale 1,1,1;
} elseif (($melt==3) && ($use_m==0)) {
model "gfx/forge/Schmelzofen_ohne.b3d";
scale 1,1,1;
}
}
script=end
-------------------------------------------------------------------------------------------------------------------------
der Schmelzofen erzeugt jedes mal einen Einboren der mich mit Pfeilen beschießt also Unit 50, was muss ich ändern damit ich die gehärtet Form bekomme?