Jump to content
  • 0

Treasure Chest will explode then player will die.


DrakeSky

Question


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  69
  • Reputation:   0
  • Joined:  03/27/18
  • Last Seen:  

Hi! Scripters,

Can I request for an event script? The event is similar to mushroom event, treasure chest will spawn in different cities or fields then once the player click on it either it will explode then player will die or it will summon a boss monster or it will give you an item. TIA

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.02
  • Content Count:  911
  • Reputation:   166
  • Joined:  11/27/14
  • Last Seen:  

sec_in01,170,180,3	script	Soccer Ball	480,{
	mes "[ Soccerball ]";
	if (!.Status)
		mes "There is no event at the moment!";
	else {
		mes "There are "+.Spawn+" soccerball left in "+.Map$+"!";
		mes "Find and kill the soccerball to gain "+getitemname(.Prize)+"!";
	}
	if (.Status || getgmlevel() < .GM) close;
	mes "Start the event?";
	next;
	if(select("- No:- Yes") == 1) close;
	donpcevent strnpcinfo(0)+"::OnClock0100";
	mes "[ Soccerball ]";
	mes "Event started!";
	close;

OnInit:
	set .Prize,7227;	// Reward item ID
	set .Amount,1;	// Reward item amount
	set .GM,99;	// GM level required to access NPC
	setarray .Maps$[0],"payon"; // Possible maps
	end;

OnClock0200:
OnClock0600:
OnClock1000:
OnClock1400:
OnClock1800:
OnClock2200:
	if (.Status) end;
	set .Status,1;
	set .Spawn,rand(1,3);	// How many soccerball should spawn?
	set .Map$,.Maps$[rand(getarraysize(.Maps$))];
	killmonster .Map$,"All";
	monster .Map$,0,0,"Soccerball!",1792,.Spawn,strnpcinfo(0)+"::OnMobKilled";
	announce "Soccerball has been summon!",0;
	sleep 5000;
	announce "Total of "+.Spawn+" soccerball have been spawned in "+.Map$+"!",0;
	end;

OnMobKilled:
	set .Spawn, .Spawn - 1;
	getitem .Prize, .Amount;
	if (.Spawn) announce "[ "+strcharinfo(0)+" ] has killed a soccerball. There are now "+.Spawn+" soccerball(s) left.",bc_map;
	else {
		announce "The soccerball event has ended. All the soccerball have been killed.",bc_map;
		set .Status,0;
	}
	end;
}


On this script when monster will die you will go to OnMobKilled:
 

Quote

    monster .Map$,0,0,"Soccerball!",1792,.Spawn,strnpcinfo(0)+"::OnMobKilled";

Then add this onMobKilled:

If you want item when the monster killed : getitem .Prize, .Amount;
If you want player die add : atcommand "@nuke "+strcharinfo(0)+"
If you want to summon a new monster add  monster .Map$,0,0,"Soccerball!",1792,.Spawn,strnpcinfo(0)+"::OnMobKilled";

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  69
  • Reputation:   0
  • Joined:  03/27/18
  • Last Seen:  

4 hours ago, Poring King said:

sec_in01,170,180,3	script	Soccer Ball	480,{
	mes "[ Soccerball ]";
	if (!.Status)
		mes "There is no event at the moment!";
	else {
		mes "There are "+.Spawn+" soccerball left in "+.Map$+"!";
		mes "Find and kill the soccerball to gain "+getitemname(.Prize)+"!";
	}
	if (.Status || getgmlevel() < .GM) close;
	mes "Start the event?";
	next;
	if(select("- No:- Yes") == 1) close;
	donpcevent strnpcinfo(0)+"::OnClock0100";
	mes "[ Soccerball ]";
	mes "Event started!";
	close;

OnInit:
	set .Prize,7227;	// Reward item ID
	set .Amount,1;	// Reward item amount
	set .GM,99;	// GM level required to access NPC
	setarray .Maps$[0],"payon"; // Possible maps
	end;

OnClock0200:
OnClock0600:
OnClock1000:
OnClock1400:
OnClock1800:
OnClock2200:
	if (.Status) end;
	set .Status,1;
	set .Spawn,rand(1,3);	// How many soccerball should spawn?
	set .Map$,.Maps$[rand(getarraysize(.Maps$))];
	killmonster .Map$,"All";
	monster .Map$,0,0,"Soccerball!",1792,.Spawn,strnpcinfo(0)+"::OnMobKilled";
	announce "Soccerball has been summon!",0;
	sleep 5000;
	announce "Total of "+.Spawn+" soccerball have been spawned in "+.Map$+"!",0;
	end;

OnMobKilled:
	set .Spawn, .Spawn - 1;
	getitem .Prize, .Amount;
	if (.Spawn) announce "[ "+strcharinfo(0)+" ] has killed a soccerball. There are now "+.Spawn+" soccerball(s) left.",bc_map;
	else {
		announce "The soccerball event has ended. All the soccerball have been killed.",bc_map;
		set .Status,0;
	}
	end;
}


On this script when monster will die you will go to OnMobKilled:
 

Then add this onMobKilled:

If you want item when the monster killed : getitem .Prize, .Amount;
If you want player die add : atcommand "@nuke "+strcharinfo(0)+"
If you want to summon a new monster add  monster .Map$,0,0,"Soccerball!",1792,.Spawn,strnpcinfo(0)+"::OnMobKilled";

Hi! Sir Poring King, how to make (getitem,@nuke,summon ) these 3 into random? For example 20% chance to get an item 30%chance summon monster 50% chance @nuke?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.02
  • Content Count:  911
  • Reputation:   166
  • Joined:  11/27/14
  • Last Seen:  

46 minutes ago, DrakeSky said:

Hi! Sir Poring King, how to make (getitem,@nuke,summon ) these 3 into random? For example 20% chance to get an item 30%chance summon monster 50% chance @nuke?

Add random condition

Link to comment
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.   Paste as plain text instead

  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.

×
×
  • Create New...