Jump to content
  • 0
Sign in to follow this  
Kuroyama

World Boss Invasion Script

Question

Spoiler

 

//===== Script =======================================
//= World Boss Apparition
//===== Par: =================================================
//= Alayne
//===== Version du Script: =================================== 
//= 1.0 Creation
//===== Compatible Avec: =====================================
//= eAthena TxT & SQL
//===== Commentaires =========================================

-	script	WorldBoss::alawboss	-1,{

OnStartWBoss:
	[email protected] = 1;
OnClock0330:
OnClock0630:
OnClock0830:
OnClock1030:
OnClock1230:
OnClock1524:
OnClock1630:
OnClock1830:
OnClock2030:
OnClock2230:
	if(.nextPopDay <= gettimetick(2) || [email protected])
	{	
		set [email protected]$, "[ ";
		set [email protected], rand(0, getarraysize(.wbMap$)-1);
		set .lastRandId, rand(0, getarraysize(.wBossIds) - 1);
		//RATHENA
		//monster .wbMap$[[email protected]],82,55,.wBossName$[.lastRandId],.wBossIds[.lastRandId],1,strnpcinfo(3) + "::OnWorldBossDied",2; 
		//set .wBossId, [email protected][0];
		//setunitdata .wBossId, UMOB_MAXHP, .wBossHp[[email protected]];
		//HERCULES
		set .wBossId, monster(.wbMap$[[email protected]],0, 0,.wBossName$[.lastRandId],.wBossIds[.lastRandId],1,strnpcinfo(3) + "::OnWorldBossDied",2); 
		setunitdata(.wBossId, UDT_MAXHP, .wBossHp[[email protected]]);
		
		set [email protected]$, [email protected]$ + .wbMapName$[[email protected]] + "]";
		
		announce "[ System ] World Boss appeared in " + [email protected]$ + " !",bc_all,0xFF0000;
		set .nextPopDay, gettimetick(2) + 259200; //next pop in 3 days, 60 for debug (1 min)
		
		set $lastPopMap$, .wbMap$[[email protected]];
		set $lastPopIdRank, [email protected];
		deletearray $wbFighters[0], getarraysize($wbFighters);
		set $wordBossPop, 1;
		set .deadCount, 0;
		
		set .timerCount, 0;
		initnpctimer;
	}
	else
	{
		if(.debug == 1)
		{
			consolemes(CONSOLEMES_DEBUG, "Not ready yet.");		
		}
	}
	end;
	
OnTimer1000:	
	set .timerCount, .timerCount + 10;
	freeloop(1);
	if(.timerCount == .bossAliveDuration * 60)
	{
		stopnpctimer; 

		killmonster $lastPopMap$, strnpcinfo(3) + "::OnWorldBossDied";
		killmonster $lastPopMap$, strnpcinfo(3) + "::OnSaveDied";
		killmonster $lastPopMap$, strnpcinfo(3) + "::OnCloneDied";
		killmonster $lastPopMap$, strnpcinfo(3) + "::OnReducedBossDied";

		set $wordBossPop, 0;
		announce "[ System ] World Boss vanished without being killed...",bc_all,0x00FF00;
	}
	set [email protected], 25;
	switch(.timerCount)
	{
		case 60:
			//1 min
			mapannounce $lastPopMap$, "[ World Boss ] Raise! Raise, my army!", bc_map, 0xFF0000;
			//RATHENA
			//getunitdata(.wBossId, [email protected]);
			//set [email protected], [email protected][UMOB_X];
			//set [email protected], [email protected][UMOB_Y];
			//HERCULES
			getmapxy([email protected]$, [email protected], [email protected], UNITTYPE_MOB, .wBossId);
			for(set [email protected],0; [email protected]<getarraysize(.wbSlaveMobsId); set [email protected],[email protected]+1)
			{
				for(set [email protected],0; [email protected]<.wbSlaveMobsCount[[email protected]]; set [email protected],[email protected]+1)
				{
					areamonster $lastPopMap$, [email protected] - [email protected], [email protected] - [email protected], [email protected] + [email protected], [email protected] + [email protected], "Slaves", .wbSlaveMobsId[[email protected]], 1, strnpcinfo(3) + "::OnSaveDied";  
				}
			}
			break;
		case 120:
			//2 min, all summon cast skills
			mapannounce $lastPopMap$, "[ World Boss ] You are all far beyond my control!", bc_map, 0xFF0000;
			//RATHENA
			//getunitdata(.wBossId, [email protected]);
			//set [email protected], [email protected][UMOB_X];
			//set [email protected], [email protected][UMOB_Y];
			//HERCULES
			getmapxy([email protected]$, [email protected], [email protected], UNITTYPE_MOB, .wBossId);
			for(set [email protected],0; [email protected]<getarraysize(.wbSlaveMobsId); set [email protected],[email protected]+1)
			{
				areamobuseskill $lastPopMap$, [email protected], [email protected], [email protected] * 2, .wbSlaveMobsId[[email protected]], .wbSummonSkillId[.lastRandId], 5, 3000,1,e_gg,3;
			}
			break;
		case 180:
			//3 min, pop 15 reduced clone of the mob
			mapannounce $lastPopMap$, "[ World Boss ] You won't go away with this, humans!", bc_map, 0xFF0000;
			monster $lastPopMap$,0,0,.wBossName$[.lastRandId],.wBossIds[.lastRandId],15,strnpcinfo(3) + "::OnReducedBossDied"; 
			copyarray [email protected][0], [email protected][0], 15;
			//RATHENA
			//getunitdata(.wBossId, [email protected]);
			//set [email protected], [email protected][UMOB_HP];
			//HERCULES
			set [email protected], getunitdata(.wBossId, UDT_HP);
			set [email protected], [email protected] / 15;
			for(set [email protected],0; [email protected]<getarraysize([email protected]); set [email protected],[email protected]+1)
			{	
				//RATHENA
				//setunitdata [email protected][[email protected]], UMOB_MAXHP, [email protected];
				//setunitdata [email protected][[email protected]], UMOB_HP, [email protected];
				//HERCULES
				setunitdata [email protected][[email protected]], UDT_MAXHP, [email protected];
				setunitdata [email protected][[email protected]], UDT_HP, [email protected];
			}
			break;
		case 240:
			//4 min, raise dead bodies
			mapannounce $lastPopMap$, "[ World Boss ] Even the deads are on my side! You can't win!", bc_map, 0xFF0000;
			set [email protected], .deadCount / getarraysize(.deadMonstersId);
			if([email protected] <= 0)
			{
				set [email protected], 2;
			}
			//RATHENA
			//getunitdata(.wBossId, [email protected]);
			//set [email protected], [email protected][UMOB_X];
			//set [email protected], [email protected][UMOB_Y];
			//HERCULES
			getmapxy([email protected]$, [email protected], [email protected], UNITTYPE_MOB, .wBossId);
			for(set [email protected],0; [email protected]<getarraysize(.deadMonstersId); set [email protected],[email protected]+1)
			{
				areamonster $lastPopMap$, [email protected] - [email protected], [email protected] - [email protected], [email protected] + [email protected], [email protected] + [email protected], "Dead Corpses", .deadMonstersId[[email protected]], [email protected], strnpcinfo(3) + "::OnSaveDied";  
			}
			break;
		case 300:
			//5 min, pop clone of each player
			mapannounce $lastPopMap$, "[ World Boss ] Fight against your own power you're so proud of, shall you?!", bc_map, 0xFF0000;
			//RATHENA
			//getunitdata(.wBossId, [email protected]);
			//set [email protected], [email protected][UMOB_X];
			//set [email protected], [email protected][UMOB_Y];
			//HERCULES
			getmapxy([email protected]$, [email protected], [email protected], UNITTYPE_MOB, .wBossId);
			for(set [email protected],0; [email protected]<getarraysize($wbFighters); set [email protected],[email protected]+1)
			{
				if(attachrid($wbFighters[[email protected]]) == 1 && strcharinfo(3) == $lastPopMap$)
				{
					clone $lastPopMap$, rand([email protected] - [email protected], [email protected] + [email protected]), rand([email protected] - [email protected], [email protected] + [email protected]), strnpcinfo(3) + "::OnCloneDied", getcharid(0);
				}
				else
				{
					deletearray $wbFighters[[email protected]], 1;
				}
			}
			break;
		case 360:
			//6 min
			mapannounce $lastPopMap$, "[ World Boss ] Raise! Raise, my army!", bc_map, 0xFF0000;
			//RATHENA
			//getunitdata(.wBossId, [email protected]);
			//set [email protected], [email protected][UMOB_X];
			//set [email protected], [email protected][UMOB_Y];
			//HERCULES
			getmapxy([email protected]$, [email protected], [email protected], UNITTYPE_MOB, .wBossId);
			for(set [email protected],0; [email protected]<getarraysize(.wbSlaveMobsId); set [email protected],[email protected]+1)
			{
				for(set [email protected],0; [email protected]<.wbSlaveMobsCount[[email protected]]; set [email protected],[email protected]+1)
				{
					areamonster $lastPopMap$, [email protected] - [email protected] * 2, [email protected] - [email protected] * 2, [email protected] + [email protected] * 2, [email protected] + [email protected] * 2, "Slaves", .wbSlaveMobsId[[email protected]], 1, strnpcinfo(3) + "::OnSaveDied";  
				}
			}
			break;
		case 420:
			//7 min, autocast earthquake at 10% hp cost
			mapannounce $lastPopMap$, "[ World Boss ] STOP BOTHERING ME, HUMANS!", bc_map, 0xFF0000;
			//RATHENA
			//getunitdata(.wBossId, [email protected]);
			//set [email protected], [email protected][UMOB_HP];
			//set [email protected], [email protected][UMOB_MAXHP];
			//set [email protected], [email protected][UMOB_X];
			//set [email protected], [email protected][UMOB_Y];
			//HERCULES
			set [email protected], getunitdata(.wBossId, UDT_HP);
			set [email protected], getunitdata(.wBossId, UDT_MAXHP);
			getmapxy([email protected]$, [email protected], [email protected], UNITTYPE_MOB, .wBossId);
			if([email protected] > 10 * [email protected] / 100)
			{
				//RATHENA
				//setunitdata .wBossId, UMOB_HP, [email protected] - 10 * [email protected] / 100;
				//HERCULES
				setunitdata .wBossId, UDT_HP, [email protected] - 10 * [email protected] / 100;
				set [email protected], .wbSlaveMobsId[rand(getarraysize(.wbSlaveMobsId) - 1)];
				areamobuseskill $lastPopMap$, [email protected], [email protected], [email protected] * 2, [email protected], 653, 3, 3000, 1, e_gg, 3;
			}
			else
			{
				//only world boss pop, but stronger
				areamobuseskill $lastPopMap$, [email protected], [email protected], [email protected] * 2, .wBossIds[$lastPopIdRank], 653, 10, 3000, 1, e_gg, 3;
			}
			break;
		case 480:
			//8 min, wide bleeding
			mapannounce $lastPopMap$, "[ World Boss ] You don't even deserve me to fight you!", bc_map, 0xFF0000;
			areamobuseskill $lastPopMap$, [email protected], [email protected], 50, .wBossIds[$lastPopIdRank], 665, 5, 3000, 1, e_gg, 3;
			break;
		case 540:
			//9 min, random kill over fighters
			mapannounce $lastPopMap$, "[ World Boss ] Feel my rage! Limitless is my power!!", bc_map, 0xFF0000;
			set [email protected], rand(getarraysize($wbFighters));
			for(set [email protected],0; [email protected]<getarraysize($wbFighters); set [email protected]i,[email protected]i+1)
			{
				if(attachrid($wbFighters[[email protected]i]) == 1 && strcharinfo(3) == $lastPopMap$)
				{
					charcommand "#nuke " + strcharinfo(0) + " " + strcharinfo(0);
				}
				else
				{
					deletearray $wbFighters[[email protected]i], 1;
				}
			}
			break;
		case 600:
			//10 min, raise life according to alive clones
			mapannounce $lastPopMap$, "[ World Boss ] I'll feast from your bones!!", bc_map, 0xFF0000;
			set [email protected]mobCount, mobcount($lastPopMap$, strnpcinfo(3) + "::OnReducedBossDied");
			killmonster $lastPopMap$, strnpcinfo(3) + "::OnReducedBossDied";
			//RATHENA
			//getunitdata(.wBossId, [email protected]worldBossData);
			//set [email protected]hp, [email protected]worldBossData[UMOB_HP];
			//set [email protected]mhp, [email protected]worldBossData[UMOB_MAXHP];
			//if( [email protected]hp + [email protected]mobCount * 50000 > [email protected] )
			//	setunitdata .wBossId, UMOB_HP, [email protected];
			//else
			//	setunitdata .wBossId, UMOB_HP, [email protected] + [email protected] * 50000;
			//HERCULES
			set [email protected], getunitdata(.wBossId, UDT_HP);
			set [email protected], getunitdata(.wBossId, UDT_MAXHP);
			if( [email protected] + [email protected] * 50000 > [email protected] )
				setunitdata .wBossId, UDT_HP, [email protected];
			else
				setunitdata .wBossId, UDT_HP, [email protected] + [email protected] * 50000;
			break;
		case 660:
			//11 min, slave skill area
			mapannounce $lastPopMap$, "[ World Boss ] Life and death are nothing to me!", bc_map, 0xFF0000;
			//RATHENA
			//getunitdata(.wBossId, [email protected]);
			//set [email protected], [email protected][UMOB_X];
			//set [email protected], [email protected][UMOB_Y];
			//HERCULES
			getmapxy([email protected]$, [email protected], [email protected], UNITTYPE_MOB, .wBossId);
			for(set [email protected],0; [email protected]<getarraysize(.wbSlaveMobsId); set [email protected]i,[email protected]i+1)
			{
				//BASILICA 362 (5) OR EVILLAND 670 (1)
				if(rand(1) == 0)
				{
					areamobuseskill $lastPopMap$, [email protected]x, [email protected]y, [email protected]cellRange * 2, .wbSlaveMobsId[[email protected]i], 362, 5, 3000,1,e_gg,3;
				}
				else
				{
					areamobuseskill $lastPopMap$, [email protected]x, [email protected]y, [email protected]cellRange * 2, .wbSlaveMobsId[[email protected]i], 670, 1, 3000,1,e_gg,3;
				}
			}
			break;
	}
	setnpctimer 0;
	freeloop(0);
	end;
	
OnPCDieEvent:
	if(strcharinfo(3) == $lastPopMap$ && getarraysize(.wbMap$) == 1)
	{
		set [email protected]rebirthArea, rand(4);
		warp $lastPopMap$, .rebirthXY[[email protected]rebirthArea * 2], .rebirthXY[[email protected]rebirthArea * 2 + 1];	 
		charcommand "#alive " + strcharinfo(0);
	}
	addtimer 10000, strnpcinfo(3) + "::OnPopClone";
	set .deadCount, .deadCount + 1;
	end;
	
OnPopClone:
	if(Hp > 0)
	{
		set [email protected], 25;
		//RATHENA
		//getunitdata(.wBossId, [email protected]);
		//set [email protected], [email protected][UMOB_X];
		//set [email protected], [email protected][UMOB_Y];
		//HERCULES
		getmapxy([email protected]$, [email protected], [email protected], UNITTYPE_MOB, .wBossId);
		clone $lastPopMap$, rand([email protected] - [email protected], [email protected] + [email protected]), rand([email protected] - [email protected], [email protected] + [email protected]), strnpcinfo(3) + "::OnCloneDied", getcharid(0);
	}
	end;
	
OnSaveDied:
OnCloneDied:
OnReducedBossDied:
	//nothing, used to clean
	end;
	
OnWorldBossDied:
	stopnpctimer;
	killmonster $lastPopMap$, "all";
	setarray [email protected][0],
		969; //gold
	announce "[ System ] "+strcharinfo(0)+" just killed a World Boss !",bc_all,0x0000FF;		
	if(.rewardCount == 1)
	{
		set .rewardCount, getmapusers(strnpcinfo(4)) - 1;
	}
	for(set [email protected],0; [email protected]<.rewardCount; set [email protected],[email protected]+1)
	{
		set [email protected], rand(0,getarraysize([email protected]) - 1);
		//edit 150 if the map length and height is different of 150 cell
		makeitem [email protected][[email protected]],1,$lastPopMap$,rand(150),rand(150); 
	}
	set $wordBossPop, 0;
	end;

OnInit:	
	set .rewardCount, 1;
	set .timerCount, 0;
	set .bossAliveDuration, 30; //in minutes
	set .debug, 1;
	setarray .rebirthXY[0],120,202,202,120,119,37,37,119; //X, then Y. Only used if only one map is used
	set $lastPopMap$, "prontera";
	set $wordBossPop, 0;
	setarray .wbMap$[0],
		"prontera";
	setarray .wbMapName$[0],
		"Prontera";
	setarray .wBossIds[0],
		2320;//,2483,1917,2942,2131;
	setarray .wBossHp[0],
		20000000,30000000,40000000,50000000,60000000;
	//Storm Gust, Meteor Storm, Lord of Vermillion, Bowling Bash, Kyrie Eleison
	setarray .wbSummonSkillId[0],
		89, 83, 85, 62, 73;
	setarray .wBossName$[0],
		"Hoktarrh","Giashim","Deathres","Cerbere","Citrak";
	setarray .wbSlaveMobsId[0], 1098, 2023, 2365, 2019, 2472;
	setarray .wbSlaveMobsCount[0], 25, 15, 10, 15, 5;
	setarray .deadMonstersId[0], 1865, 2603, 1870, 2473, 2474, 2283;
	bindatcmd "worldboss", strnpcinfo(3) + "::OnStartWBoss";
	end;
}

askald,155,85,5	script	World Class Master::alawcm	4_M_CATMAN2,{
	mes "[World Class Master]";
	if($wordBossPop == 1)
	{
		mes "Hurry up, " + strcharinfo(0) + ".";
		mes "A World Boss threat has been raised, a few ago!";
		mes "We need all fighters to join!";
		if(select("Send me there","No way, I'm not going") == 1)
		{
			next;
			mes "[World Boss Area]";
			mes "Right, get ready.";
			set $wbFighters[getarraysize($wbFighters)], getcharid(3);
			warp $lastPopMap$, 0, 0;
		}
		else
		{
			next;
			mes "[World Boss Area]";
			mes "What are you? A coward?";
			mes "You'll be blessed when we all be dead...";
		}
	}
	else
	{
		mes "I'm the one you should come to visit when a World Boss will appear.";
		mes "And believe, it will.";
		mes "Those monsters are regular, in some kind.";
		mes "Al mortal, giant...And ridiculously strong...";
	}
	close;
}

 

 

 

So uhh, found this simple world boss invasion. It's all ready and good, but one thing I would like to request some help is the reward system is not working.

After killing the Boss monster, no reward is given. There's no error I received in the script after killing the boss monster except [Debug]: mapindex_name2id: Map "" not found in index list!.

Edited by Kuroyama

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0
set .rewardCount, getmapusers(strnpcinfo(4)) - 1;

change strnpcinfo(4) into $lastPopMap$

 

by the way the condition down below might not work,

we don't have *getfreecell script command to search for a free cell to drop items

 

while(checkcell ... trick might work, but might take a lot goto_count .... though

Share this post


Link to post
Share on other sites
  • 0

Hi ms. annie, thanks for lending a support. However, I did try the "change strnpcinfo(4) into $lastPopMap$", but still not giving a reward.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.