Go Back   RunUO - Ultima Online Emulation > RunUO > Script Support

Script Support Get support for modifying RunUO Scripts, or writing your own!

Reply
 
Thread Tools Display Modes
Old 08-25-2008, 10:39 AM   #1 (permalink)
Forum Novice
 
Join Date: Jan 2004
Posts: 143
Send a message via ICQ to robinson
Default a power hour thing

i wanna do a power hour thing for my shard
when i use command [ph in game skill gains will be faster..

Code:
 //here is gainrates 4 each skill
         //for instance .15 would be a 15% chance to gain in the particular skill

         SkillInfo.Table[0].GainFactor = .11;// Alchemy = 0, 
         SkillInfo.Table[1].GainFactor = .11;// Anatomy = 1, 
         SkillInfo.Table[2].GainFactor = .11;// AnimalLore = 2, 
         SkillInfo.Table[3].GainFactor = .11;// ItemID = 3, 
         SkillInfo.Table[4].GainFactor = .11;// ArmsLore = 4, 
         SkillInfo.Table[5].GainFactor = .11;// Parry = 5, 
         SkillInfo.Table[6].GainFactor = .11;// Begging = 6, 
         SkillInfo.Table[7].GainFactor = .11;// Blacksmith = 7, 
         SkillInfo.Table[8].GainFactor = .11;// Fletching = 8, 
         SkillInfo.Table[9].GainFactor = .11;// Peacemaking = 9, 
         SkillInfo.Table[10].GainFactor = .11;// Camping = 10, 
         SkillInfo.Table[11].GainFactor = .11;// Carpentry = 11, 
         SkillInfo.Table[12].GainFactor = .11;// Cartography = 12, 
         SkillInfo.Table[13].GainFactor = .11;// Cooking = 13, 
         SkillInfo.Table[14].GainFactor = .11;// DetectHidden = 14, 
         SkillInfo.Table[15].GainFactor = .11;// Discordance = 15, 
         SkillInfo.Table[16].GainFactor = .11;// EvalInt = 16, 
         SkillInfo.Table[17].GainFactor = .11;// Healing = 17, 
         SkillInfo.Table[18].GainFactor = .11;// Fishing = 18, 
         SkillInfo.Table[19].GainFactor = .11;// Forensics = 19, 
         SkillInfo.Table[20].GainFactor = .11;// Herding = 20, 
         SkillInfo.Table[21].GainFactor = .11;// Hiding = 21, 
         SkillInfo.Table[22].GainFactor = .11;// Provocation = 22, 
         SkillInfo.Table[23].GainFactor = .11;// Inscribe = 23, 
         SkillInfo.Table[24].GainFactor = .11;// Lockpicking = 24, 
         SkillInfo.Table[25].GainFactor = .11;// Magery = 25, 
         SkillInfo.Table[26].GainFactor = .11;// MagicResist = 26, 
         SkillInfo.Table[27].GainFactor = .11;// Tactics = 27, 
         SkillInfo.Table[28].GainFactor = .11;// Snooping = 28, 
         SkillInfo.Table[29].GainFactor = .11;// Musicianship = 29, 
         SkillInfo.Table[30].GainFactor = .11;// Poisoning = 30 
         SkillInfo.Table[31].GainFactor = .11;// Archery = 31 
         SkillInfo.Table[32].GainFactor = .11;// SpiritSpeak = 32 
         SkillInfo.Table[33].GainFactor = .11;// Stealing = 33 
         SkillInfo.Table[34].GainFactor = .11;// Tailoring = 34 
         SkillInfo.Table[35].GainFactor = .11;// AnimalTaming = 35 
         SkillInfo.Table[36].GainFactor = .11;// TasteID = 36 
         SkillInfo.Table[37].GainFactor = .11;// Tinkering = 37 
         SkillInfo.Table[38].GainFactor = .11;// Tracking = 38 
         SkillInfo.Table[39].GainFactor = .11;// Veterinary = 39 
         SkillInfo.Table[40].GainFactor = .11;// Swords = 40 
         SkillInfo.Table[41].GainFactor = .11;// Macing = 41 
         SkillInfo.Table[42].GainFactor = .11;// Fencing = 42 
         SkillInfo.Table[43].GainFactor = .11;// Wrestling = 43 
         SkillInfo.Table[44].GainFactor = .11;// Lumberjacking = 44 
         SkillInfo.Table[45].GainFactor = .11;// Mining = 45 
         SkillInfo.Table[46].GainFactor = .11;// Meditation = 46 
         SkillInfo.Table[47].GainFactor = .11;// Stealth = 47 
         SkillInfo.Table[48].GainFactor = .11;// RemoveTrap = 48 
         SkillInfo.Table[49].GainFactor = .11;// Necromancy = 49 
         SkillInfo.Table[50].GainFactor = .11;// Focus = 50 
         SkillInfo.Table[51].GainFactor = .11;// Chivalry = 51
i want them to be all .16 for example and when i do [ph again they will back to .11
robinson is offline   Reply With Quote
Old 08-25-2008, 11:23 AM   #2 (permalink)
Forum Novice
 
Join Date: Aug 2005
Location: Italy (Piemonte)
Age: 20
Posts: 210
Send a message via ICQ to Smjert Send a message via MSN to Smjert
Default

If you see Table it's an array so you can loop it with a for loop

Last edited by Smjert; 08-25-2008 at 11:31 AM. Reason: don't want to be harsh
Smjert is offline   Reply With Quote
Old 08-25-2008, 02:08 PM   #3 (permalink)
Forum Master
 
Lord_Greywolf's Avatar
 
Join Date: Dec 2005
Posts: 6,777
Send a message via Yahoo to Lord_Greywolf
Default

you would have to define some place a global variable of "PowerHour" and have it be a bool
and your command to set that variable to true or not
(could possibly make it in skillcheck itself, but might want to have other uses for it also, bonus experience gains, etc)

then can do your list very easy:


Code:
			for ( int i = 0; i <= 51; ++i )
				SkillInfo.Table[0].GainFactor = (bool ? PowerHour 0.16, 0.11);
i showed how to do this for the long list to a "for loop" when all are the same
and to show how to do a simple compare to see which number to use

but the method below does it for ALL skills you have set up to use based on your expansion: (ML, SE, AOS, etc)

Code:
			for ( int i = 0; i < PowerScroll.Skills.Length; ++i )
				SkillInfo.Table[0].GainFactor = (bool ? PowerHour 0.16, 0.11);
__________________
http://www.AoAUO.com

:) ..... Come for the Customs, Play for the Fun. Return to see your new Friends ..... :)

Last edited by Lord_Greywolf; 08-25-2008 at 02:11 PM.
Lord_Greywolf is offline   Reply With Quote
Old 08-25-2008, 03:05 PM   #4 (permalink)
Forum Novice
 
Soteric's Avatar
 
Join Date: Aug 2006
Location: Russia, Rostov-on-Don
Posts: 772
Send a message via ICQ to Soteric
Default

If the gainFactor is the same for all skills why don't modify it in CheckSkill method?
Code:
gc *= skill.Info.GainFactor; // Original code
We can check static bool PowerHour here... something like:
Code:
gc = ( PowerHour ? gc * .11 : gc * skill.Info.GainFactor );
Soteric is online now   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5