Jump to content

Recommended Posts

Someone can tell me how to implement this in martysama source?

#include <vector>
#include <array>
#include "../../common/length.h"
#include "item_manager.h"
using namespace std;
enum 
{ 
	MAX_ATTR = ITEM_MANAGER::MAX_NORM_ATTR_NUM + ITEM_MANAGER::MAX_RARE_ATTR_NUM, 
	COMMON_ITEMS = JOB_MAX_NUM,
};
struct GiveBasicWeapon
{
	DWORD	dwVnum, count;
	bool	equip;
	array<auto, ITEM_SOCKET_MAX_NUM> sockets;
	array<auto, MAX_ATTR> attr_types;
	array<auto, MAX_ATTR> attr_vals;
};
vector<GiveBasicWeapon> Give_Items[JOB_MAX_NUM];

auto PrepareItems()
{
	Give_Items[COMMON_ITEMS] {
		{11200, 1},
		{27989, 1},
		{50053, 1},
		{40002, 1},
		{27003, 200},
		{27006, 200},
		{70038, 1},
		{13009, 1, true, {}, {APPLY_CON, APPLY_BLOCK, APPLY_REFLECT_MELEE, APPLY_IMMUNE_STUN, APPLY_STR}, {12, 15, 10, 1, 12}},
		{14009, 1, true, {}, {APPLY_MAX_HP, APPLY_MAX_SP, APPLY_PENETRATE_PCT, APPLY_STEAL_HP, APPLY_MANA_BURN_PCT}, {2000, 80, 10, 10, 10}},
		{15009, 1, true, {}, {APPLY_MAX_HP, APPLY_MAX_SP, APPLY_MOV_SPEED, APPLY_ATT_SPEED, APPLY_CRITICAL_PCT}, {2000, 80, 8, 8, 10}},
		{16009, 1, true, {}, {APPLY_MAX_HP, APPLY_HP_REGEN, APPLY_CRITICAL_PCT, APPLY_PENETRATE_PCT, APPLY_STEAL_HP}, {2000, 30, 10, 10, 10}},
		{17009, 1, true, {}, {APPLY_MOV_SPEED, APPLY_ATTBONUS_ANIMAL, APPLY_POISON_REDUCE, APPLY_ATTBONUS_DEVIL, APPLY_ATTBONUS_UNDEAD}, {20, 20, 5, 20, 20}},
		{39036, 1, true},
		{76037, 1, true}
	}
	Give_Items[JOB_WARRIOR] {
		{11209, 1, true, {28442, 0, 0}, {APPLY_MAX_HP, APPLY_CAST_SPEED, APPLY_STEAL_HP, APPLY_REFLECT_MELEE, APPLY_ATT_GRADE_BONUS}, {2000, 20, 10, 10, 50}},
		{19, 	1, true, {28430, 0, 0}, {APPLY_STR, APPLY_CRITICAL_PCT, APPLY_PENETRATE_PCT, APPLY_ATTBONUS_ANIMAL, APPLY_STUN_PCT}, {12, 10, 10, 20, 8}},
		{12209, 1, true, {}, 			{APPLY_ATT_SPEED, APPLY_HP_REGEN, APPLY_ATTBONUS_ANIMAL, APPLY_DODGE, APPLY_STEAL_HP}, {8, 30, 20, 15, 10}},
	}
	Give_Items[JOB_ASSASSIN] {
		{11409, 1, true, {28442, 0, 0}, {APPLY_MAX_HP, APPLY_CAST_SPEED, APPLY_STEAL_HP, APPLY_REFLECT_MELEE, APPLY_ATT_GRADE_BONUS}, {2000, 20, 10, 10, 50}},
		{1009, 	1, true, {28430, 0, 0}, {APPLY_STR, APPLY_CRITICAL_PCT, APPLY_PENETRATE_PCT, APPLY_ATTBONUS_ANIMAL, APPLY_STUN_PCT}, {12, 10, 10, 20, 8}},
		{12349, 1, true, {},			{APPLY_ATT_SPEED, APPLY_HP_REGEN, APPLY_ATTBONUS_ANIMAL, APPLY_DODGE, APPLY_STEAL_HP}, {8, 30, 20, 15, 10}},
	}
	Give_Items[JOB_SURA] {
		{11609, 1, true, {28442, 0, 0}, {APPLY_MAX_HP, APPLY_CAST_SPEED, APPLY_STEAL_HP, APPLY_REFLECT_MELEE, APPLY_ATT_GRADE_BONUS}, {2000, 20, 10, 10, 50}},
		{19, 	1, true, {28430, 0, 0}, {APPLY_STR, APPLY_CRITICAL_PCT, APPLY_PENETRATE_PCT, APPLY_ATTBONUS_ANIMAL, APPLY_STUN_PCT}, {12, 10, 10, 20, 8}},
		{12489, 1, true, {}, 			{APPLY_ATT_SPEED, APPLY_HP_REGEN, APPLY_ATTBONUS_ANIMAL, APPLY_DODGE, APPLY_STEAL_HP}, {8, 30, 20, 15, 10}},
	}
	Give_Items[JOB_SHAMAN] {
		{11809, 1, true, {28442, 0, 0}, {APPLY_MAX_HP, APPLY_CAST_SPEED, APPLY_STEAL_HP, APPLY_REFLECT_MELEE, APPLY_ATT_GRADE_BONUS}, {2000, 20, 10, 10, 50}},
		{5009, 	1, true, {28430, 0, 0}, {APPLY_STR, APPLY_CRITICAL_PCT, APPLY_PENETRATE_PCT, APPLY_ATTBONUS_ANIMAL, APPLY_STUN_PCT}, {12, 10, 10, 20, 8}},
		{12629, 1, true, {}, 			{APPLY_ATT_SPEED, APPLY_HP_REGEN, APPLY_ATTBONUS_ANIMAL, APPLY_DODGE, APPLY_STEAL_HP}, {8, 30, 20, 15, 10}},
	}
#ifdef ENABLE_WOLFMAN_CHARACTER
	Give_Items[JOB_WOLFMAN] {
		{21009, 1, true, {28442, 0, 0}, {APPLY_MAX_HP, APPLY_CAST_SPEED, APPLY_STEAL_HP, APPLY_REFLECT_MELEE, APPLY_ATT_GRADE_BONUS}, {2000, 20, 10, 10, 50}},
		{6009, 	1, true, {28430, 0, 0}, {APPLY_STR, APPLY_CRITICAL_PCT, APPLY_PENETRATE_PCT, APPLY_ATTBONUS_ANIMAL, APPLY_STUN_PCT}, {12, 10, 10, 20, 8}},
		{21509, 1, true, {}, 			{APPLY_ATT_SPEED, APPLY_HP_REGEN, APPLY_ATTBONUS_ANIMAL, APPLY_DODGE, APPLY_STEAL_HP}, {8, 30, 20, 15, 10}},
	}
#endif	
}
void GiveBasicWeapon(LPCHARACTER ch)
{
	PrepareItems();
	auto GetHorse = [&ch]()
	{
		ch->SetHorseLevel(21);
		ch->StartRiding();
	};
	auto MakeFNotice = [](LPCHARACTER ch)
	{
		array<auto, JOB_MAX_NUM> JobNames {"Warrior", "Assassin", "Sura", "Shaman", "Lycan"};
		array<auto, EMPIRE_MAX_NUM> EmpireNames {"전제국","신수국","천조국","진노국"};
		array<auto, 256> buf;
		snprintf(buf,sizeof(buf), "New player %s, job: %s, empire: %s", ch->GetName(), JobNames[ch->GetJob()], LC_TEXT(EmpireNames[ch->GetEmpire()]));
		SendNotice(buf);
	};
	for (auto subdata : {ch->GetJob(), COMMON_ITEMS}) {
		for (auto data : Give_Items[subdata]) {
			auto item = ch->AutoGiveItem(data.dwVnum, data.count);
			if (item) {
				for (auto i = 0; i < MAX_ATTR; i++)
					item->SetForceAttribute(i, data.attr_types[i], data.attr_vals[i]);
				for (auto c = 0; c < ITEM_SOCKET_MAX_NUM; c++)
					item->SetSocket(c, data.sockets[c]);
				if (data.equip)
					ch->EquipItem(item);
			}
		}
	}
	MakeFNotice(ch);
	GetHorse();
}

i have try solo but......this is the error

compiling char.cpp
compiling event.cpp
compiling event_queue.cpp
compiling exchange.cpp
compiling file_loader.cpp
compiling fishing.cpp
compiling gm.cpp
In file included from char.cpp:61:
GiveBasicWeapon.h:15:2: error: non-static data member declared with placeholder 'auto'
   15 |  array<auto, ITEM_SOCKET_MAX_NUM> sockets;
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GiveBasicWeapon.h:16:2: error: non-static data member declared with placeholder 'auto'
   16 |  array<auto, MAX_ATTR> attr_types;
      |  ^~~~~~~~~~~~~~~~~~~~~
GiveBasicWeapon.h:17:2: error: non-static data member declared with placeholder 'auto'
   17 |  array<auto, MAX_ATTR> attr_vals;
      |  ^~~~~~~~~~~~~~~~~~~~~
GiveBasicWeapon.h: In function 'auto PrepareItems()':
GiveBasicWeapon.h:23:26: error: expected ';' before '{' token
   23 |  Give_Items[COMMON_ITEMS] {
      |                          ^~
      |                          ;
GiveBasicWeapon.h:23:25: warning: statement has no effect [-Wunused-value]
   23 |  Give_Items[COMMON_ITEMS] {
      |  ~~~~~~~~~~~~~~~~~~~~~~~^
In file included from char.cpp:61:
GiveBasicWeapon.h:39:25: error: expected ';' before '{' token
   39 |  Give_Items[JOB_WARRIOR] {
      |                         ^~
      |                         ;
GiveBasicWeapon.h:39:24: warning: statement has no effect [-Wunused-value]
   39 |  Give_Items[JOB_WARRIOR] {
      |  ~~~~~~~~~~~~~~~~~~~~~~^
GiveBasicWeapon.h:44:26: error: expected ';' before '{' token
   44 |  Give_Items[JOB_ASSASSIN] {
      |                          ^~
      |                          ;
GiveBasicWeapon.h:44:25: warning: statement has no effect [-Wunused-value]
   44 |  Give_Items[JOB_ASSASSIN] {
      |  ~~~~~~~~~~~~~~~~~~~~~~~^
GiveBasicWeapon.h:49:22: error: expected ';' before '{' token
   49 |  Give_Items[JOB_SURA] {
      |                      ^~
      |                      ;
GiveBasicWeapon.h:49:21: warning: statement has no effect [-Wunused-value]
   49 |  Give_Items[JOB_SURA] {
      |  ~~~~~~~~~~~~~~~~~~~^
GiveBasicWeapon.h:54:24: error: expected ';' before '{' token
   54 |  Give_Items[JOB_SHAMAN] {
      |                        ^~
      |                        ;
GiveBasicWeapon.h:54:23: warning: statement has no effect [-Wunused-value]
   54 |  Give_Items[JOB_SHAMAN] {
      |  ~~~~~~~~~~~~~~~~~~~~~^
GiveBasicWeapon.h: In lambda function:
GiveBasicWeapon.h:77:86: error: direct-list-initialization of 'auto' requires exactly one element [-fpermissive]
   77 |   array<auto, JOB_MAX_NUM> JobNames {"Warrior", "Assassin", "Sura", "Shaman", "Lycan"};
      |                                                                                      ^
GiveBasicWeapon.h:77:86: note: for deduction to 'std::initializer_list', use copy-list-initialization (i.e. add '=' before the '{')
GiveBasicWeapon.h:77:86: error: unable to deduce 'std::array<std::initializer_list<auto>, 4>' from '{"Warrior", "Assassin", "Sura", "Shaman", "Lycan"}'
GiveBasicWeapon.h:77:86: note:   couldn't deduce template parameter 'auto'
GiveBasicWeapon.h:78:91: error: direct-list-initialization of 'auto' requires exactly one element [-fpermissive]
   78 |   array<auto, EMPIRE_MAX_NUM> EmpireNames {"전제국","신수국","천조국","진노국"};
      |                                                                               ^
GiveBasicWeapon.h:78:91: note: for deduction to 'std::initializer_list', use copy-list-initialization (i.e. add '=' before the '{')
GiveBasicWeapon.h:78:91: error: unable to deduce 'std::array<std::initializer_list<auto>, 4>' from '{"\37777777754\37777777640\37777777604\37777777754\37777777640\37777777634\37777777752\37777777665\37777777655", "\37777777754\37777777613\37777777640\37777777754\37777777610\37777777630\37777777752\37777777665\37777777655", "\37777777754\37777777662\37777777634\37777777754\37777777641\37777777660\37777777752\37777777665\37777777655", "\37777777754\37777777647\37777777604\37777777753\37777777605\37777777670\37777777752\37777777665\37777777655"}'
GiveBasicWeapon.h:78:91: note:   couldn't deduce template parameter 'auto'
GiveBasicWeapon.h:79:3: error: declaration of 'std::array<auto, 256> buf' has no initializer
   79 |   array<auto, 256> buf;
      |   ^~~~~~~~~~~~~~~~
GiveBasicWeapon.h: In function 'void GiveBasicWeapon(LPCHARACTER)':
GiveBasicWeapon.h:83:49: error: unable to deduce 'std::initializer_list<auto>&&' from '{ch->CHARACTER::GetJob(), COMMON_ITEMS}'
   83 |  for (auto subdata : {ch->GetJob(), COMMON_ITEMS}) {
      |                                                 ^
GiveBasicWeapon.h:83:49: note:   deduced conflicting types for parameter 'auto' ('unsigned char' and '<unnamed enum>')
compiling guild.cpp
compiling guild_manager.cpp
compiling guild_war.cpp
gmake: *** [Makefile:184: .obj/char.o] Error 1
gmake: *** Waiting for unfinished jobs....

 

Edited by revengertmt
update error
Link to comment
Share on other sites

  • Premium
5 hours ago, revengertmt said:

Someone can tell me how to implement this in martysama source?

#include <vector>
#include <array>
#include "../../common/length.h"
#include "item_manager.h"
using namespace std;
enum 
{ 
	MAX_ATTR = ITEM_MANAGER::MAX_NORM_ATTR_NUM + ITEM_MANAGER::MAX_RARE_ATTR_NUM, 
	COMMON_ITEMS = JOB_MAX_NUM,
};
struct GiveBasicWeapon
{
	DWORD	dwVnum, count;
	bool	equip;
	array<auto, ITEM_SOCKET_MAX_NUM> sockets;
	array<auto, MAX_ATTR> attr_types;
	array<auto, MAX_ATTR> attr_vals;
};
vector<GiveBasicWeapon> Give_Items[JOB_MAX_NUM];

auto PrepareItems()
{
	Give_Items[COMMON_ITEMS] {
		{11200, 1},
		{27989, 1},
		{50053, 1},
		{40002, 1},
		{27003, 200},
		{27006, 200},
		{70038, 1},
		{13009, 1, true, {}, {APPLY_CON, APPLY_BLOCK, APPLY_REFLECT_MELEE, APPLY_IMMUNE_STUN, APPLY_STR}, {12, 15, 10, 1, 12}},
		{14009, 1, true, {}, {APPLY_MAX_HP, APPLY_MAX_SP, APPLY_PENETRATE_PCT, APPLY_STEAL_HP, APPLY_MANA_BURN_PCT}, {2000, 80, 10, 10, 10}},
		{15009, 1, true, {}, {APPLY_MAX_HP, APPLY_MAX_SP, APPLY_MOV_SPEED, APPLY_ATT_SPEED, APPLY_CRITICAL_PCT}, {2000, 80, 8, 8, 10}},
		{16009, 1, true, {}, {APPLY_MAX_HP, APPLY_HP_REGEN, APPLY_CRITICAL_PCT, APPLY_PENETRATE_PCT, APPLY_STEAL_HP}, {2000, 30, 10, 10, 10}},
		{17009, 1, true, {}, {APPLY_MOV_SPEED, APPLY_ATTBONUS_ANIMAL, APPLY_POISON_REDUCE, APPLY_ATTBONUS_DEVIL, APPLY_ATTBONUS_UNDEAD}, {20, 20, 5, 20, 20}},
		{39036, 1, true},
		{76037, 1, true}
	}
	Give_Items[JOB_WARRIOR] {
		{11209, 1, true, {28442, 0, 0}, {APPLY_MAX_HP, APPLY_CAST_SPEED, APPLY_STEAL_HP, APPLY_REFLECT_MELEE, APPLY_ATT_GRADE_BONUS}, {2000, 20, 10, 10, 50}},
		{19, 	1, true, {28430, 0, 0}, {APPLY_STR, APPLY_CRITICAL_PCT, APPLY_PENETRATE_PCT, APPLY_ATTBONUS_ANIMAL, APPLY_STUN_PCT}, {12, 10, 10, 20, 8}},
		{12209, 1, true, {}, 			{APPLY_ATT_SPEED, APPLY_HP_REGEN, APPLY_ATTBONUS_ANIMAL, APPLY_DODGE, APPLY_STEAL_HP}, {8, 30, 20, 15, 10}},
	}
	Give_Items[JOB_ASSASSIN] {
		{11409, 1, true, {28442, 0, 0}, {APPLY_MAX_HP, APPLY_CAST_SPEED, APPLY_STEAL_HP, APPLY_REFLECT_MELEE, APPLY_ATT_GRADE_BONUS}, {2000, 20, 10, 10, 50}},
		{1009, 	1, true, {28430, 0, 0}, {APPLY_STR, APPLY_CRITICAL_PCT, APPLY_PENETRATE_PCT, APPLY_ATTBONUS_ANIMAL, APPLY_STUN_PCT}, {12, 10, 10, 20, 8}},
		{12349, 1, true, {},			{APPLY_ATT_SPEED, APPLY_HP_REGEN, APPLY_ATTBONUS_ANIMAL, APPLY_DODGE, APPLY_STEAL_HP}, {8, 30, 20, 15, 10}},
	}
	Give_Items[JOB_SURA] {
		{11609, 1, true, {28442, 0, 0}, {APPLY_MAX_HP, APPLY_CAST_SPEED, APPLY_STEAL_HP, APPLY_REFLECT_MELEE, APPLY_ATT_GRADE_BONUS}, {2000, 20, 10, 10, 50}},
		{19, 	1, true, {28430, 0, 0}, {APPLY_STR, APPLY_CRITICAL_PCT, APPLY_PENETRATE_PCT, APPLY_ATTBONUS_ANIMAL, APPLY_STUN_PCT}, {12, 10, 10, 20, 8}},
		{12489, 1, true, {}, 			{APPLY_ATT_SPEED, APPLY_HP_REGEN, APPLY_ATTBONUS_ANIMAL, APPLY_DODGE, APPLY_STEAL_HP}, {8, 30, 20, 15, 10}},
	}
	Give_Items[JOB_SHAMAN] {
		{11809, 1, true, {28442, 0, 0}, {APPLY_MAX_HP, APPLY_CAST_SPEED, APPLY_STEAL_HP, APPLY_REFLECT_MELEE, APPLY_ATT_GRADE_BONUS}, {2000, 20, 10, 10, 50}},
		{5009, 	1, true, {28430, 0, 0}, {APPLY_STR, APPLY_CRITICAL_PCT, APPLY_PENETRATE_PCT, APPLY_ATTBONUS_ANIMAL, APPLY_STUN_PCT}, {12, 10, 10, 20, 8}},
		{12629, 1, true, {}, 			{APPLY_ATT_SPEED, APPLY_HP_REGEN, APPLY_ATTBONUS_ANIMAL, APPLY_DODGE, APPLY_STEAL_HP}, {8, 30, 20, 15, 10}},
	}
#ifdef ENABLE_WOLFMAN_CHARACTER
	Give_Items[JOB_WOLFMAN] {
		{21009, 1, true, {28442, 0, 0}, {APPLY_MAX_HP, APPLY_CAST_SPEED, APPLY_STEAL_HP, APPLY_REFLECT_MELEE, APPLY_ATT_GRADE_BONUS}, {2000, 20, 10, 10, 50}},
		{6009, 	1, true, {28430, 0, 0}, {APPLY_STR, APPLY_CRITICAL_PCT, APPLY_PENETRATE_PCT, APPLY_ATTBONUS_ANIMAL, APPLY_STUN_PCT}, {12, 10, 10, 20, 8}},
		{21509, 1, true, {}, 			{APPLY_ATT_SPEED, APPLY_HP_REGEN, APPLY_ATTBONUS_ANIMAL, APPLY_DODGE, APPLY_STEAL_HP}, {8, 30, 20, 15, 10}},
	}
#endif	
}
void GiveBasicWeapon(LPCHARACTER ch)
{
	PrepareItems();
	auto GetHorse = [&ch]()
	{
		ch->SetHorseLevel(21);
		ch->StartRiding();
	};
	auto MakeFNotice = [](LPCHARACTER ch)
	{
		array<auto, JOB_MAX_NUM> JobNames {"Warrior", "Assassin", "Sura", "Shaman", "Lycan"};
		array<auto, EMPIRE_MAX_NUM> EmpireNames {"전제국","신수국","천조국","진노국"};
		array<auto, 256> buf;
		snprintf(buf,sizeof(buf), "New player %s, job: %s, empire: %s", ch->GetName(), JobNames[ch->GetJob()], LC_TEXT(EmpireNames[ch->GetEmpire()]));
		SendNotice(buf);
	};
	for (auto subdata : {ch->GetJob(), COMMON_ITEMS}) {
		for (auto data : Give_Items[subdata]) {
			auto item = ch->AutoGiveItem(data.dwVnum, data.count);
			if (item) {
				for (auto i = 0; i < MAX_ATTR; i++)
					item->SetForceAttribute(i, data.attr_types[i], data.attr_vals[i]);
				for (auto c = 0; c < ITEM_SOCKET_MAX_NUM; c++)
					item->SetSocket(c, data.sockets[c]);
				if (data.equip)
					ch->EquipItem(item);
			}
		}
	}
	MakeFNotice(ch);
	GetHorse();
}

i have try solo but......this is the error

compiling char.cpp
compiling event.cpp
compiling event_queue.cpp
compiling exchange.cpp
compiling file_loader.cpp
compiling fishing.cpp
compiling gm.cpp
In file included from char.cpp:61:
GiveBasicWeapon.h:15:2: error: non-static data member declared with placeholder 'auto'
   15 |  array<auto, ITEM_SOCKET_MAX_NUM> sockets;
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GiveBasicWeapon.h:16:2: error: non-static data member declared with placeholder 'auto'
   16 |  array<auto, MAX_ATTR> attr_types;
      |  ^~~~~~~~~~~~~~~~~~~~~
GiveBasicWeapon.h:17:2: error: non-static data member declared with placeholder 'auto'
   17 |  array<auto, MAX_ATTR> attr_vals;
      |  ^~~~~~~~~~~~~~~~~~~~~
GiveBasicWeapon.h: In function 'auto PrepareItems()':
GiveBasicWeapon.h:23:26: error: expected ';' before '{' token
   23 |  Give_Items[COMMON_ITEMS] {
      |                          ^~
      |                          ;
GiveBasicWeapon.h:23:25: warning: statement has no effect [-Wunused-value]
   23 |  Give_Items[COMMON_ITEMS] {
      |  ~~~~~~~~~~~~~~~~~~~~~~~^
In file included from char.cpp:61:
GiveBasicWeapon.h:39:25: error: expected ';' before '{' token
   39 |  Give_Items[JOB_WARRIOR] {
      |                         ^~
      |                         ;
GiveBasicWeapon.h:39:24: warning: statement has no effect [-Wunused-value]
   39 |  Give_Items[JOB_WARRIOR] {
      |  ~~~~~~~~~~~~~~~~~~~~~~^
GiveBasicWeapon.h:44:26: error: expected ';' before '{' token
   44 |  Give_Items[JOB_ASSASSIN] {
      |                          ^~
      |                          ;
GiveBasicWeapon.h:44:25: warning: statement has no effect [-Wunused-value]
   44 |  Give_Items[JOB_ASSASSIN] {
      |  ~~~~~~~~~~~~~~~~~~~~~~~^
GiveBasicWeapon.h:49:22: error: expected ';' before '{' token
   49 |  Give_Items[JOB_SURA] {
      |                      ^~
      |                      ;
GiveBasicWeapon.h:49:21: warning: statement has no effect [-Wunused-value]
   49 |  Give_Items[JOB_SURA] {
      |  ~~~~~~~~~~~~~~~~~~~^
GiveBasicWeapon.h:54:24: error: expected ';' before '{' token
   54 |  Give_Items[JOB_SHAMAN] {
      |                        ^~
      |                        ;
GiveBasicWeapon.h:54:23: warning: statement has no effect [-Wunused-value]
   54 |  Give_Items[JOB_SHAMAN] {
      |  ~~~~~~~~~~~~~~~~~~~~~^
GiveBasicWeapon.h: In lambda function:
GiveBasicWeapon.h:77:86: error: direct-list-initialization of 'auto' requires exactly one element [-fpermissive]
   77 |   array<auto, JOB_MAX_NUM> JobNames {"Warrior", "Assassin", "Sura", "Shaman", "Lycan"};
      |                                                                                      ^
GiveBasicWeapon.h:77:86: note: for deduction to 'std::initializer_list', use copy-list-initialization (i.e. add '=' before the '{')
GiveBasicWeapon.h:77:86: error: unable to deduce 'std::array<std::initializer_list<auto>, 4>' from '{"Warrior", "Assassin", "Sura", "Shaman", "Lycan"}'
GiveBasicWeapon.h:77:86: note:   couldn't deduce template parameter 'auto'
GiveBasicWeapon.h:78:91: error: direct-list-initialization of 'auto' requires exactly one element [-fpermissive]
   78 |   array<auto, EMPIRE_MAX_NUM> EmpireNames {"전제국","신수국","천조국","진노국"};
      |                                                                               ^
GiveBasicWeapon.h:78:91: note: for deduction to 'std::initializer_list', use copy-list-initialization (i.e. add '=' before the '{')
GiveBasicWeapon.h:78:91: error: unable to deduce 'std::array<std::initializer_list<auto>, 4>' from '{"\37777777754\37777777640\37777777604\37777777754\37777777640\37777777634\37777777752\37777777665\37777777655", "\37777777754\37777777613\37777777640\37777777754\37777777610\37777777630\37777777752\37777777665\37777777655", "\37777777754\37777777662\37777777634\37777777754\37777777641\37777777660\37777777752\37777777665\37777777655", "\37777777754\37777777647\37777777604\37777777753\37777777605\37777777670\37777777752\37777777665\37777777655"}'
GiveBasicWeapon.h:78:91: note:   couldn't deduce template parameter 'auto'
GiveBasicWeapon.h:79:3: error: declaration of 'std::array<auto, 256> buf' has no initializer
   79 |   array<auto, 256> buf;
      |   ^~~~~~~~~~~~~~~~
GiveBasicWeapon.h: In function 'void GiveBasicWeapon(LPCHARACTER)':
GiveBasicWeapon.h:83:49: error: unable to deduce 'std::initializer_list<auto>&&' from '{ch->CHARACTER::GetJob(), COMMON_ITEMS}'
   83 |  for (auto subdata : {ch->GetJob(), COMMON_ITEMS}) {
      |                                                 ^
GiveBasicWeapon.h:83:49: note:   deduced conflicting types for parameter 'auto' ('unsigned char' and '<unnamed enum>')
compiling guild.cpp
compiling guild_manager.cpp
compiling guild_war.cpp
gmake: *** [Makefile:184: .obj/char.o] Error 1
gmake: *** Waiting for unfinished jobs....

 

goto 
 

input.h

#add in private section

void GiveStarterSet(LPCHARACTER Player);

now goto 

 

input_login.cpp

#search for

void CInputLogin::Entergame(LPDESC d, const char * data)

add at the bottom from the function :

 

if(ch != NULL)
		GiveStarterSet(ch);

define the function:

 

void CInputLogin::GiveStarterSet(LPCHARACTER Player)
{
	if (Player != NULL)
	{
		if(Player->GetQuestFlag("give_starter_set.source") == 0)
		{
			Player->SetQuestFlag("give_starter_set.source", 1);

			BYTE CharClass = Player->GetJob();
			bool Warrior	= CharClass == 0;
			bool Ninja		= CharClass == 1;
			bool Sura		= CharClass == 2;
			bool Schami		= CharClass == 3;
			if (Warrior)
				Player->EquipWarrior();
			
			if (Sura)
				Player->EquipSura();
			
			if (Ninja)
				Player->EquipNinja();
			
			if (Schami)
				Player->EquipShaman();
		}
	}
}

goto 
 

char.h

add the functions in public section ;

void EquipWarrior();
void EquipSura();
void EquipShaman();
void EquipNinja();

goto char.cpp

 

now add all 4 functions and add your ID in the vector array

void CHARACTER::EquipWarrior()
{
	std::vector<DWORD>WarriorStuff
	{
		10,
	};

	for (BYTE i = 0; i < WarriorStuff.size(); ++i)
	{
		LPITEM item = ITEM_MANAGER::instance().CreateItem(WarriorStuff[i]);
		if (item != NULL)
		{
			bool Success = item->EquipTo(this, item->FindEquipCell(this));

			if (!Success)
				M2_DESTROY_ITEM(item);
		}
	}
}

you are done

you can now add everything you need in the new character functions 

Edited by xTryhard
  • Love 1
Link to comment
Share on other sites

  • 4 months later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 3

      Crystal Metinstone

    2. 3

      Feeding game source to LLM

    3. 113

      Ulthar SF V2 (TMP4 Base)

    4. 3

      Feeding game source to LLM

    5. 0

      Target Information System

    6. 3

      Feeding game source to LLM

    7. 2

      anti exp explanation pls

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • Create New...

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.