valkryja_materiamagica.xml 5.73 KB
Newer Older
1 2 3
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE MudletPackage>
<MudletPackage version="1.001">
Maiyannah Bishop's avatar
Maiyannah Bishop committed
4 5 6 7 8 9 10 11 12
	<TriggerPackage />
	<TimerPackage />
	<AliasPackage />
	<ActionPackage />
	<ScriptPackage>
		<Script isActive="yes" isFolder="no">
			<name>Valkryja.MM.Core</name>
			<packageName></packageName>
			<script>Valkryja.MM  = Valkryja.MM or {}
13 14 15 16
Character.MM = Character.MM or {}

-- END OF SCRIPT
-- ============================================================================</script>
Maiyannah Bishop's avatar
Maiyannah Bishop committed
17 18 19 20 21
			<eventHandlerList />
		</Script>
		<Script isActive="yes" isFolder="no">
			<name>Valkryja.MM.Defences</name>
			<packageName></packageName>
22
			<script>
23 24
function Valkryja.LoadDefenceNames()
   Valkryja.DefenceNames = Valkryja.DefencesNames or {};
25 26
   Valkryja.DefenceNames["SenseLife"]   = "sense life"
   Valkryja.DefenceNames["Infravision"] = "infravision"
27

28 29 30 31 32 33
   Valkryja.DefenceNames["DetectAlignment"]    = "detect alignment"
   Valkryja.DefenceNames["DetectIllusion"]     = "detect illusion"
   Valkryja.DefenceNames["DetectInvisibility"] = "detect invisibility"
   Valkryja.DefenceNames["DetectMagic"]        = "detect magic"
   Valkryja.DefenceNames["Levitation"]         = "levitation"
   Valkryja.DefenceNames["PassDoor"]           = "pass door"
34

35 36
   Valkryja.DefenceNames["Sanctuary"]  = "sanctuary"
   Valkryja.DefenceNames["FireShield"] = "fire shield"
37

38
   Valkryja.DefenceNames["ImmutableNimbus"] = "immutable nimbus"
39 40
end

41
function Valkryja.ReloadDynamicDefenceNames()
42 43
end

44 45
function Valkryja.LoadDefenceIcons()
   Valkryja.DefenceIcons = Valkryja.DefencesIcons or {};
46 47
   Valkryja.DefenceIcons["SenseLife"]   = Valkryja.SystemPath.."img/defences/icon-senselife.png"
   Valkryja.DefenceIcons["Infravision"] = Valkryja.SystemPath.."img/defences/icon-infravision.png"
48

49 50 51 52 53 54
   Valkryja.DefenceIcons["DetectAlignment"]    = Valkryja.SystemPath.."img/defences/icon-placeholder.png"
   Valkryja.DefenceIcons["DetectIllusion"]     = Valkryja.SystemPath.."img/defences/icon-placeholder.png"
   Valkryja.DefenceIcons["DetectInvisibility"] = Valkryja.SystemPath.."img/defences/icon-placeholder.png"
   Valkryja.DefenceIcons["DetectMagic"]        = Valkryja.SystemPath.."img/defences/icon-placeholder.png"
   Valkryja.DefenceIcons["Levitation"]         = Valkryja.SystemPath.."img/defences/icon-levitation.png"
   Valkryja.DefenceIcons["PassDoor"]           = Valkryja.SystemPath.."img/defences/icon-placeholder.png"
55

56 57
   Valkryja.DefenceIcons["Sanctuary"]  = Valkryja.SystemPath.."img/defences/icon-cloak.png"
   Valkryja.DefenceIcons["FireShield"] = Valkryja.SystemPath.."img/defences/icon-thermalshield.png"
58

59
   Valkryja.DefenceIcons["ImmutableNimbus"] = Valkryja.SystemPath.."img/defences/icon-placeholder.png"
60 61
end

62 63
function Valkryja.LoadDefenceTooltips()
   Valkryja.DefenceTooltips = Valkryja.DefenceTooltips or {};
64 65 66 67
end

-- END OF SCRIPT
-- ============================================================================</script>
Maiyannah Bishop's avatar
Maiyannah Bishop committed
68 69 70 71 72
			<eventHandlerList />
		</Script>
		<ScriptGroup isActive="yes" isFolder="yes">
			<name>GMCP</name>
			<packageName></packageName>
73
			<script></script>
Maiyannah Bishop's avatar
Maiyannah Bishop committed
74 75 76 77 78
			<eventHandlerList />
			<Script isActive="yes" isFolder="no">
				<name>Character.MM.GMCP_CharStats</name>
				<packageName></packageName>
				<script>function Character.MM.GMCP_CharStats()
79 80
   -- Bail if this isn't MM
   if (not Valkryja.isMateriaMagica()) then return end
81 82 83 84 85 86 87 88 89 90
    
    -- bind current GMCP state
    stats = gmcp.char.stats
    
    -- make sure relevant tables are initialised
    Character = Character or {};
    Character.Attributes = Character.Attributes or {};
    Character.SavingThrows = Character.SavingThrows or {};
    
    -- assign stats to appropriate variables
91
   Character.Attributes.Sanity      = stats.sanity
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
    Character.Attributes.Strength    = stats.strength
    Character.Attributes.Knowledge   = stats.knowledge
    Character.Attributes.Courage     = stats.courage
    Character.Attributes.Agility     = stats.agility
    Character.Attributes.Luck        = stats.luck
    Character.Attributes.Vitality    = stats.vitality
    Character.Attributes.Wisdom      = stats.wisdom
    Character.Attributes.Personality = stats.personality
    
    -- assign saving throws to appropriate variables
    Character.SavingThrows.Rod           = stats["saving-rod"]
    Character.SavingThrows.Breath        = stats["saving-breath"]
    Character.SavingThrows.Petrification = stats["saving-petri"]
    Character.SavingThrows.Paralysis     = stats["saving-paralysis"]
    Character.SavingThrows.Spell         = stats["saving-spell"]
    
    -- garbage collection
    stats = nil
110 111 112 113
end

-- END OF SCRIPT
-- ============================================================================</script>
Maiyannah Bishop's avatar
Maiyannah Bishop committed
114 115 116 117 118 119 120 121
				<eventHandlerList>
					<string>gmcp.char.stats</string>
				</eventHandlerList>
			</Script>
			<Script isActive="yes" isFolder="no">
				<name>Character.MM.GMCP_CharBase</name>
				<packageName></packageName>
				<script>function Character.MM.GMCP_CharBase()
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146
   -- Bail if this isn't MM
    if (not Valkryja.isMateriaMagica()) then
       return
   end

   send("protocols gmcp sendchar")

   -- Initialize variables
   local stats    = gmcp.char.base
   local name     = stats.name
   local sex      = stats.sex
   local race     = stats.race
   local class1   = stats.class1
   local class2   = stats.class2
   local class3   = stats.class3
   local class4   = stats.class4
   local playtime = tonumber(stats.hoursplayed)

   -- Assign variables to appropriate class properties
   Character.Vitals.Name = name
   Character.Vitals.Sex  = sex
   Character.Vitals.Race = race

   -- Update the UI
   Kauna.UpdateName()
147 148 149 150
end

-- END OF SCRIPT
-- ============================================================================</script>
Maiyannah Bishop's avatar
Maiyannah Bishop committed
151 152 153 154 155 156 157 158
				<eventHandlerList />
			</Script>
		</ScriptGroup>
	</ScriptPackage>
	<KeyPackage />
	<HelpPackage>
		<helpURL></helpURL>
	</HelpPackage>
159
</MudletPackage>