Daemonmann (01-21-2020),mmmm22 (05-31-2022)
I my self wanted this in my game for a very long time, so here it is!
You must add this into dat1 or whatever you use.
-----------------------------------------------------------------------------------
<Object type="0x32a" id="Character Slot Unlocker">
<Class>Equipment</Class>
<Item/>
<Texture>
<File>lofiObj3</File>
<Index>0x5a0</Index>
</Texture>
<SlotType>10</SlotType>
<Description>Unlocks a character slot! Once activated, do not change maps before the confirmation message appears or the item might disappear!</Description>
<Sound>use_potion</Sound>
<Activate>UnlockCharacter</Activate>
<Consumable/>
<!--<Soulbound/>-->
<BagType>4</BagType>
</Object>
<Object type="0x32b" id="Vault Chest Unlocker">
<Class>Equipment</Class>
<Item/>
<Texture>
<File>lofiObj3</File>
<Index>0x5a1</Index>
</Texture>
<SlotType>10</SlotType>
<Description>Unlocks a vault chest! Once activated, do not change maps before the confirmation message appears or the item might disappear!</Description>
<Sound>use_potion</Sound>
<Activate>UnlockVault</Activate>
<Consumable/>
<!--<Soulbound/>-->
<BagType>4</BagType>
</Object>
-----------------------------------------------------------------------------------
go to xmldescriptors.cs and search for public enum ActivateEffects
-----------------------------------------------------------------------------------------
add this
UnlockVault,
UnlockCharacter,
------------------------------------------------------------------------------------
Go to player.useitem.cs and search for private void Activate(RealmTime time, Item item, Position target)
------------------------------------------------------------------------------------
add this under Activate
case ActivateEffects.UnlockVault:
AEUnlockVault(time, item, target, eff);
break;
case ActivateEffects.UnlockCharacter:
AEUnlockCharacter(time, item, target, eff);
break;
---------------------------------------------------------------------------------
now go below and add this
private void AEUnlockVault(RealmTime time, Item item, Position target, ActivateEffect eff)
{
var db = Manager.Database;
var acc = Client.Account;
var availableSlot = Inventory.GetAvailableInventorySlot(item);
if (!(Owner is Vault))
{
SendInfo("Vault Slot Unlocked!");
Manager.Database.CreateChest(acc);
return;
}
SendError("You cannot use a vault unlocker in vault!");
Inventory[availableSlot] = item;
return;
}
private void AEUnlockCharacter(RealmTime time, Item item, Position target, ActivateEffect eff)
{
var db = Manager.Database;
var acc = Client.Account;
Manager.Database.CreateCharacterSlot(acc);
SendInfo("Character Slot Unlocked!");
return;
}
hopefully this should work. bye
Last edited by dewewe; 01-09-2020 at 07:07 PM.
Daemonmann (01-21-2020),mmmm22 (05-31-2022)
What does this do and how do I use it?
its for adding 2 items; a Character Slot Unlocker and Vault Chest Unlocker, char slot unlocker will grant you +1 char slot when consuming, and vault chest unlocker grants +1 vault chest when consuming...
9999% pointless if you don't host a public server though, its really good thing to have if you run a server though as u can use it for giveaways or just simply add it to the loot tables for realm events or something
yeah but where do i add it,cuz im confused