Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Buff Icons l Items C++

Newbie Spellweaver
Joined
Oct 2, 2018
Messages
12
Reaction score
1
Hello

i tryed to add some additional Stones my Code is like that but cant figure out what iam doing wrong
:D

// Stone of Plus EXP 10% 1 Day if (IPlayer.IsOnline() && Item.CheckIndex() == 5300) { IPlayer.Buff(175,86400,0); <normaly buff id and time IPlayer.SetBuffIcon(86000000,0,0,1052);< ????? (*(int (__thiscall **)(DWORD, void *, signed int, signed int))(*(DWORD*)ItemOffset + 120))((int)ItemOffset,IPlayer.GetOffset(),9,-1); return Item.GetAmount(); }


5300 is the index of the item
175 is the buff id
1052 is in macro.dat the key wich give the icon to left side


my problem is atm the time isnt not exactly 24h second problem is after relog the icon is gone on the left side maybe someone can explain what is my mistake?


thank you
 
Experienced Elementalist
Joined
Oct 4, 2013
Messages
225
Reaction score
73
Hello

i tryed to add some additional Stones my Code is like that but cant figure out what iam doing wrong
:D

// Stone of Plus EXP 10% 1 Dayif (IPlayer.IsOnline() && Item.CheckIndex() == 5300){IPlayer.Buff(175,86400,0); <normaly buff id and timeIPlayer.SetBuffIcon(86000000,0,0,1052);< ?????(*(int (__thiscall **)(DWORD, void *, signed int, signed int))(*(DWORD*)ItemOffset + 120))((int)ItemOffset,IPlayer.GetOffset(),9,-1);return Item.GetAmount();}


5300 is the index of the item
175 is the buff id
1052 is in macro.dat the key wich give the icon to left side


my problem is atm the time isnt not exactly 24h second problem is after relog the icon is gone on the left side maybe someone can explain what is my mistake?


thank you
The buff does not save in DB [emoji849][emoji849]

 
Upvote 0
off@kal. - on@gw2/d3 :)
Joined
May 30, 2009
Messages
772
Reaction score
480
Code:
giving the buff  to add it into the db (check):
		IPlayer.Buff(250, 10800, 1);
		IPlayer.SetBuffIcon(10800000, 0, buffmsgexp, bufficonexp);

Safe the buff with remaining time (check) - (so it stay after relog with the old timer and do not count when u are logged off):
		if (IPlayer.IsOnline() && SetBuffx.count(IPlayer.GetPID() + 4000000000 + (250 * 1000000)) && SetBuffx.find(IPlayer.GetPID() + 4000000000 + (250 * 1000000))->second)
		{
			IPlayer.Buff(250, SetBuffx.find(IPlayer.GetPID() + 4000000000 + (250 * 1000000))->second, 0);

			if (IPlayer.IsBuff(250))
				SetBuffx.erase(IPlayer.GetPID() + 4000000000 + (250 * 1000000));
		}

rebuff the player on login // and give the real buff (2025):
	if (IPlayer.IsOnline() && IPlayer.IsBuff(250))
	{
		IPlayer.Buff(2025, 10800, 0);
		IPlayer.SetBuffIcon(IPlayer.GetBuffRemain(250) * 1000, 0, buffmsgexp, bufficonexp);
	}

	Removing the buff if time is over :
	if (IPlayer.IsOnline() && !IPlayer.IsBuff(250) && IPlayer.IsBuff(2025))
	{
		IPlayer.CancelBuff(2025);
		IPlayer.RemoveBuffIcon(0, 0, buffmsgexp, bufficonexp);
	}

im doin it via quest for the vote-plugin, but it is the same at all, hope it helps you.
Edit: made it more understandable
 
Last edited:
Upvote 0
Back
Top