Jump to content
External pictures are being replaced... ×
×
×
  • Create New...

I'm searching someone who can do a little function


ReFresh

Recommended Posts

  • Premium

Hi guys,

I need to fix a cube make all button. Now after click on this button you will get 200x text in chat of "You recieved this sh*t" :DYou can see in the video how it must be done. When the amount of items will be higher than 1 you will get how many elixirs you created as output in chat only once.

Thanks for response.

Sincerely,

ReFresh

I'll be always helpful! 👊 

Link to comment
Share on other sites

  • Replies 14
  • Created
  • Last Reply

Top Posters In This Topic

  • Premium
On 8/5/2017 at 1:12 PM, ragem0re said:

isn't the create_all command working?

Yeah cube make all working but you will get a spam in chat of: "You recieved item bla bla" for 200 times when you create 200 items.

I'll be always helpful! 👊 

Link to comment
Share on other sites

  • 7 months later...
  • Premium
On 05.08.2017 at 3:22 PM, ReFresh said:

Yeah cube make all working but you will get a spam in chat of: "You recieved item bla bla" for 200 times when you create 200 items.

So make a copy of that function and delete the lines with chat.

Link to comment
Share on other sites

  • 2 weeks later...
11 hours ago, DeadSkull7 said:

Put the original function here and i'wll do it for u 

this is the command part

case 'm':	// make
			if (0 != arg2[0])
			{
				while (true == Cube_make(ch))
					dev_log (LOG_DEB0, "cube make success");
			}
			else
				Cube_make(ch);
			break;

and this is the actual function

if ( percent_number<=cube_proto->percent)
	{
		// 성공
		ch->ChatPacket(CHAT_TYPE_COMMAND, "cube success %d %d", reward_value->vnum, reward_value->count);
		new_item = ch->AutoGiveItem(reward_value->vnum, reward_value->count);

		LogManager::instance().CubeLog(ch->GetPlayerID(), ch->GetX(), ch->GetY(),
				reward_value->vnum, new_item->GetID(), reward_value->count, 1);
		return true;
	}

 

Link to comment
Share on other sites

go to uicube.py and search:

def __OnAcceptButtonClick(self):

and repalce with :

	def __OnAcceptButtonClick(self):
		import chat
		if len(self.cubeItemInfo) == 0:
			"빈 큐브"
			return
		
		print "큐브 제작 시작"
		itemCount = 0
		for invenPos in self.cubeItemInfo.values():
			itemCount = player.GetItemCount(invenPos)
			#break
			#net.SendChatPacket("/cube add " + str(invenPos))

		net.SendChatPacket("/cube make %d " % itemCount)

go to cmd_general.cpp and search :

dev_log(LOG_DEB0, "CUBE COMMAND <%s>: %s", ch->GetName(), argument);

add down:

	DWORD count=1;

and.. search:

		case 'm':	// make
			if (0 != arg2[0])
			{
				while (true == Cube_make(ch,count)){
					dev_log (LOG_DEB0, "cube make success");
				}
			}

repalce with:

		case 'm':	// make
			if (0 != arg2[0])
			{
				str_to_number(count, arg2);
				Cube_make(ch,count);
			}

go to cube.h and search:

	void		remove_material (LPCHARACTER ch);

add down
void		remove_material (LPCHARACTER ch,DWORD count);

then search:
bool Cube_make (LPCHARACTER ch);

replace with :
bool Cube_make (LPCHARACTER ch,DWORD count);

 

go to cube.cpp and search:

void CUBE_DATA::remove_material (LPCHARACTER ch)
{
	DWORD	i, end_index;
	DWORD	need_vnum;
	int		need_count;
	LPITEM	*items = ch->GetCubeItem();

	end_index = this->item.size();
	for (i=0; i<end_index; ++i)
	{
		need_vnum	= this->item[i].vnum;
		need_count	= this->item[i].count;

		FN_remove_material (items, need_vnum, need_count);
	}
}
      
 add down
void CUBE_DATA::remove_material (LPCHARACTER ch,DWORD count)
{
	DWORD	i, end_index;
	DWORD	need_vnum;
	int		need_count;
	LPITEM	*items = ch->GetCubeItem();

	end_index = this->item.size();
	for (i=0; i<end_index; ++i)
	{
		need_vnum	= this->item[i].vnum;
		need_count	= this->item[i].count;
		FN_remove_material (items, need_vnum, count);
	}
}
 
 then search :
      bool Cube_make (LPCHARACTER ch)
 replace with:
      bool Cube_make (LPCHARACTER ch,DWORD count)
      
then search :
      cube_proto->remove_material (ch);
      
replace with:
      cube_proto->remove_material (ch,count);
 
 then search:
      if ( percent_number<=cube_proto->percent)
	{
		// 성공
		ch->ChatPacket(CHAT_TYPE_COMMAND, "cube success %d %d", reward_value->vnum, reward_value->count);
		new_item = ch->AutoGiveItem(reward_value->vnum, reward_value->count);

		LogManager::instance().CubeLog(ch->GetPlayerID(), ch->GetX(), ch->GetY(),
				reward_value->vnum, new_item->GetID(), reward_value->count, 1);
		return true;
	}
      
repalce with:
      	if ( percent_number<=cube_proto->percent)
	{
		// 성공
		ch->ChatPacket(CHAT_TYPE_COMMAND, "cube success %d %d", reward_value->vnum, count);
		new_item = ch->AutoGiveItem(reward_value->vnum, count);

		LogManager::instance().CubeLog(ch->GetPlayerID(), ch->GetX(), ch->GetY(),
				reward_value->vnum, new_item->GetID(), count, 1);
		return true;
	}
      

 

Best Wishes <3

Link to comment
Share on other sites

  • Premium

@DeadSkull Thanks so much for the tutorial but I got some error when compiling:

cmd_general.cpp
cube.h: In function 'void do_cube(CHARACTER*, const char*, int, int)':
cube.h:47: error: too few arguments to function 'bool Cube_make(CHARACTER*, DWORD)'
cmd_general.cpp:2610: error: at this point in file
Makefile:130: recipe for target 'OBJDIR/cmd_general.o' failed
gmake: *** [OBJDIR/cmd_general.o] Error 1

 

I'll be always helpful! 👊 

Link to comment
Share on other sites

in cmd_general.cpp search 

case 'm':	// make
			if (0 != arg2[0])
			{
				while (true == Cube_make(ch))
					dev_log (LOG_DEB0, "cube make success");
			}
			else
				Cube_make(ch);
			break;

 

Replace with 

case 'm':	// make
			if (0 != arg2[0])
			{
				str_to_number(count, arg2);
				Cube_make(ch,count);
            }
            else  Cube_make(ch,count);
            break;

And check cube.h & cube.cpp again 

 

Besr Wishes 

Link to comment
Share on other sites

  • Premium

@DeadSkull7 Thanks for your answer, but it's not like in video. Now only the text when I created item more than 1x disappeared. And it's done for cube make command not for cube make all command and no text output in chat ingame. Threre must be text output when I use create all button: You created item countx. 

PS: If you don't understand to what buttons do in the video I can make translation.

I'll be always helpful! 👊 

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
  • Recently Browsing   0 members

    • 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.