Jump to content
×
×
  • Create New...
  • 0

[C++] Move a Char?


Benhero

Question

Hey Metin2Dev Com,

 

i was try to move a charakter with quest commands.

I try

"Move(...)"

"Goto(...)"

"SendMovePacket(...)"

 

but nothing works.. does anyone have an idea how i can move Charakter like monsters with coward?

 

hope you unterstand..

Thanks 4 help

Link to comment
Share on other sites

  • Answers 3
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

3 answers to this question

Recommended Posts

  • 0

Hey Metin2Dev Com,

 

i was try to move a charakter with quest commands.

I try

"Move(...)"

"Goto(...)"

"SendMovePacket(...)"

 

but nothing works.. does anyone have an idea how i can move Charakter like monsters with coward?

 

hope you unterstand..

Thanks 4 help

check this 

ACMD(do_goto)
{
char arg1[256], arg2[256];
int x = 0, y = 0, z = 0;
 
two_arguments(argument, arg1, sizeof(arg1), arg2, sizeof(arg2));
 
if (!*arg1 && !*arg2)
{
ch->ChatPacket(CHAT_TYPE_INFO, "Usage: goto <x meter> <y meter>");
return;
}
 
if (isnhdigit(*arg1) && isnhdigit(*arg2))
{
str_to_number(x, arg1);
str_to_number(y, arg2);
 
PIXEL_POSITION p;
 
if (SECTREE_MANAGER::instance().GetMapBasePosition(ch->GetX(), ch->GetY(), p))
{
x += p.x / 100;
y += p.y / 100;
}
 
ch->ChatPacket(CHAT_TYPE_INFO, "You goto ( %d, %d )", x, y);
}
else
{
int mapIndex = 0;
BYTE empire = 0;
 
if (*arg1 == '#')
str_to_number(mapIndex,  (arg1 + 1));
 
if (*arg2 && isnhdigit(*arg2))
{
str_to_number(empire, arg2);
empire = MINMAX(1, empire, 3);
}
else
empire = ch->GetEmpire();
 
if (CHARACTER_GoToName(ch, empire, mapIndex, arg1))
{
ch->ChatPacket(CHAT_TYPE_INFO, "Cannot find map command syntax: /goto <mapname> [empire]");
return;
}
 
return;
 
/*
  int iMapIndex = 0;
  for (int i = 0; aWarpInfo.c_pszName != NULL; ++i)
  {
  if (iMapIndex != 0)
  {
  if (iMapIndex != aWarpInfo.iMapIndex)
  continue;
  }
  else if (!FindInString(arg1, aWarpInfo.c_pszName))
  continue;
 
  if (aWarpInfo.bEmpire == 0 || aWarpInfo.bEmpire == bEmpire)
  {
  x = aWarpInfo.x * 100;
  y = aWarpInfo.y * 100;
 
  ch->ChatPacket(CHAT_TYPE_INFO, "You warp to ( %d, %d )", x, y);
  ch->WarpSet(x, y);
  ch->Stop();
  return;
  }
  }
*/
 
}
 
x *= 100;
y *= 100;
 
ch->Show(ch->GetMapIndex(), x, y, z);
ch->Stop();
}
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Read our Rules
  • Activity

    1. 0

      How to Delay quest

    2. 0

      After choosing a character, it throws it at the login screen.

    3. 0

      Bonus Board Official like

    4. 0

      [ERROR] unfinished string , ranking quest .

    5. 0

      experience 0

    6. 0

      center text "sales price"

  • Recently Browsing

    • No registered users viewing this page.

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.