Jump to content
  • 0

[Solved]script little error


manabeast

Question


  • Group:  Members
  • Topic Count:  138
  • Topics Per Day:  0.03
  • Content Count:  835
  • Reputation:   25
  • Joined:  11/22/11
  • Last Seen:  

how to fix error on server for this thing?

Edited by manabeast
Link to comment
Share on other sites

Recommended Posts


  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.01
  • Content Count:  587
  • Reputation:   104
  • Joined:  11/19/11
  • Last Seen:  

getmapmobs(mapname)

mapname need string type of variable to save

Edited by QQfoolsorellina
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  138
  • Topics Per Day:  0.03
  • Content Count:  835
  • Reputation:   25
  • Joined:  11/22/11
  • Last Seen:  

L_MDeath: //called at each mob dead
   if(getmapmobs(prontera) == 0) {//if there no more mob on map
       set .spawn[1],0; //mark monster are all dead

like this? not working too. hmm.... string type i dunno. /swt

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

getmapmob has been dropped in rAthena.. r15530

use

*mobcount("<map name>","<event label>")

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  138
  • Topics Per Day:  0.03
  • Content Count:  835
  • Reputation:   25
  • Joined:  11/22/11
  • Last Seen:  

i see, then it's will become like this? "<event label>" = need put what? my event no need kill mobster.

L_MDeath: //called at each mob dead
    if(mobcount("prontera","0")== 0) {//if there no more mob on map
		    set .spawn[1],0; //mark monster are all dead

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

To check for mobs that have no attached event label, use an empty string:

mobcount("prontera", "")

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  138
  • Topics Per Day:  0.03
  • Content Count:  835
  • Reputation:   25
  • Joined:  11/22/11
  • Last Seen:  

thx brian.. i have another problem. someone willing to help me. but he say the script must be work only can edit. so i was trying to make this work. kinda alot bug script and unfinish work >.<"

[Fix]

Edited by manabeast
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  82
  • Topics Per Day:  0.02
  • Content Count:  846
  • Reputation:   137
  • Joined:  02/26/14
  • Last Seen:  

set .garden$,"maze" needs a ; at the end of it~

  • Upvote 2
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  138
  • Topics Per Day:  0.03
  • Content Count:  835
  • Reputation:   25
  • Joined:  11/22/11
  • Last Seen:  

ok, all thing should done. why i still can't see npc in game hmm... weird.

prontera,157,190,4 script Garden Entrance 793,{
if(gettime(4)==6) && (gettime(3)==12) {
 //enablenpc "Garden Entrance"; //this must be an issue, since if we here it's obiously enable
 Announce "The Mystical Gate of the Secret Garden has opened! Fifteen players may enter.",bc_all || bc_blue;
 mes "Rumor has it that there was once an ancient secret garden located near prontera!";
 if(countitem(7559) < 1) close;
 next;
 mes "I see that you have the key... Very well, since you have the key, I can warp you to the gate.";
 next;
 mes "Do you want me to? Only [" + .playersmax - .playersin + "] can enter.";
 next;
 if(select("Yes:No") == 2) close;
 set .playersin,getmapusers(.garden$); //updated to auto ajust for players leaving etc
 if(.playersin == .playersmax) {
  mes "Sorry the max players has been reached.";
 } else {
  warp .garden$,.x,.y;
  //set .playersin,.playersin + 1;
 }
 close;
} else {
 disablenpc "Garden Entrance";
}
end;
OnInit: //been move so we can click on NPC
set .garden$,"maze"; // <Customizable>
set .x,50; // <Customizable>
set .y,55; // <Customizable>
set .playersmax,15; // <Customizable>
set .playersin,0;
disablenpc "Garden Entrance"; //when do you enable it ?
end;
OnSat1127: //enable npc on saturday at noon
enablenpc "Garden Entrance";
end;
OnSat1800: //disable npc after 6h
disablenpc "Garden Entrance";
end;
}
maze,60,60,4 script Ancient Hero 793,{
OnPCLoadMapEvent : //autoenable and spawn, comment this if you want to handle differently
if((getmapusers(.garden$) == 15) && !.spawn[1]) { //when we reach 15 player on map we enable npc and spawn monster
 enablenpc "Ancient Hero of the Garden"; //nota : we enable npc so player can click on it but it's not really usefull, we should consider invisible automated npc instead.
//nota2 we may have extra enable from player wich it's quite annoying but shouldn't be buggy anyway
 monster .garden$,0,0,"Treasure of the Secret Garden",.spawn,10,"Ancient Hero of the Garden::L_MDeath";
 set .spawn[1],1; //mark monster are spawned
}
else {
 mes "I don't know exacly what's my purpose yet but monsters alreaby been spawn, found them !";
 close;
}
end;
L_MDeath: //called at each mob dead
if(mobcount("maze", "") == 0) {//if there no more mob on map
 set .spawn[1],0; //mark monster are all dead
 mes "I see you have found the treasure ...";
 next;
 switch(rand(1,15)){
  case 1 : goto L_First; //I dun like much goto but well
  case 2 : goto L_Second;
  case 3 : goto L_Third;
  default :
mes "I see that you did not get the sacred mark of the treasure...";
close;
 }
}
end;
L_First:
mes "Wow... You got the ultimate mark of the treasure ...";
next;
mes "I believe this is yours then...";
getitem 2862,1;
set zeny, zeny + 100000;
close;
L_Second:
mes "Wow... You got the legendary mark of the treasure ...";
next;
mes "I believe this is yours then...";
getitem 5682,1;
set zeny, zeny + 50000;
close;
L_Third:
mes "Wow... You got the holy mark of the treasure ...";
next;
mes "I believe this is yours then...";
set zeny, zeny + 20000;
close;
OnInit:
set .spawn,1902; // <Customizable>
set .garden$,"maze"; // <Customizable>
disablenpc "Ancient Hero"; //when do you enable it ?
end;
}

bump =)

Edited by manabeast
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  439
  • Reputation:   29
  • Joined:  12/08/11
  • Last Seen:  

Which NPC? Garden Entrance or Ancient Hero?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  138
  • Topics Per Day:  0.03
  • Content Count:  835
  • Reputation:   25
  • Joined:  11/22/11
  • Last Seen:  

first line.

prontera,157,190,4 script Garden Entrance 793,{

or this has set timing?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  658
  • Reputation:   57
  • Joined:  11/20/11
  • Last Seen:  

Okay in the Picture I see that it says this :

1st : the getmapmobs command was removed so change it to mobcount

2nd : The name Ancient Hero of the Garden is too long,change it to Ancient Hero

3rd : there is an unknown syntax at line 71,which I can't see in the picture,which you uploaded.

2nd Screenshot :

1st : set .garden$,"maze"; needs the ; at the end like pneuma already said.

Now you say you still don't see the NPC?

Hmm,did you fix all the tabbings?

And also,did you check the script line under the header of the NPC?

if(gettime(4)==6) && (gettime(3)==12) {

Check the Wiki for this : http://rathena.org/wiki/Gettime

It has a timer,it just shows up on Saturday because of gettime(4)==6 and at the hour of 12 because of gettime(3)==12

Good Luck,I hope that I have solved this little error now :)

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  138
  • Topics Per Day:  0.03
  • Content Count:  835
  • Reputation:   25
  • Joined:  11/22/11
  • Last Seen:  

61820886.png

actually you sew those error are old one. already beem solve.

but the ancient hero i not yet remove all. but now already been shorter the name. i still can't see npc. maybe i should remove the timing thing to test? use this? OnInit: ?

Remove this to this?

if(gettime(4)==7) && (gettime(2)==1) {

to

OnInit:

prontera,157,190,4 script Garden Entrance 793,{
if(gettime(4)==7) && (gettime(2)==1) {
 //enablenpc "Garden Entrance"; //this must be an issue, since if we here it's obiously enable
 Announce "The Mystical Gate of the Secret Garden has opened! Fifteen players may enter.",bc_all || bc_blue;
 mes "Rumor has it that there was once an ancient secret garden located near prontera!";
 if(countitem(7559) < 1) close;
 next;
 mes "I see that you have the key... Very well, since you have the key, I can warp you to the gate.";
 next;
 mes "Do you want me to? Only [" + .playersmax - .playersin + "] can enter.";
 next;
 if(select("Yes:No") == 2) close;
 set .playersin,getmapusers(.garden$); //updated to auto ajust for players leaving etc
 if(.playersin == .playersmax) {
  mes "Sorry the max players has been reached.";
 } else {
  warp .garden$,.x,.y;
  //set .playersin,.playersin + 1;
 }
 close;
} else {
 disablenpc "Garden Entrance";
}
end;
OnInit: //been move so we can click on NPC
set .garden$,"maze"; // <Customizable>
set .x,50; // <Customizable>
set .y,55; // <Customizable>
set .playersmax,15; // <Customizable>
set .playersin,0;
disablenpc "Garden Entrance"; //when do you enable it ?
end;
OnSat1127: //enable npc on saturday at noon
enablenpc "Garden Entrance";
end;
OnSat1800: //disable npc after 6h
disablenpc "Garden Entrance";
end;
}
maze,60,60,4 script Ancient Hero 793,{
OnPCLoadMapEvent : //autoenable and spawn, comment this if you want to handle differently
if((getmapusers(.garden$) == 15) && !.spawn[1]) { //when we reach 15 player on map we enable npc and spawn monster
 enablenpc "Ancient Hero"; //nota : we enable npc so player can click on it but it's not really usefull, we should consider invisible automated npc instead.
//nota2 we may have extra enable from player wich it's quite annoying but shouldn't be buggy anyway
 monster .garden$,0,0,"Treasure of the Secret Garden",.spawn,10,"Ancient Hero::L_MDeath";
 set .spawn[1],1; //mark monster are spawned
}
else {
 mes "I don't know exacly what's my purpose yet but monsters alreaby been spawn, found them !";
 close;
}
end;
L_MDeath: //called at each mob dead
if(mobcount("maze", "") == 0) {//if there no more mob on map
 set .spawn[1],0; //mark monster are all dead
 mes "I see you have found the treasure ...";
 next;
 switch(rand(1,15)){
  case 1 : goto L_First; //I dun like much goto but well
  case 2 : goto L_Second;
  case 3 : goto L_Third;
  default :
   mes "I see that you did not get the sacred mark of the treasure...";
   close;
 }
}
end;
L_First:
mes "Wow... You got the ultimate mark of the treasure ...";
next;
mes "I believe this is yours then...";
getitem 2862,1;
set zeny, zeny + 100000;
close;
L_Second:
mes "Wow... You got the legendary mark of the treasure ...";
next;
mes "I believe this is yours then...";
getitem 5682,1;
set zeny, zeny + 50000;
close;
L_Third:
mes "Wow... You got the holy mark of the treasure ...";
next;
mes "I believe this is yours then...";
set zeny, zeny + 20000;
close;
OnInit:
set .spawn,1902; // <Customizable>
set .garden$,"maze"; // <Customizable>
disablenpc "Ancient Hero"; //when do you enable it ?
end;
}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  658
  • Reputation:   57
  • Joined:  11/20/11
  • Last Seen:  

Why don't you just make it OnMinuteXX: then?

So you check your clock,lets say it's 5:32PM now you make it like this :

//if(gettime(4)==7) && (gettime(2)==1) {
 //enablenpc "Garden Entrance"; //this must be an issue, since if we here it's obiously enable
OnMinute35:

And then start your server,login and wait until it's 5:35PM and check if the NPC shows up.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  138
  • Topics Per Day:  0.03
  • Content Count:  835
  • Reputation:   25
  • Joined:  11/22/11
  • Last Seen:  

42648204.png

when time come the debug appear. how about complete remove hide npc? to make it normal event npc enought? like OnFri2000: ?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  439
  • Reputation:   29
  • Joined:  12/08/11
  • Last Seen:  

Someone may re-create/re-edit the entire script for you if you mention the mechanic or how your script works.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  138
  • Topics Per Day:  0.03
  • Content Count:  835
  • Reputation:   25
  • Joined:  11/22/11
  • Last Seen:  

prontera,100,100,4 script Ancient Coffin 801,{
Msg
[LOCKED]
it's Looked!!!
Feel like. there's a tunnel can go another place.
But look like need a key only can Open.
Next Msg
[Required]
1x Key to the Secret Garden
[Warp player to maze.gat,100,100]
=======================================
[if have key to the secret garden]
..............................
The Ancient Coffin have open!
..............................
There is a underground Tunnel. look like can go Down.
=======================================

Set time: OnMinute01: (for testing)
set array for adding monster on maze.gat.

when event start,
Annouse: The Mystical Secret Garden has opened! Fifteen players may Enter now.
Annouse: but you will need to find the Key around the Prontera City.

if 15 player Enter will annouse say: Fifteen player have Enter Mystical Secret Garden... Good luck!
Spawn: 15 Treasure box in prontera Town. (Treasure box ID:3639) // <= this treasure box drop Key ID:7559

Map: maze.gat
NPC: Ancient Hero
Talk to this npc and get prize.
1 winner = itemID :504
2 winner = 100.000z
3 winner = 50.000z

msg
Brave Warrior. you have complete the test.
Congratulation. Here are our Reward.
Menu:
Stay on the Map.
Walk out from this map.

maze mapflag nosave
maze mapflag noteleport

i write down whole thing. and shorter it.

Edited by manabeast
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  439
  • Reputation:   29
  • Joined:  12/08/11
  • Last Seen:  

I'm confused. When 15 players are in that map, what are the things they need to do to win?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  138
  • Topics Per Day:  0.03
  • Content Count:  835
  • Reputation:   25
  • Joined:  11/22/11
  • Last Seen:  

this is the maze map.

http://rathena.org/b...h&attach_id=706

there no need for doing anything. just walk from start point till end point. and talk to npc to get prize, just depend who fast. this is a maze event that i feel so ......normal. i want add more adventure feel in.

for 15 player only 3 player get prize.

ofcause if we only let player walk sure are bored. that's why i say set array for script then we can add monster we like.

example in maze map. will random spawn boss.

zombie 30

Minorous 50

Mummy 20

Osiris 1 or some other special mvp disturb player walk.

i just want a event have forest feel. if you have idea can make it more cool... that's more greats =D. just imagine a maze event how you modify not alway follow old path what also simple.

Edited by manabeast
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  69
  • Reputation:   10
  • Joined:  05/14/12
  • Last Seen:  

I offer to take a look at the script and fix it up for you, but not now because I'm tired. I'll work on it tomorrow though! ^^

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  138
  • Topics Per Day:  0.03
  • Content Count:  835
  • Reputation:   25
  • Joined:  11/22/11
  • Last Seen:  

i have short it then you can see it clear. i have write every requirement. the old one write too long. and complicated.

prontera,100,100,4 script Ancient Coffin 801,{
Msg
[LOCKED]
it's Looked!!!
Feel like. there's a tunnel can go another place.
But look like need a key only can Open.
Next Msg
[Required]
1x Key to the Secret Garden
[Warp player to maze.gat,100,100]

Set time: OnMinute01:
set array for some monster on maze.gat map.
(give npc 1x key to the secret garden can warp to maze.gat)

when event start,
Annouse: The Mystical Garden has Open!!
Annouse: 15 Treasure box have been Appear on Prontera.
Annouse: if you can find the Key and talk to Ancient Coffin. you will Warp to The Mystical Garden.
Annouse: You will need to Complete the Test to Meet Ancient Hero that live in Mystical Garden.

Spawn: 15 Treasure box in prontera Town. (Treasure box ID:3639) // <= this treasure box drop Key ID:7559

if 15 player Enter will
annouse say: The Door have Been Close.
annouse say: Fifteen Player have Enter Mystical Garden..... Good luck!
----------------------------------------------
Set Array for setting mob in maze.gat <= map)
example: zombie 100, Minorous 50, Mummy 20, dark illution 10.
----------------------------------------------

Map: maze.gat
NPC: Ancient Hero
Talk to this npc and get prize.
1 winner = itemID :504
2 winner = 100.000z
3 winner = 50.000z
4+ (Msg: Reward have Give Away. Try Harder next time.....)

msg
Brave Warrior. you have complete the test.
Congratulation. The journey have come to at End.
Here are your Reward.

Menu:
Stay on the Map.
Getting Out of Here.

Edited by manabeast
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  218
  • Topics Per Day:  0.05
  • Content Count:  1180
  • Reputation:   141
  • Joined:  01/27/12
  • Last Seen:  

Is this the actual script you tried to use or a draft of what you want it to be? If you want to make a NPC display a message you have to format like: mes "it's Looked!!!"; I don't have time to clean it up now though.

Peopleperson49

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  138
  • Topics Per Day:  0.03
  • Content Count:  835
  • Reputation:   25
  • Joined:  11/22/11
  • Last Seen:  

this is just a draft only. to be clean. if people want help me make. will easy abit for them to read.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  218
  • Topics Per Day:  0.05
  • Content Count:  1180
  • Reputation:   141
  • Joined:  01/27/12
  • Last Seen:  

Its fine for a draft I guess. I was just wondering if that was what you tried to use. Weird way to do a draft by partial scripting it, lol.

Peopleperson49

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  138
  • Topics Per Day:  0.03
  • Content Count:  835
  • Reputation:   25
  • Joined:  11/22/11
  • Last Seen:  

hehehe~ i wish i could create a very difference way of ragnarok world that can let us enjoy with =) that's my dream hehe.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  218
  • Topics Per Day:  0.05
  • Content Count:  1180
  • Reputation:   141
  • Joined:  01/27/12
  • Last Seen:  

You can but it all starts with coding and scripting man. A dream and An idea is great but you have to learn the basics of how stuff works. Even if that means your bored out of your mind learning and researching exactly how to do that!

Peopleperson49

  • Upvote 1
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...