Deschideți cmd.cpp din sursa Server/game și adăugați (va orientați dupa alte comenzi)
Cod: Selectaţi tot
// Schimba rasa
ACMD(do_schimba_rasa);
// Schimba rasa sfarsit
Cod: Selectaţi tot
// Schimba rasa
{ "schimba_rasa", do_schimba_rasa, 0, POS_DEAD, GM_GOD},
// Schimba rasa sfarsit
Cod: Selectaţi tot
ACMD (do_ds_list)
{
for (int i = 0; i < DRAGON_SOUL_INVENTORY_MAX_NUM; i++)
{
TItemPos cell(DRAGON_SOUL_INVENTORY, i);
LPITEM item = ch->GetItem(cell);
if (item != NULL)
ch->ChatPacket(CHAT_TYPE_INFO, "cell : %d, name : %s, id : %d", item->GetCell(), item->GetName(), item->GetID());
}
}
Cod: Selectaţi tot
ACMD(do_schimba_rasa)
{
char arg1[256], arg2[256];
two_arguments(argument, arg1, sizeof(arg1), arg2, sizeof(arg2));
// init
bool bIsSetSkillGroup = false;
DWORD dwRace = MAIN_RACE_MAX_NUM;
DWORD dwSkillGroup = 0;
// verificare argumentul1
if (!*arg1)
{
goto USAGE;
return;
}
// verificare & analizare argumentul2
if (*arg2)
{
str_to_number(dwSkillGroup, arg2);
dwSkillGroup = MINMAX(0, dwSkillGroup, 2);
bIsSetSkillGroup = true;
}
// analizare argumentul1
str_to_number(dwRace, arg1);
if (dwRace >= MAIN_RACE_MAX_NUM)
{
goto USAGE;
return;
}
// treci peste daca e aceeasi rasa
if (dwRace==ch->GetRaceNum())
return;
// proces schimbare rasa
ch->ChatPacket(CHAT_TYPE_INFO, "Rasa veche = %u, Grupa = %u", ch->GetRaceNum(), ch->GetSkillGroup());
ch->SetRace(dwRace);
ch->ClearSkill();
if (bIsSetSkillGroup)
{
ch->SetSkillGroup(dwSkillGroup);
}
// schimbare fara delogare inceput
ch->SetPolymorph(101);
ch->SetPolymorph(0);
// schimbare fara delogare sfarsit
ch->ChatPacket(CHAT_TYPE_INFO, "Rasa noua = %u, Grupa = %u", ch->GetRaceNum(), ch->GetSkillGroup());
return;
// folosire
USAGE:
ch->ChatPacket(CHAT_TYPE_INFO, "Folosire: /schimba_rasa <race_id> <skill_group>");
// lista raselor
ch->ChatPacket(CHAT_TYPE_INFO, "Lista Raselor");
ch->ChatPacket(CHAT_TYPE_INFO, "\tRazboinic M = %d", MAIN_RACE_WARRIOR_M);
ch->ChatPacket(CHAT_TYPE_INFO, "\tNinja F = %d", MAIN_RACE_ASSASSIN_W);
ch->ChatPacket(CHAT_TYPE_INFO, "\tSura M = %d", MAIN_RACE_SURA_M);
ch->ChatPacket(CHAT_TYPE_INFO, "\tSaman F = %d", MAIN_RACE_SHAMAN_W);
ch->ChatPacket(CHAT_TYPE_INFO, "\tRazboinic W = %d", MAIN_RACE_WARRIOR_W);
ch->ChatPacket(CHAT_TYPE_INFO, "\tNinja M = %d", MAIN_RACE_ASSASSIN_M);
ch->ChatPacket(CHAT_TYPE_INFO, "\tSura W = %d", MAIN_RACE_SURA_W);
ch->ChatPacket(CHAT_TYPE_INFO, "\tSaman M = %d", MAIN_RACE_SHAMAN_M);
ch->ChatPacket(CHAT_TYPE_INFO, "\tNumarul maxim de rase = %d", MAIN_RACE_MAX_NUM);
// lista grupurilor
ch->ChatPacket(CHAT_TYPE_INFO, "Lista grupelor:");
ch->ChatPacket(CHAT_TYPE_INFO, "\tNiciuna = 0");
ch->ChatPacket(CHAT_TYPE_INFO, "\tPrima = 1");
ch->ChatPacket(CHAT_TYPE_INFO, "\tA doua = 2");
return;
}
Comenzi pe joc:
- /schimba_rasa 0 =>Războinic M
- /schimba_rasa 1 =>Ninja F
- /schimba_rasa 2 =>Sura M
- /schimba_rasa 3 =>Șaman F
- /schimba_rasa 4 =>Războinic F
- /schimba_rasa 5 =>Ninja M
- /schimba_rasa 6 =>Sura F
- /schimba_rasa 7 =>Șaman M