name QuestName
type none
setlayer 3
facing 1
palette none
animationscript data/scripts/marker.c
anim idle
@script
void self = getlocalvar("self");
void P1 = getplayerproperty(0, "entity");
void P2 = getplayerproperty(1, "entity");
float x = getentityproperty(self, "x");
float z = getentityproperty(self, "z");
char Name = getentityproperty(self,"name");
float Tx1 = getentityproperty(P1, "x");
float Tz1 = getentityproperty(P1, "z");
float Tx2 = getentityproperty(P2, "x");
float Tz2 = getentityproperty(P2, "z");
float Disx1 = Tx1 - x;
float Disz1 = Tz1 - z;
float Disx2 = Tx2 - x;
float Disz2 = Tz2 - z;
if(frame >= 1){
if((Disx1*Disx1 + Disz1*Disz1 <= 900) || (Disx2*Disx2 + Disz2*Disz2 <= 900)){
if(Name == "Forest1"){
changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW1"));
} else if(Name == "Forest2"){
changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW2"));
} else if(Name == "Forest3"){
changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW3"));
} else if(Name == "Gunung1"){
changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW4"));
} else if(Name == "Room1"){
changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW5"));
} else if(Name == "Tavern1"){
changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW6"));
} else if(Name == "Bridge1"){
changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW7"));
} else if(Name == "Plains1"){
changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW8"));
}
}
}
@end_script
loop 1
delay 5
offset 240 120
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
anim follow1
loop 1
delay 5
offset 240 120
frame data/chars/misc/names/forest1.gif
@cmd dename 30 30
frame data/chars/misc/names/forest1.gif
anim follow2
loop 1
delay 5
offset 240 120
frame data/chars/misc/names/forest2.gif
@cmd dename 30 30
frame data/chars/misc/names/forest2.gif
anim follow3
loop 1
delay 5
offset 240 120
frame data/chars/misc/names/forest3.gif
@cmd dename 30 30
frame data/chars/misc/names/forest3.gif
anim follow4
loop 1
delay 5
offset 240 120
frame data/chars/misc/names/gunung1.gif
@cmd dename 30 30
frame data/chars/misc/names/gunung1.gif
anim follow5
loop 1
delay 5
offset 240 120
frame data/chars/misc/names/room1.gif
@cmd dename 30 30
frame data/chars/misc/names/room1.gif
anim follow6
loop 1
delay 5
offset 240 120
frame data/chars/misc/names/tavern1.gif
@cmd dename 30 30
frame data/chars/misc/names/tavern1.gif
anim follow7
loop 1
delay 5
offset 240 120
frame data/chars/misc/names/bridge1.gif
@cmd dename 30 30
frame data/chars/misc/names/bridge1.gif
anim follow8
loop 1
delay 5
offset 240 120
frame data/chars/misc/names/plains1.gif
@cmd dename 30 30
frame data/chars/misc/names/plains1.gif
void dename(int Rx, int Rz)
{ // cancels showing name
void self = getlocalvar("self");
void P1 = getplayerproperty(0, "entity");
void P2 = getplayerproperty(1, "entity");
float x = getentityproperty(self, "x");
float z = getentityproperty(self, "z");
float Tx1 = getentityproperty(P1, "x");
float Tz1 = getentityproperty(P1, "z");
float Tx2 = getentityproperty(P2, "x");
float Tz2 = getentityproperty(P2, "z");
float Disx1 = Tx1 - x;
float Disz1 = Tz1 - z;
float Disx2 = Tx2 - x;
float Disz2 = Tz2 - z;
if(Disx1 < 0){
Disx1 = -Disx1;
} else if(Disx1 == NULL()){
Disx1 = 200;
}
if(Disx2 < 0){
Disx2 = -Disx2;
} else if(Disx2 == NULL()){
Disx2 = 200;
}
if(Disz1 < 0){
Disz1 = -Disz1;
} else if(Disz1 == NULL()){
Disz1 = 200;
}
if(Disz2 < 0){
Disz2 = -Disz2;
} else if(Disz2 == NULL()){
Disz2 = 200;
}
if((Disx1*Disx1 + Disz1*Disz1 > Rx*Rx) && (Disx2*Disx2 + Disz2*Disz2 > Rx*Rx)){
setidle(self, openborconstant("ANI_IDLE"));
}
}
name Dialoger
type none
facing 1
palette none
animationscript data/scripts/animation/marker.c
load VampDial
load MumDial
anim idle
@script
void self = getlocalvar("self");
void P1 = getplayerproperty(0, "entity");
void P2 = getplayerproperty(1, "entity");
int Range = 100;
float x = getentityproperty(self, "x");
float z = getentityproperty(self, "z");
char Name = getentityproperty(self,"name");
float Tx1 = getentityproperty(P1, "x");
float Tz1 = getentityproperty(P1, "z");
float Tx2 = getentityproperty(P2, "x");
float Tz2 = getentityproperty(P2, "z");
float Disx1 = Tx1 - x;
float Disz1 = Tz1 - z;
float Disx2 = Tx2 - x;
float Disz2 = Tz2 - z;
if(frame >= 1){
if((Disx1*Disx1 + Disz1*Disz1 <= Range*Range) || (Disx2*Disx2 + Disz2*Disz2 <= Range*Range)){
if(Name == "Vampire"){
void Dialg = spawn06("VampDial", 240, 0, 204);
setentityvar(self, 1, Dialg);
changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW1"));
} else if(Name == "Mummy"){
void Dialg = spawn06("MumDial", 240, 0, 204);
setentityvar(self, 1, Dialg);
changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW1"));
}
}
}
@end_script
loop 1
delay 5
offset 240 120
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif
anim follow1
loop 1
delay 5
offset 240 120
frame data/chars/misc/empty.gif
@cmd dename 100
frame data/chars/misc/empty.gif
void dename(int Rx)
{ // cancels showing name
void self = getlocalvar("self");
void P1 = getplayerproperty(0, "entity");
void P2 = getplayerproperty(1, "entity");
float x = getentityproperty(self, "x");
float z = getentityproperty(self, "z");
float Tx1 = getentityproperty(P1, "x");
float Tz1 = getentityproperty(P1, "z");
float Tx2 = getentityproperty(P2, "x");
float Tz2 = getentityproperty(P2, "z");
float Disx1 = Tx1 - x;
float Disz1 = Tz1 - z;
float Disx2 = Tx2 - x;
float Disz2 = Tz2 - z;
if(Disx1 < 0){
Disx1 = -Disx1;
} else if(Disx1 == NULL()){
Disx1 = 200;
}
if(Disx2 < 0){
Disx2 = -Disx2;
} else if(Disx2 == NULL()){
Disx2 = 200;
}
if(Disz1 < 0){
Disz1 = -Disz1;
} else if(Disz1 == NULL()){
Disz1 = 200;
}
if(Disz2 < 0){
Disz2 = -Disz2;
} else if(Disz2 == NULL()){
Disz2 = 200;
}
if((Disx1*Disx1 + Disz1*Disz1 > Rx*Rx) && (Disx2*Disx2 + Disz2*Disz2 > Rx*Rx)){
void Dial = getentityvar(self, 1);
if(Dial){
killentity(Dial);
}
setidle(self, openborconstant("ANI_IDLE"));
}
}