Jump to content

n0tttt

Members
  • Posts

    303
  • Joined

  • Days Won

    12

n0tttt last won the day on September 13 2022

n0tttt had the most liked content!

7 Followers

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

6215 profile views

n0tttt's Achievements

Poring

Poring (1/15)

  • Dedicated
  • Very Popular Rare
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

117

Reputation

28

Community Answers

  1. Either integrate the part onto the script or use close2 + doevent.
  2. Try changing BL_PC to UNITTYPE_PC. It seems like you have an outdated rAthena.
  3. Like this? - script reset_map -1,{ OnInit: setarray .maplist$[0],"prt_fild08"; end; OnPCLogoutEvent: if(inarray(.maplist$,strcharinfo(3)) != -1) { getmapxy map$,x,y,BC_PC; logout_count++; } end; OnPCLoginEvent: if(logout_count == 1) { warp map$,x,y; logout_count = 0; map$ = ""; x = y = 0; } else if(inarray(.maplist$,strcharinfo(3)) != -1) { warp "SavePoint",0,0; } end; }
  4. It seems like you don't have or aren't loading Global_Functions.txt (https://raw.githubusercontent.com/rathena/rathena/master/npc/other/Global_Functions.txt) You can delete the line in add_event, and also the Event_DevilSquare script.
  5. Isn't this based on my own modification? The var names and announce hex colors are even the same. ?
  6. .@P_HP = (@'.'U_HP*100)/.@U_MAXHP; to: .@P_HP = (.@U_HP*100)/.@U_MAXHP;
  7. Just go to your rAthena npc folder and edit script_custom.conf with Notepad. Add this line anywhere: npc: npc/custom/Events.txt Then copy the "Events.txt" file into the npc/custom folder. You can now talk in-game to the script using @events script command.
  8. You could delete the bindatcmd line, but better use this one since I deleted it altogether: /* Changelog: v1.1 Added option to debuff players when entering the room. Added command to rotate manually. Remove hiding when quitting room. Added lvl checking on command. v1.1a Removed right curly which made dispell function don't work. Sorry. Added color to the npc name in dialog. Added F_InsertPlural use. v1.2 Added waitingroom with player count. */ // You can use this function with other scripts as well. function script dispell { while(.@i++ < SC_SPL_MATK) { if( .@i != SC_WEIGHT50 && .@i != SC_WEIGHT90 && .@i != SC_NOCHAT && .@i != SC_BABY && /* .@i != SC_WEDDING && .@i != SC_XMAS && .@i != SC_SUMMER && .@i != SC_HANBOK && .@i != SC_OKTOBERFEST && */ .@i != SC_JAILED && .@i != SC_EXPBOOST && .@i != SC_ITEMBOOST ) sc_end .@i; } .@i = SC_FEAR; while(.@i++ < SC_AKAITSUKI) sc_end .@i; } prontera,147,172,6 script PvP#0 4_M_SAKRAYROYAL,{ .@n$ = "^3227cd[PvP Room]^000000"; mes .@n$; if(BaseLevel >= .min_lv) { mes "There are ^d40f00"+F_InsertPlural(getmapusers(.map$),"player")+"^000000 inside right now."; mes "Do you want to enter to the room?"; if(.debuff) mes "^8b0d1fBe careful, because every buff you have will be lost upon entering the room.^000000"; next; if(select("Yes.","No, thanks.") == 1) { specialeffect2 F_Rand(EF_STORMKICK1,EF_STORMKICK2,EF_STORMKICK3,EF_STORMKICK6,EF_STORMKICK7); sleep2 600; specialeffect2 F_Rand(EF_SPINMOVE,EF_CASTSPIN2); sleep2 550; if(.debuff) dispell(); warp .map$,0,0; mapannounce .map$,strcharinfo(0)+" has entered the room.",bc_map,0xb50505; if(!.waiting_room) donpcevent "PvP#0::OnWaitingRoom"; } } else { mes "You must be at least level "+.min_lv+" to be able to enter the room."; close; } end; OnInit: // Command to rotate the room maually. bindatcmd "rotatepvp","PvP#0::OnMinute00",60; // Min LvL to enter the room. .min_lv = 50; // Will players be dispelled upon entering the room? .debuff = false; OnMinute00: OnMinute30: // PvP maps go here. Change them as you wish. setarray .@maps$[0], "guild_vs2","guild_vs3","guild_vs5","pvp_y_1-1","guild_vs4","guild_vs1","arena_room"; // Max amount of times a map can be repeated. 0 = unlimited. .@row = 3; .@size = getarraysize(.@maps$); if(.map$ == "") { // You can edit the room mapflags here. setarray .@mapfl[0], mf_nosave, mf_nodrop, mf_novending, mf_noteleport, mf_noreturn, mf_nowarp, mf_nowarpto, mf_nomemo, mf_nopenalty, mf_nobranch, mf_hidemobhpbar, mf_pvp, mf_pvp_noguild, mf_pvp_noparty, mf_pvp_nocalcrank, mf_loadevent; .@i = getarraysize(.@mapfl); while(.@i--) { .@j = .@size; while(.@j--) setmapflag .@maps$[.@j],.@mapfl[.@i]; } } .@map$ = .map$; .@r = rand(.@size); .map$ = .@maps$[.@r]; if(.@row && .map$ == .@map$) { if(++.row >= .@row) { deletearray .@maps$[.@r],1; .map$ = .@maps$[rand(.@size - 1)]; .row = 0; } } else if(.row) { .row = 0; } if(.map$ != .@map$ && .@map$ != "") { mapwarp .@map$,.map$,0,0; sleep 2500; mapannounce .map$,"The PvP Room has changed!",bc_npc,0xe53a12; } end; OnWaitingRoom: .waiting_room = true; while(true) { .@count = getmapusers(.map$); if(.@count != .@old_count) { .@old_count = .@count; delwaitingroom; waitingroom F_InsertPlural(.@count,"player")+".",0; } sleep 2500; } end; }
  9. Probably the map you warped to didn't have the mf_loadevent mapflag. You can use this version anyways. I avoided doing it this way since it can cause a bit of lagging. /* Changelog: v1.1 Added option to debuff players when entering the room. Added command to rotate manually. Remove hiding when quitting room. Added lvl checking on command. v1.1a Removed right curly which made dispell function don't work. Sorry. Added color to the npc name in dialog. Added F_InsertPlural use. v1.2 Added waitingroom with player count. v1.3 Use of pcblock command. */ // You can use this function with other scripts as well. function script dispell { while(.@i++ < SC_SPL_MATK) { if( .@i != SC_WEIGHT50 && .@i != SC_WEIGHT90 && .@i != SC_NOCHAT && .@i != SC_BABY && /* .@i != SC_WEDDING && .@i != SC_XMAS && .@i != SC_SUMMER && .@i != SC_HANBOK && .@i != SC_OKTOBERFEST && */ .@i != SC_JAILED && .@i != SC_EXPBOOST && .@i != SC_ITEMBOOST ) sc_end .@i; } .@i = SC_FEAR; while(.@i++ < SC_AKAITSUKI) sc_end .@i; } prontera,147,172,6 script PvP#0 4_M_SAKRAYROYAL,{ .@n$ = "^3227cd[PvP Room]^000000"; mes .@n$; if(BaseLevel >= .min_lv) { mes "There are ^d40f00"+F_InsertPlural(getmapusers(.map$),"player")+"^000000 inside right now."; mes "Do you want to enter to the room?"; if(.debuff) mes "^8b0d1fBe careful, because every buff you have will be lost upon entering the room.^000000"; next; if(select("Yes.","No, thanks.") == 1) { specialeffect2 F_Rand(EF_STORMKICK1,EF_STORMKICK2,EF_STORMKICK3,EF_STORMKICK6,EF_STORMKICK7); sleep2 600; specialeffect2 F_Rand(EF_SPINMOVE,EF_CASTSPIN2); sleep2 550; if(.debuff) dispell(); warp .map$,0,0; mapannounce .map$,strcharinfo(0)+" has entered the room.",bc_map,0xb50505; if(!.waiting_room) donpcevent "PvP#0::OnWaitingRoom"; } } else { mes "You must be at least level "+.min_lv+" to be able to enter the room."; close; } end; OnInit: // This command can be used to enter the PvP Room. bindatcmd "pvp","PvP#0::OnCommand"; // Command to rotate the room maually. bindatcmd "rotatepvp","PvP#0::OnMinute00",60; // Min LvL to enter the room. .min_lv = 50; // Will players be dispelled upon entering the room? .debuff = false; OnMinute00: OnMinute30: // PvP maps go here. Change them as you wish. setarray .@maps$[0], "guild_vs2","guild_vs3","guild_vs5","pvp_y_1-1","guild_vs4","guild_vs1","arena_room"; // Max amount of times a map can be repeated. 0 = unlimited. .@row = 3; .@size = getarraysize(.@maps$); if(.map$ == "") { // You can edit the room mapflags here. setarray .@mapfl[0], mf_nosave, mf_nodrop, mf_novending, mf_noteleport, mf_noreturn, mf_nowarp, mf_nowarpto, mf_nomemo, mf_nopenalty, mf_nobranch, mf_hidemobhpbar, mf_pvp, mf_pvp_noguild, mf_pvp_noparty, mf_pvp_nocalcrank, mf_loadevent; .@i = getarraysize(.@mapfl); while(.@i--) { .@j = .@size; while(.@j--) setmapflag .@maps$[.@j],.@mapfl[.@i]; } } .@map$ = .map$; .@r = rand(.@size); .map$ = .@maps$[.@r]; if(.@row && .map$ == .@map$) { if(++.row >= .@row) { deletearray .@maps$[.@r],1; .map$ = .@maps$[rand(.@size - 1)]; .row = 0; } } else if(.row) { .row = 0; } if(.map$ != .@map$ && .@map$ != "") { mapwarp .@map$,.map$,0,0; sleep 2500; mapannounce .map$,"The PvP Room has changed!",bc_npc,0xe53a12; } end; OnCommand: .@ins_id = instance_id(); .@m$ = strcharinfo(3); if((!.@ins_id || instance_mapname(.@m$,.@ins_id) == "") && BaseLevel >= .min_lv) { if(.@m$ != .map$) { message strcharinfo(0),"Preparing to enter!"; } else { message strcharinfo(0),"Quitting the room..."; unitstopwalk getcharid(3); //pcblock PCBLOCK_MOVE|PCBLOCK_ATTACK|PCBLOCK_SKILL,true; pcblockmove getcharid(3),true; pcblockskill getcharid(3),true; setoption OPTION_HIDE|OPTION_CLOAK|OPTION_CHASEWALK,false; } .@hp = HP; sleep2 1400; while(.@i++ < 5) { message strcharinfo(0),(6 - .@i)+"..."; sleep2 990; if(HP < .@hp) { message strcharinfo(0),"You can't do this in the middle of a battle."; //pcblock PCBLOCK_MOVE|PCBLOCK_ATTACK|PCBLOCK_SKILL,false; pcblockmove getcharid(3),false; pcblockskill getcharid(3),false; end; } } specialeffect2 F_Rand(EF_STORMKICK1,EF_STORMKICK2,EF_STORMKICK3,EF_STORMKICK6,EF_STORMKICK7); sleep2 600; specialeffect2 F_Rand(EF_SPINMOVE,EF_CASTSPIN2); sleep2 550; if(.@m$ != .map$) { if(.debuff) dispell(); warp .map$,0,0; mapannounce .map$,strcharinfo(0)+" has entered the room.",bc_map,0xb50505; if(!.waiting_room) donpcevent "PvP#0::OnWaitingRoom"; } else { warp "SavePoint",0,0; //pcblock PCBLOCK_MOVE|PCBLOCK_ATTACK|PCBLOCK_SKILL,false; pcblockmove getcharid(3),false; pcblockskill getcharid(3),false; } } else if(BaseLevel < .min_lv) { message strcharinfo(0),"You must be at least level "+.min_lv+" to be able to enter the room."; } else { message strcharinfo(0),"You can't enter the room in the middle of an instance."; } end; OnWaitingRoom: .waiting_room = true; while(true) { .@count = getmapusers(.map$); if(.@count != .@old_count) { .@old_count = .@count; delwaitingroom; waitingroom F_InsertPlural(.@count,"player")+".",0; } sleep 2500; } end; }
  10. You don't have the last version of rAthena. But you can change this line: getmapxy .@m$,.@x0,.@y0,BL_NPC; to: getmapxy .@m$,.@x0,.@y0,UNITTYPE_NPC;
  11. payon,147,229,4 script Test#HPbar 1_F_MARIA,{ if (.HP_Bar == false) { .HP_Bar = true; .mobGID = monster ("payon",148,226,"[T] HP Test",1031,1,strnpcinfo(0)+"::OnDie"); setunitdata .mobGID,UMOB_MAXHP,4000; setunitdata .mobGID,UMOB_HP,4000; .@count = getmapunits(BL_PC, "payon", .@units); for (.@i = 0; .@i < .@count; .@i++) { attachrid .@units[.@i]; addtimer(0,strnpcinfo(0)+"::OnHPBar"); } } end; OnDie: .HP_Bar = false; end; OnHPBar: .@U_MAXHP = getunitdata (.mobGID,UMOB_MAXHP); while (.HP_Bar != false) { .@U_HP = getunitdata (.mobGID,UMOB_HP); .@P_HP = (@.U_HP*100)/.@U_MAXHP; cutin(.@P_HP+"", 1); sleep2 100; } cutin("0_hpbar", 1); sleep2 5000; //Delay to hide HP Bar cutin("", 255); end; } This could be done for every MvP, but the way it's done (by adding a script and an attach every player on the map, adding new players on the map, and show them the HP every 100ms) would generate a lot of lag. I'd recommend using this for a special event mostly, and even that would be resource-intensive. Another way could be adding only the characters who attack the MvP with a custom label like OnAttack. I think there's such a label floating around boards.
  12. Something like this? - script Hourly_Rewards -1,{ OnAddMinute: #online_time++; if(#online_time % 5 == 0) { dispbottom "Time online: "+Time2Str(#online_time*60 + gettimetick(2))+"."; if(#online_time % 60 == 0) { .@old_points = #hourly_points; .@reward = ((#online_time / 60) + 5)%6 + 1; switch(.@reward) { case 1: #hourly_points += 10; break; case 2: #hourly_points += 20; break; case 3: #hourly_points += 30; break; case 4: #hourly_points += 10; break; case 5: #hourly_points += 10; break; case 6: #hourly_points += 30; break } dispbottom "You won "+(#hourly_points - .@old_points)+" points. Current amount:"+F_InsertComma(#hourly_points)+"."; } } OnPCLoginEvent: addtimer 60000,"Hourly_Rewards::OnAddMinute"; end; }
  13. n0tttt

    R> Map Access

    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?).
  14. n0tttt

    R> Map Access

    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;
×
×
  • Create New...