Jump to content
V1N1C1U5

Script with chat gpt

Recommended Posts

I ask to chat gpt to make an npc to heal and give buff to near players, this is the result:

#include <stdio.h>
#include <unistd.h>

// Função para obter jogadores próximos
Player* get_nearby_players(int* num_players) {
  // Código para obter jogadores próximos
  return players;
}

// Função para curar jogadores
void heal_players(Player* players, int num_players) {
  for (int i = 0; i < num_players; i++) {
    // Código para curar o jogador
    players[i].health = players[i].max_health;
  }
}

// Função para dar buff nos jogadores
void buff_players(Player* players, int num_players) {
  for (int i = 0; i < num_players; i++) {
    // Código para adicionar um buff ao jogador
    players[i].buffs |= BUFF_ID;
  }
}

int main() {
  while (1) {
    int num_players;
    // Obter jogadores próximos
    Player* players = get_nearby_players(&num_players);
    
    // Curar jogadores
    heal_players(players, num_players);
    
    // Dar buff nos jogadores
    buff_players(players, num_players);
    
    // Pausar por alguns segundos antes de executar novamente
    sleep(5);
  }
  
  return 0;
}

Now my question to u guys, this gonna work in emulator?

Link to comment
Share on other sites

If you mean an "rAthena NPC script"

I guess this won't work.

The code you've shown above only seems like some C style code rather than rAthena script.

  • Upvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...