Skip to content

Instantly share code, notes, and snippets.

View msturgill's full-sized avatar

Mark Sturgill msturgill

  • https://keybase.io/msturgill
View GitHub Profile

Keybase proof

I hereby claim:

  • I am msturgill on github.
  • I am msturgill (https://keybase.io/msturgill) on keybase.
  • I have a public key whose fingerprint is BD48 E2F2 B8E9 C35A 3E7A 2775 6799 DA44 1735 958F

To claim this, I am signing this object:

effect = (int)( from.Skills[SkillName.Discordance].Value / -5.0 );
scalar = effect * 0.01;
mods.Add( new StatMod( StatType.Str, "DiscordanceStr", (int)(targ.RawStr * scalar), TimeSpan.Zero ) );
mods.Add( new StatMod( StatType.Int, "DiscordanceInt", (int)(targ.RawInt * scalar), TimeSpan.Zero ) );
mods.Add( new StatMod( StatType.Dex, "DiscordanceDex", (int)(targ.RawDex * scalar), TimeSpan.Zero ) );
for ( int i = 0; i < targ.Skills.Length; ++i )
{
if ( targ.Skills[i].Value > 0 )
public static double GetBaseDifficulty( Mobile targ )
{
/* Difficulty TODO: Add another 100 points for each of the following abilities:
- Radiation or Aura Damage (Heat, Cold etc.)
- Summoning Undead
*/
double val = targ.Hits + targ.Stam + targ.Mana;
for ( int i = 0; i < targ.Skills.Length; i++ )
@msturgill
msturgill / Razor.nsi
Created March 2, 2014 20:11
Razor NSIS
;--------------------------------
;Include Modern UI
!include "MUI.nsh"
;--------------------------------
;General
;Name and file
Name "Razor"
@msturgill
msturgill / iptables persistence
Last active August 29, 2015 13:56
iptables persistence
/etc/network/if-pre-up.d/ip-pre
#!/bin/bash
test "$IFACE"="eth1" || exit 0
/sbin/iptables-restore -c < /etc/iptables.rules
/sbin/ip6tables-restore -c < /etc/ip6tables.rules
/etc/network/if-post-down.d/ip-post
#!/bin/bash
@msturgill
msturgill / HousePlacement.cs
Created February 22, 2014 19:27
Zenvera HousePlacement.cs
using System;
using System.Collections;
using System.Collections.Generic;
using Server;
using Server.Guilds;
using Server.Items;
using Server.Misc;
using Server.Regions;
using Server.Spells;
@msturgill
msturgill / PlayerInfo.cs
Created February 7, 2014 18:45
PlayerInfo Implementation
using System;
using System.Collections.Generic;
using System.Text;
using Server;
using Server.Misc;
using Server.Items;
using Server.Gumps;
using Server.Mobiles;
using Server.ContextMenus;
using Server.Accounting;
@msturgill
msturgill / FisherYatesShuffle.cs
Created November 21, 2013 01:30
Fisher-Yates Shuffle
public void Shuffle()
{
int n = this.Count;
byte[] box = new byte[1];
while (n > 1)
{
do Utility.RandomBytes(box);
while (!(box[0] < n * (Byte.MaxValue / n)));
int k = (box[0] % n);