Jump to content

Orgasmator

Members
  • Posts

    51
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Location
    Istanbul/Turkey
  • Server
    Project XV
  • Interests
    Amateur Scripter/Developer/Graphic Designer<br/><br/>Skateboarder,Gamer etc

Recent Profile Visitors

4337 profile views

Orgasmator's Achievements

Poring

Poring (1/15)

0

Reputation

  1. Thank you for your fast response but sadly, I still get the same error. I've placed my script in scripts_custom.conf file. I've used <tabs> in the header of the script. Tried to use "return;" in the end of the function. Still doesn't work.. Any ideas?
  2. Hi all, I've been thinking of making a new Guild Package that could let people choose their own options of items. The Guild Package is an usable item actually. Is it possible to use menu with items? I'm getting the following error in my map server: [Error] script:callfunc: function not found! [gpack] [Debug] Source (NPC): FAKE_NPC (invisible/not on a map) Basically, I want this box to do the following: 1. Please Choose Your color of valk set--> Pop Up a menu Of Colors---then go to-->2 2.Please Choose Your Color Of Wings --> Pop Up a menu Of Colors---then go to-->3 3.Please Choose Your Accessories---> Pop Up a menu Of Items---- then go to -->4 4. Give a quest headgear Randomly----then go to---> 5 5. Give the remaining supply stuff NOTE: I used the script as a function, and used "callfunc "gpack"" in my item script. Here's my function: function script gpack { mes "[ Guild Package ]"; mes " Please choose a color of Valkyrie Set"; menu "Red",R_red,"Black",R_black,"White",R_white; R_black: next; getitem 30007,1; getitem 30281,1; getitem 30284,1; getitem 30287,1; getitem 30290,1; goto L_Wing; close; R_red: next; getitem 30008,1; getitem 30282,1; getitem 30285,1; getitem 30286,1; getitem 30291,1; goto L_Wing; close; R_white: next; getitem 30033,1; getitem 30283,1; getitem 30286,1; getitem 30289,1; getitem 30292,1; goto L_Wing; close; L_Wing: next; mes " [Guild Package] "; mes " Please choose a color of Fairy Wings."; menu "Red",L_red,"Black",L_black,"Green",L_green,"Blue",L_blue; L_red: next; getitem 30237,1; goto L_access; L_black: next; getitem 30238,1; goto L_access; L_green: next; getitem 30239,1; goto L_access; L_blue: next; getitem 30240,1; goto L_access; L_access; next; mes " [Guild Package] "; mes " Please choose a pair of accessory"; menu "Megingard",L_meg,"Sacred Incense",L_sac,"Occult Incense",L_occu,"Brisingamen",L_bris,"Critical Ring",L_crit,"Nile Rose",L_nile; L_meg: next; getitem 2629,2; goto L_supp; L_sac: next; getitem 2638,2; goto L_supp; L_occu: next; getitem 2639,2; goto L_supp; L_bris: next; getitem 2630,2; goto L_supp; L_crit: next; getitem 2688,2; goto L_supp; L_nile: next; getitem 2658,2; goto L_supp; L_supp: mes " [Guild Package] "; mes " Here, your supplies! "; getitem 30005,100; getitem 30395,5; getitem 4302,1; getitem 4131,1; getitem 14232,40; getitem 30324,40; close; } And here's my item script: 30415,Guild_Package,Guild Package,18,20,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "gpack"; },{},{} 1. Can somebody help me about my script? 2. How can I put "give random item" part in my script?
  3. Hi all, I've been wondering if it's possible to change Scream skill's effect to Frost Joke. It seems useless in my server due to some features so i want Dancer's Scream skill to be same as Frost Joke. Can someone kindly guide me about what src files and how i should edit?. Thank you.
  4. Hi, Since both Euphy's and Toasty's WoE controllers make the castle portals debuffing, I've decided to use Toasty's script only for timer and use a seperate script for WoE. I unchecked the box "Check if you want this script to control WoE" in Toasty's website. Here's the script: //====================================================================================================== //= Toasty's WoE Controller (formerly WoE Info Banner) //===== By: ============================================================================================ //= ToastOfDoom (aka: iHeart) //===== Current Version: =============================================================================== //= 1.22 //===== Description: =================================================================================== //= A WoE Controller function which controls castle based WoE by utilising npc events. //= Includes a NPC that provides information on the next WoE session //= //= This script is kinda @reloadscript/@loadnpc safe, provided that someone clicks the NPCs afterwards //= to start the OnInit function. That said..it is recommended that you don't use @reloadscript/@loadnpc //= but reset your server. //===== Changelog: ===================================================================================== //= 1.22 //= - Fixed an issue regarding the controller getting confused when using @reloadscript/loadnpc while //= WoE was still active. (thanks to annie for pointing out) //= 1.21 //= - Fixed a misspelt variable name (thanks to rahuldev345 for pointing out) //= 1.20 //= - Project renamed to 'Toasty's WoE Controller'. The script originally was only used to display WoE //= times then I 1st wrote it 3yrs ago and I feel it's purpose is more to control WoE these days. So //= name change to better reflect purpose. //= - Added support for novice WoE. Region teleport goes to the Novice Warper NPC (default in prontera) //= Change position in .region_maps, .region_x, .region_y if needed. //= - Region warp now only displays regions that have castles used at least once. (eg. If you don't //= configure any castles for Payon region, payon will not show up) //= - Optimised WoE Active/Inactive map notifier. Old method used too many loops for something that //= can happen alot. //= - Adjusted menus to be abit more friendly. 'next's will always display before 'menu's //= - Fixed bug with WoE autostarting when only configured for 2 sessions in one day //= - Added some nifty code that prevents catastrophic failure of the script if you try to run a trunk //= version on a stable server (ie. if you do, it will show an error message, but script will still //= run perfectly fine - check out WoEToggler function for those that want to peek at it =P) //= 1.11 //= - Fixed timer glitch when players only configured sessions for one day of the week //= - Adjusted timer to show remaining time more accurately //= - Modified .num_woes calculation due to bug regarding 0's being counted as unset values in arrays //= 1.10 //= - Expanded script to allow castle based configuration //= - Moved away from portal based woe control. Now using donpcevents to OnAgitEnd/2 events. Provided //= castles are linked to the main agit commands in this manner, they will be controllable using this //= script. //= - Added an onLoadMap WoE available notifier. Can be disabled by setting .notify_woe to 0 in the //= CONFIG section. //= - Did some funky color coding. //= - Added Coordinate based warping per region (see .region_x & .region_y in the CONSTANTS section) //= 1.02 //= - Added delwaitingroom to banner npc to prevent memory leaks from bug #2325 //= - To reduce spamming of waitingroom packets to players banner NPC only now updates when the banner //= text changes. Thus min time between updates is now 1sec regardless of setting. //= - Added setting for rate which banner time is updated (.banner_refresh_rate) in the CONFIG section. //= - Added agitstart2/end2 to provide WoE2 support (Hope it works //= 1.01 //= - Hardcoded in refresh value for banner npc instead of getting it from config from WoEInfoBase. Had //= issues starting the script after @reloadscript/@loadnpc //====================================================================================================== - script WoEInfoBase -1,{ OnStartMenu: if(.init == 0) donpcevent strnpcinfo(3)+"::OnInit"; OnStartMenu2: mes "The " + ((.state)?"^00DD00current":"^DD0000next") + "^000000 WoE session is: "; mes " "; mes "Day: ^0000DD" + .daysOfWeek$[.woe_day[.woe_index]]; mes "^000000Start time: ^00DD00" + .woe_0_str$[.woe_index]; mes "^000000End time: ^DD0000" + .woe_1_str$[.woe_index]; mes "^000000Region:"; set .@state_strs$, ".woe_state_str_" + .woe_state[.woe_index] + "$"; for(set .@i, 0; .@i < .num_regions; set .@i, .@i + 1) { set .@output$, getd(.@state_strs$ + "[" + .@i + "]"); if(.@output$ != "") mes "^000000- ^0000DD" + .@output$; } next; if(getgmlevel() >= .gm_access) select( "Warp to Castle Grounds", "View Castle Owners", "View all WoE times", ((!.state)?"Start next WoE":"End current WoE"), ((.state)?"":"Skip next WoE session") ); else select( "Warp to Castle Grounds", "View Castle Owners", "View all WoE times"); switch(@menu) { case 1: //warp mes "Which region would you like to warp to?"; next; select(.region_warp$[.woe_state[.woe_index]]); if(@menu < 1 || @menu > .num_regions) close; close2; warp .region_maps$[@menu - 1], .region_x[@menu - 1], .region_y[@menu - 1]; end; case 2: //view set .@woe_state_array$, ".woe_state_" + .woe_state[.woe_index]; for(set .@i, 0; .@i < .num_regions; set .@i, .@i + 1) { set .@k, 0; set .@castles$, ".castles_" + .regions$[.@i] + "$"; set .@castle_check, getd(.@woe_state_array$ + "[" + .@i + "]"); while(.@castle_check && .@k < .num_castles[.@i]) { if(.@castle_check & (1 << .@k)) { set .@map$, getd(.@castles$+"["+.@k+"]"); if (GetCastleData(.@map$,1)) { dispbottom "The [" + GetCastleName(.@map$) + "] castle of the [" + .region_names$[.@i] + "] region is currently held by the [" + GetGuildName(GetCastleData(.@map$,1)) + "] guild."; } else { dispbottom "The [" + GetCastleName(.@map$) + "] castle of the [" + .region_names$[.@i] + "] region is currently unoccupied."; } set .@castle_check, .@castle_check - (1 << .@k); } set .@k, .@k + 1; } } break; case 3: //woe times for(set .@i, 0; .@i < .num_woes; set .@i, .@i + 1) { dispbottom "- " + .daysOfWeek$[.woe_day[.@i]] + " " + .woe_0_str$[.@i] + "-" + .woe_1_str$[.@i]; set .@woe_state_str_array$, ".woe_state_str_" + .woe_state[.@i] + "$"; for(set .@k, 0; .@k < .num_regions; set .@k, .@k + 1) { set .@output$, getd(.@woe_state_str_array$ + "[" + .@k + "]"); if(.@output$ != "") dispbottom " " + .@output$; } } break; case 4: //start next; if(getgmlevel() <.gm_access) close; mes "^FF0000Are you sure you want to " + ((!.state)?"start the next WoE session?":"end the current WoE session?"); next; if(select("Yes:No") == 2) break; set .remainTime, 0; //might not work sometimes...you have like a 500ms window out of 505ms i guess.. sleep2 .timer_refresh_rate; //wait abit so the menu doesn't screw up (how long it takes for the timer to update) break; case 5: //skip next; if(getgmlevel() <.gm_access || .state) close; mes "^FF0000Are you sure you want to skip the next WoE session^000000"; next; if(select("Yes:No") == 2) break; if(.state) { //you really can't do this with woe active next; mes "Sorry, in the time you took making your decision, WoE started"; mes "Please either manually end it first or wait"; break; } set .woe_index, (.woe_index + 1) % .num_woes; donpcevent strnpcinfo(3)+"::OnUpdateCountTick"; sleep2 .timer_refresh_rate; break; default: close; } goto OnStartMenu2; OnInit: //-----------------------------------------------------------------------------------------// //CONFIG START // //-----------------------------------------------------------------------------------------// set .gm_access, 60; //WoE timings needs to be ordered ascendingly unless you want to do weird //stuff like skip a region every other week or so... //Also times can't overlap. Uses second of day(gettimetick(1)) for timing // eg 1am -> 3600, 2:30pm -> 52200, midnight -> 86400 (anything past that doesn't work) //Note: woe_0 is start times, woe_1 is end times. Ignore how it's called but // don't change it either since it's dynamically used // Also..woe has to end on the same day it starts (it's easier that way..) setarray .woe_day[0], 0, 1, 2, 3, 4, 5, 6; setarray .woe_0[0], 72000,72000,72000,72000,72000,72000,72000; setarray .woe_1[0], 75600,75600,75600,75600,75600,75600,75600; setarray .woe_state[0], 0, 0, 0, 0, 0, 0, 0; //WoE state settings. Every WoE session can be defined as a particular state of castle configuration. //.woe_state_#[%] = $ // # - state number // % - region number // $ - binary representation of castles that are active for that region in that state ( // (ie. 0 is no castles, 5 is castle 0 and 2 (2^0 + 2^2 = 5)) setarray .woe_state_0[0],1,0,0,0,0,0,0; //Setting for if script handles WoE controller function. Disable agit_controller.txt if you are using this. //For if you want to use something else to handle your woe stuff but only this script //to show info (1 - on, 0 - off...duh) set .active_woe, 0; //WoE inactive on map notifier. Basically notifies player if the castle they are entering is //WoE active or not set .notify_woe, 1; //-----------------------------------------------------------------------------------------// //CONFIG END // //-----------------------------------------------------------------------------------------// //-----------------------------------------------------------------------------------------// //CONSTANTS START - Don't touch this unless you know what you are doing // //-----------------------------------------------------------------------------------------// //castle maps by region setarray .castles_prtg$[0],"prtg_cas01","prtg_cas02","prtg_cas03","prtg_cas04","prtg_cas05"; setarray .castles_payg$[0],"payg_cas01","payg_cas02","payg_cas03","payg_cas04","payg_cas05"; setarray .castles_gefg$[0],"gefg_cas01","gefg_cas02","gefg_cas03","gefg_cas04","gefg_cas05"; setarray .castles_aldeg$[0],"aldeg_cas01","aldeg_cas02","aldeg_cas03","aldeg_cas04","aldeg_cas05"; setarray .castles_arug$[0],"arug_cas01","arug_cas02","arug_cas03","arug_cas04","arug_cas05"; setarray .castles_schg$[0],"schg_cas01","schg_cas02","schg_cas03","schg_cas04","schg_cas05"; setarray .castles_novi$[0],"nguild_alde","nguild_gef","nguild_pay","nguild_prt"; //woe kill functions for each castle setarray .woe_kill_prtg$[0],"Agit#prtg_cas01::OnAgitEnd","Agit#prtg_cas02::OnAgitEnd","Agit#prtg_cas03::OnAgitEnd","Agit#prtg_cas04::OnAgitEnd","Agit#prtg_cas05::OnAgitEnd"; setarray .woe_kill_payg$[0],"Agit#payg_cas01::OnAgitEnd","Agit#payg_cas02::OnAgitEnd","Agit#payg_cas03::OnAgitEnd","Agit#payg_cas04::OnAgitEnd","Agit#payg_cas05::OnAgitEnd"; setarray .woe_kill_gefg$[0],"Agit#gefg_cas01::OnAgitEnd","Agit#gefg_cas02::OnAgitEnd","Agit#gefg_cas03::OnAgitEnd","Agit#gefg_cas04::OnAgitEnd","Agit#gefg_cas05::OnAgitEnd"; setarray .woe_kill_aldeg$[0],"Agit#aldeg_cas01::OnAgitEnd","Agit#aldeg_cas02::OnAgitEnd","Agit#aldeg_cas03::OnAgitEnd","Agit#aldeg_cas04::OnAgitEnd","Agit#aldeg_cas05::OnAgitEnd"; setarray .woe_kill_arug$[0],"Manager#aru01_02::OnAgitEnd2","Manager#aru02_02::OnAgitEnd2","Manager#aru03_02::OnAgitEnd2","Manager#aru04_02::OnAgitEnd2","Manager#aru05_02::OnAgitEnd2"; setarray .woe_kill_schg$[0],"Manager#sch01_02::OnAgitEnd2","Manager#sch02_02::OnAgitEnd2","Manager#sch03_02::OnAgitEnd2","Manager#sch04_02::OnAgitEnd2","Manager#sch05_02::OnAgitEnd2"; setarray .woe_kill_novi$[0],"Agit_N01::OnAgitEnd","Agit_N02::OnAgitEnd","Agit_N03::OnAgitEnd","Agit_N04::OnAgitEnd"; //region prefixs setarray .regions$[0],"prtg","payg","gefg","aldeg","arug","schg","novi"; //region info setarray .region_names$[0],"Prontera", "Payon", "Geffen", "Aldebaran", "Arunafeltz", "Schwarzwald", "Novice Castles"; setarray .region_maps$[0],"prt_gld", "pay_gld", "gef_fild13", "alde_gld", "aru_gld", "sch_gld", "prontera"; //coords to warp player to region (0 is random) setarray .region_x[0],0, 0, 0, 0, 0, 0, 148; setarray .region_y[0],0, 0, 0, 0, 0, 0, 163; setarray .waitMsg$[0], "WoE Starts: ", "WoE Ends: "; setarray .startMsg$[0], "WoE is Starting", "WoE is Ending"; set .ticks_in_day, 86400; //mmm...magic numbers setarray .daysOfWeek$[0], "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"; set .timer_refresh_rate, 500; //how many ms per timer refresh...keep less than 1000 (in milliseconds) set .change_state_sleep, 3000; //how long to show "WoE is Start|End-ing" msg for in ms. (in milliseconds) //Make sure WoE sessions are longer than this xD set .banner_refresh_rate, 10; //how many seconds per banner refresh...keep 1 or above (in seconds) //-----------------------------------------------------------------------------------------// //CONSTANTS END // //-----------------------------------------------------------------------------------------// set .num_regions, getarraysize(.regions$); set .num_woes, getarraysize(.woe_1); //force WoE to end if active callfunc "WoEToggler", 0; for(set .@i, 0; .@i < .num_regions; set .@i, .@i + 1) { //count num castles per region set .num_castles[.@i], getarraysize(getd(".castles_" + .regions$[.@i] + "$")); } //convert timestamps to readable format for(set .@i, 0; .@i < .num_woes; set .@i, .@i + 1) { set .@hrs, .woe_0[.@i] / 3600; set .@mins, .woe_0[.@i] % 3600 / 60; set .@output$, ((.@hrs % 12)?.@hrs%12:12) + ":" + ((.@mins < 10)?"0"+.@mins:.@mins) + " " + ((.@hrs > 12)?"PM":"AM"); set .woe_0_str$[.@i], .@output$; set .@hrs, .woe_1[.@i] / 3600; set .@mins, .woe_1[.@i] % 3600 / 60; set .@output$, ((.@hrs % 12)?.@hrs%12:12) + ":" + ((.@mins < 10)?"0"+.@mins:.@mins) + " " + ((.@hrs > 12)?"PM":"AM"); set .woe_1_str$[.@i], .@output$; } //calc number of woe states and consolidate states to create list of castles used set .num_states, 0; while(getarraysize(getd(".woe_state_" + (.num_states)))) { set .@state$, ".woe_state_" + .num_states; set .@i, 0; while(.@i < getarraysize(getd(.@state$))) { set .castleUsage[.@i], .castleUsage[.@i] | getd(.@state$ + "[" + .@i + "]"); set .@i, .@i + 1; } set .num_states, .num_states + 1; } for(set .@i, 0; .@i < .num_states; set .@i, .@i + 1) { set .@woe_state_array$, ".woe_state_" + .@i; for(set .@k, 0; .@k < .num_regions; set .@k, .@k + 1) { if(.castleUsage[.@k] > 0) { set .@castles$, ".castles_" + .regions$[.@k] + "$"; set .@castle_check, getd(.@woe_state_array$ + "[" + .@k + "]"); if(.@castle_check == 0) { //region not in this state //region warp menu string set .region_warp$[.@i], .region_warp$[.@i] + "^DD0000" + .region_names$[.@k] + "^000000:"; continue; } else { if(.@castle_check >= ((1 << .num_castles[.@k]) - 1)) { //includes all castles...just list as region. setd(".woe_state_str_" + .@i + "$[" + .@k + "]", .region_names$[.@k]); //region warp menu string set .region_warp$[.@i], .region_warp$[.@i] + "^00DD00" + .region_names$[.@k] + "^000000:"; } else { set .@j, 0; set .@output$, ""; while(.@j < .num_castles[.@k]) { if(.@castle_check & (1 << .@j)) { set .@output$, .@output$ + GetCastleName(getd(.@castles$+"["+.@j+"]")); set .@castle_check, .@castle_check - (1 << .@j); if(.@castle_check) { if(.@output$ != "") set .@output$, .@output$ + ", "; } else break; } set .@j, .@j + 1; } setd(".woe_state_str_" + .@i + "$[" + .@k + "]", .region_names$[.@k] + " ("+ .@output$ + ")"); //region warp menu string set .region_warp$[.@i], .region_warp$[.@i] + "^00DD00" + .region_names$[.@k] + " ("+ .@output$ + ")^000000:"; } } } else { set .region_warp$[.@i], .region_warp$[.@i] + ":"; } } } donpcevent strnpcinfo(3)+"::OnFindCurIndex"; donpcevent strnpcinfo(3)+"::OnUpdateCountTick"; if(.active_woe) { if(.notify_woe) { //set mapflag for all castle maps for(set .@i, 0; .@i < .num_regions; set .@i, .@i + 1) { set .@region_array$, ".castles_" + .regions$[.@i] + "$"; for(set .@k, 0; .@k < .num_castles[.@i]; set .@k, .@k + 1) { setmapflag getd(.@region_array$ + "[" + .@k + "]"), mf_loadevent; setd(".loadmap_region_" + getd(.@region_array$ + "[" + .@k + "]"), .@i + 1); setd(".loadmap_castleIndex_" + getd(.@region_array$ + "[" + .@k + "]"), .@k); } } } //activates WoE if needed donpcevent strnpcinfo(3)+"::OnDoWoE"; } //flag that init occured set .init, 1; OnWoETimer: //timer stuff while (1) { set .remainTime, .count_tick - gettimetick(2); set .bannerTimer, .remainTime - (.remainTime % .banner_refresh_rate) + .banner_refresh_rate; set .min, .bannerTimer / 60; set .sec, .bannerTimer - .min * 60; set .hr, .min / 60; set .min, .min - .hr * 60; set .roomMsg$, .waitMsg$[.state] + .hr + ":" + ((.min < 10 )?"0":"") + .min + ":" + ((.sec < 10 )?"0":"") + .sec; sleep .timer_refresh_rate; if(.remainTime <= 0) { if(.active_woe) { donpcevent strnpcinfo(3)+"::OnDoWoE"; } set .roomMsg$, .startMsg$[.state]; set .woe_index, (.woe_index + .state) % .num_woes; //go to next index if needed set .state, (.state + 1) % 2; //flip state donpcevent strnpcinfo(3)+"::OnUpdateCountTick"; sleep .change_state_sleep; } } end; //obligatory end =D OnUpdateCountTick: set .count_tick, getd(".woe_" + .state + "[" + .woe_index + "]"); set .count_tick, gettimetick(2) + .count_tick - gettimetick(1) + (.woe_day[.woe_index] - gettime(4) + 7) % 7 * .ticks_in_day; if(gettimetick(2) > .count_tick) set .count_tick, .count_tick + 7 * .ticks_in_day; end; OnFindCurIndex: set .@cur_day, gettime(4); set .@cur_tick, gettimetick(1); set .woe_index, 0; set .state, 0; for(set .@i, 0; .@i < .num_woes; set .@i, .@i + 1) { if(.woe_day[.@i] < .@cur_day) continue; if(.woe_day[.@i] == .@cur_day) { if(.woe_0[.@i] >= .@cur_tick) { set .woe_index, .@i; set .state, 0; break; } if(.woe_1[.@i] >= .@cur_tick) { set .woe_index, .@i; set .state, 1; break; } } if(.woe_day[.@i] > .@cur_day) { set .woe_index, .@i; set .state, 0; break; } } end; //On map notifier //Comment out OnPCLoadMapEvent label if .notify_woe is disabled to prevent unnecessary triggering OnPCLoadMapEvent: if(.state && .notify_woe) { getmapxy(.@map$, .@x, .@y, 0); set .@region, getd(".loadmap_region_" + .@map$) - 1; if(.@region >= 0) { set .@castleIndex, getd(".loadmap_castleIndex_" + .@map$); if(getd(".woe_state_" + .woe_state[.woe_index] + "[" + .@region + "]") & 1 << .@castleIndex) dispbottom "The [" + GetCastleName(.@map$) + "] castle is available for conquering during this WoE session"; else dispbottom "The [" + GetCastleName(.@map$) + "] castle is NOT available for conquering during this WoE session"; } } end; //------------------------------------------------------------------------------ // WoE Controller Stuff Here //------------------------------------------------------------------------------ OnDoWoE: if((.state == 0 && .init) || (.state == 1 && !agitcheck())) { //starting callfunc "WoEToggler", 1; //kills WoE in all castles that shouldn't have WoE set .@woe_state_array$, ".woe_state_" + .woe_state[.woe_index]; for(set .@i, 0; .@i < .num_regions; set .@i, .@i + 1) { set .@castles$, ".castles_" + .regions$[.@i] + "$"; set .@castle_check, getd(.@woe_state_array$ + "[" + .@i + "]"); for(set .@k, 0; .@k < .num_castles[.@i]; set .@k, .@k + 1) { set .@map$, getd(.@castles$+"["+.@k+"]"); if((.@castle_check & (1 << .@k)) == 0) { donpcevent getd(".woe_kill_" + .regions$[.@i] + "$[" + .@k + "]"); } } } announce "The War Of Emperium has begun!",bc_all; donpcevent strnpcinfo(3)+"::OnDisplayOwners"; } else { //ending if(agitcheck()) { callfunc "WoEToggler", 0; announce "The War Of Emperium is over!",bc_all; donpcevent strnpcinfo(3)+"::OnDisplayOwners"; } } end; OnDisplayOwners: //displays based on current region set .@woe_state_array$, ".woe_state_" + .woe_state[.woe_index]; for(set .@i, 0; .@i < .num_regions; set .@i, .@i + 1) { set .@k, 0; set .@castle_check, getd(.@woe_state_array$ + "[" + .@i + "]"); set .@castles$, ".castles_" + .regions$[.@i] + "$"; while(.@castle_check && .@k < .num_castles[.@i]) { if(.@castle_check & (1 << .@k)) { set .@map$, getd(.@castles$+"["+.@k+"]"); if (GetCastleData(.@map$,1)) { announce "The [" + GetCastleName(.@map$) + "] castle of the [" + .region_names$[.@i] + "] region is currently held by the [" + GetGuildName(GetCastleData(.@map$,1)) + "] guild.",bc_all; } else { announce "The [" + GetCastleName(.@map$) + "] castle of the [" + .region_names$[.@i] + "] region is currently unoccupied.",bc_all; } set .@castle_check, .@castle_check - (1 << .@k); } set .@k, .@k + 1; } } end; } prontera,163,194,4 script WoE Info 837,{ if(getwaitingroomstate(3, strnpcinfo(3)) == -1) donpcevent strnpcinfo(3)+"::OnInit"; doevent "WoEInfoBase::OnStartMenu"; end; OnInit: while (1) { //only updates if msg is different set .banner$, getwaitingroomstate(4, strnpcinfo(3)); if(getvariableofnpc(.roomMsg$, "WoEInfoBase") != .banner$) { delwaitingroom; waitingroom getvariableofnpc(.roomMsg$, "WoEInfoBase"), 0; } sleep 500; } end; } //zomg! it duplicates!! prontera,156,196,6 duplicate(WoE Info) WoE Info#2winfo 837 //--------------------------------------------------------------------------------------------------------------------- //These two functions handle WoE's activation/deactivation. Since stable does not have AgitStart2/AgitEnd2, //using the trunk version will result in catastrophic failure of the script. Double declaration of the following //functions fixes this (you will get warning messages though) function script WoEToggler { //<state> = 0|1 if(getarg(0)) { AgitStart; } else { AgitEnd; } return; } //if stable script will fail parsing this function, but the rest of the script will still be usable function script WoEToggler { //<state> = 0|1 if(getarg(0)) { AgitStart; AgitStart2; } else { AgitEnd; AgitEnd2; } return; } The timer is working fine but WoE doesn't start. It should start between 20.00 (8pm) and end at 21.00 (9pm). Here's the script: //===== rAthena Script ======================================= //= War of Emperium - WoE Auto-Start //===== By: ================================================== //= kalen (1.0) //= 1.1 by Akaru and ho|yAnge| //===== Current Version: ===================================== //= 2.0 //===== Compatible With: ===================================== //= rAthena SVN; RO Episode 4+ //===== Description: ========================================= //= Auto Start for War of Emperium //============================================= //= gettime(3): Gets hour (24 hour time) //= gettime(4): Gets day of week 1=Monday, 2=Tuesday, //= 3=Wednesday, 4=Thursday, etc. //===== Additional Comments: ================================= //= v1.1a changed OnInit to OnAgitInit.[kobra_k88] //= v1.2 added gettime checks. removed $AgitStarted var.[kobra_k88] //= v1.3 Moved treasure spawn time here.[kobra_k88] //= v1.3a Implemented Shadowlady's idea to allow for different //= start/stop times on different days.[kobra_k88] //= 1.4 Fixed treasure chests spawn! We had to unroll some loops //= Now they appear in castles from 00:01 to 00:24. [Lupus] //= 1.5 Fixed WOE end messages on non-WOE days, by Avaj //= 1.5a missing tabs [KarLaeda] //= 1.6 Corrected multiple "WoE has begun" announces [ultramage] //= 1.7 Commented out the WoE start and end announces. [L0ne_W0lf] //= 1.8 Castle owners displayed when WoE starts and finished. [L0ne_W0lf] //= 1.8a Will now report unoccupied castles at start/end. [L0ne_W0lf] //= 1.8b Whoops. Fixed a mistake [L0ne_W0lf] //= 1.9 Rearranged the time-checks so they no longer use goto. [L0ne_W0lf] //= Removed treasure spawning function calls. (No longer needed) //= 2.0 Added WoE Battle Log support for broadcasts. [L0ne_W0lf] //============================================================ //| To know how to set up WoE times, go to doc\woe_time_explanation.txt // WoE Start/Stop times //====================================== - script Agit_Event -1,{ end; OnClock2000: //start time for Tues(2), Thurs(4) OnClock2100: //end time for Tues(2), Thurs(4) OnClock2000: //start time for Tues(2), Thurs(4) OnClock2100: //end time for Tues(2), Thurs(4) OnClock2000: //start time for Tues(2), Thurs(4) OnClock2100: //end time for Tues(2), Thurs(4) OnClock2000: //start time for Tues(2), Thurs(4) OnClock2100: //end time for Tues(2), Thurs(4) OnClock2000: //start time for Tues(2), Thurs(4) OnClock2100: //end time for Tues(2), Thurs(4 OnClock2000: //start time for Sat(6) OnClock2100: //end time for Sat(6) OnClock2000: //start time for Tues(2), Thurs(4) OnClock2100: //end time for Tues(2), Thurs(4) OnAgitInit: // starting time checks if((gettime(4)==1) && (gettime(3)>=20 && gettime(3)<21) || (gettime(4)==2) && (gettime(3)>=20 && gettime(3)<21) || (gettime(4)==4) && (gettime(3)>=20 && gettime(3)<21) || (gettime(4)==5) && (gettime(3)>=20 && gettime(3)<21) || (gettime(4)==6) && (gettime(3)>=20 && gettime(3)<21) || (gettime(4)==7) && (gettime(3)>=20 && gettime(3)<21)) { if (!agitcheck()) { AgitStart; callsub S_DisplayOwners; } end; } // end time checks if ((gettime(4)==1) && (gettime(3)==21) || (gettime(4)==2) && (gettime(3)==21) || (gettime(4)==3) && (gettime(3)==21) || (gettime(4)==4) && (gettime(3)==21) || (gettime(4)==5) && (gettime(3)==21) || (gettime(4)==6) && (gettime(3)==21) || (gettime(4)==7) && (gettime(3)==21)) { if (agitcheck()) { AgitEnd; callsub S_DisplayOwners; } end; } end; S_DisplayOwners: setarray .@maps$[0],"aldeg_cas01","aldeg_cas02","aldeg_cas03","aldeg_cas04","aldeg_cas05"; setarray .@maps$[5],"gefg_cas01","gefg_cas02","gefg_cas03","gefg_cas04","gefg_cas05"; setarray .@maps$[10],"payg_cas01","payg_cas02","payg_cas03","payg_cas04","payg_cas05"; setarray .@maps$[15],"prtg_cas01","prtg_cas02","prtg_cas03","prtg_cas04","prtg_cas05"; for( set .@i, 0; .@i <= 19; set .@i, .@i+1 ) { if (GetCastleData(.@maps$[.@i],1)) { Announce "The [" + GetCastleName(.@maps$[.@i]) + "] castle has been conquered by the [" + GetGuildName(GetCastleData(.@maps$[.@i],1)) + "] guild.",bc_all|bc_woe; } else { Announce "The [" + GetCastleName(.@maps$[.@i]) + "] castle is currently unoccupied.",bc_all|bc_woe; } } end; } Toasty's timer is named as woe_controller.txt in npc/custom and it's added in scripts_custom.conf file. My main WoE controller is named as agit_controller and it's in guild file, also written in scripts_guild.conf file. I'm sure the agit_main is active in scripts_guild.conf too. I don't understand why it doesn't start. Is there anyone who can solve my problem?
  5. I tried to use it only for timer. I unchecked the option "use this script to control WoE" in Toasty's php site. Now it doesnt dispell. How can that happen? Now I'm using her/his script only for timer and official agit_controller for WoE starting script. I'm not sure if official one will dispell or not in WoE time.
  6. I already check the WHOLE npc folder and i couldn't find any sc_ commands. Asking again, if you excuse me: "Is it possible to deactivate the debuff with script modification?"
  7. I've searched and I'm sure none of them has sc_end. As I said, If I deactivate the woe controller im using (either euphy or toaster's) portals doesn't debuff. It must be something related to these scripts but I can't figure out. Is it possible to deactivate the debuff with script modification? Moootie suggested some function stuff, he edited my toaster's script but this time, WoE didnt start and the timer was not working. He said his function blocked the timer so he needs to edit again, but he's busy. My mind is about to blow. How can this happen? Edit: I also checked agit_main.txt and prtg_cas01.txt files. They don't have any lines with any "sc_" command.
  8. That's the point! It doesn't have any sc_end commands in it. I also tried euphy's latest woe_controller script which came with rAthena (trunk/npc/custom/woe_controller.txt) and it does the same thing. But it doesnt have any lines with sc_end/sc_all also. I have never used such a modification. I didn't install any castle dispell scripts also. Weird thing is, if i disable woe_controller, portals doesn't debuff but then i can't have WoE started automatically. Any ideas?
  9. Hi Emistry, I've been trying them 1 by 1 already. This is ToastOfDoom's script that i'm using: //====================================================================================================== //= Toasty's WoE Controller (formerly WoE Info Banner) //===== By: ============================================================================================ //= ToastOfDoom (aka: iHeart) //===== Current Version: =============================================================================== //= 1.22 //===== Description: =================================================================================== //= A WoE Controller function which controls castle based WoE by utilising npc events. //= Includes a NPC that provides information on the next WoE session //= //= This script is kinda @reloadscript/@loadnpc safe, provided that someone clicks the NPCs afterwards //= to start the OnInit function. That said..it is recommended that you don't use @reloadscript/@loadnpc //= but reset your server. //===== Changelog: ===================================================================================== //= 1.22 //= - Fixed an issue regarding the controller getting confused when using @reloadscript/loadnpc while //= WoE was still active. (thanks to annie for pointing out) //= 1.21 //= - Fixed a misspelt variable name (thanks to rahuldev345 for pointing out) //= 1.20 //= - Project renamed to 'Toasty's WoE Controller'. The script originally was only used to display WoE //= times then I 1st wrote it 3yrs ago and I feel it's purpose is more to control WoE these days. So //= name change to better reflect purpose. //= - Added support for novice WoE. Region teleport goes to the Novice Warper NPC (default in prontera) //= Change position in .region_maps, .region_x, .region_y if needed. //= - Region warp now only displays regions that have castles used at least once. (eg. If you don't //= configure any castles for Payon region, payon will not show up) //= - Optimised WoE Active/Inactive map notifier. Old method used too many loops for something that //= can happen alot. //= - Adjusted menus to be abit more friendly. 'next's will always display before 'menu's //= - Fixed bug with WoE autostarting when only configured for 2 sessions in one day //= - Added some nifty code that prevents catastrophic failure of the script if you try to run a trunk //= version on a stable server (ie. if you do, it will show an error message, but script will still //= run perfectly fine - check out WoEToggler function for those that want to peek at it =P) //= 1.11 //= - Fixed timer glitch when players only configured sessions for one day of the week //= - Adjusted timer to show remaining time more accurately //= - Modified .num_woes calculation due to bug regarding 0's being counted as unset values in arrays //= 1.10 //= - Expanded script to allow castle based configuration //= - Moved away from portal based woe control. Now using donpcevents to OnAgitEnd/2 events. Provided //= castles are linked to the main agit commands in this manner, they will be controllable using this //= script. //= - Added an onLoadMap WoE available notifier. Can be disabled by setting .notify_woe to 0 in the //= CONFIG section. //= - Did some funky color coding. //= - Added Coordinate based warping per region (see .region_x & .region_y in the CONSTANTS section) //= 1.02 //= - Added delwaitingroom to banner npc to prevent memory leaks from bug #2325 //= - To reduce spamming of waitingroom packets to players banner NPC only now updates when the banner //= text changes. Thus min time between updates is now 1sec regardless of setting. //= - Added setting for rate which banner time is updated (.banner_refresh_rate) in the CONFIG section. //= - Added agitstart2/end2 to provide WoE2 support (Hope it works //= 1.01 //= - Hardcoded in refresh value for banner npc instead of getting it from config from WoEInfoBase. Had //= issues starting the script after @reloadscript/@loadnpc //====================================================================================================== - script WoEInfoBase -1,{ OnStartMenu: if(.init == 0) donpcevent strnpcinfo(3)+"::OnInit"; OnStartMenu2: mes "The " + ((.state)?"^00DD00current":"^DD0000next") + "^000000 WoE session is: "; mes " "; mes "Day: ^0000DD" + .daysOfWeek$[.woe_day[.woe_index]]; mes "^000000Start time: ^00DD00" + .woe_0_str$[.woe_index]; mes "^000000End time: ^DD0000" + .woe_1_str$[.woe_index]; mes "^000000Region:"; set .@state_strs$, ".woe_state_str_" + .woe_state[.woe_index] + "$"; for(set .@i, 0; .@i < .num_regions; set .@i, .@i + 1) { set .@output$, getd(.@state_strs$ + "[" + .@i + "]"); if(.@output$ != "") mes "^000000- ^0000DD" + .@output$; } next; if(getgmlevel() >= .gm_access) select( "Warp to Castle Grounds", "View Castle Owners", "View all WoE times", ((!.state)?"Start next WoE":"End current WoE"), ((.state)?"":"Skip next WoE session") ); else select( "Warp to Castle Grounds", "View Castle Owners", "View all WoE times"); switch(@menu) { case 1: //warp mes "Which region would you like to warp to?"; next; select(.region_warp$[.woe_state[.woe_index]]); if(@menu < 1 || @menu > .num_regions) close; close2; warp .region_maps$[@menu - 1], .region_x[@menu - 1], .region_y[@menu - 1]; end; case 2: //view set .@woe_state_array$, ".woe_state_" + .woe_state[.woe_index]; for(set .@i, 0; .@i < .num_regions; set .@i, .@i + 1) { set .@k, 0; set .@castles$, ".castles_" + .regions$[.@i] + "$"; set .@castle_check, getd(.@woe_state_array$ + "[" + .@i + "]"); while(.@castle_check && .@k < .num_castles[.@i]) { if(.@castle_check & (1 << .@k)) { set .@map$, getd(.@castles$+"["+.@k+"]"); if (GetCastleData(.@map$,1)) { dispbottom "The [" + GetCastleName(.@map$) + "] castle of the [" + .region_names$[.@i] + "] region is currently held by the [" + GetGuildName(GetCastleData(.@map$,1)) + "] guild."; } else { dispbottom "The [" + GetCastleName(.@map$) + "] castle of the [" + .region_names$[.@i] + "] region is currently unoccupied."; } set .@castle_check, .@castle_check - (1 << .@k); } set .@k, .@k + 1; } } break; case 3: //woe times for(set .@i, 0; .@i < .num_woes; set .@i, .@i + 1) { dispbottom "- " + .daysOfWeek$[.woe_day[.@i]] + " " + .woe_0_str$[.@i] + "-" + .woe_1_str$[.@i]; set .@woe_state_str_array$, ".woe_state_str_" + .woe_state[.@i] + "$"; for(set .@k, 0; .@k < .num_regions; set .@k, .@k + 1) { set .@output$, getd(.@woe_state_str_array$ + "[" + .@k + "]"); if(.@output$ != "") dispbottom " " + .@output$; } } break; case 4: //start next; if(getgmlevel() <.gm_access) close; mes "^FF0000Are you sure you want to " + ((!.state)?"start the next WoE session?":"end the current WoE session?"); next; if(select("Yes:No") == 2) break; set .remainTime, 0; //might not work sometimes...you have like a 500ms window out of 505ms i guess.. sleep2 .timer_refresh_rate; //wait abit so the menu doesn't screw up (how long it takes for the timer to update) break; case 5: //skip next; if(getgmlevel() <.gm_access || .state) close; mes "^FF0000Are you sure you want to skip the next WoE session^000000"; next; if(select("Yes:No") == 2) break; if(.state) { //you really can't do this with woe active next; mes "Sorry, in the time you took making your decision, WoE started"; mes "Please either manually end it first or wait"; break; } set .woe_index, (.woe_index + 1) % .num_woes; donpcevent strnpcinfo(3)+"::OnUpdateCountTick"; sleep2 .timer_refresh_rate; break; default: close; } goto OnStartMenu2; OnInit: //-----------------------------------------------------------------------------------------// //CONFIG START // //-----------------------------------------------------------------------------------------// set .gm_access, 60; //WoE timings needs to be ordered ascendingly unless you want to do weird //stuff like skip a region every other week or so... //Also times can't overlap. Uses second of day(gettimetick(1)) for timing // eg 1am -> 3600, 2:30pm -> 52200, midnight -> 86400 (anything past that doesn't work) //Note: woe_0 is start times, woe_1 is end times. Ignore how it's called but // don't change it either since it's dynamically used // Also..woe has to end on the same day it starts (it's easier that way..) setarray .woe_day[0], 1, 3, 5, 6; setarray .woe_0[0], 72000,72000,72000,72000; setarray .woe_1[0], 75600,75600,75600,75600; setarray .woe_state[0], 0, 0, 0, 0; //WoE state settings. Every WoE session can be defined as a particular state of castle configuration. //.woe_state_#[%] = $ // # - state number // % - region number // $ - binary representation of castles that are active for that region in that state ( // (ie. 0 is no castles, 5 is castle 0 and 2 (2^0 + 2^2 = 5)) setarray .woe_state_0[0],1,0,0,0,0,0,0; //Setting for if script handles WoE controller function. Disable agit_controller.txt if you are using this. //For if you want to use something else to handle your woe stuff but only this script //to show info (1 - on, 0 - off...duh) set .active_woe, 1; //WoE inactive on map notifier. Basically notifies player if the castle they are entering is //WoE active or not set .notify_woe, 1; //-----------------------------------------------------------------------------------------// //CONFIG END // //-----------------------------------------------------------------------------------------// //-----------------------------------------------------------------------------------------// //CONSTANTS START - Don't touch this unless you know what you are doing // //-----------------------------------------------------------------------------------------// //castle maps by region setarray .castles_prtg$[0],"prtg_cas01","prtg_cas02","prtg_cas03","prtg_cas04","prtg_cas05"; setarray .castles_payg$[0],"payg_cas01","payg_cas02","payg_cas03","payg_cas04","payg_cas05"; setarray .castles_gefg$[0],"gefg_cas01","gefg_cas02","gefg_cas03","gefg_cas04","gefg_cas05"; setarray .castles_aldeg$[0],"aldeg_cas01","aldeg_cas02","aldeg_cas03","aldeg_cas04","aldeg_cas05"; setarray .castles_arug$[0],"arug_cas01","arug_cas02","arug_cas03","arug_cas04","arug_cas05"; setarray .castles_schg$[0],"schg_cas01","schg_cas02","schg_cas03","schg_cas04","schg_cas05"; setarray .castles_novi$[0],"nguild_alde","nguild_gef","nguild_pay","nguild_prt"; //woe kill functions for each castle setarray .woe_kill_prtg$[0],"Agit#prtg_cas01::OnAgitEnd","Agit#prtg_cas02::OnAgitEnd","Agit#prtg_cas03::OnAgitEnd","Agit#prtg_cas04::OnAgitEnd","Agit#prtg_cas05::OnAgitEnd"; setarray .woe_kill_payg$[0],"Agit#payg_cas01::OnAgitEnd","Agit#payg_cas02::OnAgitEnd","Agit#payg_cas03::OnAgitEnd","Agit#payg_cas04::OnAgitEnd","Agit#payg_cas05::OnAgitEnd"; setarray .woe_kill_gefg$[0],"Agit#gefg_cas01::OnAgitEnd","Agit#gefg_cas02::OnAgitEnd","Agit#gefg_cas03::OnAgitEnd","Agit#gefg_cas04::OnAgitEnd","Agit#gefg_cas05::OnAgitEnd"; setarray .woe_kill_aldeg$[0],"Agit#aldeg_cas01::OnAgitEnd","Agit#aldeg_cas02::OnAgitEnd","Agit#aldeg_cas03::OnAgitEnd","Agit#aldeg_cas04::OnAgitEnd","Agit#aldeg_cas05::OnAgitEnd"; setarray .woe_kill_arug$[0],"Manager#aru01_02::OnAgitEnd2","Manager#aru02_02::OnAgitEnd2","Manager#aru03_02::OnAgitEnd2","Manager#aru04_02::OnAgitEnd2","Manager#aru05_02::OnAgitEnd2"; setarray .woe_kill_schg$[0],"Manager#sch01_02::OnAgitEnd2","Manager#sch02_02::OnAgitEnd2","Manager#sch03_02::OnAgitEnd2","Manager#sch04_02::OnAgitEnd2","Manager#sch05_02::OnAgitEnd2"; setarray .woe_kill_novi$[0],"Agit_N01::OnAgitEnd","Agit_N02::OnAgitEnd","Agit_N03::OnAgitEnd","Agit_N04::OnAgitEnd"; //region prefixs setarray .regions$[0],"prtg","payg","gefg","aldeg","arug","schg","novi"; //region info setarray .region_names$[0],"Prontera", "Payon", "Geffen", "Aldebaran", "Arunafeltz", "Schwarzwald", "Novice Castles"; setarray .region_maps$[0],"prt_gld", "pay_gld", "gef_fild13", "alde_gld", "aru_gld", "sch_gld", "prontera"; //coords to warp player to region (0 is random) setarray .region_x[0],0, 0, 0, 0, 0, 0, 148; setarray .region_y[0],0, 0, 0, 0, 0, 0, 163; setarray .waitMsg$[0], "WoE Starts: ", "WoE Ends: "; setarray .startMsg$[0], "WoE is Starting", "WoE is Ending"; set .ticks_in_day, 86400; //mmm...magic numbers setarray .daysOfWeek$[0], "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"; set .timer_refresh_rate, 500; //how many ms per timer refresh...keep less than 1000 (in milliseconds) set .change_state_sleep, 3000; //how long to show "WoE is Start|End-ing" msg for in ms. (in milliseconds) //Make sure WoE sessions are longer than this xD set .banner_refresh_rate, 10; //how many seconds per banner refresh...keep 1 or above (in seconds) //-----------------------------------------------------------------------------------------// //CONSTANTS END // //-----------------------------------------------------------------------------------------// set .num_regions, getarraysize(.regions$); set .num_woes, getarraysize(.woe_1); //force WoE to end if active callfunc "WoEToggler", 0; for(set .@i, 0; .@i < .num_regions; set .@i, .@i + 1) { //count num castles per region set .num_castles[.@i], getarraysize(getd(".castles_" + .regions$[.@i] + "$")); } //convert timestamps to readable format for(set .@i, 0; .@i < .num_woes; set .@i, .@i + 1) { set .@hrs, .woe_0[.@i] / 3600; set .@mins, .woe_0[.@i] % 3600 / 60; set .@output$, ((.@hrs % 12)?.@hrs%12:12) + ":" + ((.@mins < 10)?"0"+.@mins:.@mins) + " " + ((.@hrs > 12)?"PM":"AM"); set .woe_0_str$[.@i], .@output$; set .@hrs, .woe_1[.@i] / 3600; set .@mins, .woe_1[.@i] % 3600 / 60; set .@output$, ((.@hrs % 12)?.@hrs%12:12) + ":" + ((.@mins < 10)?"0"+.@mins:.@mins) + " " + ((.@hrs > 12)?"PM":"AM"); set .woe_1_str$[.@i], .@output$; } //calc number of woe states and consolidate states to create list of castles used set .num_states, 0; while(getarraysize(getd(".woe_state_" + (.num_states)))) { set .@state$, ".woe_state_" + .num_states; set .@i, 0; while(.@i < getarraysize(getd(.@state$))) { set .castleUsage[.@i], .castleUsage[.@i] | getd(.@state$ + "[" + .@i + "]"); set .@i, .@i + 1; } set .num_states, .num_states + 1; } for(set .@i, 0; .@i < .num_states; set .@i, .@i + 1) { set .@woe_state_array$, ".woe_state_" + .@i; for(set .@k, 0; .@k < .num_regions; set .@k, .@k + 1) { if(.castleUsage[.@k] > 0) { set .@castles$, ".castles_" + .regions$[.@k] + "$"; set .@castle_check, getd(.@woe_state_array$ + "[" + .@k + "]"); if(.@castle_check == 0) { //region not in this state //region warp menu string set .region_warp$[.@i], .region_warp$[.@i] + "^DD0000" + .region_names$[.@k] + "^000000:"; continue; } else { if(.@castle_check >= ((1 << .num_castles[.@k]) - 1)) { //includes all castles...just list as region. setd(".woe_state_str_" + .@i + "$[" + .@k + "]", .region_names$[.@k]); //region warp menu string set .region_warp$[.@i], .region_warp$[.@i] + "^00DD00" + .region_names$[.@k] + "^000000:"; } else { set .@j, 0; set .@output$, ""; while(.@j < .num_castles[.@k]) { if(.@castle_check & (1 << .@j)) { set .@output$, .@output$ + GetCastleName(getd(.@castles$+"["+.@j+"]")); set .@castle_check, .@castle_check - (1 << .@j); if(.@castle_check) { if(.@output$ != "") set .@output$, .@output$ + ", "; } else break; } set .@j, .@j + 1; } setd(".woe_state_str_" + .@i + "$[" + .@k + "]", .region_names$[.@k] + " ("+ .@output$ + ")"); //region warp menu string set .region_warp$[.@i], .region_warp$[.@i] + "^00DD00" + .region_names$[.@k] + " ("+ .@output$ + ")^000000:"; } } } else { set .region_warp$[.@i], .region_warp$[.@i] + ":"; } } } donpcevent strnpcinfo(3)+"::OnFindCurIndex"; donpcevent strnpcinfo(3)+"::OnUpdateCountTick"; if(.active_woe) { if(.notify_woe) { //set mapflag for all castle maps for(set .@i, 0; .@i < .num_regions; set .@i, .@i + 1) { set .@region_array$, ".castles_" + .regions$[.@i] + "$"; for(set .@k, 0; .@k < .num_castles[.@i]; set .@k, .@k + 1) { setmapflag getd(.@region_array$ + "[" + .@k + "]"), mf_loadevent; setd(".loadmap_region_" + getd(.@region_array$ + "[" + .@k + "]"), .@i + 1); setd(".loadmap_castleIndex_" + getd(.@region_array$ + "[" + .@k + "]"), .@k); } } } //activates WoE if needed donpcevent strnpcinfo(3)+"::OnDoWoE"; } //flag that init occured set .init, 1; OnWoETimer: //timer stuff while (1) { set .remainTime, .count_tick - gettimetick(2); set .bannerTimer, .remainTime - (.remainTime % .banner_refresh_rate) + .banner_refresh_rate; set .min, .bannerTimer / 60; set .sec, .bannerTimer - .min * 60; set .hr, .min / 60; set .min, .min - .hr * 60; set .roomMsg$, .waitMsg$[.state] + .hr + ":" + ((.min < 10 )?"0":"") + .min + ":" + ((.sec < 10 )?"0":"") + .sec; sleep .timer_refresh_rate; if(.remainTime <= 0) { if(.active_woe) { donpcevent strnpcinfo(3)+"::OnDoWoE"; } set .roomMsg$, .startMsg$[.state]; set .woe_index, (.woe_index + .state) % .num_woes; //go to next index if needed set .state, (.state + 1) % 2; //flip state donpcevent strnpcinfo(3)+"::OnUpdateCountTick"; sleep .change_state_sleep; } } end; //obligatory end =D OnUpdateCountTick: set .count_tick, getd(".woe_" + .state + "[" + .woe_index + "]"); set .count_tick, gettimetick(2) + .count_tick - gettimetick(1) + (.woe_day[.woe_index] - gettime(4) + 7) % 7 * .ticks_in_day; if(gettimetick(2) > .count_tick) set .count_tick, .count_tick + 7 * .ticks_in_day; end; OnFindCurIndex: set .@cur_day, gettime(4); set .@cur_tick, gettimetick(1); set .woe_index, 0; set .state, 0; for(set .@i, 0; .@i < .num_woes; set .@i, .@i + 1) { if(.woe_day[.@i] < .@cur_day) continue; if(.woe_day[.@i] == .@cur_day) { if(.woe_0[.@i] >= .@cur_tick) { set .woe_index, .@i; set .state, 0; break; } if(.woe_1[.@i] >= .@cur_tick) { set .woe_index, .@i; set .state, 1; break; } } if(.woe_day[.@i] > .@cur_day) { set .woe_index, .@i; set .state, 0; break; } } end; //On map notifier //Comment out OnPCLoadMapEvent label if .notify_woe is disabled to prevent unnecessary triggering OnPCLoadMapEvent: if(.state && .notify_woe) { getmapxy(.@map$, .@x, .@y, 0); set .@region, getd(".loadmap_region_" + .@map$) - 1; if(.@region >= 0) { set .@castleIndex, getd(".loadmap_castleIndex_" + .@map$); if(getd(".woe_state_" + .woe_state[.woe_index] + "[" + .@region + "]") & 1 << .@castleIndex) dispbottom "The [" + GetCastleName(.@map$) + "] castle is available for conquering during this WoE session"; else dispbottom "The [" + GetCastleName(.@map$) + "] castle is NOT available for conquering during this WoE session"; } } end; //------------------------------------------------------------------------------ // WoE Controller Stuff Here //------------------------------------------------------------------------------ OnDoWoE: if((.state == 0 && .init) || (.state == 1 && !agitcheck())) { //starting callfunc "WoEToggler", 1; //kills WoE in all castles that shouldn't have WoE set .@woe_state_array$, ".woe_state_" + .woe_state[.woe_index]; for(set .@i, 0; .@i < .num_regions; set .@i, .@i + 1) { set .@castles$, ".castles_" + .regions$[.@i] + "$"; set .@castle_check, getd(.@woe_state_array$ + "[" + .@i + "]"); for(set .@k, 0; .@k < .num_castles[.@i]; set .@k, .@k + 1) { set .@map$, getd(.@castles$+"["+.@k+"]"); if((.@castle_check & (1 << .@k)) == 0) { donpcevent getd(".woe_kill_" + .regions$[.@i] + "$[" + .@k + "]"); } } } announce "The War Of Emperium has begun!",bc_all; donpcevent strnpcinfo(3)+"::OnDisplayOwners"; } else { //ending if(agitcheck()) { callfunc "WoEToggler", 0; announce "The War Of Emperium is over!",bc_all; donpcevent strnpcinfo(3)+"::OnDisplayOwners"; } } end; OnDisplayOwners: //displays based on current region set .@woe_state_array$, ".woe_state_" + .woe_state[.woe_index]; for(set .@i, 0; .@i < .num_regions; set .@i, .@i + 1) { set .@k, 0; set .@castle_check, getd(.@woe_state_array$ + "[" + .@i + "]"); set .@castles$, ".castles_" + .regions$[.@i] + "$"; while(.@castle_check && .@k < .num_castles[.@i]) { if(.@castle_check & (1 << .@k)) { set .@map$, getd(.@castles$+"["+.@k+"]"); if (GetCastleData(.@map$,1)) { announce "The [" + GetCastleName(.@map$) + "] castle of the [" + .region_names$[.@i] + "] region is currently held by the [" + GetGuildName(GetCastleData(.@map$,1)) + "] guild.",bc_all; } else { announce "The [" + GetCastleName(.@map$) + "] castle of the [" + .region_names$[.@i] + "] region is currently unoccupied.",bc_all; } set .@castle_check, .@castle_check - (1 << .@k); } set .@k, .@k + 1; } } end; } prontera,163,194,4 script WoE Info 837,{ if(getwaitingroomstate(3, strnpcinfo(3)) == -1) donpcevent strnpcinfo(3)+"::OnInit"; doevent "WoEInfoBase::OnStartMenu"; end; OnInit: while (1) { //only updates if msg is different set .banner$, getwaitingroomstate(4, strnpcinfo(3)); if(getvariableofnpc(.roomMsg$, "WoEInfoBase") != .banner$) { delwaitingroom; waitingroom getvariableofnpc(.roomMsg$, "WoEInfoBase"), 0; } sleep 500; } end; } //zomg! it duplicates!! prontera,156,196,6 duplicate(WoE Info) WoE Info#2winfo 837 //--------------------------------------------------------------------------------------------------------------------- //These two functions handle WoE's activation/deactivation. Since stable does not have AgitStart2/AgitEnd2, //using the trunk version will result in catastrophic failure of the script. Double declaration of the following //functions fixes this (you will get warning messages though) function script WoEToggler { //<state> = 0|1 if(getarg(0)) { AgitStart; } else { AgitEnd; } return; } //if stable script will fail parsing this function, but the rest of the script will still be usable function script WoEToggler { //<state> = 0|1 if(getarg(0)) { AgitStart; AgitStart2; } else { AgitEnd; AgitEnd2; } return; } Problem is, the warp portals related to castles, (prtg_cas01 for example) are dispelling/debuffing all players when this script is active. They don't do it when the script is inactive. Simply, I want to turn off the "dispell/debuff".
  10. Anyone? Please, I still couldn't find a solution. I even sent a pm to "Toastie".
  11. Hi, I've searched for help in source support section but no luck. Moootie tried to help me but when he put some functions in the script, It blocked the WoE timer. I've used 2 different WoE setter/timers. Both Euphy and Toasty's script dispells on castle portals even the WoE is not active.. I always need to manually @agitstart/@agitend. Is there anyone who can help me to disable debuffing on castle portals? Thank you.; I tried to find the words "sc_end/sc_All" inside the scripts but I couldn't find any. I don't understand how it works. When I comment out these woe controller scripts and @agitstart manually, there's no dispell on portals.
  12. So my agit_controller (sorry i said woe_controller earlier, I was mistaken, it's agit controller) is now like this: function<tab>script<tab>WoEToggler<tab>{ //<state> = 0|1 if(getarg(0)) { AgitStart; } else { AgitEnd; } <tab>function<tab>dispell<tab>{ //is it okay if i delete the first tab here? for( .@i = 0; .@i < 308; .@i++ ) if( (.@i != 53) && (.@i != 54) && (.@i != 249) && (.@i != 103) ) //Do not dispell SC_WEIGHT50, SC_WEIGHT90, SC_JAILED, SC_NOCHAT sc_end .@i; return; } And I made a new script file that looks like this: callfunc("dispell"); Should I use "end;" or "close;" after that callfunc script or is it fine like this? Sorry if I'm bothering you too much. I'm just into learning so much..
  13. Thank you for your quick support Mootie. Err, Should I put it in my woe_controller or agit_main? My WoE is running by Toasty's script at the moment. I replaced her script with official woe_controller script. And also, do I need to have any script that triggers this function, or is it running automatically?
  14. Hi again, First, I don't know if it's a script problem or a source problem but it seemed like source problem to me. If I'm wrong, please move this topic. Today, I realized my players are getting dispelled when they enter to a portal in "prtg_cas01" Kriemhild castle. I'm using Toasty's WoE controller. I've searched for "sc_end, sc_all, sc_, dispell" terms in Toasty's WoE controller script but couldnt find any. So I think it's not from that script? I've searched the same terms in "agit_main" script and "prtg_cas01" script also​ but I couldn't find it in that files also. Can anyone kindly tell me how to disable Dispell skill? If it is in a src file, I don't know which file to edit, so I didn't want to mess up any source files for safety. If anyone can teach me how to dispell specific skills, if possible, it would be much appreciated also. Thanks in advance!
×
×
  • Create New...