Jump to content
  • 0

TreasureChest Mob ideas and thoughts


Sehrentos

Question


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  91
  • Reputation:   22
  • Joined:  10/24/14
  • Last Seen:  

Greetings,

Many times when i see some monster scripts like where you kill a MVP and get extra loots from. It is many times implemented as treasure chest monster that get summoned after MVP is killed and will trigger OnMobDie label. There it checks if he was the actual killer and is able to receive rewards.

If there are many players nearby trying to kill same MVP and spamming AOE skills. This treasure chest's event label will get triggered on the first one who got the kill. So players keep spamming AOE, and the actual player who has the right to claim the reward keeps spamming AOE or wait until all players leave or get a lucky hit on it.

How I implement this kind of event is by calling an NPC to that location and only the player who has access to the rewards will have a dialog open etc.

So, my question is (I'm interested) how would you proceed in this kind of situation? Would it be with a Treasure Monster or Treasure NPC or Not summoning a visual treasure and just open dialog on MVP kill?

Here is sample with monster unit:

-	script 	Sample	-1,{
OnInit:
	monster "prontera",0,0,"--ja--",1093,1,strnpcinfo(0)+"::OnMobDie";
	end;

OnMobDie:
	getmapxy(.@map$,.@x,.@y,0);
	monster .@map$,rand(.@x,.@x-3),rand(.@y-3,.@y),"--ja--",1324,1,strnpcinfo(0)+"::OnBoxKill";
	end;

OnBoxKill:
	// If checks your able to receive rewards
	//...
	// Else summon Treasure Chest again...
	getmapxy(.@map$,.@x,.@y,0);
	monster .@map$,rand(.@x,.@x-3),rand(.@y-3,.@y),"--ja--",1324,1,strnpcinfo(0)+"::OnBoxKill";
	end;
}

Here is sample with npc unit:

-	script	Sample	-1,{
OnInit:
	monster "prontera",0,0,"--ja--",1093,1,strnpcinfo(0)+"::OnMobDie";
	end;

OnMobDie:
	// ... save players access data ...
	// Get map coordinates for the Treasure Chest NPC
	getmapxy(.event_map$, .event_x, .event_y);
	.@index = 0; // Select what treasure npc to open
	.@npc$ = "Treasure Chest#tc_"+ .@index;
	donpcevent .@npc$ +"::OnEnable";
	end;
}

// Treasure Chest NPC index = 0
prontera,0,0,5	script	Treasure Chest#tc_0	1324,{
	// If check player is able to receive rewards
	//... dialogs ...

	// If player received rewards, remove treasure NPC after close
	close2;
	.@index = 0;
	.@npc$ = "Treasure Chest#tc_"+ .@index;
	donpcevent .@npc$ +"::OnDisable";
	end;

OnInit:
	.@name$ = strnpcinfo(0);
	getmapxy(.map$, .x, .y, UNITTYPE_NPC); // Save default position
	disablenpc .@name$;
	end;

OnDisable:
	.@id = getnpcid(0);
	.@name$ = strnpcinfo(0);
	unitwarp( .@id, .map$, .x, .y ); // Return to default position
	disablenpc( .@name$ );
	end;

OnEnable:
	.@id = getnpcid(0);
	.@name$ = strnpcinfo(0);

	// get coordinates from event npc
	.@npc$ = "Sample";
	.@map$ = getvariableofnpc(.event_map$, .@npc$);
	.@x = getvariableofnpc(.event_x, .@npc$);
	.@y = getvariableofnpc(.event_y, .@npc$);

	enablenpc( .@name$ );
	unitwarp( .@id, .@map$, .@x, .@y ); // Move to new position
	end;
}

// You can also duplicate more treasure chests, if you need more
alberta,0,0,5	duplicate(Treasure Chest#tc_0)	Treasure Chest#tc_1	1324

I would love to hear your thoughts and ideas.

Thanks ?

 

Edited by Sehrentos
FixTypo
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

I did something kinda like this years ago. Like if you're in a party and you kill an mvp you can roll on the loot.

 

 

  • Like 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  91
  • Reputation:   22
  • Joined:  10/24/14
  • Last Seen:  

12 hours ago, Skorm said:

I did something kinda like this years ago. Like if you're in a party and you kill an mvp you can roll on the loot.

Yes, that is very much the same and that waiting room displaying time left is great addition.

Edited by Sehrentos
FixTypo
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...