Jump to content

Scofield

Members
  • Posts

    272
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Scofield

  1. #!/usr/sbin/nft -f flush ruleset table inet filter { # Conjunto dinâmico para IPs bloqueados set blocked_ips { type ipv4_addr flags dynamic, timeout timeout 1h } # Portas do Ragnarok Online set ragnarok_ports { type inet_service elements = { 6900, 6121, 5121, 8888 } } chain input { type filter hook input priority 0; policy drop; # Permitir tráfego de loopback iif "lo" accept # Permitir conexões estabelecidas e relacionadas ct state established,related accept # Proteção contra SYN Flood tcp flags syn \ tcp dport { 22, 80, 443, 6900, 6121, 5121, 8888 } \ meter syn_flood_protection { \ ip saddr limit rate 20/second burst 40 packets \ } \ accept # Permitir SSH, HTTP, HTTPS tcp dport { 22, 80, 443 } accept # Proteção contra flood nas portas do Ragnarok tcp dport @ragnarok_ports \ ct state new \ meter ragnarok_connections { \ ip saddr limit rate 100/second burst 50 packets \ add @blocked_ips { ip saddr timeout 1h } \ } # Bloquear IPs marcados como suspeitos ip saddr @blocked_ips \ tcp dport @ragnarok_ports \ log prefix "DDoS Attempt Blocked: " \ drop # Permitir conexões normais após verificação inicial tcp dport @ragnarok_ports accept # Bloquear pacotes inválidos ct state invalid drop # Logar e descartar pacotes não permitidos log prefix "nftables-drop: " drop } chain forward { type filter hook forward priority 0; policy drop; } chain output { type filter hook output priority 0; policy accept; } } etc/nftables.conf @Gidz Cross Install nftables on your VPS and then navigate to the /var/ directory. There, you will find a file named nftables.conf. Open it, and if you wish, you can use my rules. However, keep in mind that these rules still need to be adjusted. This means that I cannot guarantee they won’t block legitimate players. Probably not, but from what I remember, a normal player makes around 2 to 4 requests per second. So, stay alert and adjust as needed.
  2. Many people have questions about how to properly set up a newly acquired VPS to run the rAthena emulator. To simplify this process, I created an automated script that handles all the necessary configuration quickly and easily. Most tutorials available online focus on running the emulator on personal computers, but nowadays, the trend is to use a VPS for better performance and stability. With this script, you can set up your environment efficiently, even without advanced server knowledge. For those who want to start a professional rAthena project, here are some tips: 1. Use MariaDB instead of MySQL MariaDB is a community-developed fork of MySQL that offers several performance and optimization advantages, especially for large-scale applications like rAthena. While both database systems are compatible, MariaDB stands out due to its efficiency in handling intensive queries. Benefits of using MariaDB: Better Performance: MariaDB is optimized for handling large volumes of data and executes complex queries faster than MySQL. Improved Storage Engines: Supports advanced engines like Aria and TokuDB, which enhance performance and reduce data fragmentation. Faster Replication: Offers faster and safer master-slave replication, ensuring better data synchronization in distributed environments. Open Source & Active Development: Fully open-source with a more active development cycle, meaning better features and faster bug fixes. Optimized Thread Pooling: Handles multiple simultaneous connections efficiently, reducing CPU overhead and improving query response time. For an rAthena server, this translates to faster character loading, smoother gameplay, and better handling of concurrent player actions. 2. Use nftables instead of iptables nftables is a modern packet filtering framework that replaces the older iptables. It is now the default in most Linux distributions and provides better performance and flexibility when managing network rules, including basic DDoS protection. Benefits of using nftables: Higher Performance: Processes rules faster with a more optimized kernel implementation, reducing the impact on system resources. Simplified Rule Management: Uses a cleaner and unified syntax, making it easier to create and manage complex firewall rules. Better DDoS Mitigation: Supports more efficient rate limiting and packet inspection, allowing you to block basic DDoS attacks with minimal overhead. Dynamic Rules: Allows for dynamic rule adjustments without the need to reload the entire firewall configuration. IPv4/IPv6 Support: Handles both IPv4 and IPv6 rules natively, simplifying firewall management in modern environments. For a professional rAthena project, nftables ensures better network protection, faster packet processing, and more efficient handling of traffic spikes during large player events or attacks. Instructions to Use the Script: Upload the script to your VPS Use an SCP tool or copy-paste the script contents into a file called ubuntu.sh. Make the script executable: chmod +x ubuntu.sh Run the script with root privileges: sudo ./ubuntu.sh Follow the interactive prompts: Choose between MariaDB or MySQL. Input the database name, database user, and password. The script will: Update system packages. Install required dependencies for compiling rAthena. Set up MySQL or MariaDB. Install and configure phpMyAdmin at /phpmyadmin. After completing these steps, your VPS will be ready to compile and run rAthena. ubuntu.sh
  3. BUILDIN_FUNC(mobremove) { struct block_list *bl = NULL; bl = map_id2bl( script_getnum(st,2) ); if ( bl && bl->type == BL_MOB ) unit_free(bl,CLR_OUTSIGHT); return SCRIPT_CMD_SUCCESS; } BUILDIN_DEF(mobremove,"i"),
  4. a repository on github would be excellent, I would like to contribute
  5. I'm trying to activate it so clans can attack each other on maps, like if it were a GvG in this case it would be a CvC I saw that in the Hercules production emulator there is already the CVC flag, in Rathena there is nothing similar yet? https://github.com/HerculesWS/Hercules/blob/stable/src/map/map.c#L5428
  6. Hello community, I have a modification in my emulator called pvpmode. When I use it, the character enters PK mode, and in this system, it is possible to configure it to receive experience bonuses. I would like to implement the feature of receiving drop bonuses while the PK mode is active. Does anyone know how I could achieve this? Here is the part of the source code (src) that seems to be related to the experience bonus system. pc.c /*========================================== * Alters experienced based on self bonuses that do not get even shared to the party. *------------------------------------------*/ static void pc_calcexp(struct map_session_data *sd, unsigned int *base_exp, unsigned int *job_exp, struct block_list *src) { int bonus = 0; struct status_data *status = status_get_status_data(src); struct region_data* rd; unsigned int ebonus = 0, jbonus = 0; if (sd->expaddrace[status->race]) bonus += sd->expaddrace[status->race]; bonus += sd->expaddrace[status->mode&MD_BOSS?RC_BOSS:RC_NONBOSS]; if (battle_config.pk_mode && (int)(status_get_lv(src) - sd->status.base_level) >= 20) bonus += 15; // pk_mode additional exp if monster >20 levels [Valaris] if (sd->sc.data[SC_EXPBOOST]) bonus += sd->sc.data[SC_EXPBOOST]->val1; if( sd->status.iprank ) bonus += (sd->status.iprank * 2); if( pc_isPremium(sd) && battle_config.premium_bonusexp ) bonus += battle_config.premium_bonusexp; if( sd->state.pvpmode && battle_config.pvpmode_expbonus ) { int rank; if( (rank = pc_pvpfamerank(sd->status.char_id)) && rand()%100 < ((MAX_FAME_LIST + 1 - rank) * 4) ) bonus += battle_config.pvpmode_expbonus; } if (sd->sc.data[SC_JEXPBOOST]) jbonus += sd->sc.data[SC_JEXPBOOST]->val1; if( sd->status.guild_id && (rd = region_search(map[sd->bl.m].region_id)) != NULL && sd->status.guild_id == rd->guild_id ) { ebonus += rd->bonus_bexp; jbonus += rd->bonus_jexp; } if( !bonus && !ebonus && !jbonus ) return; *base_exp = (unsigned int) cap_value(*base_exp + (double)*base_exp * (bonus + ebonus)/100., 1, UINT_MAX); *job_exp = (unsigned int) cap_value(*job_exp + (double)*job_exp * (bonus + jbonus)/100., 1, UINT_MAX); return; } battle.c { "pvpmode_onlypc", &battle_config.pvpmode_onlypc, 1, 0, 1, }, { "pvpmode_gvgreductions", &battle_config.pvpmode_gvgreductions, 0, 0, 1, }, { "pvpmode_expbonus", &battle_config.pvpmode_expbonus, 0, 0, 100, }, { "pvpmode_nowarp_cmd", &battle_config.pvpmode_nowarp_cmd, 0, 0, 1, }, { "pvpmode_enable_delay", &battle_config.pvpmode_enable_delay, 120, 0, INT_MAX, }, { "pvpmode_disable_delay", &battle_config.pvpmode_disable_delay, 60, 0, INT_MAX, }, battle.h int pvpmode_onlypc; int pvpmode_gvgreductions; int pvpmode_expbonus; int pvpmode_nowarp_cmd; int pvpmode_enable_delay; int pvpmode_disable_delay;
  7. Scofield

    Tax Script

    What would it be like for merchants not to use the discount when they went to buy?
  8. +// Autor Goddameit +// Versão 20/12/2015 +// Web http://goo.gl/0vY9GV +// +// +- script bot_at -1,{ + função __onoff; +OnInit: + bindatcmd "boton",strnpcinfo(3)+"::OnDo"; + bindatcmd "botoff",strnpcinfo(3)+"::OnDo2"; + bindatcmd "botend",strnpcinfo(3)+"::OnDo2"; + fim; +OnDo: + sc_end SC_BOT; + .@SP_BOT_NA = 1; + enquanto(1) + { + .@C = select("[Terminar]","[Cancelar]","Ataque normal "+__onoff(.@SP_BOT_NA))k; + se( .@C == 1 ) + pausa; + senão se( .@C == 2 ) + fechar; + mais + interruptor(.@C) + { + caso 3: + .@SP_BOT_NA = !.@SP_BOT_NA; + pausa; + } + } + mensagem strcharinfo(0),"EXECUTAR"; + se( .@C == 1 || .@C > 2 ) + { + show "OK"; + fechar2; + } + sc_start4 SC_BOT,600000,.@SP_BOT_NA,0,0,0; + fim; +OnDo2: + sc_end SC_BOT; + mensagem strcharinfo(0),"END"; + fim; + função __onoff { + se(getarg(0) == 0) + retornar "^BEBEBE[OFF]^000000"; + mais + retornar "^000088[ON]^000000"; + } +} Didn't this NPC give errors?
  9. Did the NPC work? did you make an error?
  10. sc_config does not exist in rathena, this file only exists in the hercules emulator, I don't know which file in rathena has the same effect
  11. Hello everyone, A few years ago, I made a post about the modification of BOT v.3, native to the Hercules emulator. I'm resurrecting this discussion in the hope of finding someone who can help adapt this bot to work on rathena. It seems that someone has already made this modification and even put it up for sale, but I don't have confirmed information. If anyone has knowledge about this or knows someone who can help, I would greatly appreciate it. I'm eager to bring this functionality to the rathena community. Thank you in advance for everyone's attention, and I look forward to any information or assistance you can provide. Index: db/const.txt =================================================================== --- db/const.txt (revision 14530) +++ db/const.txt (working copy) @@ -1258,6 +1258,7 @@ SC__CHAOS 577 SC__FEINTBOMB_MASTER 578 SC_FALLENEMPIRE 579 +SC_BOT 581 e_gasp 0 e_what 1 Index: db/sc_config.txt =================================================================== --- db/sc_config.txt (revision 14530) +++ db/sc_config.txt (working copy) @@ -14,6 +14,7 @@ //Example: //SC_ENDURE, 21 //SC_ENDURE: cannot be removed by death and dispell and cosidered as buff. (16 + 4 + 1 = 21) +SC_BOT, 6 SC_PROVOKE, 32 SC_ENDURE, 21 SC_CLOAKING, 2 Index: npc/bot.txt =================================================================== --- npc/bot.txt (revision 0) +++ npc/bot.txt (working copy) @@ -0,0 +1,51 @@ +// +// +// Author Goddameit +// Version 2015/12/20 +// Web http://goo.gl/0vY9GV +// +// +- script bot_at -1,{ + function __onoff ; +OnInit: + bindatcmd "boton",strnpcinfo(3)+"::OnDo"; + bindatcmd "botoff",strnpcinfo(3)+"::OnDo2"; + bindatcmd "botend",strnpcinfo(3)+"::OnDo2"; + end; +OnDo: + sc_end SC_BOT; + .@SP_BOT_NA = 1; + while(1) + { + .@C = select("[Finish]","[Cancel]","Normal Attack "+__onoff(.@SP_BOT_NA))k; + if( .@C == 1 ) + break; + else if( .@C == 2 ) + close; + else + switch(.@C) + { + case 3: + .@SP_BOT_NA = !.@SP_BOT_NA; + break; + } + } + message strcharinfo(0),"RUN"; + if( .@C == 1 || .@C > 2 ) + { + mes "OK"; + close2; + } + sc_start4 SC_BOT,600000,.@SP_BOT_NA,0,0,0; + end; +OnDo2: + sc_end SC_BOT; + message strcharinfo(0),"END"; + end; + function __onoff { + if(getarg(0) == 0) + return "^BEBEBE[OFF]^000000"; + else + return "^000088[ON]^000000"; + } +} \ No newline at end of file Index: src/map/status.c =================================================================== --- src/map/status.c (revision 14530) +++ src/map/status.c (working copy) @@ -8982,6 +8982,10 @@ if(val2 == MH_MD_FIGHTING) val2 = MH_MD_GRAPPLING; else val2 = MH_MD_FIGHTING; break; + case SC_BOT: + tick_time = 100; + val4 = tick / tick_time; + break; case SC_FULL_THROTTLE: status_percent_heal(bl,100,0); val2 = 7 - val1; @@ -9701,6 +9705,15 @@ } } } + + if (type == SC_BOT) + { + if (sc->data[type]->val4 > 0) + { + //Record how many time you left + pc->setreg(sd, script->add_str("@SP_BOT_LTICK"), sc->data[type]->val4 * 100); + } + } (sc->count)--; @@ -10464,6 +10477,145 @@ } while(0) switch(type) { + case SC_BOT: + if (--(sce->val4) > 0) { + { + int i_ = 0; + struct mmo_charstatus *sta = &sd->status; + unsigned short inf_ = 0; + int64 last_tick = (int64)time(NULL); + unsigned short idle_ = cap_value(DIFF_TICK32(last_tick, sd->idletime), 0, USHRT_MAX); + unsigned short tele_ = cap_value(DIFF_TICK32(last_tick, pc->readreg(sd, script->add_str("@SP_BOT_TELE"))), 0, USHRT_MAX); + unsigned int starget_id_ = bot_check_target_alive(bl, pc->readreg(sd, script->add_str("@SP_BOT_TGID"))); + {//Heal + unsigned short item_id_ = sta->hotkeys[9].id; + if ((sd->battle_status.hp * 100 / 80) < sd->battle_status.max_hp && item_id_ > 0) + { + i_ = pc->search_inventory(sd, item_id_); + if (i_ >= 0) + pc->useitem(sd, i_); + } + item_id_ = sta->hotkeys[10].id; + if ((sd->battle_status.sp * 100 / 80) < sd->battle_status.max_sp && item_id_ > 0) + { + i_ = pc->search_inventory(sd, item_id_); + if (i_ >= 0) + pc->useitem(sd, i_); + } + } + {//Buff + for (i_ = 2; i_ <= 6; i_++) + { + if ((inf_ = bot_chec_khotkeys_is_skill(sd, i_)) > 0) + { + unsigned short id_ = sta->hotkeys[i_].id; + if (inf_ == 4 || inf_ == 16) + { + if (!sc->data[status->skill2sc(id_)]) + unit->skilluse_id(bl, bl->id, id_, sta->hotkeys[i_].lv); + } + } + } + } + if (idle_ % 7 != 0)//Attack + { + { + unsigned short inf_ = 0; + starget_id_ = bot_check_target_alive(bl, pc->readreg(sd, script->add_str("@SP_BOT_TGID"))); + if (starget_id_ > 0) { + if (sce->val1 > 0) + { + switch (rand() % 10) + { + case 0: + case 1: + case 2: + inf_ = bot_chec_khotkeys_is_skill(sd, 7); + if (inf_ == 1) + { + unit->stop_attack(bl); + unit->skilluse_id(bl, starget_id_, sta->hotkeys[7].id, sta->hotkeys[7].lv); + } + break; + case 5: + case 6: + inf_ = bot_chec_khotkeys_is_skill(sd, 8); + if (inf_ == 1) + { + unit->stop_attack(bl); + unit->skilluse_id(bl, starget_id_, sta->hotkeys[8].id, sta->hotkeys[8].lv); + } + break; + default: + unit->attack(bl, starget_id_, 1); + break; + } + } + else + { + switch (rand() % 7) + { + case 0: + case 1: + case 2: + case 3: + case 4: + inf_ = bot_chec_khotkeys_is_skill(sd, 7); + if (inf_ == 1) + { + unit->skilluse_id(bl, starget_id_, sta->hotkeys[7].id, sta->hotkeys[7].lv); + } + break; + case 5: + case 6: + inf_ = bot_chec_khotkeys_is_skill(sd, 8); + if (inf_ == 1) + { + unit->skilluse_id(bl, starget_id_, sta->hotkeys[8].id, sta->hotkeys[8].lv); + } + break; + } + } + } + } + } + else + {//Move + bool flywing_ = false; + if (bot_check_target(bl, starget_id_) == false) + { + if (tele_ > 7) + { + if (sta->hotkeys[0].type == 0 && sta->hotkeys[0].id == 601 && sta->hotkeys[0].lv == 0) + { + i_ = pc->search_inventory(sd, 601); + if (i_ >= 0) + { + pc->useitem(sd, i_); + flywing_ = true; + } + } + if ((st->sp > 20) && (flywing_ == false) && (sta->hotkeys[1].type == 1 && sta->hotkeys[1].id == AL_TELEPORT && sta->hotkeys[1].lv > 0)) + { + if (pc->checkskill(sd, AL_TELEPORT) > 0) + { + pc->randomwarp(sd, CLR_TELEPORT); + status->heal(&sd->bl, 0, -(skill->get_sp(AL_TELEPORT, 1)), 1); + flywing_ = true; + } + } + if (flywing_ == true) + pc->setreg(sd, script->add_str("@SP_BOT_TELE"), last_tick); + } + } + if ((idle_ % 9 == 0 && idle_ > 0) || starget_id_ == 0) + unit->walktoxy(&sd->bl, sd->bl.x + (rand() % 2 == 0 ? -1 : 1)*(rand() % 10), sd->bl.y + (rand() % 2 == 0 ? -1 : 1)*(rand() % 10), 0); + } + } + sc_timer_next(100 + tick, status->change_timer, bl->id, data); + return 0; + } + break; case SC_MAXIMIZEPOWER: case SC_CLOAKING: if(!status->charge(bl, 0, 1)) @@ -12237,3 +12389,73 @@ status->readdb_refine = status_readdb_refine; status->readdb_scconfig = status_readdb_scconfig; } + +bool bot_check_target(struct block_list *src, unsigned int id) +{ + struct block_list *bl = map->id2bl(id); + if (bl) + { + if (path->search(NULL, src->m, src->x, src->y, bl->x, bl->y, 1, CELL_CHKNOREACH) && distance_xy(src->x, src->y, bl->x, bl->y) < 11) + { + TBL_MOB *md = BL_CAST(BL_MOB, bl); + if (md) + { + if (md->status.hp > 0) + { + return true; + } + } + } + } + return false; +} + +int buildin_autoattack_sub(struct block_list *bl, va_list ap) +{ + int *target_id = va_arg(ap, int *); + int src_id = va_arg(ap, int); + struct block_list *src = map->id2bl(src_id); + if (!src || !bl) + return 1; + if (bot_check_target(src, bl->id) == true) + *target_id = bl->id; + else + *target_id = 0; + return 1; +} + +short bot_chec_khotkeys_is_skill(struct map_session_data *sd, unsigned short idx) +{ + if (sd) + { + struct mmo_charstatus *sta = &sd->status; + if (sta) + { + if (sta->hotkeys[idx].type == 1 && pc->checkskill(sd, sta->hotkeys[idx].id) > 0 && sta->hotkeys[idx].lv > 0) + return skill->get_inf(sta->hotkeys[idx].id); + } + } + return -1; +} + +unsigned int bot_check_target_alive(struct block_list *src, unsigned int id) +{ + if (bot_check_target(src, id) == true) + return id; + { + int i_, target_id_; + for (i_ = 0; i_ < 15; i_++) + { + target_id_ = 0; + map->foreachinarea(buildin_autoattack_sub, src->m, src->x - i_, src->y - i_, src->x + i_, src->y + i_, BL_MOB, &target_id_, src->id); + if (target_id_) + { + pc->setreg(map->id2sd(src->id), script->add_str("@SP_BOT_TGID"), target_id_); + break; + } + } + if (target_id_) + return target_id_; + } + return 0; +} \ No newline at end of file Index: src/map/status.h =================================================================== --- src/map/status.h (revision 14530) +++ src/map/status.h (working copy) @@ -715,6 +715,7 @@ SC_FALLENEMPIRE, SC_FLASHCOMBO, + SC_BOT, SC_MAX, //Automatically updated max, used in for's to check we are within bounds. } sc_type; @@ -2089,4 +2090,8 @@ void status_defaults(void); +bool bot_check_target(struct block_list *src, unsigned int id); +int buildin_autoattack_sub(struct block_list *bl, va_list ap); +short bot_chec_khotkeys_is_skill(struct map_session_data *sd, unsigned short idx); +unsigned int bot_check_target_alive(struct block_list *src, unsigned int id); #endif /* MAP_STATUS_H */
  12. Scofield

    BOT v.3

    Para funcionar no eAthena basta colocar int bool onde tem apenas bool. o aqui sc_config.txt tem apenas no Hercules, não sei como replicar isso no rathena.
  13. View File VCP 2.0 (Updated PHP 8.2.1) vCP (Version 2.0) The vCP (Version 2.0) is a point-based voting system designed for the game Ragnarok. This version of the system has undergone significant updates to enhance security, ensure compatibility with the latest PHP version (8.2.1), and improve code organization. Features Point-Based Voting: Players can earn points by voting and then exchange them for items that will be delivered directly to their in-game accounts. Installation Access install/index.php and fill out the installation form. Upon completion, the system will create all the necessary infrastructure for its operation. Common Errors and Solutions: Error when altering the login table: Check if the "vcp_pontos" field does not exist in the table. If it exists, you can delete it and attempt the installation again. Error when writing the configuration file: If you encounter this error, it may be due to insufficient writing permissions in the "inc" folder. Ensure that your account has the necessary permissions. Key Improvements In this version 2.0, the following improvements have been implemented: Introduction of the vCP class instance: An instance of the vCP class has been introduced to improve code organization and maintenance. Code improvements in files: The code has been enhanced to make it more secure and robust. Practices such as input sanitization using htmlspecialchars have been adopted. Updated Charset: The charset has been changed to UTF-8, ensuring support for special characters. Sql class improvements: The Sql class has been improved to make it more robust and secure. Transition to MySQLi: The system now utilizes the MySQLi extension for database communication, enhancing query security and efficiency. How to Contribute If you wish to contribute to this project or report issues, feel free to open issues or pull requests. Contributions are welcome! Conclusion The Point-Based Voting system for Ragnarok is an excellent way to encourage player participation and increase competitiveness among servers. Additionally, it provides a richer and more diverse gaming experience. The system's installation is simple and quick and can be carried out through the install/index.php file. License This project is licensed under the MIT License. Please refer to the LICENSE file for more details. Github: https://github.com/felipemike/vcp Submitter cumbe11 Submitted 10/31/23 Category Other Web/CP Scripts Video Content Author Skape  
  14. Okay, I partially solved the problem, I just removed the part that took the ip and just used the other parameters, they are enough to meet my business rule prontera,155,172,3 script Comece Com o Pé Direito 880,{ set .@aid,getcharid(3); set .@cid,getcharid(0); set .@unique_id$,get_unique_id(); query_sql("SELECT `id`,`time` FROM `reward_for_first_50` WHERE `aid` = "+.@aid+" OR `last_unique_id` = '"+escape_sql(.@unique_id$)+"' LIMIT 1", .@id, .@time$); query_sql("SELECT COUNT(`id`) FROM `reward_for_first_50`", .@size); if (.@size >= .max_redeem) { mes "Desculpe, você perdeu a recompensa. Apenas os primeiros "+.max_redeem+" jogadores receberam a recompensa."; } else if (.@id) { mes "Você já reivindicou as recompensas em "+.@time$+"."; } else { query_sql("INSERT INTO `reward_for_first_50` (`aid`,`cid`,`last_unique_id`,`time`) VALUES ("+.@aid+","+.@cid+",'"+escape_sql(.@unique_id$)+"', NOW())"); if (.@size < 10) { getitem 20001, 10; getitem 12411, 10; getitem 12312, 20; getitem 12214, 30; getitem 12210, 10; getitem 14232, 2; getitem 13989, 1; getitem 13973, 1; if (.@size == 49) { announce "Parabéns ao jogador número 50! Ele ganhou um prêmio especial!", 0, 0xFFFF00; getitem 12925, 1; // Dê um item especial ao jogador número 50 getitem 20001, 10; getitem 12411, 10; getitem 12312, 20; getitem 12214, 30; getitem 12210, 10; getitem 14232, 2; getitem 13989, 1; getitem 13973, 1; getitem 7558, 1; } mes "Parabéns! Você é um dos 10 primeiros jogadores a receber a recompensa. Aqui estão seus itens:"; } else { getitem 20001, 5; getitem 12411, 5; getitem 12312, 10; getitem 12214, 15; getitem 12210, 5; getitem 14232, 1; getitem 13989, 1; getitem 13973, 1; mes "Você recebeu uma recompensa. Aqui estão seus itens exclusivos:"; } mes "Você é o "+(.@size+1)+"/"+.max_redeem+" jogadores que receberam a recompensa"; } close; OnInit: set .max_redeem,50; end; }
  15. I didn't understand your suggestion, the script problem is exactly along these lines set .@ip$,getcharip(.@aid);
  16. I have this NPC that is showing the following error in the console, and it's possible that I'm not using the correct syntax. I'm using the eAthena emulator for my project, as it's an old-time project, and I prefer it for various reasons. prontera,155,172,3 script Comece Com o Pé Direito 880,{ set .@aid,getcharid(3); set .@cid,getcharid(0); set .@ip$,getcharip(.@aid); set .@unique_id$,get_unique_id(); query_logsql("SELECT `id`,`time` FROM `reward_for_first_50` WHERE `aid` = "+.@aid+" OR `last_ip` = '"+escape_sql(.@ip$)+"' OR `last_unique_id` = '"+escape_sql(.@unique_id$)+"' LIMIT 1", .@id, .@time$); query_logsql("SELECT COUNT(`id`) FROM `reward_for_first_50`", .@size); if (.@size >= .max_redeem) { mes "Desculpe, você perdeu a recompensa. Apenas os primeiros "+.max_redeem+" jogadores receberam a recompensa."; } else if (.@id) { mes "Você já reivindicou as recompensas em "+.@time$+"."; } else { query_logsql("INSERT INTO `reward_for_first_50` (`aid`,`cid`,`last_ip`,`last_unique_id`,`time`) VALUES ("+.@aid+","+.@cid+",'"+escape_sql(.@ip$)+"','"+escape_sql(.@unique_id$)+"', NOW())"); if (.@size < 10) { getitem 20001, 10; getitem 12411, 10; getitem 12312, 20; getitem 12214, 30; getitem 12210, 10; getitem 14232, 2; getitem 13989, 1; getitem 13973, 1; if (.@size == 49) { announce "Parabéns ao jogador número 50! Ele ganhou um prêmio especial!", 0, 0xFFFF00; getitem 12925, 1; // Dê um item especial ao jogador número 50 getitem 20001, 10; getitem 12411, 10; getitem 12312, 20; getitem 12214, 30; getitem 12210, 10; getitem 14232, 2; getitem 13989, 1; getitem 13973, 1; getitem 7558, 1; } mes "Parabéns! Você é um dos 10 primeiros jogadores a receber a recompensa. Aqui estão seus itens:"; } else { getitem 20001, 5; getitem 12411, 5; getitem 12312, 10; getitem 12214, 15; getitem 12210, 5; getitem 14232, 1; getitem 13989, 1; getitem 13973, 1; mes "Você recebeu uma recompensa. Aqui está seu item exclusivo:"; } mes "Você é o "+(.@size+1)+"/"+.max_redeem+" jogadores que receberam a recompensa"; } close; OnInit: set .max_redeem,50; end; } erro [Error]: Loading NPC file: npc/personalizado/josedias/estreia.txt script error on npc/personalizado/josedias/estreia.txt line 5 parse_line: need ';' 1 : { 2 : 3 : set .@aid,getcharid(3); 4 : set .@cid,getcharid(0); * 5 : set .@ip$,getcharip'('.@aid); 6 : set .@unique_id$,get_unique_id(); 7 : 8 : query_logsql("SELECT `id`,`time` FROM `reward_for_first_50` WHERE `aid` = "+.@aid+" OR `last_ip` = '"+escape_sql(.@ip$)+"' OR `last_unique_id` = '"+escape_sql(.@unique_id$)+"' LIMIT 1", .@id, .@time$); 9 : query_logsql("SELECT COUNT(`id`) FROM `reward_for_first_50`", .@size); 10 : if (.@size >= .max_redeem) {
  17. Version 2.0

    175 downloads

    vCP (Version 2.0) The vCP (Version 2.0) is a point-based voting system designed for the game Ragnarok. This version of the system has undergone significant updates to enhance security, ensure compatibility with the latest PHP version (8.2.1), and improve code organization. Features Point-Based Voting: Players can earn points by voting and then exchange them for items that will be delivered directly to their in-game accounts. Installation Access install/index.php and fill out the installation form. Upon completion, the system will create all the necessary infrastructure for its operation. Common Errors and Solutions: Error when altering the login table: Check if the "vcp_pontos" field does not exist in the table. If it exists, you can delete it and attempt the installation again. Error when writing the configuration file: If you encounter this error, it may be due to insufficient writing permissions in the "inc" folder. Ensure that your account has the necessary permissions. Key Improvements In this version 2.0, the following improvements have been implemented: Introduction of the vCP class instance: An instance of the vCP class has been introduced to improve code organization and maintenance. Code improvements in files: The code has been enhanced to make it more secure and robust. Practices such as input sanitization using htmlspecialchars have been adopted. Updated Charset: The charset has been changed to UTF-8, ensuring support for special characters. Sql class improvements: The Sql class has been improved to make it more robust and secure. Transition to MySQLi: The system now utilizes the MySQLi extension for database communication, enhancing query security and efficiency. How to Contribute If you wish to contribute to this project or report issues, feel free to open issues or pull requests. Contributions are welcome! Conclusion The Point-Based Voting system for Ragnarok is an excellent way to encourage player participation and increase competitiveness among servers. Additionally, it provides a richer and more diverse gaming experience. The system's installation is simple and quick and can be carried out through the install/index.php file. License This project is licensed under the MIT License. Please refer to the LICENSE file for more details. Github: https://github.com/felipemike/vcp
    Free
  18. for me to give this error would anyone know how to help me? Failed to parse LUA: Only supporting v5.0, sorry
  19. hello, the following error is appearing on my linux console, I would like to know what it would be erro: [Debug]: log_picktype2char: Unknown pick type 256.
  20. Hello, I was wondering how I can activate for skill storm gust have a chance to be reflected only the damage by the Maya card
  21. Hello, I have this pvp sql ranking, the problem is that he is not registering the class, the kills and deaths part works well, just not computing the class. - script Rank2 -1,{ OnPCKillEvent: getmapxy @map$,@x,@y,0; if ( @map$ == "amatsu" ) goto Kill; end; Kill: if( @last_killed$ == rid2name( killedrid ) ) end; set @last_killed$, rid2name( killedrid ); Announce "The player [ " + strcharinfo(0)+" ] defeated the player [ " + rid2name(killedrid) + " ] and now it has " + @points + " wins!", bc_map, 0xFF7F50; set @CID,getcharid(0); set @pvp,0; set @name$,""; set @Job$,jobname(Class); query_sql "SELECT `kills` FROM `pvp` WHERE `char_id`="+@CID+"",@pvp; query_sql "SELECT `name` FROM `pvp` WHERE `char_id`="+@CID+"",@name$; query_sql "SELECT `classe` FROM `pvp` WHERE `char_id`="+@CID+"",@Job$; if (@name$ == ""){ query_sql "INSERT INTO `pvp` (`char_id`,`name`,`kills`,`classe`) VALUES ("+@CID+",'"+strcharinfo(0)+"',1,'"+jobname(Class)+"',1)",@esc$; set @points,@points+1; dispbottom " Your Score: "+@points; end; } query_sql "UPDATE `pvp` SET `kills` = `kills` +1 WHERE `char_id`="+@CID+"",@esc$; set @points,@points+1; dispbottom " Your Score: "+@points; end; } - script Rank3 -1,{ OnPCDieEvent: getmapxy @map$,@x,@y,0; if ( @map$ == "amatsu" ) goto Deat; end; Deat: set @CID,getcharid(0); set @pvp,0; set @name$,""; set @Job$,jobname(Class); query_sql "SELECT `deaths` FROM `pvp` WHERE `char_id`="+@CID+"",@pvp; query_sql "SELECT `name` FROM `pvp` WHERE `char_id`="+@CID+"",@name$; query_sql "SELECT `classe` FROM `pvp` WHERE `char_id`="+@CID+"",@Job$; if (@name$ == ""){ query_sql "INSERT INTO `pvp` (`char_id`,`name`,`deaths`,`classe`) VALUES ("+@CID+",'"+strcharinfo(0)+"',1,'"+jobname(Class)+"',-1)",@esc$; set @points,@points+1; end; } query_sql "UPDATE `pvp` SET `deaths` = `deaths` +1 WHERE `char_id`="+@CID+"",@esc$; set @points,@points+1; end; }
×
×
  • Create New...