keough Posted January 20, 2019 Group: Members Topic Count: 20 Topics Per Day: 0.00 Content Count: 49 Reputation: 45 Joined: 07/01/12 Last Seen: 22 hours ago Share Posted January 20, 2019 Hello, I want to request a map restriction access, like everyone cannot access any map but for 1 map only which is "new_1-1" So the map "new_1-1" is the only map can access, other than that a message will pop up and DC the player Purpose: For every event or grand opening after beta test. everyone must create new novice and must be in new_1-1 Quote Link to comment Share on other sites More sharing options...
0 AnnieRuru Posted January 20, 2019 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted January 20, 2019 a few ways to do this before write this into a script Type A 1. kick every online players (#kickall atcommand) 2. OnPCLoginEvent, warp to new_1-1 3. and maybe a BaseLevel check and Class check Type B 1. use OnPCLoadMapEvent on every single map, the loadevent mapflag will be generated from map_index.txt file 2. kick or warp every online players into new_1-1 3. and maybe a BaseLevel check and Class check or maybe some other idea to do this trick ? suggestion is welcome ... Quote Link to comment Share on other sites More sharing options...
0 utofaery Posted February 9, 2019 Group: Members Topic Count: 23 Topics Per Day: 0.01 Content Count: 228 Reputation: 19 Joined: 10/27/12 Last Seen: March 17, 2019 Share Posted February 9, 2019 Or you could use sql (check online player) + script to warp/call all player to new_1-1 and disable all warps on that map and set noteleport nowarpto mapflag and use of flywing butterflywing without using kickall and etc or loadmapflag event Quote Link to comment Share on other sites More sharing options...
0 n0tttt Posted February 9, 2019 Group: Members Topic Count: 4 Topics Per Day: 0.00 Content Count: 303 Reputation: 118 Joined: 12/10/16 Last Seen: Yesterday at 02:39 AM Share Posted February 9, 2019 db/import/job_noenter_map.txt JOB_NOVICE,1,100 Something like this? Quote Link to comment Share on other sites More sharing options...
0 utofaery Posted February 10, 2019 Group: Members Topic Count: 23 Topics Per Day: 0.01 Content Count: 228 Reputation: 19 Joined: 10/27/12 Last Seen: March 17, 2019 Share Posted February 10, 2019 On 1/20/2019 at 7:43 PM, keough said: Purpose: For every event or grand opening after beta test. everyone must create new novice and must be in new_1-1 if for this you need sql and set every last map to new_1-1 and the (last_x, last_y) and reset everything ...inventory, cart, storage, statpoint, item, skill, baselevel, joblevel, zeny, in SQL basically a full server wipe except keeping the created character and account only. unless you prefer to use script to do so ( more automated way to do it ) Quote Link to comment Share on other sites More sharing options...
0 AnnieRuru Posted February 10, 2019 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted February 10, 2019 (edited) 18 hours ago, n0tttt said: db/import/job_noenter_map.txt JOB_NOVICE,1,100 Something like this? if I understand this correctly, *jobcanentermap script command works together with db/re/job_noenter_map.txt the script command only return 0 or 1, depends on the setting from job_noenter_map.txt in other words, just a simple if ( Class == Job_Novice ) return 0; do the same thing as the script command it doesn't warp out the players, kick or anything ... just return value 0 or 1 wrong info ... Edited February 10, 2019 by AnnieRuru Quote Link to comment Share on other sites More sharing options...
0 n0tttt Posted February 10, 2019 Group: Members Topic Count: 4 Topics Per Day: 0.00 Content Count: 303 Reputation: 118 Joined: 12/10/16 Last Seen: Yesterday at 02:39 AM Share Posted February 10, 2019 7 hours ago, AnnieRuru said: if I understand this correctly, *jobcanentermap script command works together with db/re/job_noenter_map.txt the script command only return 0 or 1, depends on the setting from job_noenter_map.txt in other words, just a simple if ( Class == Job_Novice ) return 0; do the same thing as the script command it doesn't warp out the players, kick or anything ... just return value 0 or 1 It also checks on warps. npc.cpp: switch(mapdata->npc[i]->subtype) { case NPCTYPE_WARP: if ((!mapdata->npc[i]->trigger_on_hidden && (pc_ishiding(sd) || (sd->sc.count && sd->sc.data[SC_CAMOUFLAGE]))) || pc_isdead(sd)) break; // hidden or dead chars cannot use warps if (!pc_job_can_entermap((enum e_job)sd->status.class_, map_mapindex2mapid(mapdata->npc[i]->u.warp.mapindex), sd->group_level)) break; if(sd->count_rewarp > 10){ ShowWarning("Prevented infinite warp loop for player (%d:%d). Please fix NPC: '%s', path: '%s'\n", sd->status.account_id, sd->status.char_id, mapdata->npc[i]->exname, mapdata->npc[i]->path); sd->count_rewarp=0; break; } pc_setpos(sd,mapdata->npc[i]->u.warp.mapindex,mapdata->npc[i]->u.warp.x,mapdata->npc[i]->u.warp.y,CLR_OUTSIGHT); break; 1 Quote Link to comment Share on other sites More sharing options...
0 AnnieRuru Posted February 10, 2019 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted February 10, 2019 (edited) let's see .. pc_job_can_entermap function check has 1. atcommand.c ... "@warp" atcommand ... 2. npc.c .... WARPNPC .... prontera,150,185,5 warp2 sadfasdfsdf 2,2,guild_vs2,50,50 3. script.c ... *warpparty/*warpguild script command ... and of course *jobcanentermap script command 4. skill.c ... emergency recall ... UNT_WARP_WAITING (acolyte's warp portal skill) ... UNT_CALLFAMILY .... weird, doesn't check on summon spouse "@reloadpcdb" can reload job_noenter_map.txt file ok but still it doesn't make sense to apply in this topic ... topic starter says all jobs CANNOT access to any map EXCEPT new_1-1 your 1 line code actually means novice can't enter new_1-1, doing opposite of what topic starter says also, using just zone 1 isn't actually work ... my novice can't warp into any map, but can enter pvp map ... LOL Example: script: prontera,155,185,5 script ksjdfhsdjfh WARPNPC,2,2,{ if ( jobcanentermap("guild_vs2") ) warp "guild_vs2", 50,50; end; } //guild_vs2 mapflag pvp guild_vs1 mapflag pvp prontera,150,185,5 warp2 sadfasdfsdf 2,2,guild_vs2,50,50 db\re\job_noenter_map.txt JOB_NOVICE,1,100 arch_bishop job cannot enter woe:te map ... ok check novice cannot warp payon, prontera, guild_vs2 ... check ... but can warp into guild_vs1 map !! because its pvp on there EDIT: hmm ... maybe if apply all the zones ... 8191 ? hmm ... doesn't really work, pc_job_can_entermap doesn't check on "@go" atcommand ... still can bypass ... damn just use OnPCLoadMapEvent already ... Edited February 10, 2019 by AnnieRuru Quote Link to comment Share on other sites More sharing options...
0 n0tttt Posted February 10, 2019 Group: Members Topic Count: 4 Topics Per Day: 0.00 Content Count: 303 Reputation: 118 Joined: 12/10/16 Last Seen: Yesterday at 02:39 AM Share Posted February 10, 2019 (edited) I didn't read completely. In any case, he can disable every NPC, disable every outside player, and disable every item or skill which might warp players out of there. Something like this? - script Event_Novice -1,{ bindatcmd "startnovice","Event_Novice::OnStart"; bindatcmd "endnovice","Event_Novice::OnEnd"; end; OnStart: setmapflag "new_1-1",mf_noexp; setmapflag "new_1-1",mf_nowarp; setmapflag "new_1-1",mf_nowarpto; setmapflag "new_1-1",mf_noskill; setmapflag "new_1-1",mf_noitemconsumption; setmapflag "new_1-1",mf_loadevent; .size = getunits(BL_NPC,"new_1-1",.npc$); freeloop true; for(.@i = 0;.@i < .size;.@i++) disablenpc .npc$[.@i]; /* .@size = getunits(BL_MOB,"new_1-1",.@mob); for(.@i = 0;.@i < .@size;.@i++) unitkill .@mob[.@i]; */ .@size = getunits(BL_PC,"new_1-1",.@player$); for(.@i = 0;.@i < .@size;.@i++) { if(readparam(Class,.@player$[.@i]) != Job_Novice) warp "SavePoint",0,0,getcharid(0,.@player$[.@i]); } freeloop false; end; OnEnd: for(.@i = 0;.@i < .size;.@i++) enablenpc .npc$[.@i]; deletearray .npc$; .size = 0; removemapflag "new_1-1",mf_noexp; removemapflag "new_1-1",mf_nowarp; removemapflag "new_1-1",mf_nowarpto; removemapflag "new_1-1",mf_noskill; removemapflag "new_1-1",mf_noitemconsumption; removemapflag "new_1-1",mf_loadevent; end; OnPCLoadMapEvent: if(strcharinfo(3) == "new_1-1" && Class != Job_Novice) warp "SavePoint",0,0; end; } I don't know what kind of event it is (GM-controlled?), but if he needs some NPCs, he can just add them with enablenpc. Forgot to mention why I added noexp. In case some people create party or guild. Actually don't remember how it works for guilds, but if it does like I think, player couldn't lvl up then couldn't join a guild and then escape by Emergency Recall or something like that. Anyways I don't know what kind of event is this (Zombie event?). Edited February 10, 2019 by n0tttt Quote Link to comment Share on other sites More sharing options...
0 utofaery Posted February 10, 2019 Group: Members Topic Count: 23 Topics Per Day: 0.01 Content Count: 228 Reputation: 19 Joined: 10/27/12 Last Seen: March 17, 2019 Share Posted February 10, 2019 Why not combine all? 1. use query_sql to set last_map of char table to new_1-1 to prevent not yet login people from warping anywhere else. 2. then use OnPCLoadMapEvent: to warp all player to new_1-1 and disable all npc on that map and set mapflag to disable item skill atcommand usage warp save teleport On 1/20/2019 at 7:43 PM, keough said: So the map "new_1-1" is the only map can access 3 then include a check when player tries to warp away or loaded map not new_1-1 On 1/20/2019 at 7:43 PM, keough said: other than that a message will pop up and DC the player and when a player is not on new_1-1 loaded different map pop up a message and say 3 second then @kick the player. not complicated but hard to do with my knowledge of scripting Quote Link to comment Share on other sites More sharing options...
Question
keough
Hello, I want to request a map restriction access, like everyone cannot access any map but for 1 map only which is "new_1-1"
So the map "new_1-1" is the only map can access, other than that a message will pop up and DC the player
Purpose: For every event or grand opening after beta test. everyone must create new novice and must be in new_1-1
Link to comment
Share on other sites
9 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.