canditw 0 Posted May 20, 2016 Hi i was wondering how does the showevent command works? Can anyone paste a simple script of a showevent (quest) on an npc?Heres my script but it doesn't show the quest icon. new_1-1,58,112,5 script Skia 888,{ showevent 1,1;mes "Hello";close;end;} Quote Share this post Link to post Share on other sites
0 Nihad 24 Posted May 20, 2016 The script you have is not exactly wrong. It shows the quest icon when you click on the npc. However I assume you want it to show a quest icon when they see the npc. A simple method is to use OnPCLoadMapEvent I have all of my OnPCLoadMapEvent: in a single file and then I link them to npcs to keep it organized. But you can do something like: new_1-1,58,112,5 script Skia 4_M_ZONDAOYAJI,{ mes "Hello"; close; end; OnPCLoadMapEvent: if( #accountvar != 1 ) { showevent 1,1; end; } end; } new_1-1 mapflag loadevent You can use this with a combination of other things such as on touch or onlogin. Just be careful and make sure it is all organized. Quote Share this post Link to post Share on other sites
0 canditw 0 Posted May 21, 2016 @@NihadYes, this works very well. But I noticed OnPCLoadMapEvent only works if the players loads the map. What if, lets say I want it to turn off showevent after the player talked to the npc.For example talking to the npc, sets a variable but is there any other triggers to deactivate the showevent. Because if I put it under OnPCLoadMapEvent, the player will have to revisit the map to make the showevent disappear. set new,3; if ( new == 3 ) {showevent 0,0; end;} Quote Share this post Link to post Share on other sites
0 Nihad 24 Posted May 21, 2016 You can easily get around that by doing something like this: #accountvar = 1; getmapxy .@map$, .@x, .@y, 0; warp .@map$, .@x, .@y; end; From the player's perspective it will look like they used @refresh where as in reality they were just warped on top of their current location. Quote Share this post Link to post Share on other sites
0 Alayne 99 Posted May 23, 2016 I never used it, but I'd more likely use an OnTouch event or something like that. As long as the distance provided for the touch area is high enough. If you enter in an area of 10*10 around the npc (or more), the popup will trigger. It should work and prevent players to reload the map or force warp them. But still, the OnLoad should work too. To make it disappear, I suppose you just have to recall the showevent on dialog completion. Quote Share this post Link to post Share on other sites
0 Legend 43 Posted May 27, 2016 I want it to turn off showevent after the player talked to the npc. Insert this in the first part of your npc dialogue script to remove existing showevent: showevent QTYPE_NONE,0; Quote Share this post Link to post Share on other sites
Hi i was wondering how does the showevent command works? Can anyone paste a simple script of a showevent (quest) on an npc?
Heres my script but it doesn't show the quest icon.
Share this post
Link to post
Share on other sites