Jump to content

Kurofly

Members
  • Posts

    283
  • Joined

  • Last visited

  • Days Won

    2

Kurofly last won the day on June 13 2015

Kurofly had the most liked content!

4 Followers

Profile Information

  • Gender
    Male
  • Location
    France
  • Server
    none
  • Interests
    you <3

Recent Profile Visitors

3768 profile views

Kurofly's Achievements

Poring

Poring (1/15)

  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

31

Reputation

25

Community Answers

  1. Welcome, good luck in your future projects If you need help for anything, you know where to ask
  2. Oops, gave you the wong version ^^ pal_dun01,70,336,4 script Realm Defender 54,{ function ItemLink ; function PrintMes ; function SetColor ; function EraseRQuest; .@name$ = "[^990000"+strnpcinfo(0)+"^000000]"; if (!$RQ_PartyId || $RQ_PartyId != getcharid(1)) { // no party doing the quest or player not in it .@loop = 1; while (.@loop) { // used to loop the menu whithout goto commands (in case the player wants to see the details of the quest, he'll be brought back here after) // quest availability mes .@name$,"Quest status : "+((gettimetick(2)<$RQ_ResetTime || $RQ_PartyId)?"^ff0000unavailable":"^00ff00available")+"^000000"; if ($RQ_PartyId) mes "Party ^cc3300"+getpartyname($RQ_PartyId)+"^000000 is currently doing the quest"; // $RQ_PartyId var is set to the id of the party doing the quest, $RQ_PartyId != 0 => party doing the quest else if ((.@delay = $RQ_ResetTime-gettimetick(2)) > 0) { // display time left ($RQ_ResetTime is set to gettimetick(2) + .questdelay upon completion of part 2) .@hours = .@delay / (60*60) ; .@min = (.@delay - (.@hours*60*60)) / 60 ; .@sec = .@delay - (.@hours*60*60) - (.@min*60); if (.@hours) mes "Delay : "+.@hours+" hour"+(.@hours>1?"s":"")+" "+.@min+" minute"+(.@min>1?"s":"")+" "+.@sec+" second"+(.@sec>1?"s":""); else if (.@min) mes "Delay : "+.@min+" minute"+(.@min>1?"s":"")+" "+.@sec+" second"+(.@sec>1?"s":""); else mes "Delay : "+.@sec+" second"+(.@sec>1?"s":""); } // rewards infos mes "Reward"+(((getarraysize(.rewards)>2)+(.ZenyReward?1:0))?"s :":" :"); for (.@i = 0 ; .@i < getarraysize(.rewards) ; .@i+=2) mes " ~ "+.rewards[.@i+1]+" "+ItemLink(.rewards[.@i]); if (.ZenyReward) mes " ~ ^ffcc00"+.ZenyReward+"^000000 zeny"; mes "Party leader reward"+(((getarraysize(.PartyLeaderBonusRewards)>2)+(.PartyLeaderBonusZenyReward?1:0))?"s":"")+" (added to the one"+(((getarraysize(.rewards)>2)+(.ZenyReward?1:0))?"s":"")+" above) :"; for (.@j = 0 ; .@j < getarraysize(.PartyLeaderBonusRewards) ; .@j+=2) mes " ~ "+.PartyLeaderBonusRewards[.@j+1]+" "+ItemLink(.PartyLeaderBonusRewards[.@j]); if (.PartyLeaderBonusZenyReward) mes " ~ ^ffcc00"+.PartyLeaderBonusZenyReward+"^000000 zeny"; // requirements mes "Requirements :"; getpartymember getcharid(1),1 ; getpartymember getcharid(1),2 ; .@n = 0; for (.@k = 0 ; .@k < $@partymembercount ; .@k++) if (isloggedin($@partymemberaid[.@k],$@partymembercid[.@k])) if ((.@x = getvar(BaseLevel,$@partymembercid[.@k])) >= .MinLevel) .@n++; // party member logged and has the required level mes " - "+(.@n<.PlayersRequired?"^ff0000":"^00ff00")+"Party of at least "+.PlayersRequired+" level "+.MinLevel+" member"+(.PlayersRequired>1?"s":"")+"^000000"; mes " - "+(getpartyleader(getcharid(1),1) == getcharid(3)?"^00ff00":"^ff0000")+"You need to be the party leader^000000"; .@can = 1; if (.@delay > 0 || .@n < .PlayersRequired || getpartyleader(getcharid(1),1) != getcharid(3)) { // quest delay, not enough valid members or player isn't the party leader .@can = 0; // shorter way to check all the requirements above if (select("View details:Leave") == 2) close; next; PrintMes(1,strnpcinfo(0)); // you can edit the dialogues in this function at the bottom of the script, I bet it'll be easier for you if (select("Go back to menu:Leave") == 2) close; } if (.@can) { next; if ((.@select = select("Proceed:View details:Leave")) == 3) close; if (.@select == 2) { PrintMes(1,strnpcinfo(0)); // you can edit the dialogues in this function at the bottom of the script, I bet it'll be easier for you if (select("Go back to menu:Leave") == 2) close; } if (.@select == 1) .@loop = 0; // selected proceed, loop break } } // quest proceeding if ($RQ_PartyId) { mes .@name$,"Arg, someone accepted the quest before you ><" ; close; } // in case someone accepts the quest while the player is in the menu getpartymember getcharid(1),1 ; getpartymember getcharid(1),2 ; .@n = 0 ; deletearray .PartyAnnounceMember,128; for (.@k = 0 ; .@k < $@partymembercount ; .@k++) if (isloggedin($@partymemberaid[.@k],$@partymembercid[.@k])) if ((.@x = getvar(BaseLevel,$@partymembercid[.@k])) >= .MinLevel) { .@n++ ; setarray .PartyAnnounceMember[getarraysize(.PartyAnnounceMember)] , $@partymemberaid[.@k]; } // keeps a trace of the players who will have to receive the first announces if (.@n < .PlayersRequired) { mes .@name$,"Arg, someone disconnected and you don't have enough valid members anymore ><" ; close; } // in case a valid member disconnects meanwhile $RQ_PartyId = getcharid(1) ; initnpctimer; for (; .@l < getarraysize(.MobsPart1) ; .@l+=2) setd "$RQ_PartyMob"+.MobsPart1[.@l]+"count" , 0; // resets monster kill counters announce "Party '"+getpartyname(getcharid(1))+"' accepted the "+strnpcinfo(0)+" quest, wish them good luck!",bc_all,.AnnounceColor; close2; sleep 5000; for (.@i = 0 ; .@i < getarraysize(.PartyAnnounceMember) ; .@i++) // broadcasts to every valid party member (since there's actually no partyannounce command) if (attachrid(.PartyAnnounceMember[.@i])) announce "["+strnpcinfo(0)+" Quest] : You sucessfully accepted the "+strnpcinfo(0)+" quest",bc_self,.AnnounceColor; sleep 5000; .@str$ = ""+.MobsPart1[1]+" "+strmobinfo(1,.MobsPart1); // this part .. for (.@m = 2 ; .@m < (getarraysize(.MobsPart1)-2) ; .@m+=2) .@str$ = .@str$ + ", "+.MobsPart1[.@m+1]+" "+strmobinfo(1,.MobsPart1[.@m]); .@str$ = .@str$ + " and "+.MobsPart1[.@m+1]+" "+strmobinfo(1,.MobsPart1[.@m]); // .. is used to fill all the monster-to-kill infos in one string so that we don't send multiple announces for (.@i = 0 ; .@i < getarraysize(.PartyAnnounceMember) ; .@i++) if (attachrid(.PartyAnnounceMember[.@i])) announce "["+strnpcinfo(0)+" Quest info] : You need to kill "+.@str$+" in order to complete the first part of the quest",bc_self,.AnnounceColor; sleep 5000; for (.@i = 0 ; .@i < getarraysize(.PartyAnnounceMember) ; .@i++) if (attachrid(.PartyAnnounceMember[.@i])) announce "["+strnpcinfo(0)+" Quest info] : Remember the party leader can abandon the quest any time by typing '@stopquest'!",bc_self,.AnnounceColor; end; } else if (!$RQ_Part1Complete || !$RQ_Part1Talked) { // part 1 incomplete or not proceeded // quest infos for (; .@i < getarraysize(.MobsPart1) ; .@i+=2) { .@amount = .@amount + getd("$RQ_PartyMob"+.MobsPart1[.@i]+"count") ; .@total = .@total + .MobsPart1[.@i+1]; } mes .@name$,"Quest status : [^0000ff"+(100*.@amount/.@total)+"% done^000000]"; for (; .@j < getarraysize(.MobsPart1) ; .@j+=2) mes " ~ "+SetColor("kill "+.MobsPart1[.@j+1]+" "+strmobinfo(1,.MobsPart1[.@j]),getd("$RQ_PartyMob"+.MobsPart1[.@j]+"count"),.MobsPart1[.@j+1]); // the 'SetColor' function adds a green and red color depending on the amount of mobs killed (ex: if you killed half of the monsters needed, half of the text will be in green and half in red) //the $RQ_Part1Complete variable is set to 1 in the OnNPCKillEvent label when all the monsters required are killed if (!$RQ_Part1Complete || getpartyleader($RQ_PartyId,1) != getcharid(3)) close; // player can't proceed if the quest is not completed or he's not the party leader next; if (select("Proceed:Leave") == 2) close; PrintMes(2,.@name$); // you can edit the dialogues in this function at the bottom of the script, I bet it'll be easier for you if (select("Go for part 2!:Not yet") == 2) close; // quest proceeding close2; $RQ_Part1Talked = 1; for (.@i = 0 ; .@i < getarraysize(.MobsPart1) ; .@i+=2) setd "$RQ_Part1Mob"+.MobsPart1[.@i]+"count" , 0; getpartymember getcharid(1),1 ; deletearray .PartyMember,128; for (; .@k < $@partymembercount ; .@k++) // gets valid players again in case someone was added to the party (it does not restrain players from warping if they don't have enough valid members because that'd be a pain for them after having done the first part..) if (attachrid($@partymemberaid[.@k])) if (BaseLevel >= .MinLevel) { setarray .PartyMember[getarraysize(.PartyMember)] , $@partymemberaid[.@k] ; announce "["+strnpcinfo(0)+" Quest] : You will be warped in 5 seconds..",bc_self,.AnnounceColor; } sleep 3000; for (; .@l < getarraysize(.PartyMember) ; .@l++) // broadcasts to every valid party member if (attachrid(.PartyMember[.@l])) { announce "["+strnpcinfo(0)+" Quest] : I wish you a good luck!",bc_self,.AnnounceColor; for (.@k = 0 ; .@k < getarraysize(.HelpItems) ; .@k+=2) getitem .HelpItems[.@k],HelpItems[.@k+1]; } sleep 2000; for (; .@m < getarraysize(.PartyMember) ; .@m++) // warps valid players to quest map if (attachrid(.PartyMember[.@m])) warp .questmap$,.x,.y; for (.@i = 0 ; .@i < getarraysize(.MobsPart2) ; .@i+=2) { // spawns part 2 monsters deletearray $@mobid,128; monster .questmap$,0,0,.MobsPart2Name$[.@i/2],.MobsPart2[.@i],.MobsPart2[.@i+1],strnpcinfo(0)+"::OnMobKilled"; for (.@j = 0 ; .@j < getarraysize($@mobid) ; .@j++) { // keeps a trace of monster spawned infos, this way we'll be able to spawn them back on reloadscript (they're being spawned back with the amount of HP they had before the reload) setd "$RQ_Part2Mob"+$RQ_Part2Mob+"GID" , $@mobid[.@j]; setd "$RQ_Part2Mob"+$RQ_Part2Mob+"ID" , .MobsPart2[.@i]; setd "$RQ_Part2Mob"+$RQ_Part2Mob+"Name$" , .MobsPart2Name$[.@i/2]; setd "$RQ_Part2Mob"+$RQ_Part2Mob+"HP" , strmobinfo(4,.MobsPart2[.@i]); $RQ_Part2Mob++; // used in the OnMobKilled label $RQ_Part2TotalMobs++; // used on reloadscript } } end; } else if ($RQ_Part1Talked) { // part 2 proceeded (means either player died in part 2, warped out or was added to the party meanwhile) if (BaseLevel < .MinLevel) { mes .@name$,"You must be at least level "+.MinLevel+" to join the quest.." ; close; } mes .@name$,"Don't give up "+strcharinfo(0)+", I know you can make it!" ; next; if (select("go to "+.questmap$+":Leave") == 2) close; warp .questmap$,.x,.y; end; } else { // not supposed to happen, I just don't wanted to put an 'else' at the last part cause if it does happen it would warp the player to pal_dun02 mes .@name$,"O_O ??"," ","Sorry but this part of the script is not supposed to trigger, could you contact your administrator please? ><"; close; } OnNPCKillEvent: // checks whether the part 1 quest is completed (also display infos) if (getcharid(1) == $RQ_PartyId && !$RQ_Part1Complete) { for (; .@i < getarraysize(.MobsPart1) ; .@i+=2) if (.MobsPart1[.@i] == killedrid && getd("$RQ_PartyMob"+killedrid+"count") < .MobsPart1[.@i+1]) { setd "$RQ_PartyMob"+killedrid+"count" , getd("$RQ_PartyMob"+killedrid+"count") + 1; getpartymember getcharid(1),1; for (.@j = 0 ; .@j < $@partymembercount ; .@j++) // broadcasts to every valid party member in the map if (attachrid($@partymemberaid[.@j])) if (strcharinfo(3) == .map$ && BaseLevel >= .MinLevel) announce "["+strnpcinfo(0)+" Quest] : "+getd("$RQ_PartyMob"+.MobsPart1[.@i]+"count")+"/"+.MobsPart1[.@i+1]+" "+strmobinfo(1,killedrid)+" killed",bc_self,.AnnounceColor; for (.@k = 0 ; .@k < getarraysize(.MobsPart1) ; .@k+=2) if (getd("$RQ_PartyMob"+.MobsPart1[.@k]+"count") < .MobsPart1[.@k+1]) { .@ko = 1 ; break; } if (!.@ko) { announce "Party '"+getpartyname(getcharid(1))+"' has finished the first part of the "+strnpcinfo(0)+" quest!",bc_all,.AnnounceColor ; $RQ_Part1Complete = 1; } } } end; OnMobKilled: // checks whether the part 2 quest is completed (also display infos) $RQ_Part2Mob--; getpartymember getcharid(1),2; for (; .@i < $@partymembercount ; .@i++)// broadcasts to every valid party member if (attachrid($@partymemberaid[.@i])) if (BaseLevel >= .MinLevel) { if ($RQ_Part2Mob > 1) announce "["+strnpcinfo(0)+" Quest] : "+$RQ_Part2Mob+" Keepers left, keep going!",bc_self,.AnnounceColor; else if ($RQ_Part2Mob) announce "["+strnpcinfo(0)+" Quest] : only one Keeper left, you've almost done it!",bc_self,.AnnounceColor; else { // quest completed, giving rewards announce "["+strnpcinfo(0)+" Quest] : "+strnpcinfo(0)+" quest completed, congratulations! Here are your rewards!",bc_self,.AnnounceColor; for (.@j = 0; .@j < getarraysize(.rewards) ; .@j+=2) getitem .rewards[.@j],.rewards[.@j+1]; Zeny += .ZenyReward; if (getpartyleader($RQ_PartyId,1) == $@partymemberaid[.@i]) { // party leader bonus rewards for (; .@k < getarraysize(.PartyLeaderBonusRewards) ; .@k+=2) getitem .PartyLeaderBonusRewards[.@k],.PartyLeaderBonusRewards[.@k+1]; Zeny += .PartyLeaderBonusZenyReward; } } } if (!$RQ_Part2Mob) { // quest completed, reseting variables & setting delay sleep 3000 ; announce "Party '"+getpartyname($RQ_PartyId)+"' has helped keeping the Realms safe by completing the "+strnpcinfo(0)+" quest! Congratulations!",bc_all,.AnnounceColor ; sleep 3000; $RQ_PartyId = 0 ; $RQ_Part1Complete = 0 ; $RQ_Part1Talked = 0 ; $RQ_Part2TotalMobs = 0; $RQ_ResetTime = gettimetick(2) + .questdelay; stopnpctimer; .@hours = .questdelay / (60*60) ; .@min = (.questdelay - (.@hours*60*60)) / 60 ; .@sec = .questdelay - (.@hours*60*60) - (.@min*60); if (.@hours) announce "The "+strnpcinfo(0)+" quest will be available again in "+.@hours+" hour"+(.@hours>1?"s":"")+(.@min?" "+.@min+" minute"+(.@min>1?"s":""):"")+(.@sec?" "+.@sec+" second"+(.@sec>1?"s":""):""),bc_all,.AnnounceColor; else if (.@min) announce "The "+strnpcinfo(0)+" quest will be available again in "+.@min+" minute"+(.@min>1?"s":"")+(.@sec?" "+.@sec+" second"+(.@sec>1?"s":""):""),bc_all,.AnnounceColor; else announce "The "+strnpcinfo(0)+" quest will be available again in "+.@sec+" second"+(.@sec>1?"s":""),bc_all,.AnnounceColor; } end; OnTimer5000: if (!$RQ_PartyId) end; getpartymember $RQ_PartyId,2; if (!$@partymembercount) { // party deleted announce "["+strnpcinfo(0)+" Quest Info] : Party '"+getpartyname($RQ_PartyId)+"' has been deleted and the quest has been erased!",bc_all,.AnnounceColor; EraseRQuest(); } .InactiveTime+=5; if (!$RQ_Part1Talked) { // part 1 inactivity check for (; .@i < getarraysize(.MobsPart1) ; .@i++) { if (getd("$RQ_PartyMob"+.MobsPart1[.@i]+"count") != getd(".PreviousCount"+.@i)) .InactiveTime = 0; setd ".PreviousCount"+.@i , getd("$RQ_PartyMob"+.MobsPart1[.@i]+"count"); } } else { // part 2 inactivity check (+ checking when loading map with the 'OnPCLoadMapEvent' label below) addrid(0); if (.questmap$ == strcharinfo(3) && $RQ_PartyId == getcharid(1)) .InactiveTime = 0; detachrid; } if (.InactiveTime == 300) { // shows warning after being inactive for 5 minutes getpartymember $RQ_PartyId,2; for (.@i = 0 ; .@i < $@partymembercount ; .@i++) if (attachrid($@partymemberaid[.@i])) if (BaseLevel >= .MinLevel) announce "["+strnpcinfo(0)+" Quest Info] : Your party has been inactive for 5 minutes.",bc_self,.AnnounceColor; sleep 3000; for (.@i = 0 ; .@i < $@partymembercount ; .@i++) if (attachrid($@partymemberaid[.@i])) if (BaseLevel >= .MinLevel) announce "["+strnpcinfo(0)+" Quest Info] : If your are still inactive after 5 more minutes, the quest will be erased.",bc_self,.AnnounceColor; sleep 3000; for (.@i = 0 ; .@i < $@partymembercount ; .@i++) if (attachrid($@partymemberaid[.@i])) if (BaseLevel >= .MinLevel) announce "["+strnpcinfo(0)+" Quest Info] : Remember the party leader can type '@stopquest' to abandon the quest.",bc_self,.AnnounceColor; } if (.InactiveTime >= 600) { // erases quest after being inactive for 10 minutes announce "["+strnpcinfo(0)+" Quest Info] : Party '"+getpartyname($RQ_PartyId)+"' has been inactive for 10 minutes and the quest has been erased!",bc_all,.AnnounceColor; EraseRQuest(); } for (.@i = 0 ; .@i < $RQ_Part2TotalMobs ; .@i++) // update part 2 monsters HP in case of a reloadscript if (getd("$RQ_Part2Mob"+.@i+"HP")) { // just to avoid getting warnings every 5 seconds deletearray .@data,128; getunitdata getd("$RQ_Part2Mob"+.@i+"GID"),.@data; // it will return a warning if it can't find the mob, don't worry that's normal (even though that's boring..) setd "$RQ_Part2Mob"+.@i+"HP" , .@data[UMOB_HP]; if (!.@data[UMOB_HP]) { setd "$RQ_Part2Mob"+.@i+"GID" , 0 ; setd "$RQ_Part2Mob"+.@i+"ID" , 0 ; setd "$RQ_Part2Mob"+.@i+"Name$" , ""; } } if ($RQ_PartyId) initnpctimer; end; OnPCLogoutEvent: if (getpartyleader($RQ_PartyId,1) == getcharid(3)) { announce "["+strnpcinfo(0)+" Quest Info] : Party leader of party '"+getpartyname($RQ_PartyId)+"' has logged out!",bc_all,.AnnounceColor; EraseRQuest(); } end; OnStopQuest: if ($RQ_PartyId != getcharid(1)) end; if (getpartyleader($RQ_PartyId,1) != getcharid(3)) { dispbottom "["+strnpcinfo(0)+" Quest Info] : Only the part leader can decide to stop the quest." ; end; } announce "["+strnpcinfo(0)+" Quest Info] : Party leader of party '"+getpartyname($RQ_PartyId)+"' has abandonned the quest!",bc_all,.AnnounceColor; EraseRQuest(); end; OnInterIfInitOnce: // deletes all quest data upon map server connection query_sql("SELECT `varname` FROM `mapreg` WHERE SUBSTR(`varname`,1,4) = '$RQ_'",.@data$); for (; .@d < getarraysize(.@data$) ; .@d++) { if (charat(.@data$[.@d],getstrlen(.@data$[.@d])-1) != "$") setd .@data$[.@d] , 0; else setd .@data$[.@d] , ""; } end; OnInit: .map$ = strnpcinfo(4); // if your npc is on a different map than the mobs in part 1, change '.map$' to the map those monsters are .questmap$ = "pal_dun02" ; .x = 49 ; .y = 6; // map, x and y where the players are warped on part 2 quest, also the map in which the part 2 monsters are spawned .PlayersRequired = 2; // amount of players required to begin the quest .MinLevel = 150; // minimum level required for each player in the party in order to do the quest .questdelay = 2*60*60; // delay (s) before any party is allowed to do the quest again setarray .MobsPart1 , 1401,80 , 2019,20; // mobs to kill in part 1 // setarray .MobsPart1 , <mob id>,<amount>{ , <mob id>,<amount>{ , <mob id>,<amount>{..}}}; setarray .MobsPart2 , 1708,1 , 1039,1 , 1917,1; // mobs to kill in part 2 // setarray .MobsPart2 , <mob id>,<amount>{ , <mob id>,<amount>{ , <mob id>,<amount>{..}}}; setarray .MobsPart2Name$ , "Azthor" , "Othar" , "Kalnor"; // mob names in part 2 (don't put too long names or they won't be fully displayed) // setarray .MobsPart2Name$ , <mob 1 name>{ , <mob 2 name>,{ , <mob i3 name>{..}}}; setarray .rewards , 7227,50; // rewards for every player in the party // setarray .rewards , <item id>,<amount>{ , <item id>,<amount>{ , <item id>,<amount>{..}}}; .ZenyReward = 0; // zeny reward for every player in the party setarray .PartyLeaderBonusRewards , 7227,50 , 512,1; // party leader bonus rewards (added to those above) // setarray .PartyLeaderBonusRewards , <item id>,<amount>{ , <item id>,<amount>{ , <item id>,<amount>{..}}}; .PartyLeaderBonusZenyReward = 0; // party leader zeny bonus reward (added to the amount above) setarray .HelpItems , 608,10; // items given to players to help them in part 2 // setarray .HelpItems , <item id>,<amount>{ , <item id>,<amount>{ , <item id>,<amount>{..}}}; .AnnounceColor = 0x00ff00; // color of announces relative to the quest setmapflag .map$,mf_loadevent; // used for showing quest availability on the map setmapflag .questmap$,mf_loadevent; // used to check players inactivity in part 2 setmapflag .questmap$,mf_nowarp; setmapflag .questmap$,mf_nogo; setmapflag .questmap$,mf_noteleport; // not sure you want that one though (disables fly wings) setmapflag .questmap$,mf_nomemo; bindatcmd "stopquest",strnpcinfo(0)+"::OnStopQuest"; initnpctimer; $RQ_Part2Mob = 0; for (; .@i < $RQ_Part2TotalMobs ; .@i++) // respawn part 2 monsters if any left to kill if (getd("$RQ_Part2Mob"+.@i+"HP")) { // mob not dead on reload $RQ_Part2Mob++; // in case a monster died and a reloadscript occured before the 5 seconds delay (the monster is respawned and so the amount of mob needs to be edited) monster .questmap$,0,0,getd("$RQ_Part2Mob"+.@i+"Name$"),getd("$RQ_Part2Mob"+.@i+"ID"),1,strnpcinfo(0)+"::OnMobKilled"; setd "$RQ_Part2Mob"+.@i+"GID" , $@mobid; setunitdata $@mobid,UMOB_HP,getd("$RQ_Part2Mob"+.@i+"HP"); // respawn with previous HP initnpctimer; } addrid(1); OnPCLoadMapEvent: if (strcharinfo(3) == .map$ && !$RQ_PartyId) { // shows players who have met the requirements a quest icon on the minimap and above the npc (only party leaders) if (getpartyleader(getcharid(1),1) == getcharid(3)) { getpartymember getcharid(1),1 ; getpartymember getcharid(1),2; for (; .@i < $@partymembercount ; .@i++) if (isloggedin($@partymemberaid[.@i],$@partymembercid[.@i])) if ((.@x = getvar(BaseLevel,$@partymembercid[.@i])) >= .MinLevel) .@n++; if (.@n >= .PlayersRequired) showevent QTYPE_QUEST,2; } } if (strcharinfo(3) == .questmap$ && getcharid(1) == $RQ_PartyId) .InactiveTime = 0; end; function ItemLink { if (0) // turn to 1 to enable item link return "<ITEMLINK>"+getitemname(getarg(0))+"<INFO>"+getarg(0)+"</INFO></ITEMLINK>"; else return "^0099ff"+getitemname(getarg(0))+"^000000"; } function SetColor { // Setcolor("<message>",<amount>,<amount to 100%>); .@pos = getstrlen(getarg(0))*getarg(1)/getarg(2); return "^00ff00"+substr(getarg(0),0,.@pos-1)+"^000000^ff0000"+substr(getarg(0),.@pos,getstrlen(getarg(0))-1)+"^000000"; } function EraseRQuest { // EraseRQuest(); killmonster .questmap$,strnpcinfo(0)+"::OnMobKilled"; for (; .@i < $RQ_Part2TotalMobs ; .@i++) { setd "$RQ_Part2Mob"+.@i+"HP" , 0 ; setd "$RQ_Part2Mob"+.@i+"GID" , 0 ; setd "$RQ_Part2Mob"+.@i+"ID" , 0 ; setd "$RQ_Part2Mob"+.@i+"Name$" , ""; } $RQ_PartyId = 0 ; $RQ_Part1Complete = 0 ; $RQ_Part1Talked = 0 ; $RQ_Part2TotalMobs = 0 ; $RQ_Part2Mob = 0 ; .InactiveTime = 0; $RQ_ResetTime = gettimetick(2) + .questdelay; stopnpctimer; sleep 3000; .@hours = .questdelay / (60*60) ; .@min = (.questdelay - (.@hours*60*60)) / 60 ; .@sec = .questdelay - (.@hours*60*60) - (.@min*60); if (.@hours) announce "The "+strnpcinfo(0)+" quest will be available again in "+.@hours+" hour"+(.@hours>1?"s":"")+(.@min?" "+.@min+" minute"+(.@min>1?"s":""):"")+(.@sec?" "+.@sec+" second"+(.@sec>1?"s":""):""),bc_all,.AnnounceColor; else if (.@min) announce "The "+strnpcinfo(0)+" quest will be available again in "+.@min+" minute"+(.@min>1?"s":"")+(.@sec?" "+.@sec+" second"+(.@sec>1?"s":""):""),bc_all,.AnnounceColor; else announce "The "+strnpcinfo(0)+" quest will be available again in "+.@sec+" second"+(.@sec>1?"s":""),bc_all,.AnnounceColor; return; } function PrintMes { // PrintMes(<part number>,"<npc name>"); if (getarg(0) == 1) { // messages about the quest when its not started (I was not inspired, you'll have to edit that one ^^) mes getarg(1),"part 1.." ; next; mes getarg(1),"part 2.." ; next; mes getarg(1),"part 3.." ; next; mes getarg(1),"..." ; next; } if (getarg(0) == 2) { // messages shown upon completion of first part (this is only a sample, feel free to edit it) mes getarg(1),"Thank god, you made it this far already!" ; next; mes getarg(1),"But the Realms are still far from safe..","The Realm Keepers are getting closer to Pallene as we speak." ; next; mes getarg(1),"Please defeat the Realm Keepers before they reach Pallene!!" ; next; } return; } }
  3. Hey there Are you trying the quest with two characters of the same account? If that's the case, that should solve it (don't really know though ^^) pal_dun01,70,336,4 script Realm Defender 54,{ function ItemLink ; function PrintMes ; function SetColor ; function EraseRQuest; .@name$ = "[^990000"+strnpcinfo(0)+"^000000]"; if (!$RQ_PartyId || $RQ_PartyId != getcharid(1)) { // no party doing the quest or player not in it .@loop = 1; while (.@loop) { // used to loop the menu whithout goto commands (in case the player wants to see the details of the quest, he'll be brought back here after) // quest availability mes .@name$,"Quest status : "+((gettimetick(2)<$RQ_ResetTime || $RQ_PartyId)?"^ff0000unavailable":"^00ff00available")+"^000000"; if ($RQ_PartyId) mes "Party ^cc3300"+getpartyname($RQ_PartyId)+"^000000 is currently doing the quest"; // $RQ_PartyId var is set to the id of the party doing the quest, $RQ_PartyId != 0 => party doing the quest else if ((.@delay = $RQ_ResetTime-gettimetick(2)) > 0) { // display time left ($RQ_ResetTime is set to gettimetick(2) + .questdelay upon completion of part 2) .@hours = .@delay / (60*60) ; .@min = (.@delay - (.@hours*60*60)) / 60 ; .@sec = .@delay - (.@hours*60*60) - (.@min*60); if (.@hours) mes "Delay : "+.@hours+" hour"+(.@hours>1?"s":"")+" "+.@min+" minute"+(.@min>1?"s":"")+" "+.@sec+" second"+(.@sec>1?"s":""); else if (.@min) mes "Delay : "+.@min+" minute"+(.@min>1?"s":"")+" "+.@sec+" second"+(.@sec>1?"s":""); else mes "Delay : "+.@sec+" second"+(.@sec>1?"s":""); } // rewards infos mes "Reward"+(((getarraysize(.rewards)>2)+(.ZenyReward?1:0))?"s :":" :"); for (.@i = 0 ; .@i < getarraysize(.rewards) ; .@i+=2) mes " ~ "+.rewards[.@i+1]+" "+ItemLink(.rewards[.@i]); if (.ZenyReward) mes " ~ ^ffcc00"+.ZenyReward+"^000000 zeny"; mes "Party leader reward"+(((getarraysize(.PartyLeaderBonusRewards)>2)+(.PartyLeaderBonusZenyReward?1:0))?"s":"")+" (added to the one"+(((getarraysize(.rewards)>2)+(.ZenyReward?1:0))?"s":"")+" above) :"; for (.@j = 0 ; .@j < getarraysize(.PartyLeaderBonusRewards) ; .@j+=2) mes " ~ "+.PartyLeaderBonusRewards[.@j+1]+" "+ItemLink(.PartyLeaderBonusRewards[.@j]); if (.PartyLeaderBonusZenyReward) mes " ~ ^ffcc00"+.PartyLeaderBonusZenyReward+"^000000 zeny"; // requirements mes "Requirements :"; getpartymember getcharid(1),1 ; getpartymember getcharid(1),2 ; .@n = 0; for (.@k = 0 ; .@k < $@partymembercount ; .@k++) if (isloggedin($@partymemberaid[.@k],$@partymembercid[.@k])) if ((.@x = getvar(BaseLevel,$@partymembercid[.@k])) >= .MinLevel) .@n++; // party member logged and has the required level mes " - "+(.@n<.PlayersRequired?"^ff0000":"^00ff00")+"Party of at least "+.PlayersRequired+" level "+.MinLevel+" member"+(.PlayersRequired>1?"s":"")+"^000000"; mes " - "+(getpartyleader(getcharid(1),1) == getcharid(3)?"^00ff00":"^ff0000")+"You need to be the party leader^000000"; .@can = 1; if (.@delay > 0 || .@n < .PlayersRequired || getpartyleader(getcharid(1),1) != getcharid(3)) { // quest delay, not enough valid members or player isn't the party leader .@can = 0; // shorter way to check all the requirements above if (select("View details:Leave") == 2) close; next; PrintMes(1,strnpcinfo(0)); // you can edit the dialogues in this function at the bottom of the script, I bet it'll be easier for you if (select("Go back to menu:Leave") == 2) close; } if (.@can) { next; if ((.@select = select("Proceed:View details:Leave")) == 3) close; if (.@select == 2) { PrintMes(1,strnpcinfo(0)); // you can edit the dialogues in this function at the bottom of the script, I bet it'll be easier for you if (select("Go back to menu:Leave") == 2) close; } if (.@select == 1) .@loop = 0; // selected proceed, loop break } } // quest proceeding if ($RQ_PartyId) { mes .@name$,"Arg, someone accepted the quest before you ><" ; close; } // in case someone accepts the quest while the player is in the menu getpartymember getcharid(1),1 ; getpartymember getcharid(1),2 ; .@n = 0 ; deletearray .PartyAnnounceMember,128; for (.@k = 0 ; .@k < $@partymembercount ; .@k++) if (isloggedin($@partymemberaid[.@k],$@partymembercid[.@k])) if ((.@x = getvar(BaseLevel,$@partymembercid[.@k])) >= .MinLevel) { .@n++ ; setarray .PartyAnnounceMember[getarraysize(.PartyAnnounceMember)] , $@partymemberaid[.@k]; } // keeps a trace of the players who will have to receive the first announces if (.@n < .PlayersRequired) { mes .@name$,"Arg, someone disconnected and you don't have enough valid members anymore ><" ; close; } // in case a valid member disconnects meanwhile $RQ_PartyId = getcharid(1) ; initnpctimer; for (; .@l < getarraysize(.MobsPart1) ; .@l+=2) setd "$RQ_PartyMob"+.MobsPart1[.@l]+"count" , 0; // resets monster kill counters announce "Party '"+getpartyname(getcharid(1))+"' accepted the "+strnpcinfo(0)+" quest, wish them good luck!",bc_all,.AnnounceColor; close2; sleep 5000; for (.@i = 0 ; .@i < getarraysize(.PartyAnnounceMember) ; .@i++) // broadcasts to every valid party member (since there's actually no partyannounce command) if (attachrid(.PartyAnnounceMember[.@i])) announce "["+strnpcinfo(0)+" Quest] : You sucessfully accepted the "+strnpcinfo(0)+" quest",bc_self,.AnnounceColor; sleep 5000; .@str$ = ""+.MobsPart1[1]+" "+strmobinfo(1,.MobsPart1); // this part .. for (.@m = 2 ; .@m < (getarraysize(.MobsPart1)-2) ; .@m+=2) .@str$ = .@str$ + ", "+.MobsPart1[.@m+1]+" "+strmobinfo(1,.MobsPart1[.@m]); .@str$ = .@str$ + " and "+.MobsPart1[.@m+1]+" "+strmobinfo(1,.MobsPart1[.@m]); // .. is used to fill all the monster-to-kill infos in one string so that we don't send multiple announces for (.@i = 0 ; .@i < getarraysize(.PartyAnnounceMember) ; .@i++) if (attachrid(.PartyAnnounceMember[.@i])) announce "["+strnpcinfo(0)+" Quest info] : You need to kill "+.@str$+" in order to complete the first part of the quest",bc_self,.AnnounceColor; sleep 5000; for (.@i = 0 ; .@i < getarraysize(.PartyAnnounceMember) ; .@i++) if (attachrid(.PartyAnnounceMember[.@i])) announce "["+strnpcinfo(0)+" Quest info] : Remember the party leader can abandon the quest any time by typing '@stopquest'!",bc_self,.AnnounceColor; end; } else if (!$RQ_Part1Complete || !$RQ_Part1Talked) { // part 1 incomplete or not proceeded // quest infos for (; .@i < getarraysize(.MobsPart1) ; .@i+=2) { .@amount = .@amount + getd("$RQ_PartyMob"+.MobsPart1[.@i]+"count") ; .@total = .@total + .MobsPart1[.@i+1]; } mes .@name$,"Quest status : [^0000ff"+(100*.@amount/.@total)+"% done^000000]"; for (; .@j < getarraysize(.MobsPart1) ; .@j+=2) mes " ~ "+SetColor("kill "+.MobsPart1[.@j+1]+" "+strmobinfo(1,.MobsPart1[.@j]),getd("$RQ_PartyMob"+.MobsPart1[.@j]+"count"),.MobsPart1[.@j+1]); // the 'SetColor' function adds a green and red color depending on the amount of mobs killed (ex: if you killed half of the monsters needed, half of the text will be in green and half in red) //the $RQ_Part1Complete variable is set to 1 in the OnNPCKillEvent label when all the monsters required are killed if (!$RQ_Part1Complete || getpartyleader($RQ_PartyId,1) != getcharid(3)) close; // player can't proceed if the quest is not completed or he's not the party leader next; if (select("Proceed:Leave") == 2) close; PrintMes(2,.@name$); // you can edit the dialogues in this function at the bottom of the script, I bet it'll be easier for you if (select("Go for part 2!:Not yet") == 2) close; // quest proceeding close2; $RQ_Part1Talked = 1; for (.@i = 0 ; .@i < getarraysize(.MobsPart1) ; .@i+=2) setd "$RQ_Part1Mob"+.MobsPart1[.@i]+"count" , 0; getpartymember getcharid(1),1 ; deletearray .PartyMember,128; for (; .@k < $@partymembercount ; .@k++) // gets valid players again in case someone was added to the party (it does not restrain players from warping if they don't have enough valid members because that'd be a pain for them after having done the first part..) if (attachrid($@partymemberaid[.@k])) if (BaseLevel >= .MinLevel) { setarray .PartyMember[getarraysize(.PartyMember)] , $@partymemberaid[.@k] ; announce "["+strnpcinfo(0)+" Quest] : You will be warped in 5 seconds..",bc_self,.AnnounceColor; } sleep 3000; for (; .@l < getarraysize(.PartyMember) ; .@l++) // broadcasts to every valid party member if (attachrid(.PartyMember[.@l])) { announce "["+strnpcinfo(0)+" Quest] : I wish you a good luck!",bc_self,.AnnounceColor; for (.@k = 0 ; .@k < getarraysize(.HelpItems) ; .@k+=2) getitem .HelpItems[.@k],HelpItems[.@k+1]; } sleep 2000; for (; .@m < getarraysize(.PartyMember) ; .@m++) // warps valid players to quest map if (attachrid(.PartyMember[.@m])) warp .questmap$,.x,.y; for (.@i = 0 ; .@i < getarraysize(.MobsPart2) ; .@i+=2) { // spawns part 2 monsters deletearray $@mobid,128; monster .questmap$,0,0,.MobsPart2Name$[.@i/2],.MobsPart2[.@i],.MobsPart2[.@i+1],strnpcinfo(0)+"::OnMobKilled"; for (.@j = 0 ; .@j < getarraysize($@mobid) ; .@j++) { // keeps a trace of monster spawned infos, this way we'll be able to spawn them back on reloadscript (they're being spawned back with the amount of HP they had before the reload) setd "$RQ_Part2Mob"+$RQ_Part2Mob+"GID" , $@mobid[.@j]; setd "$RQ_Part2Mob"+$RQ_Part2Mob+"ID" , .MobsPart2[.@i]; setd "$RQ_Part2Mob"+$RQ_Part2Mob+"Name$" , .MobsPart2Name$[.@i/2]; setd "$RQ_Part2Mob"+$RQ_Part2Mob+"HP" , strmobinfo(4,.MobsPart2[.@i]); $RQ_Part2Mob++; // used in the OnMobKilled label $RQ_Part2TotalMobs++; // used on reloadscript } } end; } else if ($RQ_Part1Talked) { // part 2 proceeded (means either player died in part 2, warped out or was added to the party meanwhile) if (BaseLevel < .MinLevel) { mes .@name$,"You must be at least level "+.MinLevel+" to join the quest.." ; close; } mes .@name$,"Don't give up "+strcharinfo(0)+", I know you can make it!" ; next; if (select("go to "+.questmap$+":Leave") == 2) close; warp .questmap$,.x,.y; end; } else { // not supposed to happen, I just don't wanted to put an 'else' at the last part cause if it does happen it would warp the player to pal_dun02 mes .@name$,"O_O ??"," ","Sorry but this part of the script is not supposed to trigger, could you contact your administrator please? ><"; close; } OnNPCKillEvent: // checks whether the part 1 quest is completed (also display infos) if (getcharid(1) == $RQ_PartyId && !$RQ_Part1Complete) { for (; .@i < getarraysize(.MobsPart1) ; .@i+=2) if (.MobsPart1[.@i] == killedrid && getd("$RQ_PartyMob"+killedrid+"count") < .MobsPart1[.@i+1]) { setd "$RQ_PartyMob"+killedrid+"count" , getd("$RQ_PartyMob"+killedrid+"count") + 1; getpartymember getcharid(1),1; for (.@j = 0 ; .@j < $@partymembercount ; .@j++) // broadcasts to every valid party member in the map if (attachrid($@partymemberaid[.@j])) if (strcharinfo(3) == .map$ && BaseLevel >= .MinLevel) announce "["+strnpcinfo(0)+" Quest] : "+getd("$RQ_PartyMob"+.MobsPart1[.@i]+"count")+"/"+.MobsPart1[.@i+1]+" "+strmobinfo(1,killedrid)+" killed",bc_self,.AnnounceColor; for (.@k = 0 ; .@k < getarraysize(.MobsPart1) ; .@k+=2) if (getd("$RQ_PartyMob"+.MobsPart1[.@k]+"count") < .MobsPart1[.@k+1]) { .@ko = 1 ; break; } if (!.@ko) { announce "Party '"+getpartyname(getcharid(1))+"' has finished the first part of the "+strnpcinfo(0)+" quest!",bc_all,.AnnounceColor ; $RQ_Part1Complete = 1; } } } end; OnMobKilled: // checks whether the part 2 quest is completed (also display infos) $RQ_Part2Mob--; getpartymember getcharid(1),2; for (; .@i < $@partymembercount ; .@i++)// broadcasts to every valid party member if (attachrid($@partymemberaid[.@i])) if (BaseLevel >= .MinLevel) { if ($RQ_Part2Mob > 1) announce "["+strnpcinfo(0)+" Quest] : "+$RQ_Part2Mob+" Keepers left, keep going!",bc_self,.AnnounceColor; else if ($RQ_Part2Mob) announce "["+strnpcinfo(0)+" Quest] : only one Keeper left, you've almost done it!",bc_self,.AnnounceColor; else { // quest completed, giving rewards announce "["+strnpcinfo(0)+" Quest] : "+strnpcinfo(0)+" quest completed, congratulations! Here are your rewards!",bc_self,.AnnounceColor; for (.@j = 0; .@j < getarraysize(.rewards) ; .@j+=2) getitem .rewards[.@j],.rewards[.@j+1]; Zeny += .ZenyReward; if (getpartyleader($RQ_PartyId,1) == $@partymemberaid[.@i]) { // party leader bonus rewards for (; .@k < getarraysize(.PartyLeaderBonusRewards) ; .@k+=2) getitem .PartyLeaderBonusRewards[.@k],.PartyLeaderBonusRewards[.@k+1]; Zeny += .PartyLeaderBonusZenyReward; } } } if (!$RQ_Part2Mob) { // quest completed, reseting variables & setting delay sleep 3000 ; announce "Party '"+getpartyname($RQ_PartyId)+"' has helped keeping the Realms safe by completing the "+strnpcinfo(0)+" quest! Congratulations!",bc_all,.AnnounceColor ; sleep 3000; $RQ_PartyId = 0 ; $RQ_Part1Complete = 0 ; $RQ_Part1Talked = 0 ; $RQ_Part2TotalMobs = 0; $RQ_ResetTime = gettimetick(2) + .questdelay; stopnpctimer; .@hours = .questdelay / (60*60) ; .@min = (.questdelay - (.@hours*60*60)) / 60 ; .@sec = .questdelay - (.@hours*60*60) - (.@min*60); if (.@hours) announce "The "+strnpcinfo(0)+" quest will be available again in "+.@hours+" hour"+(.@hours>1?"s":"")+(.@min?" "+.@min+" minute"+(.@min>1?"s":""):"")+(.@sec?" "+.@sec+" second"+(.@sec>1?"s":""):""),bc_all,.AnnounceColor; else if (.@min) announce "The "+strnpcinfo(0)+" quest will be available again in "+.@min+" minute"+(.@min>1?"s":"")+(.@sec?" "+.@sec+" second"+(.@sec>1?"s":""):""),bc_all,.AnnounceColor; else announce "The "+strnpcinfo(0)+" quest will be available again in "+.@sec+" second"+(.@sec>1?"s":""),bc_all,.AnnounceColor; } end; OnTimer5000: getpartymember $RQ_PartyId,2; if (!$@partymembercount) { // party deleted announce "["+strnpcinfo(0)+" Quest Info] : Party '"+getpartyname($RQ_PartyId)+"' has been deleted and the quest has been erased!",bc_all,.AnnounceColor; EraseRQuest(); } .InactiveTime+=5; if (!$RQ_Part1Talked) { // part 1 inactivity check for (; .@i < getarraysize(.MobsPart1) ; .@i++) { if (getd("$RQ_PartyMob"+.MobsPart1[.@i]+"count") != getd(".PreviousCount"+.@i)) .InactiveTime = 0; setd ".PreviousCount"+.@i , getd("$RQ_PartyMob"+.MobsPart1[.@i]+"count"); } } else { // part 2 inactivity check (+ checking when loading map with the 'OnPCLoadMapEvent' label below) addrid(0); if (.questmap$ == strcharinfo(3) && $RQ_PartyId == getcharid(1)) .InactiveTime = 0; detachrid; } if (.InactiveTime == 300) { // shows warning after being inactive for 5 minutes getpartymember $RQ_PartyId,2; for (.@i = 0 ; .@i < $@partymembercount ; .@i++) if (attachrid($@partymemberaid[.@i])) if (BaseLevel >= .MinLevel) announce "["+strnpcinfo(0)+" Quest Info] : Your party has been inactive for 5 minutes.",bc_self,.AnnounceColor; sleep 3000; for (.@i = 0 ; .@i < $@partymembercount ; .@i++) if (attachrid($@partymemberaid[.@i])) if (BaseLevel >= .MinLevel) announce "["+strnpcinfo(0)+" Quest Info] : If your are still inactive after 5 more minutes, the quest will be erased.",bc_self,.AnnounceColor; sleep 3000; for (.@i = 0 ; .@i < $@partymembercount ; .@i++) if (attachrid($@partymemberaid[.@i])) if (BaseLevel >= .MinLevel) announce "["+strnpcinfo(0)+" Quest Info] : Remember the party leader can type '@stopquest' to abandon the quest.",bc_self,.AnnounceColor; } if (.InactiveTime >= 600) { // erases quest after being inactive for 10 minutes announce "["+strnpcinfo(0)+" Quest Info] : Party '"+getpartyname($RQ_PartyId)+"' has been inactive for 10 minutes and the quest has been erased!",bc_all,.AnnounceColor; EraseRQuest(); } for (.@i = 0 ; .@i < $RQ_Part2TotalMobs ; .@i++) // update part 2 monsters HP in case of a reloadscript if (getd("$RQ_Part2Mob"+.@i+"HP")) { // just to avoid getting warnings every 5 seconds deletearray .@data,128; getunitdata getd("$RQ_Part2Mob"+.@i+"GID"),.@data; // it will return a warning if it can't find the mob, don't worry that's normal (even though that's boring..) setd "$RQ_Part2Mob"+.@i+"HP" , .@data[UMOB_HP]; if (!.@data[UMOB_HP]) { setd "$RQ_Part2Mob"+.@i+"GID" , 0 ; setd "$RQ_Part2Mob"+.@i+"ID" , 0 ; setd "$RQ_Part2Mob"+.@i+"Name$" , ""; } } if ($RQ_PartyId) initnpctimer; end; OnPCLogoutEvent: if (getpartyleader($RQ_PartyId,1) == getcharid(3)) { announce "["+strnpcinfo(0)+" Quest Info] : Party leader of party '"+getpartyname($RQ_PartyId)+"' has logged out!",bc_all,.AnnounceColor; EraseRQuest(); } end; OnStopQuest: if ($RQ_PartyId != getcharid(1)) end; if (getpartyleader($RQ_PartyId,1) != getcharid(3)) { dispbottom "["+strnpcinfo(0)+" Quest Info] : Only the part leader can decide to stop the quest." ; end; } announce "["+strnpcinfo(0)+" Quest Info] : Party leader of party '"+getpartyname($RQ_PartyId)+"' has abandonned the quest!",bc_all,.AnnounceColor; EraseRQuest(); end; OnInterIfInit: // deletes all quest data upon map server connection query_sql("DELETE FROM `mapreg` WHERE SUBSTR(`varname`,1,4) = '$RQ_'",.@dub); end; OnInit: .map$ = strnpcinfo(4); // if your npc is on a different map than the mobs in part 1, change '.map$' to the map those monsters are .questmap$ = "pal_dun02" ; .x = 49 ; .y = 6; // map, x and y where the players are warped on part 2 quest, also the map in which the part 2 monsters are spawned .PlayersRequired = 2; // amount of players required to begin the quest .MinLevel = 150; // minimum level required for each player in the party in order to do the quest .questdelay = 2*60*60; // delay (s) before any party is allowed to do the quest again setarray .MobsPart1 , 1401,80 , 2019,20; // mobs to kill in part 1 // setarray .MobsPart1 , <mob id>,<amount>{ , <mob id>,<amount>{ , <mob id>,<amount>{..}}}; setarray .MobsPart2 , 1708,1 , 1039,1 , 1917,1; // mobs to kill in part 2 // setarray .MobsPart2 , <mob id>,<amount>{ , <mob id>,<amount>{ , <mob id>,<amount>{..}}}; setarray .MobsPart2Name$ , "Azthor" , "Othar" , "Kalnor"; // mob names in part 2 (don't put too long names or they won't be fully displayed) // setarray .MobsPart2Name$ , <mob 1 name>{ , <mob 2 name>,{ , <mob i3 name>{..}}}; setarray .rewards , 7227,50; // rewards for every player in the party // setarray .rewards , <item id>,<amount>{ , <item id>,<amount>{ , <item id>,<amount>{..}}}; .ZenyReward = 0; // zeny reward for every player in the party setarray .PartyLeaderBonusRewards , 7227,50 , 512,1; // party leader bonus rewards (added to those above) // setarray .PartyLeaderBonusRewards , <item id>,<amount>{ , <item id>,<amount>{ , <item id>,<amount>{..}}}; .PartyLeaderBonusZenyReward = 0; // party leader zeny bonus reward (added to the amount above) setarray .HelpItems , 608,10; // items given to players to help them in part 2 // setarray .HelpItems , <item id>,<amount>{ , <item id>,<amount>{ , <item id>,<amount>{..}}}; .AnnounceColor = 0x00ff00; // color of announces relative to the quest setmapflag .map$,mf_loadevent; // used for showing quest availability on the map setmapflag .questmap$,mf_loadevent; // used to check players inactivity in part 2 setmapflag .questmap$,mf_nowarp; setmapflag .questmap$,mf_nogo; setmapflag .questmap$,mf_noteleport; // not sure you want that one though (disables fly wings) setmapflag .questmap$,mf_nomemo; bindatcmd "stopquest",strnpcinfo(0)+"::OnStopQuest"; $RQ_Part2Mob = 0; for (; .@i < $RQ_Part2TotalMobs ; .@i++) // respawn part 2 monsters if any left to kill if (getd("$RQ_Part2Mob"+.@i+"HP")) { // mob not dead on reload $RQ_Part2Mob++; // in case a monster died and a reloadscript occured before the 5 seconds delay (the monster is respawned and so the amount of mob needs to be edited) monster .questmap$,0,0,getd("$RQ_Part2Mob"+.@i+"Name$"),getd("$RQ_Part2Mob"+.@i+"ID"),1,strnpcinfo(0)+"::OnMobKilled"; setd "$RQ_Part2Mob"+.@i+"GID" , $@mobid; setunitdata $@mobid,UMOB_HP,getd("$RQ_Part2Mob"+.@i+"HP"); // respawn with previous HP initnpctimer; } addrid(1); OnPCLoadMapEvent: if (strcharinfo(3) == .map$ && !$RQ_PartyId) { // shows players who have met the requirements a quest icon on the minimap and above the npc (only party leaders) if (getpartyleader(getcharid(1),1) == getcharid(3)) { getpartymember getcharid(1),1 ; getpartymember getcharid(1),2; for (; .@i < $@partymembercount ; .@i++) if (isloggedin($@partymemberaid[.@i],$@partymembercid[.@i])) if ((.@x = getvar(BaseLevel,$@partymembercid[.@i])) >= .MinLevel) .@n++; if (.@n >= .PlayersRequired) showevent QTYPE_QUEST,2; } } if (strcharinfo(3) == .questmap$ && getcharid(1) == $RQ_PartyId) .InactiveTime = 0; end; function ItemLink { if (0) // turn to 1 to enable item link return "<ITEMLINK>"+getitemname(getarg(0))+"<INFO>"+getarg(0)+"</INFO></ITEMLINK>"; else return "^0099ff"+getitemname(getarg(0))+"^000000"; } function SetColor { // Setcolor("<message>",<amount>,<amount to 100%>); .@pos = getstrlen(getarg(0))*getarg(1)/getarg(2); return "^00ff00"+substr(getarg(0),0,.@pos-1)+"^000000^ff0000"+substr(getarg(0),.@pos,getstrlen(getarg(0))-1)+"^000000"; } function EraseRQuest { // EraseRQuest(); killmonster .questmap$,strnpcinfo(0)+"::OnMobKilled"; for (; .@i < $RQ_Part2TotalMobs ; .@i++) { setd "$RQ_Part2Mob"+.@i+"HP" , 0 ; setd "$RQ_Part2Mob"+.@i+"GID" , 0 ; setd "$RQ_Part2Mob"+.@i+"ID" , 0 ; setd "$RQ_Part2Mob"+.@i+"Name$" , ""; } $RQ_PartyId = 0 ; $RQ_Part1Complete = 0 ; $RQ_Part1Talked = 0 ; $RQ_Part2TotalMobs = 0 ; $RQ_Part2Mob = 0 ; .InactiveTime = 0; $RQ_ResetTime = gettimetick(2) + .questdelay; stopnpctimer; sleep 3000; .@hours = .questdelay / (60*60) ; .@min = (.questdelay - (.@hours*60*60)) / 60 ; .@sec = .questdelay - (.@hours*60*60) - (.@min*60); if (.@hours) announce "The "+strnpcinfo(0)+" quest will be available again in "+.@hours+" hour"+(.@hours>1?"s":"")+(.@min?" "+.@min+" minute"+(.@min>1?"s":""):"")+(.@sec?" "+.@sec+" second"+(.@sec>1?"s":""):""),bc_all,.AnnounceColor; else if (.@min) announce "The "+strnpcinfo(0)+" quest will be available again in "+.@min+" minute"+(.@min>1?"s":"")+(.@sec?" "+.@sec+" second"+(.@sec>1?"s":""):""),bc_all,.AnnounceColor; else announce "The "+strnpcinfo(0)+" quest will be available again in "+.@sec+" second"+(.@sec>1?"s":""),bc_all,.AnnounceColor; return; } function PrintMes { // PrintMes(<part number>,"<npc name>"); if (getarg(0) == 1) { // messages about the quest when its not started (I was not inspired, you'll have to edit that one ^^) mes getarg(1),"part 1.." ; next; mes getarg(1),"part 2.." ; next; mes getarg(1),"part 3.." ; next; mes getarg(1),"..." ; next; } if (getarg(0) == 2) { // messages shown upon completion of first part (this is only a sample, feel free to edit it) mes getarg(1),"Thank god, you made it this far already!" ; next; mes getarg(1),"But the Realms are still far from safe..","The Realm Keepers are getting closer to Pallene as we speak." ; next; mes getarg(1),"Please defeat the Realm Keepers before they reach Pallene!!" ; next; } return; } }
  4. Why don't you do you via a script function? callfunc "GetRandItemBound",getcharid(3); function script GetRandItemBound { attachrid(getarg(0)); // useful? Don't remember if the player is automatically attached setarray .@items , 1228 , 1229; getitem .@items[rand(getarraysize(.@items))],1,getarg(0); }
  5. Try to switch to mysql workbench for the moment. Do a complete uninstallation before installing it again, like this: uninstall wamp delete C:\ProgramFiles\Mysql folder delete C:\ProgramData\Mysql folder delete C:\<user name>\AppData\Roaming\MySQL folder (this one might be hidden but it's here) reboot Install mysql workbench and set it up
  6. If your server doesn't return any error it probably means it froze. If it did freeze normally you should still be able to open your iventory, item description etc.. Also when you disconnect the char serv doesn't notify you. Make sure whether that's the case and if it is, that's most likely a database problem. What database are You using? Did you update it properly?. Since you tried different servers you might have conflicts in their databases. If that's the case you have no choice but to delete it completely and install it again. Don't rush into this if you're not sure your server is freezing. I'm on my phone now so I can't give you more détails but I'll post some more info this evening especially about uninstalling your database. Keep going!
  7. You need to edit that part in the packet_db // Version 23 is the latest Sakexe (above versions are for Renewal clients) //packet_db_ver: 45 packet_db_ver: default replace with // Version 23 is the latest Sakexe (above versions are for Renewal clients) packet_db_ver: 30 //packet_db_ver: default also if you have the latest revision, I'd recommend you not to check the 'disable packet encryption' option when you diff. Last thing make sure the clientinfo.xml you edit is indeed the one which is read by the client (for example if you diffed with the 'read data folder first' option you need to edit the one in your data folder)
  8. Ok then tell me a bit more about those: what's your client date? what's your client version in your clientinfo.xml? Where is it? (data or grf) what's your packet db version? what's your packet version in mmo.h? Which diff options did you choose? Did you change the content of core.h?
  9. You're probably in the bugged iz_int Try to type '@go 0' or anything in the chat to warp you out
  10. Like this //On<weekday><hour><minute> OnMon0800: // monday 8 am OnFri0800: // friday 8 am
  11. I don't have the pvp_y_<x>-5 maps, I can't test it. What's the error? If there's no error what doesn't work? Full starter: //Counts down and starts race pvp_y_1-5,145,269,5 script Starter 733,{ if ($@race != 0) goto L_Started; if ($@counting != 0) goto L_Started; if ($@racecount == 1) goto L_Started; L_Menu: mes "[Race Starter]"; mes "Please stay on the Eastern side of me."; // menu "Start Race",L_Count,"Cancel",-; if (getgmlevel() >= 80) menu "Start Race",L_Count,"Cancel",-; close; L_Count: set $@counting,1; mes "Counting down..."; addtimer 1000, "Starter::OnCount1000"; addtimer 2000, "Starter::OnCount2000"; addtimer 3000, "Starter::OnCount3000"; addtimer 4000, "Starter::OnCount4000"; announce strcharinfo(0) + "Started a countdown",1; announce "Get ready to race!",1; close; OnCount1000: announce "[3]",1; end; OnCount2000: announce "[2]",1; end; OnCount3000: announce "[1]",1; end; OnCount4000: emotion e_go; specialeffect EF_CHIMTO; announce "[GO!]",1; set $@race,1; set $@position,0; set $@counting,0; set $@raceid,rand(100000,999999); end; L_Started: if ((getmapusers("pvp_y_1-5") < 3) && ($@position > 0)) goto L_Menu; if ($@position > 2) goto L_Menu; mes "[Starter]"; mes "Race in progress"; close; OnInit: set $@race,0; set $@position,0; set $@racecount,0; end; }
  12. Glad you like it What's your exe date?
  13. Should have said so sooner xD I was totally lost there Nothing simpler: L_Menu: mes "[Race Starter]"; mes "Please stay on the Eastern side of me."; -- menu "Start Race",L_Count,"Cancel",-; ++ if(getgmlevel() >= 80) menu "Start Race",L_Count,"Cancel",-; close; L_Count:
  14. Are you sure there's no other script going with it?? What do you call original script? What worked and when did it start not to work? For what I understand, the npc might be spawned when the event begins and only a gm can render it active so that means the gm_only label should call the L_Menu label instead of the L_Start label (probably only in case the $@race variable has a value of 0) If I'm right with these, try this prontera,152,260,5 script Starter 733,{ if( getgmlevel() < 80){ player_here: mes "^FF0000[Starter]^000000"; mes "^0000FF[Get Ready The Event Will Start Soon .]^000000"; close; } gm_only: -- if ($@race != 0) goto L_Started; ++ if ($@race != 0) goto L_Menu; if ($@counting != 0) goto L_Started; if ($@racecount == 1) goto L_Started; end; L_Menu: mes "[Race Starter]"; mes "Please stay on the Eastern side of me."; menu "Start Race",L_Count,"Cancel",-; close; L_Count: set $@counting,1; mes "Counting down..."; addtimer 1000, "Starter::OnCount1000"; addtimer 2000, "Starter::OnCount2000"; addtimer 3000, "Starter::OnCount3000"; addtimer 4000, "Starter::OnCount4000"; announce strcharinfo(0) + "Started a countdown",1; announce "Get ready to race!",1; close; OnCount1000: announce "[3]",1; end; OnCount2000: announce "[2]",1; end; OnCount3000: announce "[1]",1; end; OnCount4000: emotion e_go; specialeffect EF_CHIMTO; announce "[GO!]",1; set $@race,1; set $@position,0; set $@counting,0; set $@raceid,rand(100000,999999); end; L_Started: if ((getmapusers("pvp_y_1-5") < 3) && ($@position > 0)) goto L_Menu; if ($@position > 2) goto L_Menu; mes "[Starter]"; mes "Race in progress"; close; OnInit: set $@race,0; set $@position,0; set $@racecount,0; end; } Still, apart from the $@race variable, nothing is ever set to anything so that's really weird
  15. It does go to the gm_only label on gm click, trust me. it then goes to the L_Started label but since the variable $@position has a value of 0,it does nothing apart from triggering the OnInit label. Add debug messages if you want to make sure: prontera,152,260,5 script Starter 733,{ if( getgmlevel() < 80){ player_here: mes "^FF0000[Starter]^000000"; mes "^0000FF[Get Ready The Event Will Start Soon .]^000000"; close; } gm_only: debugmes "triggering gm_only label"; if ($@race != 0) goto L_Started; if ($@counting != 0) goto L_Started; if ($@racecount == 1) goto L_Started; end; L_Menu: mes "[Race Starter]"; mes "Please stay on the Eastern side of me."; menu "Start Race",L_Count,"Cancel",-; close; L_Count: set $@counting,1; mes "Counting down..."; addtimer 1000, "Starter::OnCount1000"; addtimer 2000, "Starter::OnCount2000"; addtimer 3000, "Starter::OnCount3000"; addtimer 4000, "Starter::OnCount4000"; announce strcharinfo(0) + "Started a countdown",1; announce "Get ready to race!",1; close; OnCount1000: announce "[3]",1; end; OnCount2000: announce "[2]",1; end; OnCount3000: announce "[1]",1; end; OnCount4000: emotion e_go; specialeffect EF_CHIMTO; announce "[GO!]",1; set $@race,1; set $@position,0; set $@counting,0; set $@raceid,rand(100000,999999); end; L_Started: debugmes "triggering L_Started label"; debugmes "$@position value : "+$@position; if ((getmapusers("pvp_y_1-5") < 3) && ($@position > 0)) goto L_Menu; if ($@position > 2) goto L_Menu; mes "[Starter]"; mes "Race in progress"; close; OnInit: debugmes "triggering OnInit label"; set $@race,0; set $@position,0; set $@racecount,0; end; }
×
×
  • Create New...