-
Posts
1282 -
Joined
-
Last visited
-
Days Won
41
Content Type
Profiles
Forums
Downloads
Jobs Available
Server Database
Third-Party Services
Top Guides
Store
Crowdfunding
Everything posted by Skorm
-
Hmm I'm not sure I could probably test it tomorrow sometime.
-
The error message and debugs come from the way I'm checking for realistic IDs. It could be done differently but really I see no harm in it. I modified the above post to what I think you wanted it to announce... :/ I forgot to add the monster name part.
-
Right -.-* Try triggering an event label inside of a function.If you want the script applicable only to those who've equipped the item, add a temporary character variable. { } , { set @m_Eq,1; }, { set @m_Eq,0; } - script Mirage -1,{ OnNPCKillEvent: if(rand(1,20)-1||!@m_Eq) end; getmapxy( .@Map$,.@X,.@Y,0,strcharinfo(0) ); clone .@Map$,.@X,.@Y,"Mirage::OnCloneDeath",getcharid(0),getcharid(0),14261,0,30; end; OnCloneDeath: charcommand "#heal "+strcharinfo(0)+" -9999"; end; }Really I'm not sure if the item script is called every time the character attacks, but I do know that's why it randomly spawns clones when you warp.
-
I just tested there is no bug, whenever "accidentally killed the poring!" is announced a new poring is spawned I even mentioned in my previous post how to change that. Anyways I removed that so now they have to go back to the npc to spawn a new one, but because character specific monsters summoned on the map would be... a pain... if 3 people summon porings and 1 person kills 2 and the third person just left the map reguardless of whatever porings the first guy killed there will still be 1 poring left on the map for the second player. Do @mobsearch poring and you'll see. function script timeleft__ { set .@left, getarg(0); if ( .@left <= 0 ) return getarg(0); set .@day, .@left / 86400; set .@hour, .@left % 86400 / 3600; set .@min, .@left % 3600 / 60; set .@sec, .@left % 60; return ( ( .@day )?.@day +" day ":"" )+( ( .@day || .@hour )?.@hour +" hour ":"" )+( ( .@day == 0 && ( .@hour || .@min ) )?.@min +" min ":"" )+( ( .@day || .@hour )?"":.@sec +" sec" ); } prontera,95,96,2 script Bloody Branch Quest 76,{ if(!#Bloody_b_Q){ set .QNPC$,"[^0000FF???^000000]"; } else { set .QNPC$,"[^0000FFAlice^000000]"; } if(!mobcount("prontera","Bloody Branch Quest::OnPoringDead")&Bloody_b_Q==1){ npctalk "Hmm... *looks around* Ahh, I see one over there!"; monster "prontera",0,0,"Poring",1002,1,"Bloody Branch Quest::OnPoringDead"; emotion e_gasp; end; } if(#Bloody_b_Q==2){ npctalk "Thanks again, come back in 3 hours and I'm sure another one will slip through!"; getitem 12103,2; set #Bloody_b_Q,(gettimetick(0)+(3*60*60*1000)); end; } if(#Bloody_b_Q==1) { mes .QNPC$; mes "There's already a Poring out there with your name on it!"; close; } if(((#Bloody_b_Q-gettimetick(0))/1000)>0&Bloody_b_Q){ mes .QNPC$; mes strcharinfo(0)+" you have "+callfunc("timeleft__",((#Bloody_b_Q-gettimetick(0))/1000))+"left."; close; } if(BaseLevel<255){ mes .QNPC$; mes "I'm sorry, but only the truly strong can do this quest. Come back with a base level of 255 or higher."; close; } mes .QNPC$; mes "Hello I need your help, Porings from the surounding feilds slip past our lazy guards, and I'm to cute to hunt them down now they're running a muk!"; next; mes .QNPC$; mes "Would you like to participate in our daily Poring Hunt?"; mes "Oh- I almost forgot to mention, we need 300m to cover any casualities."; if(select("Yes:No")-1){ next; mes .QNPC$; mes "What!- You expect me to just kill all these porings bymyself?!"; emotion e_sob; close; } if(Zeny<3000000) { next; mes .QNPC$; mes "Look I can't just let you loose swinging a sword at everything you think is a poring without some funding!"; mes "Come back when you get some more cash!"; close; } emotion e_no1; set Zeny,Zeny-3000000; next; if(!#Bloody_b_Q){ mes "[^0000FFAlice^000000]"; mes "Thanks for your patronage."; mes "You can call me ^0000FFAlice^000000 from now on..."; mes "Now get to work rookie!"; } else { mes .QNPC$; mes "Welcome back!"; mes "Good luck on your hunt!"; } set #Bloody_b_Q,1; monster "prontera",0,0,"Poring",1002,1,"Bloody Branch Quest::OnPoringDead"; close; OnPoringDead: if(#Bloody_b_Q==1){ mapannounce "prontera",strcharinfo(0)+" has found the poring!",bc_map,"0xFFCE00"; set #Bloody_b_Q,2; end; } if(!#Bloody_b_Q||((#Bloody_b_Q-gettimetick(0))/1000)>0&Bloody_b_Q&&Bloody_b_Q!=1){ mapannounce "prontera",strcharinfo(0)+" accidentally killed the poring!",bc_map,"0xFFCE00"; end; } }^ this version the player has to go back and summon a new poring if "There's already a Poring out there with your name on it!" is announced there is a poring on the map already.
-
Sorry about that gettimetick(0) is weird it goes into negative values. Right now it's setup to automatically spawn a new poring if someone else kills it. If you want them to have to go back to the quest npc to spawn a new one just remove monster "prontera",0,0,"Poring",1002,1,"Bloody Branch Quest::OnPoringDead"; fourth line from the bottom. function script timeleft__ { set .@left, getarg(0); if ( .@left <= 0 ) return getarg(0); set .@day, .@left / 86400; set .@hour, .@left % 86400 / 3600; set .@min, .@left % 3600 / 60; set .@sec, .@left % 60; return ( ( .@day )?.@day +" day ":"" )+( ( .@day || .@hour )?.@hour +" hour ":"" )+( ( .@day == 0 && ( .@hour || .@min ) )?.@min +" min ":"" )+( ( .@day || .@hour )?"":.@sec +" sec" ); } prontera,95,96,2 script Bloody Branch Quest 76,{ if(!#Bloody_b_Q){ set .QNPC$,"[^0000FF???^000000]"; } else { set .QNPC$,"[^0000FFAlice^000000]"; } if(!mobcount("prontera","Bloody Branch Quest::OnPoringDead")&Bloody_b_Q==1){ npctalk "Hmm... *looks around* Ahh, I see one over there!"; monster "prontera",0,0,"Poring",1002,1,"Bloody Branch Quest::OnPoringDead"; emotion e_gasp; end; } if(#Bloody_b_Q==2){ npctalk "Thanks again, come back in 3 hours and I'm sure another one will slip through!"; getitem 12103,2; set #Bloody_b_Q,(gettimetick(0)+(3*60*60*1000)); end; } if(#Bloody_b_Q==1) { mes .QNPC$; mes "There's already a Poring out there with your name on it!"; close; } if(((#Bloody_b_Q-gettimetick(0))/1000)>0&Bloody_b_Q){ mes .QNPC$; mes strcharinfo(0)+" you have "+callfunc("timeleft__",((#Bloody_b_Q-gettimetick(0))/1000))+"left."; close; } if(BaseLevel<255){ mes .QNPC$; mes "I'm sorry, but only the truly strong can do this quest. Come back with a base level of 255 or higher."; close; } mes .QNPC$; mes "Hello I need your help, Porings from the surounding feilds slip past our lazy guards, and I'm to cute to hunt them down now they're running a muk!"; next; mes .QNPC$; mes "Would you like to participate in our daily Poring Hunt?"; mes "Oh- I almost forgot to mention, we need 300m to cover any casualities."; if(select("Yes:No")-1){ next; mes .QNPC$; mes "What!- You expect me to just kill all these porings bymyself?!"; emotion e_sob; close; } if(Zeny<3000000) { next; mes .QNPC$; mes "Look I can't just let you loose swinging a sword at everything you think is a poring without some funding!"; mes "Come back when you get some more cash!"; close; } emotion e_no1; set Zeny,Zeny-3000000; next; if(!#Bloody_b_Q){ mes "[^0000FFAlice^000000]"; mes "Thanks for your patronage."; mes "You can call me ^0000FFAlice^000000 from now on..."; mes "Now get to work rookie!"; } else { mes .QNPC$; mes "Welcome back!"; mes "Good luck on your hunt!"; } set #Bloody_b_Q,1; monster "prontera",0,0,"Poring",1002,1,"Bloody Branch Quest::OnPoringDead"; close; OnPoringDead: if(#Bloody_b_Q==1){ mapannounce "prontera",strcharinfo(0)+" has found the poring!",bc_map,"0xFFCE00"; set #Bloody_b_Q,2; end; } if(!#Bloody_b_Q||((#Bloody_b_Q-gettimetick(0))/1000)>0&Bloody_b_Q&&Bloody_b_Q!=1){ mapannounce "prontera",strcharinfo(0)+" accidentally killed the poring!",bc_map,"0xFFCE00"; monster "prontera",0,0,"Poring",1002,1,"Bloody Branch Quest::OnPoringDead"; end; } }
-
Semi-tested thanks for all the info.
-
{ if(!rand(1,20)-1){ doevent "Mirage::OnNPCKillEvent"; } } , { set @delay,(gettimetick(0)+5000); }, { } - script Mirage -1,{ OnNPCKillEvent: if(@delay>gettimetick(0)||rand(1,20)-1) end; getmapxy( .@Map$,.@X,.@Y,0,strcharinfo(0) ); clone .@Map$,.@X,.@Y,"Mirage::OnCloneDeath",getcharid(0),getcharid(0),14261,0,30; end; OnCloneDeath: charcommand "#heal "+strcharinfo(0)+" -9999"; end; } I hadn't set the random condition for the OnNPCKillEvent: because I didn't know you wanted it. This should work and I found a different value for the flag that might fix your -1% hp problem.
-
Player gotta wait after 10 mins before finish item is made by the NPC?
Skorm replied to Currently's question in Script Requests
Lol perhaps that's why I haven't. I tend to forget things, but wouldn't it be something if we had this for npc timers... I guess we could use waiting room with like a batch loading bar ( [||||||||| ] ) LOL, just a thought. But really what I was thinking about- would be instance based loading bars... Shown above the invoked npc only to the attached character. -
Player gotta wait after 10 mins before finish item is made by the NPC?
Skorm replied to Currently's question in Script Requests
is a good idea I didn't even thing of adding a progress bar to timed npc events... Hmm, would that show up for all characters or just the invoked char, and does it show up above the players head or the npc's head? -
{ if(!rand(1,20)-1){ doevent "Mirage::OnNPCKillEvent"; } } , { set @delay,(gettimetick(0)+5000); }, { } - script Mirage -1,{ OnNPCKillEvent: if(@delay>gettimetick(0)) end; getmapxy( .@Map$,.@X,.@Y,0,strcharinfo(0) ); clone .@Map$,.@X,.@Y,"Mirage::OnCloneDeath",getcharid(0),getcharid(0),"",1,30; end; OnCloneDeath: charcommand "#heal "+strcharinfo(0)+" -9999"; end; }Something like this maybe? I know some labels don't work inside functions like OnTimer I'm not sure if OnNPCKillEvent was the same way, so I just made it into an npc. I added a delay so that people can't just equipped it and unequipped it to try and spawn clones.100/5=20 1,20 is roughly 5% chance.
-
gonryun,156,122,5 script Broadcaster 901,{ mes "[ ^FE021BMerme^000000 ]"; mes "Hello, ^F509DE"+strcharinfo(0)+"^000000"; mes "Do you want to broadcast something? Payment is^FAEB60 1 Gold Coins^000000."; menu "Yes please.",-,"No",no; if((countitem(.payitem)<.payamt)) goto exit2; next; mes "[ ^FE021BMerme^000000 ]"; mes "We Have Color Please choose!"; for(set .@i,0; .@i<getarraysize(.colormenu$);set .@i,.@i+1){ set .@menu$,.@menu$+.colormenu$[.@i]+":"; } set .@menu$,.@menu$+"Cancel"; if(select(.@menu$)>getarraysize(.colormenu$)) goto no; next; mes "[ ^FE021BMerme^000000 ]"; mes "Type your message and it will be heard miles away!"; input .@message$; setarray .@a$,callfunc("str_explode","@explosion$[0]",.@message$," "); for(set .@a,0;.@a<getarraysize(@explosion$);set .@a,.@a+1){ for(set .@i,0;.@i<getarraysize(.bad_words$);set .@i,.@i+1){ if(compare(@explosion$[.@a],.bad_words$[.@i])) { while(getstrlen(@explosion$[.@a])>getstrlen(.@tmp$)){ set .@tmp$,.@tmp$+.filter$; } set @explosion$[.@a],.@tmp$; } } if(!.@a){ callfunc "str_toarray", @explosion$[.@a], "@tmp$[0]"; set @tmp$[0],callfunc("str_changecase", @tmp$[0], 1); set @explosion$[.@a],""; set .@i,0; while(getstrlen(@explosion$[.@a])<getarraysize(@tmp$)){ set @explosion$[.@a],@explosion$[.@a]+@tmp$[.@i]; set .@i,.@i+1; } } set .@message2$,.@message2$+" "+@explosion$[.@a]; } delitem .payitem,.payamt; announce ""+strcharinfo(0)+":"+.@message2$+" ",bc,"0x"+.hexcolors$[(@menu-1)]; close; no: next; mes "[ ^FE021BMerme^000000 ]"; mes "Oh that's a bummmer."; mes "Come back when you need me. ^_^"; close; exit2: next; mes "[ ^FE021BMerme^000000 ]"; mes "Sorry you don't have enough coins to make the broadcast."; mes "Please come again."; close; OnInit: setarray .colormenu$[0],"Red","Black","Blue","Green","Purple","Pink","Gray","Orange"; setarray .hexcolors$[0],"FF0000","000000","0000FF","00FF00","9900FF","FF33FF","888888","FF6600"; setarray .bad_words$[0],"tang ina mo", "gago", "tanga", "bobo", "mother fucker", "fuck you", "noob", "asshole", "putang ina mo", "puta", "bitch", "fuck", "fucker"; set .payitem,671; set .payamt,1; set .filter$,"*"; //Will be repeated to match the length of given string. } function script str_explode { if ( getarg(2,"") == "" ) return callfunc("str_toarray", getarg(1), getarg(0) ); sleep2 1; setarray .@char$, getarg(2), " ", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "e", "i", "a", "s", "r", "n", "t", "o", "u", "l", "c", "p", "m", "d", "v", "h", "g", "f", "b", "y", "q", "k", "z", "x", "j", "w", "_", "-", ".", ",", ";", "*"; set .@charsize, getarraysize(.@char$); set .@tmp$, "|~key~|"; set .@str$, .@tmp$ + getarg(1) ; set .@len, getstrlen(getarg(1)); set .@parse_len, getstrlen(getarg(2)); while( .@len > .@s ) { set .@i, 0 ; while( .@i < .@charsize ) { if ( ! ( set(.@l,.@l+1) % 600) ) sleep2 1; if ( compare( .@str$ , .@tmp$ + .@char$[.@i] ) ) { set .@tmp$, .@tmp$ + .@char$[.@i]; if ( .@i ) set .@arr$[.@p], .@arr$[.@p] + .@char$[.@i]; else { set .@p, .@p + 1; set .@s, .@s + .@parse_len-1 ; } break; } set .@i, .@i+1 ; } if ( .@i == .@charsize ) return 0; else set .@s, .@s+1 ; } deletearray getd(getarg(0)), 128; copyarray getd(getarg(0)), .@arr$, .@p+1; return .@p+1; } function script str_charat { sleep2 1; setarray .@char$[ 0 ], " ", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "e", "i", "a", "s", "r", "n", "t", "o", "u", "l", "c", "p", "m", "d", "v", "h", "g", "f", "b", "y", "q", "k", "z", "x", "j", "w", "_", "-", ".", ",", ";", "*"; set .@charsize, getarraysize(.@char$); set .@tmp$, "|~key~|"; set .@str$, .@tmp$ + getarg(0) ; set .@len, getstrlen(getarg(0)); set .@pos, getarg(1); if ( .@pos >= .@len ) return ""; while( .@len>.@s ) { set .@i,0; while( .@i<.@charsize ) { if ( ! ( set(.@l,.@l+1) % 650) ) sleep2 1; if ( compare( .@str$ , .@tmp$ + .@char$[.@i] ) ) { set .@tmp$, .@tmp$ + .@char$[.@i]; if ( .@s == .@pos ) return .@char$[.@i] ; else break; } set .@i, .@i+1; } if ( .@i == .@charsize ) return 0; else set .@s, .@s+1; } deletearray getd(getarg(1)); copyarray getd(getarg(1)), .@arr$, .@len; return ""; } function script str_changecase { sleep2 1; if ( getarg(1) ) { setarray .@char$[ 0 ], " ", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "E", "I", "A", "S", "R", "N", "T", "O", "U", "L", "C", "P", "M", "D", "V", "H", "G", "F", "B", "Y", "Q", "K", "Z", "X", "J", "W", "_", "-", ".", ",", ";", "*"; } else { setarray .@char$[ 0 ], " ", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "e", "i", "a", "s", "r", "n", "t", "o", "u", "l", "c", "p", "m", "d", "v", "h", "g", "f", "b", "y", "q", "k", "z", "x", "j", "w", "_", "-", ".", ",", ";", "*"; } set .@charsize, getarraysize(.@char$); set .@str$, "|~key~|" + getarg(0) ; set .@len, getstrlen(getarg(0)); while( .@len>.@s ) { set .@i,0; while( .@i<.@charsize ) { if ( ! ( set(.@l,.@l+1) % 650) ) sleep2 1; if ( compare( .@str$ , "|~key~|" + .@tmp$ + .@char$[.@i] ) ) { set .@tmp$, .@tmp$ + .@char$[.@i]; break; } set .@i, .@i+1; } if ( .@i == .@charsize ) return ""; else set .@s, .@s+1; } return .@tmp$; } function script str_toarray { sleep2 1; if ( getstrlen( getarg(0) ) > 128 ) return 0; setarray .@char$[ 0 ], " ", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "e", "i", "a", "s", "r", "n", "t", "o", "u", "l", "c", "p", "m", "d", "v", "h", "g", "f", "b", "y", "q", "k", "z", "x", "j", "w", "_", "-", ".", ",", ";", "*"; set .@charsize, getarraysize(.@char$); set .@tmp$, "|~key~|"; set .@str$, .@tmp$ + getarg(0) ; set .@len, getstrlen(getarg(0)); while( .@len>.@s ) { set .@i,0; while( .@i<.@charsize ) { if ( ! ( set(.@l,.@l+1) % 650) ) sleep2 1; if ( compare( .@str$ , .@tmp$ + .@char$[.@i] ) ) { set .@tmp$, .@tmp$ + .@char$[.@i]; set .@arr$[.@s], .@char$[.@i]; break; } set .@i, .@i+1; } if ( .@i == .@charsize ) return 0; else set .@s, .@s+1; } deletearray getd(getarg(1)); copyarray getd(getarg(1)), .@arr$, .@len; return .@len; } Works with eAthena etc etc.
-
I hadn't slept in 48 hours before posting that, but again I still agree with it. I come from America and when someone says "No offense" it's because that're about to say something extremely offensive, which transpires as condescendence. If you hadn't said anything in regards to my post and instead just posted your script I probably wouldn't've reacted as such. Anyways I'm done posting on this thread/section to help people, because I simply lack the time. If I see something that piques my interests I'll message you. Alternatively, if you have a small request they're always welcome in my inbox. Thanks~ Thanks for this, Gaddameit, really is a great scripter, and I'd like to give him credit for his work!
-
Firstly I'd like to clarify as I said I did not make the original file structure the BlackHoleEvent was made by a different scripter of unknown origin and later modified by me as my file states. Secondly, yes, the above script does use permanant global variables which it then DELETES! right after that player logsout. * I really get frusterated with mods feeling the need to 1UP everyone else here. Here's a hint Capuche there are hundereds of unanswered SCRIPT REQUESTs out there that I'm sure would love your scripting expertise how about you do one of those, and leave my posts alone. Thanks~
-
Requesting for When a MVP dead Respawn a treasure box
Skorm replied to hexor9's question in Script Requests
I replaced the 13 post with the version that I know is working on my server, because maybe the forums editor distorted my previous post. Make sure you aren't using both of these npcs at the same time that could be causeing errors. If it still doesn't work I feel there is nothing I can do, and perhaps it's just a misconfiguration on your part or maybe you're not reloading scripts or something of that nature. Good Luck For some reason the editor doesn't like %100 and replaced them with 0 :/ -
Requesting for When a MVP dead Respawn a treasure box
Skorm replied to hexor9's question in Script Requests
Change it to a really common npc just to test, because I'm not getting this error running the most updated version of rAthena. prt_fild08,0,0,0 duplicate(TreasureChest_dup) TreasureChest#1_mvp 100 abbey03,0,0,0 duplicate(TreasureChest_dup) TreasureChest#2_mvp 100 abyss_03,0,0,0 duplicate(TreasureChest_dup) TreasureChest#3_mvp 100 100 is non-3D sailor npc... If that doesn't work maybe it has something to do with the items you've set here. setarray .loot[0], 501,502,503,504,505,506; // Items that will be looted from the box. -
Requesting for When a MVP dead Respawn a treasure box
Skorm replied to hexor9's question in Script Requests
That's because I changed the sprite ID to a treasure chest you probably don't have that specific one. Find: 1350 Replace it with: http://ratemyserver.net/index.php?mob_name=treasure&page=mob_db&f=1&mob_search=Search&page_num=4 One of those that works for you in your server when you do @disguise. If you keep erroring you might want to change it to a non-3D mob I've noticed myself in RO, on multiple occasions, if you're loading a map and the 3D mob is in one of the first 24 squares you load it will cause error even if you have the files. :/ -
Requesting for When a MVP dead Respawn a treasure box
Skorm replied to hexor9's question in Script Requests
Somehow a random Zero snuck in there... I've removed it... Probably a typo when I was posting. -
I can, but I really don't have time for it right now. Maybe it'll be my next project. Still open to others though.
-
I'm not sure what you mean OnNPCKillEvent is triggered when a "monster" is killed. Killerrid and Killedrid are set. If you want something that's triggered when a player is killed use. OnPCKillEvent:
-
Requesting for When a MVP dead Respawn a treasure box
Skorm replied to hexor9's question in Script Requests
Hmm weird there doesn't appear to be anything wrong with that line. 6 one side and 6 on the other... Unless you changed something? Anyways I'm going to see if I can't work on your request now. Edit: I think this is what you wanted. function script timeleft__ { set .@left, getarg(0); if ( .@left <= 0 ) return getarg(0); set .@day, .@left / 86400; set .@hour, .@left % 86400 / 3600; set .@min, .@left % 3600 / 60; set .@sec, .@left % 60; return ( ( .@day )?.@day +" day ":"" )+( ( .@day || .@hour )?.@hour +" hour ":"" )+( ( .@day == 0 && ( .@hour || .@min ) )?.@min +" min ":"" )+( ( .@day || .@hour )?"":.@sec +" sec" ); } - script TreasureChest_dup -1,{ end; Oncmvpdead: getmapxy .map$, .x, .y, 0; set .a,0; set .b,0; set .id,atoi(strnpcinfo(2)); if(getmobdrops(.mvpid[.id])) { for( set .@i,0; .@i < getarraysize(.loot); set .@i,.@i +1 ) { if((.lrates[.@i]/100)>100){ set .drops[.@b],.loot[.@i]; set .droprs[.@b],(.lrates[.@i]/100); set .@b,.@b+1; } else if(.lrates[.@i]>99){ if(!rand((100/(.lrates[.@i]/100))-1)){ set .drops[.@b],.loot[.@i]; set .droprs[.@b],(.lrates[.@i]/100); set .@b,.@b+1; } } else if(.lrates[.@i]<99){ if(!(rand((100/(.lrates[.@i]%100))*100)-1)){ set .drops[.@b],.loot[.@i]; set .droprs[.@b],(.lrates[.@i]/100); set .@b,.@b+1; } } } } else { end; } if(strcharinfo(1)==""){ goto Alone; } deletearray $@partymemberaid[0],128; getpartymember getcharid(1),1; getpartymember getcharid(1),2; set .@count, $@partymembercount; set .count,0; copyarray .@party[0],$@partymemberaid[0],.@count; copyarray .@cparty[0],$@partymembercid[0],.@count; for( set .@i,0; .@i < .@count; set .@i,.@i +1 ) { getmapxy(.@map$,.@x,.@y,0,rid2name(.@party[.@i])); if(.@map$==strcharinfo(3)) set .@p,.@p+1; } if(.@p<2){ goto Alone; } for ( set .@i, 0; .@i < .@count; set .@i, .@i +1 ){ if(isloggedin(.@party[.@i],.@cparty[.@i])){ set .party[.count],.@party[.@i]; set .count, .count +1 ; } } if(.count<2) { goto Alone; } movenpc strnpcinfo(0), .x, .y; restart: setnpctimer 0; attachnpctimer(strcharinfo(0)); startnpctimer; set .loop, .tlimit; while ( .loop ) { delwaitingroom strnpcinfo(0); waitingroom callfunc("timeleft__", .loop ), 0; set .loop, .loop -1; sleep2 1000; } if(.a<.count){ set .a,.a+1; npctalk strcharinfo(0)+" has taken to long!"; getmapxy .@map$, .@x, .@y, 0; warp .@map$,.@x,.@y; while(.b<getarraysize(.drops)){ setd ".partyroll"+.b+"["+.a+"]",0; set .b,.b+1; } goto restart; } end; OnTimer1: while(.a<.count){ detachrid; attachrid(.party[.a]); set .b,0; while(.b<getarraysize(.drops)){ if((playerattached())&&strcharinfo(3)==.map$) { L_lo: if(.droprs[.b]>.ratelimit&&.ratelimit>0) { setd ".partyroll"+.b+"["+.a+"]",0; } else { select("============(^0000FF"+getitemname(.drops[.b])+"^000000)===============:-Roll:-Pass"); if(!((@menu)-1)||@menu>3) goto L_lo; if(@menu==2){ setd ".partyroll"+.b+"["+.a+"]",rand(100); npctalk strcharinfo(0)+" rolled a ["+getd(".partyroll"+.b+"["+.a+"]")+"] on "+getitemname(.drops[.b])+"."; dispbottom "You rolled a ["+getd(".partyroll"+.b+"["+.a+"]")+"] on "+getitemname(.drops[.b])+"."; } else { setd ".partyroll"+.b+"["+.a+"]",0; npctalk strcharinfo(0)+" passed a on "+getitemname(.drops[.b])+"."; dispbottom "You passed a on "+getitemname(.drops[.b])+"."; } } set .loop, 60; } set .b,.b+1; } set .a,.a+1; } //Find Highest Bawler. for (set .@i,0; .@i < getarraysize(.party); set .@i,.@i+1){ for(set .@s,0; .@s < getarraysize(.drops); set .@s,.@s+1){ if(getd(".partyroll"+.@s+"["+.@i+"]")>getd(".wpartyroll"+.@s)) { setd ".wpartyroll"+.@s,getd(".partyroll"+.@s+"["+.@i+"]"); setd ".wrid"+.@s,.party[.@i]; } } } //Distribute Prize. for(set .@s,0; .@s < getarraysize(.drops); set .@s,.@s+1){ detachrid; attachrid(getd(".wrid"+.@s)); if(getd(".wpartyroll"+.@s)){ npctalk strcharinfo(0)+" won ["+getitemname(.drops[.@s])+"]."; getitem .drops[.@s],1; } else { makeitem .drops[.@s],1,.map$,.x,.y; } } //Warp everyone so they aren't stuck anymore. for (set .@i,0; .@i < getarraysize(.party); set .@i,.@i+1){ detachrid; attachrid(.party[.@i]); getmapxy .@map$, .@x, .@y, 0; warp .@map$,.@x,.@y; } stopnpctimer; delwaitingroom strnpcinfo(0); movenpc strnpcinfo(0), 0,0; end; Alone: for(set .@s,0; .@s < getarraysize(.drops); set .@s,.@s+1){ getitem .drops[.@s],1; } delwaitingroom strnpcinfo(0); movenpc strnpcinfo(0), 0,0; end; OnInit: if ( strnpcinfo(2) == "" ) { //=-=-=-=-=-=Configuration=-=-=-=-=-=-= setarray .mvpid[1], 1871,1872,1719; // Custom Mob IDs here. setarray .loot[0], 501,502,503,504,505,506; // Items that will be looted from the box. setarray .lrates[0], 1,10000,50,600,700,100; // Rate that item will be dropped by chest. 10000 = 100% / 1 = 0.01% set .tlimit,60; // In seconds set .ratelimit,0; // Ignores roll on loot with rates higher then this value. 0 = off //=-=-=-=-=-=-=Skorm=-=-=-=-=-=-=-=-=-= } //setmapflag strnpcinfo(4),mf_nomvploot; // Enable if mob has loot by default. If monster summoned with boss_monster this will disable the drops. end; } prt_fild08,175,352,1,1 boss_monster Metaling 1613,1,1,1,"TreasureChest#1_mvp::Oncmvpdead" prt_fild08,0,0,0 duplicate(TreasureChest_dup) TreasureChest#1_mvp 100 abbey03,0,0,0 duplicate(TreasureChest_dup) TreasureChest#2_mvp 100 abyss_03,0,0,0 duplicate(TreasureChest_dup) TreasureChest#3_mvp 100 -
Because you didn't tell me what the bug was? I have been unable to find any bugs. Ugh Yeah I see the problem Thank you for helping me... I beleive it's fixed now
-
Example adding it to items. 2201,Sunglasses,Sunglasses,5,5000,,100,,0,,0,0xFFFFFFFF,7,2,512,,0,0,12,{ callfunc "players2minimap"; },{},{}Functions:function script players2minimap { While((playerattached()?IsEquipped(.itemid):0)){ getmapxy(.@N$,.@B,.@C,0); while((playerattached()?.@V<($PlayerNumber<=0?.@V+1:$PlayerNumber):0)){ set .@V,.@V+1; if(isloggedin(getd("$RecordAID"+.@V))) getmapxy(.@map$,.@x[.@V],.@y[.@V],0,rid2name(getd("$RecordAID"+.@V))); if( .@N$ == .@map$ && getd("$RecordAID"+.@V) != getcharid(3) && isloggedin(getd("$RecordAID"+.@V))){ viewpoint 1,.@x[.@V],.@y[.@V],.@V,0xFF0000; } if(.@V>=$PlayerNumber){ sleep2 1+.delay; for(set .@i,1;.@i<=$PlayerNumber;set .@i,.@i+1) viewpoint 2,.@x[.@i],.@y[.@i],.@i,0xFF0000; } } if(playerattached()){ set .@V,0; } else { break; } } end; OnInit: //=-=-=-=-=Configuration=-=-=-=-=-= set .delay,0; // Delay between refresh in Milliseconds. Default is one Millisecond. set .itemid,2201; // ID of item being used. //You can change the color of the markers //By searching for "FF0000" and replacing //It with a Hexidecimal number. //=-=-=-=-=-=-=Skorm=-=-=-=-=-=-=-= //Credits to goddameit for //file architecture and BlackHoleEvent. //Special thanks to joelolopez for //The idea, and testing. <3 } - script BlackHoleEvent -1,{ OnPCLoginEvent: setd "$RecordAID"+set($PlayerNumber,$PlayerNumber+1),getcharid(3); end; OnInit: OnTimer1000: initnpctimer; OnPCLogoutEvent: for(set .@i,1;.@i<=$PlayerNumber;set .@i,.@i+1) { if(!isloggedin(getd("$RecordAID"+.@i))) { set $PlayerNumber,$PlayerNumber-1; setd "$RecordAID"+.@i,getd("$RecordAID"+(.@i+1)); setd "$RecordAID"+(.@i+1),0; set .@i,.@i-1; } } end; }Tested small update to make sure the script fully runs after unequipped. Fully working done!
-
It's the way blackhole stores the variables... sec sec From what I can tell it's working now, but you seem to be able to find bugs that I otherwise wouldn't. Lol See this post http://rathena.org/board/topic/80727-detect-users-within-the-map/?p=190265