One thing I do with my admin editor for porting spells from my old spell system into the new fancier one was converting database records into JSON, or some other type of object. In my case, it's a Ruby Hash object.
So, that would take a Spell record, convert it to a hash, along with all the dependent data. Something like:
Code: Select all
{
"type" => 0,
"cast_type" => 0,
"name" => "Thunderbolt",
"description" => "Instantly deals a significant amount of magic damage to a target.",
"icon" => 233,
"icon_heroic_op" => 14,
"icon_backdrop" => 315,
"class_skill" => 0,
"mastery_skill" => 0,
"min_class_skill_req" => 0,
"duration_until_cancel" => false,
"target_type" => 1,
"success_message" => "%t has finished casting Thunderbolt.",
"fade_message" => "Thunderbolt fades from %t.",
"interruptable" => true,
"cast_while_moving" => false,
"lua_script" => "Spells/Priest/Druid/Fury/Thunderbolt.lua",
"spell_visual" => 2497,
"effect_message" => "%t was affected by Thunderbolt",
"spell_book_type" => 0,
"can_effect_raid" => false,
"affect_only_group_members" => false,
"display_spell_tier" => false,
"friendly_spell" => false,
"group_spell" => false,
"spell_type" => 0,
"det_type" => 0,
"control_effect_type" => 0,
"incurable" => false,
"not_maintained" => false,
"casting_flags" => 0,
"persist_through_death" => false,
"savage_bar" => 0,
"savage_bar_slot" => 0,
"is_active" => 1,
"is_aa" => false,
"is_deity" => false,
"deity" => 0,
"last_auto_update" => 0,
"soe_last_update" => 1478011145,
"spell_tier" => {
"hp_req" => 0,
"hp_req_percent" => 0,
"hp_upkeep" => 0,
"power_req" => 92,
"power_req_percent" => 0,
"power_upkeep" => 0,
"savagery_req" => 0,
"savagery_req_percent" => 0,
"savagery_upkeep" => 0,
"dissonance_req" => 0,
"dissonance_req_percent" => 0,
"dissonance_upkeep" => 0,
"req_concentration" => 0,
"cast_time" => 300,
"recovery" => 50.0,
"recast" => 15.0,
"radius" => 0.0,
"max_aoe_targets" => 0,
"min_range" => 0.0,
"range" => 30.0,
"duration1" => 0,
"duration2" => 0,
"resistibility" => 0.748,
"hit_bonus" => 0.0,
"call_frequency" => 0,
"unknown9" => 0,
"given_by" => ""},
"spell_data" => [
{"index_field" => 0, "value_type" => "INT", "value" => "253", "value2" => "0"},
{"index_field" => 1, "value_type" => "INT", "value" => "421", "value2" => "0"}
],
"spell_display_effects" => [
{
"percentage" => 100,
"description" => "Inflicts 253 - 421 magic damage on target",
"bullet" => 0,
"index" => 0
}
]
}
And then there's a method that takes that and re-inserts the records into each table.
Nothing too crazy. If people were okay with nuking their entire zone population each time, that's easy enough to do.
Otherwise, we need to start getting into comparisons and do smarter updates. Still doable, I would think, but would take some more thought.