Jump to content

I'm searching someone who can do a little function


Recommended Posts

  • Active Member

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

Edited by ReFresh

I'll be always helpful! 👊 

Link to comment
Share on other sites

  • Replies 14
  • Created
  • Last Reply

Top Posters In This Topic

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

  • Active Member

@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

  • Active Member

@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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 5

      Effect weapons

    2. 3

      Crystal Metinstone

    3. 3

      Feeding game source to LLM

    4. 113

      Ulthar SF V2 (TMP4 Base)

    5. 3

      Feeding game source to LLM

    6. 0

      Target Information System

    7. 3

      Feeding game source to LLM

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