from.FollowersMax += 1;
jaynigs said:Ah ic, the property you need to change is FollowersMax.
So for example
Code:from.FollowersMax += 1;
Dont forget to have it revert back to normal when the player removes the earrings.
Also, dont expect to just paste that line of code in and expect it to work, from looking at your script you need to do more work to it yet
public override void OnAdded( object parent )
{
//you code here
}
public override void OnRemoved( object parent )
{
//your code here
}
jaynigs said:yes, provided that (from) is defined as the player equiping the earrings, which is one part that is missing from the script you posted.
you need to add these 2 overrides to your script to start with..
Code:public override void OnAdded( object parent ) { //you code here } public override void OnRemoved( object parent ) { //your code here }
jaynigs said:Yes it will, try and work out what you need to add to those 2 overrides, i have given you pretty much all the code you need, except a few things, give it a try and see if you can work out how to do it.
//Created by Script Creator
using System;
using Server;
using Server.Items;
public class ControlCap: SilverEarrings
{
[Constructable]
public ControlCap()
{
Weight = 1;
Name = "More Control Cap";
Hue = 1153;
LootType = LootType.Blessed;
}
public override void OnAdded( object parent )
{
from.FollowersMax += 1;
}
public override void OnRemoved( object parent )
{
from.FollowersMax -= 1;
}
public ControlCap( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 );
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
public override void OnAdded( object parent )
{
if ( Core.AOS && parent is Mobile )
{
Mobile from = (Mobile)parent;
m_AosSkillBonuses.AddTo( from );
int strBonus = m_AosAttributes.BonusStr;
int dexBonus = m_AosAttributes.BonusDex;
int intBonus = m_AosAttributes.BonusInt;
if ( strBonus != 0 || dexBonus != 0 || intBonus != 0 )
{
string modName = this.Serial.ToString();
if ( strBonus != 0 )
from.AddStatMod( new StatMod( StatType.Str, modName + "Str", strBonus, TimeSpan.Zero ) );
if ( dexBonus != 0 )
from.AddStatMod( new StatMod( StatType.Dex, modName + "Dex", dexBonus, TimeSpan.Zero ) );
if ( intBonus != 0 )
from.AddStatMod( new StatMod( StatType.Int, modName + "Int", intBonus, TimeSpan.Zero ) );
}
from.CheckStatTimers();
}
}
public override void OnRemoved( object parent )
{
if ( Core.AOS && parent is Mobile )
{
Mobile from = (Mobile)parent;
m_AosSkillBonuses.Remove();
string modName = this.Serial.ToString();
from.RemoveStatMod( modName + "Str" );
from.RemoveStatMod( modName + "Dex" );
from.RemoveStatMod( modName + "Int" );
from.CheckStatTimers();
}
}
mkiplm said:public override void OnAdded( object parent )
{
if ( Core.AOS && parent is Mobile )
{
Mobile from = (Mobile)parent;
public override void OnRemoved( object parent )
{
if ( Core.AOS && parent is Mobile )
{
Mobile from = (Mobile)parent;
so only that
if ( parent is Mobile )
{
Mobile from = (Mobile)parent;
mkiplm said:if ( parent is Mobile )
{
Mobile from = (Mobile)parent;
so this should go right under the other one
if ( parent is Mobile )
{
Mobile from = (Mobile)parent;
from.FollowersMax += 1;
}
- Error: Scripts\custom scripts\ScriptMaker3[1].25\+1controlcap.cs: CS1519: (li
ne 18, column 17) Invalid token 'if' in class, struct, or interface member decla
ration
- Error: Scripts\custom scripts\ScriptMaker3[1].25\+1controlcap.cs: CS1519: (li
ne 18, column 30) Invalid token 'is' in class, struct, or interface member decla
ration
- Error: Scripts\custom scripts\ScriptMaker3[1].25\+1controlcap.cs: CS1519: (li
ne 18, column 40) Invalid token ')' in class, struct, or interface member declar
ation
- Error: Scripts\custom scripts\ScriptMaker3[1].25\+1controlcap.cs: CS1519: (li
ne 21, column 41) Invalid token '+=' in class, struct, or interface member decla
ration
- Error: Scripts\custom scripts\ScriptMaker3[1].25\+1controlcap.cs: CS1518: (li
ne 24, column 18) Expected class, delegate, enum, interface, or struct
- Error: Scripts\custom scripts\ScriptMaker3[1].25\+1controlcap.cs: CS1518: (li
ne 30, column 18) Expected class, delegate, enum, interface, or struct
- Error: Scripts\custom scripts\ScriptMaker3[1].25\+1controlcap.cs: CS1518: (li
ne 35, column 9) Expected class, delegate, enum, interface, or struct
- Error: Scripts\custom scripts\ScriptMaker3[1].25\+1controlcap.cs: CS1518: (li
ne 39, column 18) Expected class, delegate, enum, interface, or struct
- Error: Scripts\custom scripts\ScriptMaker3[1].25\+1controlcap.cs: CS1518: (li
ne 45, column 18) Expected class, delegate, enum, interface, or struct
- Error: Scripts\custom scripts\ScriptMaker3[1].25\+1controlcap.cs: CS1022: (li
ne 50, column 1) Type or namespace definition, or end-of-file expected