Jump to content

Winterfox

Members
  • Posts

    248
  • Joined

  • Last visited

  • Days Won

    19

Everything posted by Winterfox

  1. Hello, it is hard to help you, since you didn't provide the complete script. But I can give you a tip. getpartymembercount and getpartycount aren't functions. Later you get the number of people in the party here: set .@count, $@partymembercount; So you basically could move: if (getpartymembercount(getcharid(1)) != 3 && getpartycount(getcharid(1)) != 3){ mes "Desculpe, Você não atende o requesitos, Verifique se sua Party têm 3 pessoas e tente novamente."; close; } Below above said line and change it to: if (.@count != 3){ mes "Desculpe, Você não atende o requesitos, Verifique se sua Party têm 3 pessoas e tente novamente."; close; } To achieve what it seems you want it to do.
  2. - script GetRed FAKE_NPC,{ OnNPCKillEvent: #KILLED_MONSTERS += 1; if (#KILLED_MONSTERS % .mobsPerDrop != 0) end; getunitdata(killedgid, .@mobData); makeitem(.itemDropId, .itemDropAmt, mapid2name(.@mobData[UMOB_MAPID]), .@mobData[UMOB_X], .@mobData[UMOB_Y]); dispbottom "[ระบบ] : ยินดีด้วย คุณได้รับดรอปไอเทม " + getitemname(.itemDropId) + " จากการกำจัดมอนเตอร์"; end; OnInit: .itemDropId = 501; .itemDropAmt = 1; .mobsPerDrop = 100; }
  3. Hello, what do you exactly want to achieve with this script? If you want to simply remove SC_BOSSMAPINFO state from a player on login, you can use this: - script delete_scbossmapinfo FAKE_NPC,{ OnPCLoginEvent: sc_end(SC_BOSSMAPINFO); }
  4. Winterfox

    Unjail Npc

    Based on your packet version, your rAthena is pretty old. The current packt version is 20211103. The included script doesn't allow others to bail someone out. You can only bail yourself out via payment or labor. It also seems like it doesn't work anymore, since it doesn't really unjail you, but tries to warp you out of jail and change your savepoint which fails. But it might be that on your server version it still works.
  5. Winterfox

    Unjail Npc

    Hello, I tested it on my server and I can't reproduce your error. It works fine for me. Which rAthena version are you using? It seems like your rAthena doesn't know the getareaunits command.
  6. To remove the cast fixed cast time you need to edit the skill_db.yml and remove this from the asura strike entry: FixedCastTime: - Level: 1 Time: 2000 - Level: 2 Time: 1750 - Level: 3 Time: 1500 - Level: 4 Time: 1250 - Level: 5 Time: 1000
  7. Winterfox

    Unjail Npc

    Hello, how about this? - script JailSystem#proto FAKE_NPC,{ OnBail: .@charCount = getareaunits(BL_PC, "sec_pri", 14, 85, 59, 65, .@charNames$); mes "[Guard]"; if(.@charCount == 0) { mes "There is no one in jail."; close; } mes "Who do you want to bail out?"; next; select(implode(.@charNames$, ":")); mes "[Guard]"; mes "The fee is " + callfunc("F_InsertComma", .bailOutPrice) + "z. Do you want to pay that?"; next; if (select("Yes:No" ) == 1) { mes "[Guard]"; if(Zeny < .bailOutPrice) { mes "It seems you don't have enough money, come back when you have enough."; close; } Zeny -= .bailOutPrice; .@addressation$ = (strcharinfo(0) == .@charNames$[@menu - 1]) ? "you" : .@charNames$[@menu - 1]; mes "Alright, i'll let " + .@addressation$ + " go for now."; close2; atcommand("@unjail " + .@charNames$[@menu - 1]); end; } mes "[Guard]"; mes "You can come back when you change your mind."; close; end; OnInit: .bailOutPrice = 10000; } - script BAIL_ATCOMMAND FAKE_NPC,{ OnInit: bindatcmd("bail", "Guard#proto::OnBail"); } prontera, 159, 190, 4 duplicate(JailSystem#proto) Prison Warden#sec_pri01 4_M_YOUNGKNIGHT sec_pri, 18, 63, 4 duplicate(JailSystem#proto) Jail Guard#sec_pri02 4_M_EDEN_GUARDER sec_pri, 45, 63, 4 duplicate(JailSystem#proto) Jail Guard#sec_pri03 4_M_LGTGUARD
  8. Hello, this is only possible if your server has a way of identifying a unique PC for example based on a hardware id. If you want someone to modify your script, you would need to tell them how to access this unique id via script to be able to help you.
  9. I missed a variable. This should spawn monsters now: - script EXCLUSIVE_GUILD_MAPS FAKE_NPC,{ OnGuildpointmobDeath: if ( .rate > rand( 10 ) ) { .@point = rand( .guild_amount[0], .guild_amount[1] ); #GUILDPOINTS += .@point; dispbottom "Gained " + .@point + " Point. You got "+F_InsertComma( #GUILDPOINTS ) + " Points now."; } callsub MobSpawn, strcharinfo(3), .respawnGPmobs; end; OnGoldmobDeath: .@r = rand(100); if ( .@r < 3 ) getitem 969, 50; else if ( .@r < 5 ) getitem 969, 20; else if ( .@r < 25 ) getitem 969, 5; else if ( .@r < 50 ) getitem 969, 3; else getitem 969, 1; callsub MobSpawn, strcharinfo(3), .respawnGoldmobs; end; MobSpawn: .@map$ = getarg(0); for(.@i = 0; .@i < getarraysize(getarg(1)); .@i += 3) { .@mobId = getelementofarray(getarg(1), .@i); .@mobType = getelementofarray(getarg(1), .@i + 1); .@mobAmt = getelementofarray(getarg(1), .@i + 2); .@mobTypeName$ = .mobTypeNames$[.@mobType]; .@mobLabel$ =.labels$[.@mobType]; monster .@map$, 0,0, .@mobTypeName$, .@mobId, .@mobAmt, strnpcinfo(0) + "::" + .@mobLabel$; } return; OnInit: //Castle Maps setarray .castleMaps$[0], "prtg_cas01","aldeg_cas05"; // Exclusive Map setarray .exclusiveMaps$[0], "prt_fild07","prt_fild09"; // Guildpoints random amount setarray .guild_amount, 1, 3; // Rate to get Guildpoints .rate = 100; // Mob Spawn // ID, Type (0 = Gold, 1 = Guildpoints), Amount setarray .mobs[0], 1369, 0, 100, 1840, 0, 100, 1934, 1, 50, 1935, 1, 50; // Respawn Mobs Gold // ID, Type (0 = Gold, 1 = Guildpoints), Amount setarray .respawnGoldmobs[0], 1369, 0, 1, 1840, 0, 1; // Respawn Mobs Guildpoints // ID, Type (0 = Gold, 1 = Guildpoints), Amount setarray .respawnGPmobs[0], 1934, 1, 1, 1935, 1, 1; setarray .mobTypeNames$[0], "[DG]Gold", "[DG]Flower"; setarray .labels$[0], "OnGoldmobDeath", "OnGuildpointmobDeath"; for(.@i = 0; .@i < getarraysize(.exclusiveMaps$); .@i++) { setmapflag .exclusiveMaps$[.@i], MF_LOADEVENT; callsub MobSpawn, .exclusiveMaps$[.@i], .mobs; } } byako,152,144,0 script FarmGuild 1,{ copyarray .cpyCastleMaps$[0], getvariableofnpc(.castleMaps$[0], "EXCLUSIVE_GUILD_MAPS"), getarraysize(getvariableofnpc(.castleMaps$[0], "EXCLUSIVE_GUILD_MAPS")); copyarray .cpyExclusiveMaps$[0], getvariableofnpc(.exclusiveMaps$[0], "EXCLUSIVE_GUILD_MAPS"), getarraysize(getvariableofnpc(.exclusiveMaps$[0], "EXCLUSIVE_GUILD_MAPS")); mes "[Entrance Guard]"; if (agitcheck() || agitcheck2() || agitcheck3()) { mes "WoE is currently active you can't enter right now"; close; } if(getcharid(2) == 0) { mes "Your need to be in a Guild, for me to be able to assist you."; close; } .@index = 0; for(.@i = 0; .@i < getarraysize(.cpyCastleMaps$); .@i++) { if(getcastledata(.cpyCastleMaps$[.@i], CD_GUILD_ID) == getcharid(2)) { .@ownedCastleIndexes[.@index] = .@i; .@index++; } } .@ownedCastlesCount = getarraysize(.@ownedCastleIndexes); if (.@ownedCastlesCount == 0 && .@index == 0) { mes "You don't own a Castle. Come back when you do."; close; } if(.@ownedCastlesCount == 0) .@map$ = .cpyExclusiveMaps$[.@ownedCastleIndexes[0]]; if(.@ownedCastlesCount > 0) { for(.@i = 0; .@i < .@ownedCastlesCount; .@i++) .@ownedCastleNames$[.@i] = getcastlename(.cpyCastleMaps$[.@ownedCastleIndexes[.@i]]); mes "You own multiple Castles, select to which Castles exclusive map you want to teleport."; next; select(implode(.@ownedCastleNames$, ":")); .@map$ = .cpyExclusiveMaps$[.@ownedCastleIndexes[@menu - 1]]; } mes "You will be warped to Lost Midgard"; next; warp .@map$, 0, 0; dispbottom "[Guild Message]: Welcome to Lost Midgard"; end; }
  10. - script EXCLUSIVE_GUILD_MAPS FAKE_NPC,{ OnGuildpointmobDeath: if ( .rate > rand( 10 ) ) { .@point = rand( .guild_amount[0], .guild_amount[1] ); #GUILDPOINTS += .@point; dispbottom "Gained " + .@point + " Point. You got "+F_InsertComma( #GUILDPOINTS ) + " Points now."; } callsub MobSpawn, strcharinfo(3), .respawnGPmobs; end; OnGoldmobDeath: .@r = rand(100); if ( .@r < 3 ) getitem 969, 50; else if ( .@r < 5 ) getitem 969, 20; else if ( .@r < 25 ) getitem 969, 5; else if ( .@r < 50 ) getitem 969, 3; else getitem 969, 1; callsub MobSpawn, strcharinfo(3), .respawnGoldmobs; end; MobSpawn: .@map$ = getarg(0); for(.@i = 0; .@i < getarraysize(getarg(1)); .@i += 3) { .@mobId = getelementofarray(getarg(1), .@i); .@mobType = getelementofarray(getarg(1), .@i + 1); .@mobAmt = getelementofarray(getarg(1), .@i + 2); .@mobTypeName$ = .mobTypeNames$[.@mobType]; .@mobLabel$ =.labels$[.@mobType]; monster .@map$, 0,0, .@mobTypeName$, .@mobId, .@mobAmt, strnpcinfo(0) + "::" + .@mobLabel$; } return; OnInit: //Castle Maps setarray .castleMaps$[0], "prtg_cas01", "prtg_cas02"; // Exclusive Map setarray .exclusiveMaps$[0], "prt_fild07", "prt_fild08"; // Guildpoints random amount setarray .guild_amount, 1, 3; // Rate to get Guildpoints .rate = 100; // Mob Spawn // ID, Type (0 = Gold, 1 = Guildpoints), Amount setarray .mobs[0], 1369, 0, 100, 1840, 0, 100, 1934, 1, 50, 1935, 1, 50; // Respawn Mobs Gold // ID, Type (0 = Gold, 1 = Guildpoints), Amount setarray .respawnGoldmobs[0], 1369, 0, 1, 1840, 0, 1; // Respawn Mobs Guildpoints // ID, Type (0 = Gold, 1 = Guildpoints), Amount setarray .respawnGPmobs[0], 1934, 1, 1, 1935, 1, 1; setarray .mobTypeNames$[0], "[DG]Gold", "[DG]Flower"; setarray .labels$[0], "OnGoldmobDeath", "OnGuildpointmobDeath"; for(.@i = 0; .@i < getarraysize(.maps$); .@i++) { setmapflag .exclusiveMaps$[.@i], MF_LOADEVENT; callsub MobSpawn, .exclusiveMaps$[.@i], .mobs; } } prontera,150,150,0 script Entrance Guard 112,{ copyarray .cpyCastleMaps$[0], getvariableofnpc(.castleMaps$[0], "EXCLUSIVE_GUILD_MAPS"), getarraysize(getvariableofnpc(.castleMaps$[0], "EXCLUSIVE_GUILD_MAPS")); copyarray .cpyExclusiveMaps$[0], getvariableofnpc(.exclusiveMaps$[0], "EXCLUSIVE_GUILD_MAPS"), getarraysize(getvariableofnpc(.exclusiveMaps$[0], "EXCLUSIVE_GUILD_MAPS")); mes "[Entrance Guard]"; if (agitcheck() || agitcheck2() || agitcheck3()) { mes "WoE is currently active you can't enter right now"; close; } if(getcharid(2) == 0) { mes "Your need to be in a Guild, for me to be able to assist you."; close; } .@index = 0; for(.@i = 0; .@i < getarraysize(.cpyCastleMaps$); .@i++) { if(getcastledata(.cpyCastleMaps$[.@i], CD_GUILD_ID) == getcharid(2)) { .@ownedCastleIndexes[.@index] = .@i; .@index++; } } .@ownedCastlesCount = getarraysize(.@ownedCastleIndexes); if (.@ownedCastlesCount == 0 && .@index == 0) { mes "You don't own a Castle. Come back when you do."; close; } if(.@ownedCastlesCount == 0) .@map$ = .cpyExclusiveMaps$[.@ownedCastleIndexes[0]]; if(.@ownedCastlesCount > 0) { for(.@i = 0; .@i < .@ownedCastlesCount; .@i++) .@ownedCastleNames$[.@i] = getcastlename(.cpyCastleMaps$[.@ownedCastleIndexes[.@i]]); mes "You own multiple Castles, select to which Castles exclusive map you want to teleport."; next; select(implode(.@ownedCastleNames$, ":")); .@map$ = .cpyExclusiveMaps$[.@ownedCastleIndexes[@menu - 1]]; } mes "You will be warped to Lost Midgard"; next; warp .@map$, 0, 0; dispbottom "[Guild Message]: Welcome to Lost Midgard"; end; }
  11. Hello, I put your script into an item on my server and I don't get that error. It seems like the error message and the script you provided aren't related.
  12. Hello, try this: mall01, 92, 135, 5 script Guild Vip Registrar 612,{ if(getcharid(2) == 0) { mes .NPC$; mes "You need to be in a guild to use my services."; close; } query_sql("SELECT TIMESTAMPDIFF(SECOND, NOW(), expiration_time) FROM vip_guild WHERE `guild_id` = " + getcharid(2), .@secondsUntilExpiration); if (.@secondsUntilExpiration > 0) { mes .NPC$; mes "Dear " + strcharinfo(0) + ", your guild " + strcharinfo(2) + " has still vip status. So there is nothing i can really help you with."; close; } mes .NPC$; mes "Hello " + strcharinfo(0) + ", What can i do for you?"; next; if (select("- I want to make my guild vip:- Nothing") - 1) close; mes .NPC$; mes "Okay, to make your guild vip you need the following: "; mes "- " + .Amount + " x " + getitemname(.ID); next; mes .NPC$; mes "So what do you want now?"; next; if (select("Yes, i have those requirements:I'll think over it again") - 1) close; mes .NPC$; mes "Let me check your items to ensure that you meet the requirements."; next; if (countitem(.ID) < .Amount) { mes .NPC$; mes "Sorry " + strcharinfo(0) + ", it seems like you don't meet the requirements."; close; } mes .NPC$; mes "Alright then, i will register your guild as a vip guild."; query_sql "INSERT INTO `vip_guild` (`guild_id`, `expiration_time`) VALUES (" + getcharid(2) + ", DATE_ADD(NOW(), INTERVAL 1 MONTH))"; delitem .ID, .Amount; close; OnPCLoginEvent: .@rowCount = query_sql("SELECT TIMESTAMPDIFF(DAY, NOW(), expiration_time), TIMESTAMPDIFF(SECOND, NOW(), expiration_time) FROM vip_guild WHERE `guild_id` = " + getcharid(2), .@daysUntilExpiration, .@secondsUntilExpiration); if(.@rowCount == 0) end; if (.@secondsUntilExpiration <= 0) { dispbottom "Your guilds vip state has expired"; query_sql("DELETE FROM `vip_guild` WHERE `guild_id` = " + getcharid(2)); end; } dispbottom "Hello " +strcharinfo(0)+ ", your guilds vip state ends in " + callfunc("F_InsertPlural", .@daysUntilExpiration, "day") + "."; end; OnInit: .NPC$ = "[ " +strnpcinfo(1)+ " ]"; .Amount = 30; .ID = 51582; query_sql("CREATE TABLE IF NOT EXISTS `vip_guild` (`guild_id` INT NOT NULL, `expiration_time` DATETIME NOT NULL, PRIMARY KEY (guild_id)) ENGINE=INNODB"); }
  13. Hello, try it like this: - script Fire Wings Evolution -1,{ OnPCLoadMapEvent: if (strcharinfo(3) != .map$ || !isequipped(.starterItem)) end; fire_wings_evo = 1; for(.@i = 0; .@i < .duration; .@i++) { if(strcharinfo(3) != .map$) end; sleep2(.duration * 100); } if (fire_wings_evo == 0) end; unequip EQI_HEAD_LOW; getitem .nextItem, 1; sleep2 100; delitem .starterItem, 1; equip .nextItem; end; OnPCDieEvent: if (fire_wings_evo > 0) fire_wings_evo = 0; end; OnInit: .starterItem = 30058; .nextItem = 30035; .map$ = "thor_03"; .duration = 10; } thor_03 mapflag loadevent
  14. Hello, this should do what you want. - script mob_cleaner -1,{ OnTimer60000: for(.@i = 0; .@i < getarraysize(.cleanMaps$); .@i++) if(getmapunits(BL_PC, .cleanMaps$[.@i]) == 0) killmonsterall(.cleanMaps$[.@i]); setnpctimer 0; end; OnInit: setarray .cleanMaps$[0], "prontera", "payon"; initnpctimer; }
  15. Hello, you could do it something like this. prontera,150,150,0 script Entrance Guard 112,{ mes "[Entrance Guard]"; if (agitcheck() || agitcheck2() || agitcheck3()) { mes "Woe is currently active you can't enter right now"; close; } .@gid = getcastledata("prtg_cas01", CD_GUILD_ID); if (getcharid(2) != .@gid) { mes "[Entrance Guard]"; mes "Your Guild did not conquer Krimhild Castle!"; dispbottom "[Guild Message]: Only the Guild that owns Kriemhild Castle can enter here!"; close; } mes "You will be warped to Lost Midgard"; next; warp .map$, 0, 0; dispbottom "[Guild Message]: Welcome to Lost Midgard"; end; OnGuildpointmobDeath: if ( .rate > rand( 10 ) ) { .@point = rand( .guild_amount[0], .guild_amount[1] ); #GUILDPOINTS += .@point; dispbottom "Gained " + .@point + " Point. You got "+F_InsertComma( #GUILDPOINTS ) + " Points now."; } callsub MobSpawn, strcharinfo(3), .respawnGPmobs; end; OnGoldmobDeath: .@r = rand(100); if ( .@r < 3 ) getitem 969, 50; else if ( .@r < 5 ) getitem 969, 20; else if ( .@r < 25 ) getitem 969, 5; else if ( .@r < 50 ) getitem 969, 3; else getitem 969, 1; callsub MobSpawn, strcharinfo(3), .respawnGoldmobs; end; MobSpawn: .@map$ = getarg(0); for(.@i = 0; .@i < getarraysize(getarg(1)); .@i += 3) { .@mobId = getelementofarray(getarg(1), .@i); .@mobType = getelementofarray(getarg(1), .@i + 1); .@mobAmt = getelementofarray(getarg(1), .@i + 2); .@mobTypeName$ = .mobTypeNames$[.@mobType]; .@mobLabel$ =.labels$[.@mobType]; monster .@map$, 0,0, .@mobTypeName$, .@mobId, .@mobAmt, strnpcinfo(0) + "::" + .@mobLabel$; } return; OnInit: //Castle Maps setarray .maps$[0], "prt_fild07", "prt_fild08"; // Guildpoints random amount setarray .guild_amount, 1, 3; // Rate to get Guildpoints .rate = 100; // Mob Spawn // ID, Type (0 = Gold, 1 = Guildpoints), Amount setarray .mobs[0], 1369, 0, 100, 1840, 0, 100, 1934, 1, 50, 1935, 1, 50; // Respawn Mobs Gold // ID, Type (0 = Gold, 1 = Guildpoints), Amount setarray .respawnGoldmobs[0], 1369, 0, 1, 1840, 0, 1; // Respawn Mobs Guildpoints // ID, Type (0 = Gold, 1 = Guildpoints), Amount setarray .respawnGPmobs[0], 1934, 1, 1, 1935, 1, 1; setarray .mobTypeNames$[0], "[DG]Gold", "[DG]Flower"; setarray .labels$[0], "OnGoldmobDeath", "OnGuildpointmobDeath"; for(.@i = 0; .@i < getarraysize(.maps$); .@i++) { setmapflag .maps$[.@i], MF_LOADEVENT; callsub MobSpawn, .maps$[.@i], .mobs; } // fallthrough as first check upon script loaded OnTimer5000: // next timer after ini will run on 5 seconds after .@gid = getcastledata("prtg_cas01", CD_GUILD_ID); .@num = getmapunits(BL_PC, .map$, .@name$[0]); freeloop(1); for (.@i = 0; .@i < .@num;.@i++) { if (getcharid(2, .@name$[.@i]) == .@gid) // still on the guild? skip it. continue; message .@name$[.@i], "YOU ARE NO LONGER WELCOME HERE, YOU WILL BE WARPED TO WHERE YOU BELONG!!!!"; warp "SavePoint", 0, 0, getcharid(0, .@name$[.@i]); } freeloop(0); initnpctimer; // reinit the timer tick end; OnAgitStart: OnAgitStart2: OnAgitStart3: .@num = getmapunits(BL_PC, .map$, .@name$[0]); freeloop(1); for (.@i = 0; .@i < .@num; .@i++) { message .@name$[.@i], "Agit event has been started, You will be warped to Save Point"; warp "SavePoint", 0, 0, getcharid(0, .@name$[.@i]); } freeloop(0); end; OnPCLoadMapEvent: if (strcharinfo(3) != .map$) end; if (agitcheck() || agitcheck2() || agitcheck3()) { message strcharinfo(0), "Agit event is on going, You will be warped to Save Point"; warp "SavePoint", 0, 0; end; } .@gid = getcastledata("prtg_cas01", CD_GUILD_ID); if (getcharid(2) != .@gid) { mes "YOU ARE NOT ALLOWED HERE, GO BACK!!!!"; next; warp "SavePoint", 0, 0; } }
  16. Hello, that is because pc_setpos isn't a file but a function in src/map/pc.cpp. It is the point where the interactions of a player character with the game world (maps) are managed.
  17. Hello, I am not sure how you achieved that all boss monsters drop TCG, but I guess the reason why it doesn't work for some monsters is that you use a script to achieve this that uses the OnNPCKillEvent label. The Problem is that this label only gets triggered when a monster gets killed that doesn't already have a label, which most of those you mentioned as not working have. You could use addmonsterdrop to add the drop manually to all boss monsters, an example would be this: - script ITEM_DROP FAKE_NPC,{ OnInit: setarray .reward[0], 7227, 10000; query_sql("SELECT id FROM `mob_db_re` WHERE `mvp_exp` > 0;", .@monsterIds); for(.@i = 0; .@i < getarraysize(.@monsterIds); .@i++) addmonsterdrop .@monsterIds[.@i], .reward[0], .reward[1]; } It pulls all monsters IDs that have mvp exp and adds a 100% drop chance for the TGC. If you want to define the monsters manually, you also could simply put them in an array. - script ITEM_DROP FAKE_NPC,{ OnInit: // mob id, chance (1% = 100) setarray .reward[0], 7227, 10000; setarray .monsterIds[0], 1002; for(.@i = 0; .@i < getarraysize(.monsterIds); .@i++) addmonsterdrop .monsterIds[.@i], .reward[0], .reward[1]; } One thing you need to know though is that the drop rate you set is influenced by the level penalty system if you use renewal. So if you set it to 100% but your character is 6~9 level or more above the mob the drop rate will be reduced.
  18. Hello, try this: - script MVP_DROP FAKE_NPC,{ OnNPCKillEvent: if(!getmonsterinfo(killedrid, MOB_MVPEXP)) end; .@rowCount = getarraysize(.itemInfos) / .columnCount; for (.@i = 0; .@i < .@rowCount; .@i++) { .@index = .@i * .@rowCount; .@randIndex = rand(.@i, .@rowCount - 1) * .@rowCount; copyarray .tmpItemInfo[0], .itemInfos[.@randIndex], .columnCount; copyarray .itemInfos[.@randIndex], .itemInfos[.@index], .columnCount; copyarray .itemInfos[.@index], .tmpItemInfo[0], .columnCount; } for(.@i = 0; .@i < getarraysize(.itemInfos); .@i += .columnCount) { if(rand(1, 100) <= .itemInfos[.@i + 2]) { getitem .itemInfos[.@i], .itemInfos[.@i + 1]; announce "Congratulations! Player " + strcharinfo(0) + " has obtained "+ getitemname(.itemInfos[.@i]) +" [" + .itemInfos[.@i + 1] + "] from "+ getmonsterinfo(killedrid, 0) +" (chance: " + .itemInfos[.@i + 2] + "%) MVP Drop(s).", bc_all, 0x00FF00; if(.onlyOneDrop) end; } } end; OnInit: // item id, item amount, item chance in % setarray .itemInfos[0], 7179, 1, 5, 7227, 1, 25, 7539, 1, 50; .onlyOneDrop = true; .columnCount = 3; }
  19. Hello, you should read the documentation more carefully, getmapflag takes at least two arguments. *getmapflag("<map name>",<flag>{,<type>}) So you need to input the map the user is on as the first argument. Based on your example, a working solution would be this: - script at_mall -1,{ OnMallWarp: if(getmapflag(strcharinfo(3), gvg_castle)){ dispbottom "You cannot use this command inside a War of Emperium castle.", 0xFF0000; end; } warp "prontera",152,252; end; OnInit: bindatcmd "Mall", strnpcinfo(0)+"::OnMallWarp"; }
  20. Hi, you can't use bonus directly, but as a workaround you can use bonus_script. There are just two things to be aware of when using bonus_script, the first is that it requires a duration. The second is that when there is another bonus script that is exactly the same, the second will be ignored. For the first problem you can use a duration of for example 1 day and extend the duration every midnight by another day using the flags that bonus_script provides. Also, it would be a good idea to use the flags to make sure that the script gets removed on logout, otherwise the duration stacking could cause you trouble later. The second problem isn't that big either. There aren't that many bonus scripts, and those that are there by default are unique. But in case there are bonus scripts that are the same, let's say you have this bonus script in two places, and they should both be applied uniquely: bonus_script "{ bonus bVit, 30; }", 60; You can put in any other command to make the script be considered unique, for example, you could change one of those bonus scripts to look like this: bonus_script "{ bonus bVit, 30; sleep2 0; }", 60; The sleep2 makes the script unique and since it sleeps for 0 seconds it does nearly nothing. Here is an example of how a solution possibly could look like: - script LoginBonusStats -1,{ OnHour00: addrid 0; OnPCLoginEvent: if (#vit_up == 1) bonus_script "{ bonus bVit, 30; }", 86400, 1032; }
×
×
  • Create New...