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