Customizing some very specific things.

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

Re: Customizing some very specific things.

Post by kjLotus » Tue May 06, 2014 11:06 pm

type

masterurat
Posts: 81
Joined: Sat May 03, 2014 7:05 pm

Re: Customizing some very specific things.

Post by masterurat » Wed May 07, 2014 10:27 pm

Just to verify then, is slottype going to be something like

0x00: Weapon
0x01: Sub
0x02: Ranged
0x03: Ammo
0x04: Head
0x05: Neck

And so on?

Edit: Also I'm struggling quite a bit with trying to effectively convert a Carmor* back into a Citem to reestablish the item's augments.

Code: Select all


CItemArmor* Piece = (CItemArmor*)(PItem);
			SLOTTYPE slotType = Piece->getSlotType;
			switch (slotType)
			{
				case SLOT_MAIN:
				case SLOT_SUB:
				case SLOT_RANGED:
				case SLOT_AMMO:
				case SLOT_HEAD:
				case SLOT_BODY:
				case SLOT_HANDS:
				case SLOT_LEGS:
				case SLOT_FEET:
				case SLOT_NECK:
				case SLOT_WAIST:
				case SLOT_EAR1:
				case SLOT_EAR2:
				case SLOT_RING1:
				case SLOT_RING2:
				case SLOT_BACK:
This part is working fine but what do I do to convert a CItemArmor* into a CItem?

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

Re: Customizing some very specific things.

Post by kjLotus » Wed May 07, 2014 10:49 pm

masterurat wrote:Just to verify then, is slottype going to be something like

0x00: Weapon
0x01: Sub
0x02: Ranged
0x03: Ammo
0x04: Head
0x05: Neck

And so on?
ctrl+f slottype

masterurat wrote:Edit: Also I'm struggling quite a bit with trying to effectively convert a Carmor* back into a Citem to reestablish the item's augments.

Code: Select all


CItemArmor* Piece = (CItemArmor*)(PItem);
			SLOTTYPE slotType = Piece->getSlotType;
			switch (slotType)
			{
				case SLOT_MAIN:
				case SLOT_SUB:
				case SLOT_RANGED:
				case SLOT_AMMO:
				case SLOT_HEAD:
				case SLOT_BODY:
				case SLOT_HANDS:
				case SLOT_LEGS:
				case SLOT_FEET:
				case SLOT_NECK:
				case SLOT_WAIST:
				case SLOT_EAR1:
				case SLOT_EAR2:
				case SLOT_RING1:
				case SLOT_RING2:
				case SLOT_BACK:
This part is working fine but what do I do to convert a CItemArmor* into a CItem?
CItemArmor is a subclass of CItem

masterurat
Posts: 81
Joined: Sat May 03, 2014 7:05 pm

Re: Customizing some very specific things.

Post by masterurat » Wed May 07, 2014 11:23 pm

Meh, seems to be working, I guess cause I am converting as a pointer I dont need to convert back to double check, it ended up working out just as above.

Will all unequipped earings/rings just return as leftear from slottype? Or does the function not follow the SLOTTYPE enum (which differentiates between leftear and rightear and same for rings)

Or will it work but I will just never encounter an unequipped ring that slottype returns left ring, until it gets equipped?

My testing is quite fruitful, already I can make it so whenever a player obtains a body piece it automatically gets augmented with HP+1, so now I am just making arrays of what augments I want on what armor, and I just need to detect what level the armor is to specify how many augments it can roll and how strong the rolls will be.

Anyone know the max value an augment can hold? is it 255?

I think my best bet is

If floor(level/15) to get level mod, of a range of 0-5. Then do augment roll of random(1 to 5) + level mod.

Which means level 1-15 armor can roll mods of 1-5, and level 75 gear rolls 6-10. At level 30 armor will get 2 rolls, and at level 60 armor will start rolling 3 rolls.

I think thats a pretty balanced and fair rolling system :)

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

Re: Customizing some very specific things.

Post by kjLotus » Wed May 07, 2014 11:32 pm

earrings have a slot value of 6144 (both earrings)

max value of an augment is 32 - for higher than that you use a different augment id that goes from 34 to 66

masterurat
Posts: 81
Joined: Sat May 03, 2014 7:05 pm

Re: Customizing some very specific things.

Post by masterurat » Thu May 08, 2014 12:08 am

Code: Select all

case SLOT_BODY:
			{
				uint16 RollTable[21] = {33,134,31,37,512,513,514,515,516,517,518,2,10,23,27,177,25,142,137,39,40};
				uint8 ItemLevel = Piece->getReqLvl();
				uint8 levelMod = floor(ItemLevel / 15);
				uint8 Rolls = 0;
				if (ItemLevel >= 20) Rolls++;
				if (ItemLevel >= 40) Rolls++;
				if (ItemLevel >= 60) Rolls++;
				for (int i = 20; i > 0; --i) {
					int j = rand() % i;
					int temp = RollTable[i];
					RollTable[i] = RollTable[j];
					RollTable[j] = temp;
				}
				int i = 0;
				while (i < Rolls){
					int value = rand() % 5 + 1;
					Piece->setAugment(i, RollTable[i], value + levelMod);
					i++;
				}
			}
My current half assed code I am using to get this working, and it is working perfectly O_o

All body pieces I give my character are now rolling randomized stats when they enter the player's inventory. This should work with every conceivable way a player obtains items in the game.

masterurat
Posts: 81
Joined: Sat May 03, 2014 7:05 pm

Re: Customizing some very specific things.

Post by masterurat » Thu May 08, 2014 1:10 am

Image

Bam. Also works when buying from npc, I can't test yet for crafting since there isnt any @setcraftlevel command (Im gonna make one shortly to verify crafting an item also augments it)

Next step: I'm gonna make special cases for specific armor, particularly AF, AF2, and special armor dropped by HNMs. Also gonna add flavor text to the gear via its' signature :)

Once that is working Ill probably start looking to host the server. I'm rather surprised how super easy it was to add augments. In all honesty deleting character on homepointing was the hardest part of the modding.

Other little mods left still. I still need to remove reraises and raise 2/3 from the game, that won't take long at all though.

masterurat
Posts: 81
Joined: Sat May 03, 2014 7:05 pm

Re: Customizing some very specific things.

Post by masterurat » Sun May 11, 2014 5:35 am

Ok so now that I have my main stuff down and working, I have some more stuff to add to my todo list, any tips for this would be great.

#1: Where do I set level cap, since this seems to be a thing most servers have implemented and described in their bio, I would like to make the level cap the old school 75.

#2: I need to completely wipe the ability to use and obtain reraise scrolls, potions, instant scrolls, and etc from my game, as well as wipe Raise 2 and Raise 3 from my game, and make Raise 1 only drop from a specific BCNM. Or at the very least make these items ultra ultra SUPER rare, like a potion of reraiser should be so rare on my server (since its hardcore so this literally can save you from getting your character deleted) that it should be worth millions upon millions of gil to players.

Optimally I think Id like to make it a super rare drop from maybe HNMs (on par with D ring drop rate) and maybe let it drop from the KSNM99 fights, and thats it.

Raise will drop from level 75 BCNM fights as well, and I would like to have that be the only way to get it. The ability to save another character should be something only a small handful of players should be privy to, I want getting Raise to be on par with a relic weapon in value.

What would be every table I would need to go through in order to sever all methods of getting these normally in the game? OBviously tonnes of NPCs sell them, LOTS of them, and lots of things drop them, especially reraiser potions ugggh.

So I need to delete a LOT of stuff, but I wanna know if there is a shortcut to quickly take the items out of the server I dont want to be in it in any way.

I assume there might be a quick fix to that, while leaving scroll of instant reraise + hi-reraiser in game

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

Re: Customizing some very specific things.

Post by kjLotus » Sun May 11, 2014 1:22 pm

#1 - map_darkstar.conf (default's 75 i think)
#2 - to get rid of them completely: delete their scripts, otherwise, remove their drops from the drop table and do a directory search to remove them all from shops

masterurat
Posts: 81
Joined: Sat May 03, 2014 7:05 pm

Re: Customizing some very specific things.

Post by masterurat » Sun May 11, 2014 3:07 pm

Thank you, that seems to have gotten most of it. I think there are some random quests and stuff that give you reraise effects as rewards though, so I gotta hunt all those down individually and remove them.

I think I got it all though. Now I just need to make raise sell for 75\100 million gil from shops, and make it a rare drop from the uncapped BCNMs. :p

Moving onwards, signatures are an array of int8s, am I correct in presuming these correspond to ASCI values? Whats the easiest way to convert a string into an armor's signature? Do we have a function to do that or would I need to figure out a way to convert string->char[]->int8[]?

Post Reply