Jump to content

Sehrentos

Members
  • Posts

    87
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Sehrentos

  1. Hey, Have you tried with this ? *recovery <type>{,<option>,<revive_flag>{,<map name>}}; This command will revive and fully restore the HP/SP of the selected characters. It returns 1 upon successful use. <type> is the target, and determines the <option> parameter: 0: Player -> Character ID number 1: Party -> Party ID number 2: Guild -> Guild ID number 3: Map -> Map name (a string) 4: All -> None (takes <revive_flag> as option) If no option is specified, the invoking player's character ID, party ID, guild ID, or map will be used. <revive_flag> determines the action: 1: Revive and heal all players (default) 2: Heal living players only 4: Revive dead players only <map name> can optionally be used to define a single map to execute the command on for types 1 (party) and 2 (guild). Example: recovery 1, getcharid(1);
  2. Hey, Use instance commands when targeting instance NPC's, like the ones you commented out. instance_npcname(strnpcinfo(0))+"::OnMobDead"
  3. Yes, unit commands and you can also use a timer to check for nearby players to get players GID
  4. I don't have enough time or interest to continue updating this any further. If some one want's to continue or update it, feel free to do so. Thank you all for your feed back and support and have a happy late summer!
  5. Hi, I think its because inarray function does not exist. Check if your server support it in script commands.
  6. Filter multiple accounts to have 1 loot access instead of many? update: Added filter_same_ip option in this test version. @Radian This need more testing and if possible, a better detection. Link: https://pastebin.com/4AEtSbVb
  7. @Radian Yes, it's possible. I made a small update to the script.
  8. Hey @max65 No idea.. I have not been able to produce this effect on my test server. Hey @melv0 I have not been able to produce this effect on my test server. @CyberDevil Yes, i have not added amount array for the loots so that would need a little editing. To disable random appearance, comment (//) these lines out: // Set NPC size if class_id supports [email protected]_class = rand(495, 498); [email protected]_size = rand(0, 2); // 0=normal, 1=small, 2=big setnpcdisplay(strnpcinfo(0), strnpcinfo(1), [email protected]_class, [email protected]_size); Sorry for slow reply. I don't visit here so often any more.
  9. Yes, that is very much the same and that waiting room displaying time left is great addition.
  10. Greetings, Many times when i see some monster scripts like where you kill a MVP and get extra loots from. It is many times implemented as treasure chest monster that get summoned after MVP is killed and will trigger OnMobDie label. There it checks if he was the actual killer and is able to receive rewards. If there are many players nearby trying to kill same MVP and spamming AOE skills. This treasure chest's event label will get triggered on the first one who got the kill. So players keep spamming AOE, and the actual player who has the right to claim the reward keeps spamming AOE or wait until all players leave or get a lucky hit on it. How I implement this kind of event is by calling an NPC to that location and only the player who has access to the rewards will have a dialog open etc. So, my question is (I'm interested) how would you proceed in this kind of situation? Would it be with a Treasure Monster or Treasure NPC or Not summoning a visual treasure and just open dialog on MVP kill? Here is sample with monster unit: - script Sample -1,{ OnInit: monster "prontera",0,0,"--ja--",1093,1,strnpcinfo(0)+"::OnMobDie"; end; OnMobDie: getmapxy([email protected]$,[email protected],[email protected],0); monster [email protected]$,rand([email protected],[email protected]),rand([email protected],[email protected]),"--ja--",1324,1,strnpcinfo(0)+"::OnBoxKill"; end; OnBoxKill: // If checks your able to receive rewards //... // Else summon Treasure Chest again... getmapxy([email protected]$,[email protected],[email protected],0); monster [email protected]$,rand([email protected],[email protected]),rand([email protected],[email protected]),"--ja--",1324,1,strnpcinfo(0)+"::OnBoxKill"; end; } Here is sample with npc unit: - script Sample -1,{ OnInit: monster "prontera",0,0,"--ja--",1093,1,strnpcinfo(0)+"::OnMobDie"; end; OnMobDie: // ... save players access data ... // Get map coordinates for the Treasure Chest NPC getmapxy(.event_map$, .event_x, .event_y); [email protected] = 0; // Select what treasure npc to open [email protected]$ = "Treasure Chest#tc_"+ [email protected]; donpcevent [email protected]$ +"::OnEnable"; end; } // Treasure Chest NPC index = 0 prontera,0,0,5 script Treasure Chest#tc_0 1324,{ // If check player is able to receive rewards //... dialogs ... // If player received rewards, remove treasure NPC after close close2; [email protected] = 0; [email protected]$ = "Treasure Chest#tc_"+ [email protected]; donpcevent [email protected]$ +"::OnDisable"; end; OnInit: [email protected]$ = strnpcinfo(0); getmapxy(.map$, .x, .y, UNITTYPE_NPC); // Save default position disablenpc [email protected]$; end; OnDisable: [email protected] = getnpcid(0); [email protected]$ = strnpcinfo(0); unitwarp( [email protected], .map$, .x, .y ); // Return to default position disablenpc( [email protected]$ ); end; OnEnable: [email protected] = getnpcid(0); [email protected]$ = strnpcinfo(0); // get coordinates from event npc [email protected]$ = "Sample"; [email protected]$ = getvariableofnpc(.event_map$, [email protected]$); [email protected] = getvariableofnpc(.event_x, [email protected]$); [email protected] = getvariableofnpc(.event_y, [email protected]$); enablenpc( [email protected]$ ); unitwarp( [email protected], [email protected]$, [email protected], [email protected] ); // Move to new position end; } // You can also duplicate more treasure chests, if you need more alberta,0,0,5 duplicate(Treasure Chest#tc_0) Treasure Chest#tc_1 1324 I would love to hear your thoughts and ideas. Thanks
  11. Updated v2.9.3 changed the WorldBossRates NPC script to properly check for .use_floating_rates setting. Reported by @Quesooo Many thanks!
  12. Hey, Thank you. There is option to turn off the floating rates: .use_floating_rates = 0; // Increase servers exp and drop rates for 1 hour after boss kill(0=Disable, 1=Enable)
  13. Open the file in any text editor and edit that query_sql line: query_sql "SELECT char.char_id, char.name, char_reg_num.value FROM char_reg_num LEFT JOIN `char` ON char.char_id=char_reg_num.char_id WHERE char_reg_num.key='brokeemp' ORDER BY CAST(char_reg_num.value AS UNSIGNED) DESC LIMIT 10", [email protected]_id, [email protected]$, [email protected]; Then save it Complete sample: https://pastebin.com/5EFXpJnH
  14. Hey, The error says: Table global_reg_value doesn't exist. So, you can try and change the SQL statement: SELECT char.char_id, char.name, char_reg_num.value FROM char_reg_num LEFT JOIN `char` ON char.char_id=char_reg_num.char_id WHERE char_reg_num.key='brokeemp' ORDER BY CAST(char_reg_num.value AS UNSIGNED) DESC LIMIT 10; Hope this helps.
  15. Hey, i think it's because your arrays starts from index 1, but using rand start from 0 [email protected] = .thd0[rand(getarraysize(.thd0))];
  16. Sehrentos

    Timer

    Trigger 2 times a week in certain time and gives all available players a packet/item/etc. Or with a GM command @woebonus - script #atcmd_woebonus -1,{ OnInit: bindatcmd "woebonus", strnpcinfo(3)+"::OnAtCommand",10,10; end; OnAtCommand: showscript "WoE Bonus!!", getcharid(3), SELF; OnSun1600: // Every Sunday 4:00pm OnWed1600: // Every Wednesday 4:00pm // Attach all available players addrid(0); // Give package/items/etc. getitem 501,1; // Announce current player about it announce "WoE Bonus Received!",BC_SELF,0x00FF00; end; } Oops, forgot about this part:
  17. Yup, forgot. Same public IP over wi-fi but, you can limit the coffee house users at least :heh
  18. A possible workaround would be to use IP detection script with login event: OnPCLoginEvent: [email protected] = query_sql("SELECT login.account_id FROM login INNER JOIN `char` ON char.account_id=login.account_id WHERE login.last_ip='"+getcharip()+"' AND char.online=1;", [email protected]_id); if ([email protected] > 2) { mes "[IP notice]"; mes "Too many online from same IP address."; // Block, Kick, etc. pcblockmove getcharid(3),1; pcblockskill getcharid(3),1; sleep2 5000; atcommand "@kick " + getcharid(0); close; } end;
  19. Hey, clear; is script function: *clear; This command will clear the dialog text and continue the script without player interaction. Just rename it.
  20. Thank you @Rene That worked for me This is the final result if any one is interested: // callsub(S_ForgeProperty, @inventorylist_card2[[email protected]], @inventorylist_card3[[email protected]], @inventorylist_card4[[email protected]]) S_ForgeProperty: [email protected] = getarg(0); [email protected] = getarg(1); [email protected] = getarg(2); // 1 - Ice, 2 - Earth 3 - Fire 4 - Wind. // Calc formula: ElementNumber + ((StarCrubNumber * 5) << 8) [email protected]_id = ([email protected] << 16) | [email protected]; // Character ID's start from 150000 if ([email protected]_id >= 150000) { // Using strcharinfo(0,[email protected]_id) will throw Error if player is offline... // So we use good old SQL query: query_sql("SELECT name FROM `char` WHERE `char_id`="[email protected]_id, [email protected]_name$); } else { setarray [email protected]_name$[0], "Unknown"; } switch([email protected]) { case 3840: [email protected]$ = "Very Very Very Strong "+ [email protected]_name$[0] +"'s Neutral"; break; case 3841: [email protected]$ = "Very Very Very Strong "+ [email protected]_name$[0] +"'s Ice"; break; case 3842: [email protected]$ = "Very Very Very Strong "+ [email protected]_name$[0] +"'s Earth"; break; case 3843: [email protected]$ = "Very Very Very Strong "+ [email protected]_name$[0] +"'s Fire"; break; case 3844: [email protected]$ = "Very Very Very Strong "+ [email protected]_name$[0] +"'s Wind"; break; case 2560: [email protected]$ = "Very Very Strong "+ [email protected]_name$[0] +"'s Neutral"; break; case 2561: [email protected]$ = "Very Very Strong "+ [email protected]_name$[0] +"'s Ice"; break; case 2562: [email protected]$ = "Very Very Strong "+ [email protected]_name$[0] +"'s Earth"; break; case 2563: [email protected]$ = "Very Very Strong "+ [email protected]_name$[0] +"'s Fire"; break; case 2564: [email protected]$ = "Very Very Strong "+ [email protected]_name$[0] +"'s Wind"; break; case 1280: [email protected]$ = "Very Strong "+ [email protected]_name$[0] +"'s Neutral"; break; case 1281: [email protected]$ = "Very Strong "+ [email protected]_name$[0] +"'s Ice"; break; case 1282: [email protected]$ = "Very Strong "+ [email protected]_name$[0] +"'s Earth"; break; case 1283: [email protected]$ = "Very Strong "+ [email protected]_name$[0] +"'s Fire"; break; case 1284: [email protected]$ = "Very Strong "+ [email protected]_name$[0] +"'s Wind"; break; case 0: [email protected]$ = [email protected]_name$[0] +"'s Neutral"; break; case 1: [email protected]$ = [email protected]_name$[0] +"'s Ice"; break; case 2: [email protected]$ = [email protected]_name$[0] +"'s Earth"; break; case 3: [email protected]$ = [email protected]_name$[0] +"'s Fire"; break; case 4: [email protected]$ = [email protected]_name$[0] +"'s Wind"; break; default: [email protected]$ = ""; break; } return [email protected]$;
  21. Hello, Is it possible to calculate and extract the crafted items char_id from card position 3 and 4 ? I have this test script, where i'm trying to extract as many data from the crafted items as possible and show results. In docs char_id is calculated: @card3 = @charid & 65535; @card4 = @charid >> 16; when crafting them. - script #atcmd_test -1,{ OnInit: bindatcmd "test", strnpcinfo(3)+"::OnAtCommand"; end; OnAtCommand: if (getgmlevel() < 60) end; [email protected]_id = getcharid(0); getinventorylist( [email protected]_id ); for( [email protected] = 0; [email protected]<@inventorylist_count; [email protected]++ ) { if(@inventorylist_card1[[email protected]] == CARD0_PET) { message strcharinfo(0), ([email protected]+1) +". [Pet] "+ getitemname(@inventorylist_id[[email protected]]) + " ("+ @inventorylist_amount[[email protected]] +")"; } else if(@inventorylist_card1[[email protected]] == CARD0_FORGE) { message strcharinfo(0), ([email protected]+1) +". [Forge]" + (@inventorylist_refine[[email protected]] ? " +"+ @inventorylist_refine[[email protected]] : "") + " "+ callsub(S_ForgeProperty, @inventorylist_card2[[email protected]]) + " "+ getitemname(@inventorylist_id[[email protected]]) + " ("+ @inventorylist_amount[[email protected]] +")" + (@inventorylist_equip[[email protected]] > 0 ? " Equiped: "+ callsub(S_EquipPosition,@inventorylist_equip[[email protected]]) : "") + (@inventorylist_attribute[[email protected]] ? " broken" : ""); // for debugs: //(@inventorylist_card2[[email protected]] ? " card-2:" + @inventorylist_card2[[email protected]] : "") + //(@inventorylist_card3[[email protected]] ? " card-3:" + @inventorylist_card3[[email protected]] : "") + //(@inventorylist_card4[[email protected]] ? " card-4:" + @inventorylist_card4[[email protected]] : ""); } else if(@inventorylist_card1[[email protected]] == CARD0_CREATE) { message strcharinfo(0), ([email protected]+1) +". [Create]" + (@inventorylist_refine[[email protected]] ? " +"+ @inventorylist_refine[[email protected]] : "") + " "+ getitemname(@inventorylist_id[[email protected]]) + " ("+ @inventorylist_amount[[email protected]] +")" + (@inventorylist_equip[[email protected]] > 0 ? " Equiped: "+ callsub(S_EquipPosition,@inventorylist_equip[[email protected]]) : ""); // for debugs: //(@inventorylist_card2[[email protected]] ? " card-2:" + @inventorylist_card2[[email protected]] : "") + //(@inventorylist_card3[[email protected]] ? " card-3:" + @inventorylist_card3[[email protected]] : "") + //(@inventorylist_card4[[email protected]] ? " card-4:" + @inventorylist_card4[[email protected]] : ""); } else if (@inventorylist_equip[[email protected]] > 0) { // Equiped items message strcharinfo(0), ([email protected]+1) +"." + (@inventorylist_refine[[email protected]] ? " +"+ @inventorylist_refine[[email protected]] : "") + " "+ getitemname(@inventorylist_id[[email protected]]) + " ("+ @inventorylist_amount[[email protected]] +")" + " Equiped: "+ callsub(S_EquipPosition,@inventorylist_equip[[email protected]]) + (@inventorylist_identify[[email protected]] ? "" : " unidentified") + (@inventorylist_attribute[[email protected]] ? " broken" : "") + (@inventorylist_card1[[email protected]] ? " card-1:" + @inventorylist_card1[[email protected]] : "") + //@inventorylist_card1[[email protected]] == 256 is Egg (@inventorylist_card2[[email protected]] ? " card-2:" + @inventorylist_card2[[email protected]] : "") + (@inventorylist_card3[[email protected]] ? " card-3:" + @inventorylist_card3[[email protected]] : "") + (@inventorylist_card4[[email protected]] ? " card-4:" + @inventorylist_card4[[email protected]] : ""); } else { // Other inventory items message strcharinfo(0), ([email protected]+1) +"." + (@inventorylist_refine[[email protected]] ? " +"+ @inventorylist_refine[[email protected]] : "") + " "+ getitemname(@inventorylist_id[[email protected]]) + " ("+ @inventorylist_amount[[email protected]] +")" + (@inventorylist_identify[[email protected]] ? "" : " unidentified") + (@inventorylist_attribute[[email protected]] ? " broken" : "") + (@inventorylist_card1[[email protected]] ? " card-1:" + @inventorylist_card1[[email protected]] : "") + (@inventorylist_card2[[email protected]] ? " card-2:" + @inventorylist_card2[[email protected]] : "") + (@inventorylist_card3[[email protected]] ? " card-3:" + @inventorylist_card3[[email protected]] : "") + (@inventorylist_card4[[email protected]] ? " card-4:" + @inventorylist_card4[[email protected]] : ""); } //debugmes "Equip: "+ getitemname(@inventorylist_id[[email protected]]) + ": "[email protected]_equip[[email protected]]; } end; S_ForgeProperty: [email protected] = getarg(0); // 1 - Ice, 2 - Earth 3 - Fire 4 - Wind. // Calc formula: ElementNumber + ((StarCrubNumber * 5) << 8) switch([email protected]) { case 3840: [email protected]$ = "Very Very Very Strong Neutral"; break; case 3841: [email protected]$ = "Very Very Very Strong Ice"; break; case 3842: [email protected]$ = "Very Very Very Strong Earth"; break; case 3843: [email protected]$ = "Very Very Very Strong Fire"; break; case 3844: [email protected]$ = "Very Very Very Strong Wind"; break; case 2560: [email protected]$ = "Very Very Strong Neutral"; break; case 2561: [email protected]$ = "Very Very Strong Ice"; break; case 2562: [email protected]$ = "Very Very Strong Earth"; break; case 2563: [email protected]$ = "Very Very Strong Fire"; break; case 2564: [email protected]$ = "Very Very Strong Wind"; break; case 1280: [email protected]$ = "Very Strong Neutral"; break; case 1281: [email protected]$ = "Very Strong Ice"; break; case 1282: [email protected]$ = "Very Strong Earth"; break; case 1283: [email protected]$ = "Very Strong Fire"; break; case 1284: [email protected]$ = "Very Strong Wind"; break; case 0: [email protected]$ = "Neutral"; break; case 1: [email protected]$ = "Ice"; break; case 2: [email protected]$ = "Earth"; break; case 3: [email protected]$ = "Fire"; break; case 4: [email protected]$ = "Wind"; break; default: [email protected]$ = ""; break; } //debugmes "Calc value: "+ [email protected]; //debugmes "Calc result: "+ [email protected]$; return [email protected]$; S_EquipPosition: [email protected] = getarg(0); if([email protected] == EQP_ACC_L) { [email protected]$ = "Accessory Left"; } else if([email protected] == EQP_ACC_R) { [email protected]$ = "Accessory Right"; } else if([email protected] == EQP_SHOES) { [email protected]$ = "Shoes"; } else if([email protected] == EQP_GARMENT) { [email protected]$ = "Garment"; } else if([email protected] == EQP_HEAD_LOW) { [email protected]$ = "Head lower"; } else if([email protected] == EQP_HEAD_MID) { [email protected]$ = "Head middle"; } else if([email protected] == EQP_HEAD_TOP) { [email protected]$ = "Head top"; } else if([email protected] == EQP_ARMOR) { [email protected]$ = "Armor"; } else if([email protected] == EQP_HAND_L) { [email protected]$ = "Hand Left"; } else if([email protected] == EQP_HAND_R) { [email protected]$ = "Hand Right"; } else if([email protected] == EQP_HAND_L + EQP_HAND_R) { [email protected]$ = "Hands Left & Right"; } else if([email protected] == EQP_COSTUME_HEAD_TOP) { [email protected]$ = "C-Head top"; } else if([email protected] == EQP_COSTUME_HEAD_MID) { [email protected]$ = "C-Head middle"; } else if([email protected] == EQP_COSTUME_HEAD_LOW) { [email protected]$ = "C-Head lower"; } else if([email protected] == EQP_COSTUME_GARMENT) { [email protected]$ = "C-Garment"; } else if([email protected] == EQP_AMMO) { [email protected]$ = "Ammonition"; } else if([email protected] == EQP_SHADOW_ARMOR) { [email protected]$ = "S-Armor"; } else if([email protected] == EQP_SHADOW_WEAPON) { [email protected]$ = "S-Weapon"; } else if([email protected] == EQP_SHADOW_SHIELD) { [email protected]$ = "S-Shield"; } else if([email protected] == EQP_SHADOW_SHOES) { [email protected]$ = "S-Shoes"; } else if([email protected] == EQP_SHADOW_ACC_R) { [email protected]$ = "S-Accessory Right"; } else if([email protected] == EQP_SHADOW_ACC_L) { [email protected]$ = "S-Accessory Left"; } else if([email protected] == EQP_ACC_RL) { [email protected]$ = "Accessory Both"; } else if([email protected] == EQP_SHADOW_ACC_RL) { [email protected]$ = "S-Accessory Both"; } else { [email protected]$ = ""; } return [email protected]$; } Thanks in advance.
  22. One option is to use OnTime events with rand and switch when to start or skip the tick. To start that event call: donpcevent "Announcer2::OnGMStart";
  23. Hi, You can try if this works for you: INSERT INTO pvp_ranking (charid,points) VALUES(150013, 0) ON DUPLICATE KEY UPDATE points = CASE WHEN points >= 12 THEN points - 12 ELSE 0 END Change the table column names to match yours.
  24. Hey, I got some spare time and decided to update the script. @Musika6988 Version 2.9 Added loot modes 10 and 11 with party select option. And option to turn off the radar (changing monster HP) Update: Version 2.9.1 Fix random reward will be selected only once, to avoid abuse. Added option to turn off mapflags. Added more default .MOB_ status points. Renamed some values. easier to understand. Update2: Version 2.9.2 Disabled FOG effect. Added more announce text. Added unit checks OnMobDie event. Added inarray optimizations. Note: To rename the Treasure Chest NPC, replace ALL "Treasure Chest#wb_" strings but keep the index numbers.
×
×
  • Create New...

Important Information

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