Jump to content

Winterfox

Members
  • Posts

    236
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by Winterfox

  1. 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"); }
  2. 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
  3. 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; }
  4. 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; } }
  5. 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.
  6. 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.
  7. 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; }
  8. 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"; }
  9. 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...