|
||
|
|||||||
| Script Support Get support for modifying RunUO Scripts, or writing your own! |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Forum Novice
Join Date: Mar 2007
Age: 21
Posts: 266
|
hello again.
i got two questions again. First: In CraftItem, there is a possibility to use consumeType.Half or All. where exectly do i have to make this check? PlayerMobile plm = (PlayerMobile) from; if( plm.HalfResourcesRequired == true ) consumetype = ConsumeType.Half else ConsumeType consumeType = ( UseAllRes ? ConsumeType.Half : ConsumeType.All ); I tried this: Code:
}
else if ( !allRequiredSkills )
{
if ( tool != null && !tool.Deleted && tool.UsesRemaining > 0 )
from.SendGump( new CraftGump( from, craftSystem, tool, 1044153 ) );
else
from.SendLocalizedMessage( 1044153 ); // You don't have the required skills to attempt this item.
}
else
{
PlayerMobile plm = (PlayerMobile)from;
if( plm.HalfResourcesRequired == true )
consumeType = ConsumeType.Half;
else
ConsumeType consumeType = ( UseAllRes ? ConsumeType.Half : ConsumeType.All );
int resHue = 0;
int maxAmount = 0;
object message = null;
Code:
RunUO - [www.runuo.com] Version 2.0, Build 2959.20979
Core: Running on .NET Framework Version 2.0.50727
Scripts: Compiling C# scripts...failed (1 errors, 0 warnings)
Errors:
+ Engines/Craft/Core/CraftItem.cs:
CS1023: Line 1176: Embedded statement cannot be a declaration or labeled sta
tement
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.
And in HarvestSystem, i found this: Code:
if ( type != null )
{
Item item = Construct( type, from );
if ( item == null )
{
type = null;
}
else
{
//The whole harvest system is kludgy and I'm sure this is just adding to it.
if ( item.Stackable )
{
int amount = def.ConsumedPerHarvest;
int feluccaAmount = def.ConsumedPerFeluccaHarvest;
int racialAmount = (int)Math.Ceiling( amount * 1.1 );
int feluccaRacialAmount = (int)Math.Ceiling( feluccaAmount * 1.1 );
bool eligableForRacialBonus = ( def.RaceBonus && from.Race == Race.Human );
bool inFelucca = (map == Map.Felucca);
if( eligableForRacialBonus && inFelucca && bank.Current >= feluccaRacialAmount )
item.Amount = feluccaRacialAmount;
else if( inFelucca && bank.Current >= feluccaAmount )
item.Amount = feluccaAmount;
else if( eligableForRacialBonus && bank.Current >= racialAmount )
item.Amount = racialAmount;
else
item.Amount = amount;
}
bank.Consume( item.Amount, from );
if ( Give( from, item, def.PlaceAtFeetIfFull ) )
{
SendSuccessTo( from, item, resource );
}
else
{
SendPackFullTo( from, item, def, resource );
item.Delete();
}
BonusHarvestResource bonus = def.GetBonusResource();
if ( bonus != null && bonus.Type != null && skillBase >= bonus.ReqSkill )
{
Item bonusItem = Construct( bonus.Type, from );
if ( Give( from, bonusItem, true ) ) //Bonuses always allow placing at feet, even if pack is full irregrdless of def
{
bonus.SendSuccessTo( from );
}
else
{
item.Delete();
}
}
thanks in advance Last edited by DarkViper2006; 12-04-2008 at 04:56 PM. |
|
|
|
|
|
#2 (permalink) |
|
Forum Master
|
1st one is easy - you are redifinging it again - remove the 1st part of this statement (in red)
ConsumeType consumeType 2nd one felucca consume amounts are defined in the individual harvest scripts (search for felucca in mining, etc) but they take the extra out of the vein felucca bonuses is not more ore, but faster extraction - i.e. you get 2-3 or what ever out at a time instead of 1, but the vein still only holds 20 or what ever, so you drain the vein faster you could make it so fel only removes 1 at a time in the harvest core by setting it to only remove from the bank the same amount as non fel - but that gives a very big unbalanced advantage to mining on fel then
__________________
http://www.AoAUO.com
:) ..... Come for the Customs, Play for the Fun. Return to see your new Friends ..... :) |
|
|
|
|
|
#3 (permalink) | |
|
Forum Novice
Join Date: Mar 2007
Age: 21
Posts: 266
|
Quote:
And want to set felucca to trammel like mining( just 1 ). But i have a customskill, that will triple the harvested amount for a minute. But that skill coding is messing with me mind. ![]() And for the ConsumeType. i when i remove it it sends the error: consumeType is missing.... are you missing a file error. and when i change it to this i get : Code:
else if ( !allRequiredSkills )
{
if ( tool != null && !tool.Deleted && tool.UsesRemaining > 0 )
from.SendGump( new CraftGump( from, craftSystem, tool, 1044153 ) );
else
from.SendLocalizedMessage( 1044153 ); // You don't have the required skills to attempt this item.
}
else
{
PlayerMobile plm = (PlayerMobile)from;
if( plm.HalfResourcesRequired == true )
ConsumeType consumeType = ConsumeType.Half; else
ConsumeType consumeType = ( UseAllRes ? ConsumeType.Half : ConsumeType.All );
int resHue = 0;
int maxAmount = 0;
object message = null;
// Not enough resource to craft it
if ( !ConsumeRes( from, typeRes, craftSystem, ref resHue, ref maxAmount, consumeType, ref message, true ) )
{
if ( tool != null && !tool.Deleted && tool.UsesRemaining > 0 )
from.SendGump( new CraftGump( from, craftSystem, tool, message ) );
else if ( message is int && (int)message > 0 )
from.SendLocalizedMessage( (int)message );
else if ( message is string )
from.SendMessage( (string)message );
return;
}
Code:
RunUO - [www.runuo.com] Version 2.0, Build 2959.20979
Core: Running on .NET Framework Version 2.0.50727
Scripts: Compiling C# scripts...failed (1 errors, 0 warnings)
Errors:
+ Engines/Craft/Core/CraftItem.cs:
CS1023: Line 1174: Embedded statement cannot be a declaration or labeled sta
tement
CS1023: Line 1176: Embedded statement cannot be a declaration or labeled sta
tement
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.
Last edited by DarkViper2006; 12-05-2008 at 12:03 AM. |
|
|
|
|
|
|
#4 (permalink) |
|
Forum Novice
|
Change it to this, you need to declare the variable before using it in the fashion you're using it.
Code:
else if ( !allRequiredSkills )
{
if ( tool != null && !tool.Deleted && tool.UsesRemaining > 0 )
from.SendGump( new CraftGump( from, craftSystem, tool, 1044153 ) );
else
from.SendLocalizedMessage( 1044153 ); // You don't have the required skills to attempt this item.
}
else
{
ConsumeType consumeType;
PlayerMobile plm = (PlayerMobile)from;
if( plm.HalfResourcesRequired == true )
consumeType = ConsumeType.Half;
else
consumeType = ( UseAllRes ? ConsumeType.Half : ConsumeType.All );
int resHue = 0;
int maxAmount = 0;
object message = null;
// Not enough resource to craft it
__________________
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|