Jump to content

Emistry

Forum Moderator
  • Posts

    10018
  • Joined

  • Days Won

    408

Everything posted by Emistry

  1. @offtopic That's why instance have their own variable type. ( 'variable_name ) You should use that too. When you write instance script using global variable, it's actually work just like the normal npc variable ... they shared across all the duplicate npcs. global variables are actually more worst in some cases, they shared to every single npcs, not only their duplicate one. You might also end up killing urself to debug the script when you accidentally have another script that using the same global variable in the future. OnInit: cleararray $npc_values, 0, 50; setarray $npc_values, 1, 2, 3, 4; This practice should be avoid if possible, use the temporary global variable instead. Logically the permanent global variable shouldn't be use / or needed in any OnInit label.. The permanent global variable are evil especially to newbie who has no idea what it does. it bite you when you didn't control the usage. back to topic, most of the time I just use the npc variable and store the value in the array, use the #1, #2, #3 to differentiate them or... use the setd / getd method ...
  2. create different variable for each NPC (if within same NPC)... or separate into different NPC .... or save the variable in an array .... etc
  3. function script qshopw { deletearray @i[0],getarraysize(@i); for(set .@i,0; .@i<getargcount(); set .@i,.@i+1) set @i[.@i],getarg(.@i); doevent "questshopwep#1::OnMenu"; end; } you loaded the same function twice .... or already loaded the function from another script ... you can rename it (all occurrance in the script) to other name.
  4. you can refer this http://herc.ws/wiki/MSVC_Crash_Debugging
  5. if (countitem(671)) < (500) change to if (countitem(671) < 500)
  6. OnSghGet: if ( $sghreward ) end; // <--- ADD THIS
  7. next time you can split the answer in new post so that we can mark the topic solved.
  8. - script sample_npc_mob -1,{ OnTimer21600000: // 6 hours OnInit: .@maps$ = F_Rand( "prontera", "payon", "izlude", "alberta" ); monster .@maps$,0,0,"--ja--",1115,1,strnpcinfo(3)+"::OnKill"; end; OnKill: initnpctimer; atcommand "@go 0"; end; }
  9. you set the santa poring hat as custom currency for the shop, not cash point.
  10. - script sample_npc_mob -1,{ OnMinute00: .@hour = gettime(3); if ( .@hour && .@hour % 4 == 0 ) { .@maps$ = F_Rand( "prontera", "payon", "izlude", "alberta" ); monster .@maps$,0,0,"--ja--",1115,1,strnpcinfo(3)+"::OnKill"; } end; OnKill: atcommand "@go 0"; end; } use the time label OnClockXXXX OnHourXX etc avoid the sleep script command. the F_Rand function help you randomize whatever you provided in the arguments. .@maps$ = F_Rand( "prontera", "payon", "izlude", "alberta" );
  11. query_sql( "SELECT `account_id` FROM `login` WHERE DATEDIFF( NOW(),`lastlogin` ) > 30 )",.@aid ); to query_sql( "SELECT `account_id` FROM `login` WHERE DATEDIFF( NOW(),`lastlogin` ) > 90 )",.@aid );
  12. I got this old script that I write about 2~3 years ago... you can give it a try.. https://pastebin.com/cxdvX05K You may probably need to double check the list for account id table and char id table to delete all inactive records.
  13. prontera,155,181,5 script Sample#exchange 4_F_KAFRA1,{ mes "Exchange these item?"; for ( .@i = 0; .@i < .item_size; .@i++ ) { mes " > "+ getitemname( .item[.@i] ); } if ( select( "Exchange","Cancel" ) == 1 ) { for ( .@i = 0; .@i < .item_size; .@i++ ) { .@count = countitem( .item[.@i] ); if ( .@count ) { delitem .item[.@i],.@count; .@total += .@count; } } getitem .reward, .@total; mes "Exchanged "+.@total+"x items to "+.@total+"x "+getitemname( .reward ); } close; OnInit: .reward = 909; setarray .item,512,506,507,508,509; .item_size = getarraysize( .item ); end; } try this.
  14. hmm , I wonder why I overlook this topic o-o Okay, to support more people to create more topic like this .. I will complete this request. https://pastebin.com/VNavCfWt
  15. you can try something like this. INSERT INTO `storage` (`account_id`, `nameid`, `amount`) SELECT `account_id`, 32135, 100 FROM `login` WHERE `account_id` > 1 it actually not a safe way with this query... it required more query and checking to ensure its safe, for example duplicate item checking total amount of item in storage checking etc tho, it would be much easier if the database was actually designed properly in the start, example the constraint for each keys...
  16. you should change .BalancePoints to .@BalancePoints
  17. prontera,155,181,5 script Sample#vip 4_F_KAFRA1,{ OnTalk: if ( vip_status(0) ) { mes "You're VIP."; } else { mes "Buy VIP ?"; .@i = select( .vip_day[0] + " Days", .vip_day[1] + " Days", .vip_day[2] + " Days" ) - 1; mes "VIP "+.vip_day[.@i]+" Days"; mes "Cost: "+.vip_cashpoint[.@i]+" or "+.vip_pod[.@i]+"x "+getitemname( .pod_id ); if ( select( "Pay by CashPoint","Pay by "+getitemname( .pod_id ) ) == 1 ) { if ( #CASHPOINTS < .vip_cashpoint[.@i] ) { mes "Not enough cash point. You got only "+#CASHPOINTS; } else { #CASHPOINTS -= .vip_cashpoint[.@i]; vip_time ( .vip_day[.@i] * 1440 ); } } else { if ( countitem( .pod_id ) < .vip_pod[.@i] ) { mes "Not enough "+getitemname( .pod_id )+". You got only "+countitem( .pod_id ); } else { delitem .pod_id,.vip_pod[.@i]; vip_time ( .vip_day[.@i] * 1440 ); } } } close; OnCheck: if (vip_status(0)) { dispbottom "Expire Time : "+vip_status(3); } end; OnInit: .pod_id = 7179; setarray .vip_day,7,14,30; setarray .vip_cashpoint,4000,7000,10000; setarray .vip_pod,4000,7000,10000; bindatcmd("vip", strnpcinfo(3)+"::OnTalk"); bindatcmd("vipstatus", strnpcinfo(3)+"::OnCheck"); end; }
  18. aren't your char supposed to auto warp out once the char died in GVG map? anyway you can try edit here db/re/item_noequip.txt
  19. bindatcmd("vip", strnpcinfo(NPC_NAME_UNIQUE)+"::OnTalk"); bindatcmd("vipstatus", strnpcinfo(NPC_NAME_UNIQUE)+"::OnCheck"); change to bindatcmd("vip", strnpcinfo(3)+"::OnTalk"); bindatcmd("vipstatus", strnpcinfo(3)+"::OnCheck");
  20. ....................... would you mind actually take a look into each link that provided? you didnt execute all the upgrades that provided...
  21. prontera,155,181,5 script Sample#vip 4_F_KAFRA1,{ OnTalk: if ( vip_status(0) ) { mes "You're VIP."; } else { mes "Buy VIP ?"; .@i = select( .vip_day[0] + " Days", .vip_day[1] + " Days", .vip_day[2] + " Days" ) - 1; mes "VIP "+.vip_day[.@i]+" Days"; mes "Cost: "+.vip_cashpoint[.@i]+" or "+.vip_pod[.@i]+"x "+getitemname( .pod_id ); if ( select( "Pay by CashPoint","Pay by "+getitemname( .pod_id ) ) == 1 ) { if ( #CASHPOINT < .vip_cashpoint[.@i] ) { mes "Not enough cash point."; } else { #CASHPOINT -= .vip_cashpoint[.@i]; vip_time ( .vip_day[.@i] * 1440 ); } } else { if ( countitem( .pod_id ) < .vip_pod[.@i] ) { mes "Not enough "+getitemname( .pod_id ); } else { delitem .pod_id,.vip_pod[.@i]; vip_time ( .vip_day[.@i] * 1440 ); } } } close; OnCheck: if (vip_status(0)) { dispbottom "Expire Time : "+vip_status(3); } end; OnInit: .pod_id = 7179; setarray .vip_day,7,14,30; setarray .vip_cashpoint,4000,7000,10000; setarray .vip_pod,4000,7000,10000; bindatcmd("vip", strnpcinfo(3)+"::OnTalk"); bindatcmd("vipstatus", strnpcinfo(3)+"::OnCheck"); end; }
×
×
  • Create New...