DROP TIME IN SOURCE (C++)

06/03/2014 00:04 meca4h4#1
i need expire 'noname' items expire - 5 sec

because ownership is easy to config but how to change - expire noname items (StartDestroyEvent)

example:

[Only registered and activated users can see links. Click Here To Register...]
06/03/2014 08:31 .HC'Destrox#2
Like you said: in the CItem::StartDestroyEvent.
Just open "char.h" and search for "StartDestroyEvent".
Then you find something like "void StartDestroyEvent(int iSec=300);".
The "iSec=300" is meaning, that the "default-value" for "iSec" is 300.
So if no argument is given it's 300. Change this value and you will have an other drop time.

Kind Regards
06/03/2014 15:51 meca4h4#3
Quote:
Originally Posted by .HC'Destrox View Post
Like you said: in the CItem::StartDestroyEvent.
Just open "char.h" and search for "StartDestroyEvent".
Then you find something like "void StartDestroyEvent(int iSec=300);".
The "iSec=300" is meaning, that the "default-value" for "iSec" is 300.
So if no argument is given it's 300. Change this value and you will have an other drop time.

Kind Regards
but when i change this:

item.h
[Only registered and activated users can see links. Click Here To Register...]

for example: 5 sec then drop destroy / expire with name too but i need only destroy / expire noname items. HELP PLS nad sry fo my bad english ;p
06/03/2014 15:58 .HC'Destrox#4
Well, if you wanna have it easy just change the StartDestroyEvent()-Function (in item.cpp) to:
Code:
void CItem::StartDestroyEvent(int iSec)
{
	if (m_pkDestroyEvent)
		return;

	if (iSec == 300 && !GetOwner())
		iSec = 5;

	item_event_info* info = AllocEventInfo<item_event_info>();
	info->item = this;

	SetDestroyEvent(event_create(item_destroy_event, info, PASSES_PER_SEC(iSec)));
}
Kind Regards
06/03/2014 16:04 meca4h4#5
Quote:
Originally Posted by .HC'Destrox View Post
Well, if you wanna have it easy just change the StartDestroyEvent()-Function (in item.cpp) to:
Code:
void CItem::StartDestroyEvent(int iSec)
{
	if (m_pkDestroyEvent)
		return;

	if (iSec == 300 && !GetOwner())
		iSec = 5;

	item_event_info* info = AllocEventInfo<item_event_info>();
	info->item = this;

	SetDestroyEvent(event_create(item_destroy_event, info, PASSES_PER_SEC(iSec)));
}
Kind Regards
Thx, man i test it :p

MY CONFIG

ITEM.H

Quote:
void StartDestroyEvent(int iSec=300);
for wnership:

Quote:
void SetOwnership(LPCHARACTER ch, int iSec = 180);
item.cpp
Quote:
void CItem::StartDestroyEvent(int iSec)
{
if (m_pkDestroyEvent)
return;

if (iSec == 300 && !GetOwner())
iSec = 5;

item_event_info* info = AllocEventInfo<item_event_info>();
info->item = this;

SetDestroyEvent(event_create(item_destroy_event, info, PASSES_PER_SEC(iSec)));
}
for ownership:

Quote:
if (m_pkOwnershipEvent)
return;

if (true == LC_IsEurope())
{
if (iSec == 180)
iSec = 180;
}
and item with DROP and 'noname' expire destroy 5 sec :/ what is it? ;<
06/03/2014 17:26 .HC'Destrox#6
What do you mean with "with DROP" ? with ownership ?
06/03/2014 17:35 meca4h4#7
ownership is good - 180 sec - work

i need - after item thrown to the ground - expire / destory 5 sec
06/03/2014 18:44 .HC'Destrox#8
Yeah this should work with this source... or if this dont work replace "if (iSec == 300 && !GetOwner())" with "if (!GetOwner())"

Kind Regards
06/03/2014 18:52 meca4h4#9
Quote:
Originally Posted by .HC'Destrox View Post
Yeah this should work with this source... or if this dont work replace "if (iSec == 300 && !GetOwner())" with "if (!GetOwner())"

Kind Regards
if (iSec == 300 !GetOwner())

?

f5

help pls:
[Only registered and activated users can see links. Click Here To Register...]
06/03/2014 20:49 .HC'Destrox#10
Just write that what i've wrote:
Code:
if (!GetOwner()) iSec = 5;
in item.cpp

This should be all.

Kind Regards
06/03/2014 21:24 meca4h4#11
NOPE :/

[Only registered and activated users can see links. Click Here To Register...]

Destroy - 5 sec

it's ok

[Only registered and activated users can see links. Click Here To Register...]

destroy - 5 sec

this should be 180 or 300 sec
06/03/2014 21:44 .HC'Destrox#12
Oh well, i failed. Replace the
Code:
if (!GetOwner()) iSec = 5;
with
Code:
if (!m_pkOwnershipEvent) iSec = 5;
Now it should work.

Kind Regards
06/03/2014 21:53 meca4h4#13
Still my point is that the objects of drop disappear at the same time, and I want to drop rates of items disappearing after 180 sec and thrown to the ground 5 sec.

nope, error compile game :/

rly it's dat diffucilt

exapmle diff:

Item disable 5 secund

game_r40250
0005212A : 2C 05
0005212B : 01 00

but i need in source ;o
06/03/2014 22:02 .HC'Destrox#14
Well maybe it would be easier to just change it in the player function "CHARACTER::Reward":
Change every "item->StartDestroyEvent();" to "item->StartDestroyEvent(5);"
That HAVE to work!

Kind Regards
06/03/2014 22:20 meca4h4#15
Quote:
Originally Posted by .HC'Destrox View Post
Well maybe it would be easier to just change it in the player function "CHARACTER::Reward":
Change every "item->StartDestroyEvent();" to "item->StartDestroyEvent(5);"
That HAVE to work!

Kind Regards
my bad, its work: if (!m_pkOwnershipEvent) iSec = 5;

but i was have if (!m_pkOwnershipEvent)) iSec = 5; and errow was XD

THX MAN!