[Development] 4267 conquer server.

03/10/2010 17:37 ChingChong23#211
if(player.isBulker())
return rand(1, 200);
else return rand(1, 200000);
03/10/2010 17:48 Kiyono#212
//no nvm
03/10/2010 18:14 ImmuneOne#213
Quote:
Originally Posted by ChingChong23 View Post
if(player.isBulker())
return rand(1, 200);
else return rand(1, 200000
);
Decreasing chances because of bulkers, good concept. A bit unfair though.
03/10/2010 18:24 ~Falcon#214
Quote:
Originally Posted by ImmuneOne View Post
Decreasing chances because of bulkers, good concept. A bit unfair though.
I interpreted it as some sort of jibe at TQ, implying they gave bulkers a higher chance of upgrading than others. (who knows, they may have).

Chances for upgrading level and quality from the EO source:

At the processing of upgrading we have a check to upgrade, this is the same for both level and quality.
Code:
      
int nRateSucc =  RateSuccForEquipLevel(pEquipItem);
if( RandGet(100) < nRateSucc ) { //Upgrade };
RateSuccForEquipLevel:
Code:
int CMsgDataArray::RateSuccForEquipLevel(CItemPtr pEquipItem)
{
	IF_NOT(pEquipItem)
		return 0;

	int nLevel = pEquipItem->GetLevel();
	if (pEquipItem->IsShield() || pEquipItem->IsArmor() || pEquipItem->IsHelmet())
	{
		if (nLevel>=0 && nLevel < 2)		 	    return 100;
		else if(nLevel>=2 && nLevel < 4)			return 35;
		else if(nLevel>=4 && nLevel < 6)			return 20;
		else if(nLevel>=6 && nLevel < 7)			return 10;
		else if(nLevel>=7 && nLevel < 8)			return 7;
		else if(nLevel>=8 && nLevel < 9)			return 4;		
	}
	else
	{
		if (nLevel>=0 && nLevel < 4)		 	    return 100;
		else if(nLevel>=4 && nLevel < 7)			return 35;
		else if(nLevel>=7 && nLevel < 10)			return 20;
		else if(nLevel>=10 && nLevel < 13)			return 10;
		else if(nLevel>=13 && nLevel < 16)			return 7;
		else if(nLevel>=16 && nLevel < 19)			return 4;
		else if(nLevel>=19&&nLevel<22) 			return 2;
	}	
	return 0;
}
bReset is false when the RandGet() method is called, its an optional parameter in the BaseFunc header.

Code:
static _int64 RandSeed = 3721 ;
int RandGet(int nMax, BOOL bReset)
{
	if (bReset)
		RandSeed = ::TimeGet();

	_int64 x = 0xffffffff;
	double i ;
	unsigned long final ;
	
	RandSeed *= ((_int64)134775813);
	RandSeed += 1 ;
	RandSeed = RandSeed % x ;
	i = ((double)RandSeed) / (double)0xffffffff ;
	final = (long) (nMax * i) ;
	
	return (int)final;
}
And the chance upgrade for quality:

Code:
int CMsgDataArray::RateSuccForQuality(CItemPtr pEquipItem)
{
	int iQuality = pEquipItem->GetQuality();
	
	if (iQuality==0)	return 30;
	else if(iQuality==1)	return 12;
	else if(iQuality==2)	return 6;
	else if(iQuality==3)	return 4;
	
	return 0;
}
Hope this helps you :)
03/10/2010 19:03 ImmuneOne#215
Quote:
Originally Posted by ~Falcon View Post
Hope this helps you :)
I actually just asked for the chance rates, thanks for putting effort in it anyway.
03/10/2010 19:12 ~Falcon#216
Quote:
Originally Posted by ImmuneOne View Post
I actually just asked for the chance rates, thanks for putting effort in it anyway.
I honestly have nothing better to do, lol.

Sat looking at loads of work I've got to do, just don't have the motivation to start it :D

Good luck with the project mind, nice to see something that at least has the motivation to document progress and ensure us you're not fading into obscurity.
I hope your very successful :)
03/11/2010 10:27 Korvacs#217
Does anyone remember if you can update items using the item creation packet in 4267, i was pretty certain you could but the update switch isnt working >_>", it just makes the item disappear or does nothing at all.
03/11/2010 14:18 KraHen#218
Quote:
Originally Posted by Korvacs View Post
Does anyone remember if you can update items using the item creation packet in 4267, i was pretty certain you could but the update switch isnt working >_>", it just makes the item disappear or does nothing at all.
Is there a packet which updates your items? I always did stuff like this by removing the initial item and adding the new one.
03/11/2010 14:22 Korvacs#219
Yeah there is. But it doesnt appear to be working in 4267 :(
03/11/2010 16:37 ImmuneOne#220
Quote:
Originally Posted by Korvacs View Post
Yeah there is. But it doesnt appear to be working in 4267 :(
It does,

Code:
                        #region SendPackets
                        Client.SendPacket(new ItemInfo(I.UID, I.ID, I.Dura, I.MaxDura, Loc, I.Soc1, I.Soc2, I.Plus));
                        Client.SendPacket(new UseItem(I.UID, I.Location, 5));
                        Client.SendPacket(new UseItem(I.UID, I.Location, 3));
                        Client.SendPacketToAll(new CharacterSpawn(Client.Character));
                        #endregion
03/11/2010 17:13 Korvacs#221
Code:
            Server.packetServer.SendData(Packets.ItemInfomation(_Item, ItemCreationType.Update, Data.ConnectionID));
Is what i was thinking of, the ItemInfo packet.

You have posted Updating the item equipment, im on about updating items in your inventory.
03/11/2010 17:27 ImmuneOne#222
Quote:
Originally Posted by Korvacs View Post
Code:
            Server.packetServer.SendData(Packets.ItemInfomation(_Item, ItemCreationType.Update, Data.ConnectionID));
Is what i was thinking of, the ItemInfo packet.

You have posted Updating the item equipment, im on about updating items in your inventory.
In that case, remove the item with;

Code:
[B]// UID, LOC, 3[/B]
        public UseItem(uint UID, uint Loc, uint Type)
            : base(20)
        {
            WriteUInt16((ushort)Packet.Length);
            WriteUInt16(1009);
            WriteUInt32(UID);
            WriteUInt32(Loc);
            WriteUInt32(Type);
            WriteUInt32(0);
        }
And send the new item information.
03/11/2010 17:29 Korvacs#223
Thats definately not the correct way to do it, all you had to do was send one packet, and it was the one i posted, i just dont think it was in this client.
03/11/2010 17:32 ImmuneOne#224
Quote:
Originally Posted by Korvacs View Post
Thats definately not the correct way to do it, all you had to do was send one packet, and it was the one i posted, i just dont think it was in this client.
Check my edited post, I made a little mistake.

BTW; The previous post I made before the UseItem packet was for equipping items instead for updating equipped items.
03/11/2010 17:36 Korvacs#225
That still isnt right, thats what im having to do now, remove the old item and recreate it.

Your meant to just send the update packet and it makes the adjustments itself, without removing & recreating.

Turns out it is just:

Code:
            Server.packetServer.SendData(Packets.ItemInfomation(Upgrade, ItemCreationType.Update, Data.ConnectionID));
Sadly it moves the item to the last position in your inventory, i guess thats how the 4267 worked.