Jump to content

astralprojection

Members
  • Content Count

    316
  • Joined

  • Last visited

  • Days Won

    6

astralprojection last won the day on February 24

astralprojection had the most liked content!

5 Followers

About astralprojection

  • Rank
    Advanced Member

Recent Profile Visitors

4459 profile views
  1. /* custom npc trader */ prontera,153,152,1 trader TestCustom2 4_F_EDEN_OFFICER,{ OnInit: tradertype(NST_CUSTOM); sellitem Red_Potion,2; end; /* allows currency to be item 501 and 502 */ OnCountFunds: setcurrency(countitem(Red_Potion),countitem(Orange_Potion)); end; /* receives @price (total cost) and @points (the secondary input field for cash windows) */ OnPayFunds: dispbottom "Hi: price="[email protected]+" and points="[email protected]; /* check if how many item is sold already if max but sorry, we reach max purchase of item end; else ok you can still buy */ if( countitem(Orange_Potion) < @points || countitem(Red_Potion) < @[email protected] ) end; delitem Orange_Potion,@points; delitem Red_Potion,@[email protected]; purchaseok(); end; } that is why i want to use that NTS_MARKET instead, no confusion.
  2. i understand master , it the official setup. but what i was trying to customize or achieve here that "qty limit" of item sold. It can't be done using NST_CUSTOM i believe. Correct me if im wrong.
  3. yes master but i wanted to use that LIMITED QTY feature but uses #CASHPOINTS instead of Zeny i tried already /** * Processes incoming npc market purchase list **/ static enum market_buy_result npc_market_buylist(struct map_session_data *sd, struct itemlist *item_list) { struct npc_data* nd; struct npc_item_list *shop = NULL; int64 z; int i,j,w,new_; unsigned short shop_size = 0; nullpo_retr(1, sd); nullpo_retr(1, item_list); nd = npc->checknear(sd,map->id2bl(sd->npc_shopid)); if (nd == NULL || nd->subtype != SCRIPT || VECTOR_LENGTH(*item_list) == 0 || !nd->u.scr.shop || nd->u.scr.shop->type != NST_MARKET) return MARKET_BUY_RESULT_ERROR; shop = nd->u.scr.shop->item; shop_size = nd->u.scr.shop->items; z = 0; w = 0; new_ = 0; // process entries in buy list, one by one for (i = 0; i < VECTOR_LENGTH(*item_list); ++i) { int value; struct itemlist_entry *entry = &VECTOR_INDEX(*item_list, i); // find this entry in the shop's sell list ARR_FIND( 0, shop_size, j, entry->id == shop[j].nameid || //Normal items entry->id == itemdb_viewid(shop[j].nameid) //item_avail replacement ); if (j == shop_size) /* TODO find official response for this */ return MARKET_BUY_RESULT_ERROR; // no such item in shop entry->id = shop[j].nameid; //item_avail replacement if (entry->amount > (int)shop[j].qty) return MARKET_BUY_RESULT_AMOUNT_TOO_BIG; value = shop[j].value; npc_market_qty[i] = j; if (!itemdb->exists(entry->id)) /* TODO find official response for this */ return MARKET_BUY_RESULT_ERROR; // item no longer in itemdb if (!itemdb->isstackable(entry->id) && entry->amount > 1) { //Exploit? You can't buy more than 1 of equipment types o.O ShowWarning("Player %s (%d:%d) sent a hexed packet trying to buy %d of non-stackable item %d!\n", sd->status.name, sd->status.account_id, sd->status.char_id, entry->amount, entry->id); entry->amount = 1; } switch (pc->checkadditem(sd, entry->id, entry->amount)) { case ADDITEM_EXIST: break; case ADDITEM_NEW: new_++; break; case ADDITEM_OVERAMOUNT: /* TODO find official response for this */ return 1; } z += (int64)value * entry->amount; w += itemdb_weight(entry->id) * entry->amount; } if (z > sd->cashPoints) /* TODO find official response for this */ return MARKET_BUY_RESULT_NO_ZENY; // Not enough Zeny if( w + sd->weight > sd->max_weight ) /* TODO find official response for this */ return MARKET_BUY_RESULT_OVER_WEIGHT; // Too heavy if( pc->inventoryblank(sd) < new_ ) /* TODO find official response for this */ return MARKET_BUY_RESULT_OUT_OF_SPACE; // Not enough space to store items pc->paycash(sd,(int)z,0); for (i = 0; i < VECTOR_LENGTH(*item_list); ++i) { struct itemlist_entry *entry = &VECTOR_INDEX(*item_list, i); j = npc_market_qty[i]; if (entry->amount > (int)shop[j].qty) /* wohoo someone tampered with the packet. */ return MARKET_BUY_RESULT_AMOUNT_TOO_BIG; shop[j].qty -= entry->amount; npc->market_tosql(nd,j); if (itemdb_type(entry->id) == IT_PETEGG) { pet->create_egg(sd, entry->id); } else { struct item item_tmp; memset(&item_tmp,0,sizeof(item_tmp)); item_tmp.nameid = entry->id; item_tmp.identify = 1; pc->additem(sd, &item_tmp, entry->amount, LOG_TYPE_NPC); } } return MARKET_BUY_RESULT_SUCCESS; } if (z > sd->cashPoints) /* TODO find official response for this */ It's working ok by deducting CP. It still check zeny when you drag item to buy.
  4. Is there way to change currency from zeny > cash? Any help is greatly appreciated. Thank you all!
  5. its solved using setmapflag(mapname$,MF_ZONE,"Zone_Name");
  6. PRE-RE, 1. place trap 2. lure mob to the trap. it did not catch or hold a mob, can somebody confirm this?
  7. i have been reading the entire script command and not able to find this. i hope anyone could help me out on this.
  8. //===== Hercules Script ====================================== // MVP Spawn Controller //===== By: ================================================== // astralprojektion //===== Current Version: ===================================== // 1.3 //===== Description: ========================================= // Control MVP Spawn with script. MVP will not respawn on server start or reload using flag. // Delete or Comment all MVP and mini boss spawn at npc/pre-re/mobs/dungeons/ or /fields. // Make sure set at NifInvasion to make it work. // OnLoDDead: // // Set LOD as dead ang next respawn is 5580sec // $S11373 = 2; $T11373 = (gettimetick(2) + 5580); // //===== Additional Comments: ================================= // 1.0 Initial Release // 1.1 Use TimeStamp when mvp is killed // Fixed typo on MVP_Map array. // 1.2 Set Variables to Global. // 1.3 Include some Mini Boss on the controller // Added PvP On/Off MvP is alive // Integrate LOD invasion // Added @mvpcontroller command to reset all or a specific mvp and other settings. //============================================================ /* Credits to Meko https://herc.ws/board/files/file/326-array-manipulation-functions/ */ function script array_find { [email protected] = getarraysize(getarg(0)); [email protected] = getarg(2, false); freeloop(true); for ([email protected] = getarrayindex(getarg(0)); [email protected] < [email protected]; [email protected]) { if (([email protected] && (getelementofarray(getarg(0), [email protected]) != getarg(1))) || (!([email protected]) && (getelementofarray(getarg(0), [email protected]) == getarg(1)))) { freeloop(false); return [email protected]; } } freeloop(false); return -1; } - script mvpcontroller FAKE_NPC,{ end; OnNPCKillEvent: if(array_find(.mvpid, killedrid) >= 0 ){ for( [email protected] = 0; [email protected] < getarraysize(.mvpid); [email protected]++ ) { if( killedrid == .mvpid[[email protected]] && strcharinfo(PC_MAP) == .mvpmaps$[[email protected]]) { // 1 - Alive 2 - Dead setd("$S"+.mvpa[[email protected]]+.mvpid[[email protected]], 2); // current time + respawn time (seconds) setd("$T"+.mvpa[[email protected]]+.mvpid[[email protected]],gettimetick(2)+(.mvptime[[email protected]]*60)); setd("$P"+.mvpa[[email protected]]+.mvpid[[email protected]]+"$", strcharinfo(PC_NAME)); if( killedrid == 1120 || killedrid == 1096 || killedrid == 1388 ) { if(.announce) announce "A mini boss monster [ "+strmobinfo(1,killedrid)+" ] at "+strcharinfo(PC_MAP)+" has been slain.",bc_all; } else { if(.announce) announce "A boss monster [ "+strmobinfo(1,killedrid)+" ] at "+strcharinfo(PC_MAP)+" has been slain.",bc_all; if(.pvp){ removemapflag .mvpmaps$[[email protected]], mf_pvp_nocalcrank; pvpoff .mvpmaps$[[email protected]]; } } break; } } } end; OnSettings: while(1){ switch(select( " ~ PvP On Map [ "+((.pvp)?"^28bf00Yes^000000":"^ff0000No^000000")+" ]:"+ " ~ Announce [ "+((.announce)?"^28bf00Yes^000000":"^ff0000No^000000")+" ]:"+ " ~ Reset All MvP:"+ " ~ Reset Specific MvP:"+ " ~ ^777777Close^000000" )) { case 1: .pvp =! .pvp; for( [email protected] = 0; [email protected] < getarraysize(.mvpid); [email protected]++ ) { if ( getd("$S"+.mvpa[[email protected]]+.mvpid[[email protected]]) < 2 || getd("$T"+.mvpa[[email protected]]+.mvpid[[email protected]]) <= gettimetick(2) ) { // if mini boss, just ignore pvp if(.pvp){ if(.mvpid[[email protected]] == 1120 || .mvpid[[email protected]] == 1096 || .mvpid[[email protected]] == 1388 ){ //PASS THROUGH } else { setmapflag .mvpmaps$[[email protected]], mf_pvp_nocalcrank; pvpon .mvpmaps$[[email protected]]; } } else { removemapflag .mvpmaps$[[email protected]], mf_pvp_nocalcrank; pvpoff .mvpmaps$[[email protected]]; } } } break; case 2: .announce =! .announce; break; case 3: freeloop(1); for( [email protected] = 0; [email protected] < getarraysize(.mvpid); [email protected]++ ) { setd("$S"+.mvpa[[email protected]]+.mvpid[[email protected]], 1); setd("$T"+.mvpa[[email protected]]+.mvpid[[email protected]], 0); setd("$P"+.mvpa[[email protected]]+.mvpid[[email protected]]+"$",""); killmonsterall .mvpmaps$[[email protected]]; } for( [email protected] = 0; [email protected] < getarraysize(.mvpid); [email protected]++ ) { if( compare( .mvpmaps$[[email protected]], "prt_maze03" ) && .mvpid[[email protected]] == 1039 ) { // Baphomet monster .mvpmaps$[[email protected]],100,100,"--ja--",.mvpid[[email protected]],1; } else if( compare( .mvpmaps$[[email protected]], "treasure02" ) && .mvpid[[email protected]] == 1112 ) { // Drake monster .mvpmaps$[[email protected]],101,151,"--ja--",.mvpid[[email protected]],1; } else if( compare( .mvpmaps$[[email protected]], "pay_dun04" ) && .mvpid[[email protected]] == 1150 ) { // moonlight monster .mvpmaps$[[email protected]],120,115,"--ja--",.mvpid[[email protected]],1; } else if( compare( .mvpmaps$[[email protected]], "tur_dun04" ) && .mvpid[[email protected]] == 1312 ) { // turtle monster .mvpmaps$[[email protected]],99,93,"--ja--",.mvpid[[email protected]],1; } else if( compare( .mvpmaps$[[email protected]], "moc_pryd06" ) && .mvpid[[email protected]] == 1511 ) { // amon monster .mvpmaps$[[email protected]],102,166,"--ja--",.mvpid[[email protected]],1; } else if( compare( .mvpmaps$[[email protected]], "ayo_dun02" ) && .mvpid[[email protected]] == 1688 ) { // lady monster .mvpmaps$[[email protected]],150,90,"--ja--",.mvpid[[email protected]],1; } else if( compare( .mvpmaps$[[email protected]], "niflheim" ) && .mvpid[[email protected]] == 1373 ) { // LOD donpcevent("NifInvasion::OnSpawn"); } else { monster .mvpmaps$[[email protected]],0,0,"--ja--",.mvpid[[email protected]],1; } if(.pvp){ if(.mvpid[[email protected]] == 1120 || .mvpid[[email protected]] == 1096 || .mvpid[[email protected]] == 1388 ){ //PASS THROUGH } else { setmapflag .mvpmaps$[[email protected]], mf_pvp_nocalcrank; pvpon .mvpmaps$[[email protected]]; } } else { removemapflag .mvpmaps$[[email protected]], mf_pvp_nocalcrank; pvpoff .mvpmaps$[[email protected]]; } } freeloop(0); dispbottom "All MVP has been reset."; break; case 4: set [email protected]$,""; freeloop(1); for( [email protected] = 0; [email protected] < getarraysize(.mvpid); [email protected]++ ) set [email protected]$, [email protected]$+getmonsterinfo(.mvpid[[email protected]],0)+" - ("+.mvpmaps$[[email protected]]+"):"; set [email protected]$, [email protected]$+" ~ ^777777Cancel^000000"; freeloop(0); set [email protected], select([email protected]$)-1; setd("$S"+.mvpa[[email protected]]+.mvpid[[email protected]], 1); setd("$T"+.mvpa[[email protected]]+.mvpid[[email protected]], 0); setd("$P"+.mvpa[[email protected]]+.mvpid[[email protected]]+"$",""); killmonsterall .mvpmaps$[[email protected]]; monster .mvpmaps$[[email protected]],0,0,"--ja--",.mvpid[[email protected]],1; if(.pvp){ if(.mvpid[[email protected]] == 1120 || .mvpid[[email protected]] == 1096 || .mvpid[[email protected]] == 1388 ){ //PASS THROUGH } else { setmapflag .mvpmaps$[[email protected]], mf_pvp_nocalcrank; pvpon .mvpmaps$[[email protected]]; } } else { removemapflag .mvpmaps$[[email protected]], mf_pvp_nocalcrank; pvpoff .mvpmaps$[[email protected]]; } dispbottom "Monster [ "+strmobinfo(1,.mvpid[[email protected]])+" ] at "+.mvpmaps$[[email protected]]+" has been reset."; break; default: close; } } close; OnTimer60000: // Let recheck after a minute. for( [email protected] = 0; [email protected] < getarraysize(.mvpid); [email protected]++ ) { /* $S 1 - Alive $S 2 - Dead */ // If MvP status is not yet set if ( getd("$S"+.mvpa[[email protected]]+.mvpid[[email protected]]) == 2 && getd("$T"+.mvpa[[email protected]]+.mvpid[[email protected]]) <= gettimetick(2) ) { // check if MvP has fixed spawn location in the map. if( compare( .mvpmaps$[[email protected]], "prt_maze03" ) && .mvpid[[email protected]] == 1039 ) { // Baphomet monster .mvpmaps$[[email protected]],100,100,"--ja--",.mvpid[[email protected]],1; } else if( compare( .mvpmaps$[[email protected]], "treasure02" ) && .mvpid[[email protected]] == 1112 ) { // Drake monster .mvpmaps$[[email protected]],101,151,"--ja--",.mvpid[[email protected]],1; } else if( compare( .mvpmaps$[[email protected]], "pay_dun04" ) && .mvpid[[email protected]] == 1150 ) { // moonlight monster .mvpmaps$[[email protected]],120,115,"--ja--",.mvpid[[email protected]],1; } else if( compare( .mvpmaps$[[email protected]], "tur_dun04" ) && .mvpid[[email protected]] == 1312 ) { // turtle monster .mvpmaps$[[email protected]],99,93,"--ja--",.mvpid[[email protected]],1; } else if( compare( .mvpmaps$[[email protected]], "moc_pryd06" ) && .mvpid[[email protected]] == 1511 ) { // amon monster .mvpmaps$[[email protected]],102,166,"--ja--",.mvpid[[email protected]],1; } else if( compare( .mvpmaps$[[email protected]], "ayo_dun02" ) && .mvpid[[email protected]] == 1688 ) { // lady monster .mvpmaps$[[email protected]],150,90,"--ja--",.mvpid[[email protected]],1; // Initiate LOD invasion at Niflheim } else if( compare( .mvpmaps$[[email protected]], "niflheim" ) && .mvpid[[email protected]] == 1373 ) { // LOD donpcevent("NifInvasion::OnSpawn"); } else { // Spawn the MvP at random location. monster .mvpmaps$[[email protected]],0,0,"--ja--",.mvpid[[email protected]],1; } if(.announce) announce "Monster [ "+strmobinfo(1,.mvpid[[email protected]])+" ] at "+.mvpmaps$[[email protected]]+" has been spawned.",bc_all; // set status of MvP as ALIVE! setd("$S"+.mvpa[[email protected]]+.mvpid[[email protected]], 1); // reset killer name. setd("$P"+.mvpa[[email protected]]+.mvpid[[email protected]]+"$", ""); if(.pvp){ // if mini boss, just ignore pvp if(.mvpid[[email protected]] == 1120 || .mvpid[[email protected]] == 1096 || .mvpid[[email protected]] == 1388 ){ //PASS THROUGH } else { setmapflag .mvpmaps$[[email protected]], mf_pvp_nocalcrank; pvpon .mvpmaps$[[email protected]]; } } else { removemapflag .mvpmaps$[[email protected]], mf_pvp_nocalcrank; pvpoff .mvpmaps$[[email protected]]; } } } initnpctimer(); end; OnCheck: OnPCLoginEvent: [email protected] = 0; query_sql "SELECT DATABASE()", [email protected]_db$; query_logsql "SELECT DATABASE()", [email protected]_db$; query_sql( "SELECT COUNT(`monster_id`) AS `total`,`char`.`name`,`kill_char_id` FROM "[email protected]_db$+".`mvplog`"+" LEFT JOIN "[email protected]_db$+".`char` ON `char`.`char_id` = `mvplog`.`kill_char_id` WHERE `map` <> 'guild_vs5' AND DATE_FORMAT( `mvp_date`, '%Y-%m-%d') = DATE_FORMAT( now(), '%Y-%m-%d') GROUP BY `kill_char_id` ORDER BY `total` DESC LIMIT 10",[email protected],[email protected]$,[email protected]_char_id ); for( [email protected] = 0; [email protected] < getarraysize([email protected]_char_id); [email protected]++ ) { if(getcharid(CHAR_ID_CHAR) == [email protected]_char_id[[email protected]]){ [email protected] = [email protected]+1; [email protected] = [email protected][[email protected]]; } } if ( [email protected] > 0 && [email protected] < 4 ) { if(countitem(.topreward) == 0){ dispbottom "Congratulations you ranked as #"[email protected]+" MvP Hunter for today. Total kill "[email protected]; getitembound .topreward,1,4; equip(.topreward); } } else { if(countitem(.topreward) > 0){ delitem .topreward,countitem(.topreward); dispbottom "Sorry you have lost your rank as Top 3 MvP Hunter of the day."; } } addtimer 300000,strnpcinfo(0) + "::OnCheck"; end; OnInit: .topreward = 31488; // top mvp daily reward .toprange = 3; // Only Top 3 gets the reward .announce = 1; // shall we announce mvp kills and spawn? (yes = 1 no = 0) .pvp = 1; // shall will make the map pvp? (yes = 1 no = 0) bindatcmd("mvpcontroller","mvpcontroller::OnSettings",99,99); // Mvp ids setarray .mvpid[0],1511,1096,1096,1388,1039,1272,1272,1046,1046,1389,1112,1115,1115,1418,1252,1120,1120,1120,1120,1086,1492,1251,1147,1147,1059,1150,1087,1190,1038,1157,1159,1312,1373,1630,1688; // Mvp Index is used because there are same mvp that spawn on different maps. setarray .mvpa[0],1,1,2,1,1,1,2,1,2,1,1,1,2,1,1,1,2,3,4,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1; // MvP maps setarray .mvpmaps$[0],"moc_pryd06","pay_fild04","xmas_dun01","yuno_fild02","prt_maze03","gl_chyard","gld_dun04","gef_dun02","gld_dun02","gef_dun01","treasure02","gld_dun01","pay_fild11","gon_dun03","xmas_fild01","gld_dun04","pay_fild04","prt_maze03","treasure02","prt_sewb4","ama_dun03","xmas_dun02","anthell02","gld_dun03","mjolnir_04","pay_dun04","gef_fild14","gef_fild10","moc_pryd04","in_sphinx5","moc_fild15","tur_dun04","niflheim","lou_dun03","ayo_dun02"; // How many minutes to respawn? setarray .mvptime[0],60,60,60,60,120,60,480,120,480,60,120,480,120,95,120,240,60,114,32,60,91,60,120,480,120,60,60,120,60,60,120,60,93,117,420; freeloop(1); for( [email protected] = 0; [email protected] < getarraysize(.mvpid); [email protected]++ ) { // If MvP status is not yet set if ( getd("$S"+.mvpa[[email protected]]+.mvpid[[email protected]]) < 2 || getd("$T"+.mvpa[[email protected]]+.mvpid[[email protected]]) <= gettimetick(2) ) { // check if MvP has fixed spawn location in the map. if( compare( .mvpmaps$[[email protected]], "prt_maze03" ) && .mvpid[[email protected]] == 1039 ) { // Baphomet monster .mvpmaps$[[email protected]],100,100,"--ja--",.mvpid[[email protected]],1; } else if( compare( .mvpmaps$[[email protected]], "treasure02" ) && .mvpid[[email protected]] == 1112 ) { // Drake monster .mvpmaps$[[email protected]],101,151,"--ja--",.mvpid[[email protected]],1; } else if( compare( .mvpmaps$[[email protected]], "pay_dun04" ) && .mvpid[[email protected]] == 1150 ) { // moonlight monster .mvpmaps$[[email protected]],120,115,"--ja--",.mvpid[[email protected]],1; } else if( compare( .mvpmaps$[[email protected]], "tur_dun04" ) && .mvpid[[email protected]] == 1312 ) { // turtle monster .mvpmaps$[[email protected]],99,93,"--ja--",.mvpid[[email protected]],1; } else if( compare( .mvpmaps$[[email protected]], "moc_pryd06" ) && .mvpid[[email protected]] == 1511 ) { // amon monster .mvpmaps$[[email protected]],102,166,"--ja--",.mvpid[[email protected]],1; } else if( compare( .mvpmaps$[[email protected]], "ayo_dun02" ) && .mvpid[[email protected]] == 1688 ) { // lady monster .mvpmaps$[[email protected]],150,90,"--ja--",.mvpid[[email protected]],1; // Initiate LOD invasion at Niflheim } else if( compare( .mvpmaps$[[email protected]], "niflheim" ) && .mvpid[[email protected]] == 1373 ) { // LOD donpcevent("NifInvasion::OnSpawn"); } else { // Spawn the MvP at random location. monster .mvpmaps$[[email protected]],0,0,"--ja--",.mvpid[[email protected]],1; } // set status of MvP as ALIVE! setd("$S"+.mvpa[[email protected]]+.mvpid[[email protected]], 1); // status is alive (1) // reset killer name. setd("$P"+.mvpa[[email protected]]+.mvpid[[email protected]]+"$", ""); // killer name reset if(.pvp){ // if mini boss, just ignore pvp if(.mvpid[[email protected]] == 1120 || .mvpid[[email protected]] == 1096 || .mvpid[[email protected]] == 1388 ){ //PASS THROUGH } else { setmapflag .mvpmaps$[[email protected]], mf_pvp_nocalcrank; pvpon .mvpmaps$[[email protected]]; } } else { removemapflag .mvpmaps$[[email protected]], mf_pvp_nocalcrank; pvpoff .mvpmaps$[[email protected]]; } } } freeloop(0); initnpctimer(); end; } /* If you want your player have access to spawn time, you can use this function to display status of each MvP and who killed them { Id: 501 AegisName: "Red_Potion" Name: "Red Potion" Type: "IT_HEALING" Buy: 50 Weight: 70 Script: <" callfunc "F_MVPTime"; "> }, */ function script F_MVPTime { mes "^FF0000MvP Status^000000"; for( [email protected] = 0; [email protected] < getarraysize(getvariableofnpc(.mvpid,"mvpcontroller")); [email protected]++ ) { [email protected] = getd("$T" +getvariableofnpc(.mvpindex[[email protected]],"mvpcontroller") + getvariableofnpc(.mvpid[[email protected]],"mvpcontroller")); [email protected] = getd("$S" +getvariableofnpc(.mvpindex[[email protected]],"mvpcontroller") + getvariableofnpc(.mvpid[[email protected]],"mvpcontroller")); set [email protected], ([email protected] - gettimetick(2)) / 3600; set [email protected], ([email protected] - gettimetick(2))%3600/60; set [email protected], ([email protected] - gettimetick(2))%60; set [email protected]$,getmonsterinfo( getvariableofnpc(.mvpid[[email protected]], "mvpcontroller"),0 ); set [email protected]$,getvariableofnpc(.mvpmaps$[[email protected]], "mvpcontroller"); set [email protected]$,getd("$P"+getvariableofnpc(.mvpindex[[email protected]], "mvpcontroller") + getvariableofnpc(.mvpid[[email protected]], "mvpcontroller") +"$"); mes (([email protected] == 1) ? "[ ^01DF01+^000000 ]" : "[ ^FF0000x^000000 ]")+((getstrlen( [email protected]$ ) > 10 ) ? " ^0055FF"+substr([email protected]$,0, 10)+"^000000" : " ^0055FF"[email protected]$+"^000000")+" ^777777"[email protected]$+"^000000 "; if( [email protected] == 2 ) { mes "^FF0000"+(([email protected]) ? [email protected] +"h" : "")+" "+(([email protected]) ? [email protected] +"m" : "")+" "+(([email protected]) ? [email protected] +"s" : "")+"^000000 "+"^777777 kiiled by "[email protected]$+"^000000"; } } close; } What does it do? - prevents spawn of mvp on each server starts or reload. - spawns mvp or mini only at specific time based when it was killed + spawn time - reward x top mvp killers. Cons: - you can not use convex mirrors to show mvp in the map - you can not find mvp using @whereis. How to use: - Delete or Comment target MVP and mini boss spawn from your npc/pre-re/mobs/dungeons/ or /fields. - Add these mvps to array. FAQ: #Q1 What the heck is this? setarray .mvpa[0],1,1,2,1,1,1,2,1,2,1,1,1,2,1,1,1,2,3,4,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1; #A1: since there are same kind of MVP spawn on multile map (i.e Angeling spawns at pay_fild04, xmas_dun01, yuno_fild03) those numbers are the unique identifiers. if there is only 1 spawn, then just write 1. succeeding spawn is 2 then 3 .... All other suggestions to simplify and improve @AnnieRuru yohoo! my master.
  9. anyway, i will release full script after i finish in a while.
  10. 1. Delete or Comment all MVP and mini boss spawn at npc/pre-re/mobs/dungeons/ or /fields. 2. add all MobID, spawn time and map of mvp to array. OnInit: setarray .mvpid[0],1511,1039; <- osiris and baphomet setarray .mvptime[0],60,60; setarray .mvpmaps$[0],"moc_pryd06","prt_maze03"; 3. Upon script load add global variables to each item in .mvpid and initialize timer. OnInit: /* Loop to each mvp. lets set global variable getd("$S"+.mvpid[[email protected]] = 0 <- not set getd("$S"+.mvpid[[email protected]] = 1 <- alive getd("$S"+.mvpid[[email protected]] = 2 <- dead */ for( [email protected] = 0; [email protected] < getarraysize(.mvpid); [email protected]++ ) { /* if variable is not yet set or getd("$S"+.mvpid[[email protected]] < 2 (alive or not set) OR time from setarray .mvptime[0] has elapse setd("$S"+.mvpid[[email protected]],1); (alive) spawn .mvpid[[email protected]] } */ } initnpctimer(); 4 Check every 1 minutes OnTimer60000: for( [email protected] = 0; [email protected] < getarraysize(.mvpid); [email protected]++ ) { /* same thing just check on each mvp if flag is dead then skip, if alive then spawn. if variable is not yet set or getd("$S"+.mvpid[[email protected]] < 2 (alive or not set) OR time from setarray .mvptime[0] has elapse set global mvp status variable to (alive) clear global mvp death variable. spawn .mvpid[[email protected]] } */ } initnpctimer(); 5. Finally, record if mvp is killed and set flag to killed. /* must load that useful function array_find from meko https://herc.ws/board/files/file/326-array-manipulation-functions/ */ OnNPCKillEvent: if(array_find(.mvpid, killedrid) >= 0 ){ // check if monster killed is part of your mvp array // loop to that array until it matches mvpid and map for( [email protected] = 0; [email protected] < getarraysize(.mvpid); [email protected]++ ) { // if match then set variable to dead and set the global mvptime variable to timestamp. break; } } end;
  11. its very impossible to fix that unless you showing the script.
  12. is there any reason why we need to do that?
  13. its not only 2010, i have tried 2018 , its also same. i saw this report also https://github.com/HerculesWS/Hercules/issues/2925
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.