0% found this document useful (0 votes)
4 views4 pages

TMP Script

The document outlines a script for a game event involving a boss stage where players must protect 'Life Giving Water' from orc attacks. It initializes various game objects and locations, tracks player interactions, and manages a timer to control the attack sequence. The script includes functions for creating visual effects and spawning NPCs to enhance gameplay dynamics.

Uploaded by

mec.huezoyde
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views4 pages

TMP Script

The document outlines a script for a game event involving a boss stage where players must protect 'Life Giving Water' from orc attacks. It initializes various game objects and locations, tracks player interactions, and manages a timer to control the attack sequence. The script includes functions for creating visual effects and spawning NPCs to enhance gameplay dynamics.

Uploaded by

mec.huezoyde
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

ScriptEngine@instance;

bool bossStage=false;
int aliveCount=0;
int summonedFirework=0;
bool isStarted=false;
int timerDelay=20;

void SetInstance(ScriptEngine&in i)
{
@instance=@i;
}

void Initialize()
{
bossStage=false;
aliveCount=0;
isStarted=false;
summonedFirework=0;

instance.CreateObjectByPosition(39375793,330.00f,830.00f,1);
instance.CreateObjectByPosition(39375793,670.00f,475.00f,1);
instance.CreateObjectByPosition(39375793,260.00f,175.00f,1);
instance.CreateObjectByPosition(39375793,165.00f,510.00f,1);

instance.AddInterestLocation(0,true);
instance.AddInterestLocation(1,true);
instance.AddInterestLocation(2,true);
instance.AddInterestLocation(3,true);
instance.AddInterestLocation(4,true);
instance.AddInterestLocation(5,true);
instance.AddInterestLocation(6,true);
instance.AddInterestLocation(7,true);
instance.AddInterestLocation(8,true);
instance.AddInterestLocation(9,true);
instance.AddInterestLocation(10,true);
instance.AddInterestLocation(11,true);
instance.AddInterestLocation(12,true);

instance.AddInterestObjects(10017338,true);

}
void ObjectEntered(int type,uint32 objectId,int location,uint8 team)
{

void ObjectDestroyed(uint32 objectId,int type)


{
if(objectId==10017338&&isStarted==false){
summonedFirework++;
if(summonedFirework==5){
isStarted=true;
instance.LocPlayers(true);
instance.DisplayText(0,"You have caught the attention of the orcs! Ensure that no
Life Giving Water dies!");

instance.TimerRun(0,7.0f);
attackLife();
instance.AddInterestObjects(10017338,false);
}
return;
}
}

void InterestObjectDestroyed(uint32 serial)


{

void TimerAlarmed(int timer)


{
switch(timer){
case 0:
if(bossStage==false){instance.TimerRun(1,timerDelay);}
break;
case 1:
if(timerDelay>10){timerDelay-=2;}
attackLife();
instance.TimerRun(0,0.1f);
break;
}
}
void NPCArrived(uint32 npcId,uint32 serial,int pathCnt,int posCnt)
{

void GiveMissionClearExp()
{
instance.GiveExpToAllPlayer(1,150);
}

void CreateBlockEffectByX(int number,float x,float y)


{
float[]xArray(number);
float[]yArray(number);

for(int i=0;i<number;++i)
{
xArray[i]=x+i*11.0f;
yArray[i]=y;
}

instance.CreateObjectsByPosition(9791246,xArray,yArray,100);
}

void CreateBlockEffectByY(int number,float x,float y)


{
float[]xArray(number);
float[]yArray(number);

for(int i=0;i<number;++i)
{
xArray[i]=x;
yArray[i]=y+i*19.0f;
}

instance.CreateObjectsByPosition(9791246,xArray,yArray,100);
}

void attackLife(){
int rando=instance.GetRandomInt(0,4);
int pingX=0;
int pingY=0;

switch(rando){
case 0:
pingX=330;pingY=830;
break;
case 1:
pingX=670;pingY=475;
break;
case 2:
pingX=260;pingY=175;
break;
case 3:
pingX=165;pingY=510;
break;
}
instance.RemoveMinimapPing(0);
instance.AddMinimapPing(0,pingX,pingY);

int[]mobList={7693039,18352493,48948700,31088480,7693040,23689193,18118909};
int mobCount=instance.GetRandomInt(3,7);
for(int i=0;i<mobCount;i++){
int mobNo=instance.GetRandomInt(0,7);
int shiftX=instance.GetRandomInt(-21,21);
int shiftY=instance.GetRandomInt(-21,21);
instance.CreateNPCByPosD(mobList[mobNo],pingX+shiftX,pingY+shiftY,0,-
1,100,0,0,0,0);

aliveCount++;
}
}

You might also like