diff --git a/_module/are/aschentryandooc.are.json b/_module/are/aschentryandooc.are.json index 3d814d2c..d961c277 100644 --- a/_module/are/aschentryandooc.are.json +++ b/_module/are/aschentryandooc.are.json @@ -1713,7 +1713,7 @@ }, "Version": { "type": "dword", - "value": 3 + "value": 4 }, "Width": { "type": "int", diff --git a/_module/dlg/hs_del_pc.dlg.json b/_module/dlg/hs_del_pc.dlg.json new file mode 100644 index 00000000..6ea71548 --- /dev/null +++ b/_module/dlg/hs_del_pc.dlg.json @@ -0,0 +1,631 @@ +{ + "__data_type": "DLG ", + "DelayEntry": { + "type": "dword", + "value": 0 + }, + "DelayReply": { + "type": "dword", + "value": 0 + }, + "EndConverAbort": { + "type": "resref", + "value": "nw_walk_wp" + }, + "EndConversation": { + "type": "resref", + "value": "nw_walk_wp" + }, + "EntryList": { + "type": "list", + "value": [ + { + "__struct_id": 0, + "ActionParams": { + "type": "list", + "value": [] + }, + "Animation": { + "type": "dword", + "value": 0 + }, + "AnimLoop": { + "type": "byte", + "value": 1 + }, + "Comment": { + "type": "cexostring", + "value": "" + }, + "Delay": { + "type": "dword", + "value": 4294967295 + }, + "Quest": { + "type": "cexostring", + "value": "" + }, + "RepliesList": { + "type": "list", + "value": [ + { + "__struct_id": 0, + "Active": { + "type": "resref", + "value": "" + }, + "ConditionParams": { + "type": "list", + "value": [] + }, + "Index": { + "type": "dword", + "value": 1 + }, + "IsChild": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 1, + "Active": { + "type": "resref", + "value": "" + }, + "ConditionParams": { + "type": "list", + "value": [] + }, + "Index": { + "type": "dword", + "value": 0 + }, + "IsChild": { + "type": "byte", + "value": 0 + } + } + ] + }, + "Script": { + "type": "resref", + "value": "" + }, + "Sound": { + "type": "resref", + "value": "" + }, + "Speaker": { + "type": "cexostring", + "value": "" + }, + "Text": { + "type": "cexolocstring", + "value": { + "0": "What do you need, mortal?" + } + } + }, + { + "__struct_id": 1, + "ActionParams": { + "type": "list", + "value": [] + }, + "Animation": { + "type": "dword", + "value": 0 + }, + "AnimLoop": { + "type": "byte", + "value": 1 + }, + "Comment": { + "type": "cexostring", + "value": "" + }, + "Delay": { + "type": "dword", + "value": 4294967295 + }, + "Quest": { + "type": "cexostring", + "value": "" + }, + "RepliesList": { + "type": "list", + "value": [ + { + "__struct_id": 0, + "Active": { + "type": "resref", + "value": "" + }, + "ConditionParams": { + "type": "list", + "value": [] + }, + "Index": { + "type": "dword", + "value": 3 + }, + "IsChild": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 1, + "Active": { + "type": "resref", + "value": "" + }, + "ConditionParams": { + "type": "list", + "value": [] + }, + "Index": { + "type": "dword", + "value": 2 + }, + "IsChild": { + "type": "byte", + "value": 0 + } + } + ] + }, + "Script": { + "type": "resref", + "value": "" + }, + "Sound": { + "type": "resref", + "value": "" + }, + "Speaker": { + "type": "cexostring", + "value": "" + }, + "Text": { + "type": "cexolocstring", + "value": { + "0": "You'd like to delete this character from the server vault?" + } + } + }, + { + "__struct_id": 2, + "ActionParams": { + "type": "list", + "value": [] + }, + "Animation": { + "type": "dword", + "value": 0 + }, + "AnimLoop": { + "type": "byte", + "value": 1 + }, + "Comment": { + "type": "cexostring", + "value": "" + }, + "Delay": { + "type": "dword", + "value": 4294967295 + }, + "Quest": { + "type": "cexostring", + "value": "" + }, + "RepliesList": { + "type": "list", + "value": [ + { + "__struct_id": 0, + "Active": { + "type": "resref", + "value": "" + }, + "ConditionParams": { + "type": "list", + "value": [] + }, + "Index": { + "type": "dword", + "value": 5 + }, + "IsChild": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 1, + "Active": { + "type": "resref", + "value": "" + }, + "ConditionParams": { + "type": "list", + "value": [] + }, + "Index": { + "type": "dword", + "value": 4 + }, + "IsChild": { + "type": "byte", + "value": 0 + } + } + ] + }, + "Script": { + "type": "resref", + "value": "" + }, + "Sound": { + "type": "resref", + "value": "" + }, + "Speaker": { + "type": "cexostring", + "value": "" + }, + "Text": { + "type": "cexolocstring", + "value": { + "0": " Are you certain? You will be booted from the server. When you come back your character will be deleted. This cannot be undone, and there is nothing the server admins or DMs can do to undelete this character." + } + } + } + ] + }, + "NumWords": { + "type": "dword", + "value": 67 + }, + "PreventZoomIn": { + "type": "byte", + "value": 0 + }, + "ReplyList": { + "type": "list", + "value": [ + { + "__struct_id": 0, + "ActionParams": { + "type": "list", + "value": [] + }, + "Animation": { + "type": "dword", + "value": 0 + }, + "AnimLoop": { + "type": "byte", + "value": 1 + }, + "Comment": { + "type": "cexostring", + "value": "" + }, + "Delay": { + "type": "dword", + "value": 4294967295 + }, + "EntriesList": { + "type": "list", + "value": [] + }, + "Quest": { + "type": "cexostring", + "value": "" + }, + "Script": { + "type": "resref", + "value": "" + }, + "Sound": { + "type": "resref", + "value": "" + }, + "Text": { + "type": "cexolocstring", + "value": { + "0": "Done" + } + } + }, + { + "__struct_id": 1, + "ActionParams": { + "type": "list", + "value": [] + }, + "Animation": { + "type": "dword", + "value": 0 + }, + "AnimLoop": { + "type": "byte", + "value": 1 + }, + "Comment": { + "type": "cexostring", + "value": "" + }, + "Delay": { + "type": "dword", + "value": 4294967295 + }, + "EntriesList": { + "type": "list", + "value": [ + { + "__struct_id": 0, + "Active": { + "type": "resref", + "value": "" + }, + "ConditionParams": { + "type": "list", + "value": [] + }, + "Index": { + "type": "dword", + "value": 1 + }, + "IsChild": { + "type": "byte", + "value": 0 + } + } + ] + }, + "Quest": { + "type": "cexostring", + "value": "" + }, + "Script": { + "type": "resref", + "value": "" + }, + "Sound": { + "type": "resref", + "value": "" + }, + "Text": { + "type": "cexolocstring", + "value": { + "0": "I'd like to delete this character." + } + } + }, + { + "__struct_id": 2, + "ActionParams": { + "type": "list", + "value": [] + }, + "Animation": { + "type": "dword", + "value": 0 + }, + "AnimLoop": { + "type": "byte", + "value": 1 + }, + "Comment": { + "type": "cexostring", + "value": "" + }, + "Delay": { + "type": "dword", + "value": 4294967295 + }, + "EntriesList": { + "type": "list", + "value": [] + }, + "Quest": { + "type": "cexostring", + "value": "" + }, + "Script": { + "type": "resref", + "value": "" + }, + "Sound": { + "type": "resref", + "value": "" + }, + "Text": { + "type": "cexolocstring", + "value": { + "0": "No." + } + } + }, + { + "__struct_id": 3, + "ActionParams": { + "type": "list", + "value": [] + }, + "Animation": { + "type": "dword", + "value": 0 + }, + "AnimLoop": { + "type": "byte", + "value": 1 + }, + "Comment": { + "type": "cexostring", + "value": "" + }, + "Delay": { + "type": "dword", + "value": 4294967295 + }, + "EntriesList": { + "type": "list", + "value": [ + { + "__struct_id": 0, + "Active": { + "type": "resref", + "value": "" + }, + "ConditionParams": { + "type": "list", + "value": [] + }, + "Index": { + "type": "dword", + "value": 2 + }, + "IsChild": { + "type": "byte", + "value": 0 + } + } + ] + }, + "Quest": { + "type": "cexostring", + "value": "" + }, + "Script": { + "type": "resref", + "value": "" + }, + "Sound": { + "type": "resref", + "value": "" + }, + "Text": { + "type": "cexolocstring", + "value": { + "0": "Yes." + } + } + }, + { + "__struct_id": 4, + "ActionParams": { + "type": "list", + "value": [] + }, + "Animation": { + "type": "dword", + "value": 0 + }, + "AnimLoop": { + "type": "byte", + "value": 1 + }, + "Comment": { + "type": "cexostring", + "value": "" + }, + "Delay": { + "type": "dword", + "value": 4294967295 + }, + "EntriesList": { + "type": "list", + "value": [] + }, + "Quest": { + "type": "cexostring", + "value": "" + }, + "Script": { + "type": "resref", + "value": "" + }, + "Sound": { + "type": "resref", + "value": "" + }, + "Text": { + "type": "cexolocstring", + "value": { + "0": "No, my mistake." + } + } + }, + { + "__struct_id": 5, + "ActionParams": { + "type": "list", + "value": [] + }, + "Animation": { + "type": "dword", + "value": 0 + }, + "AnimLoop": { + "type": "byte", + "value": 1 + }, + "Comment": { + "type": "cexostring", + "value": "" + }, + "Delay": { + "type": "dword", + "value": 4294967295 + }, + "EntriesList": { + "type": "list", + "value": [] + }, + "Quest": { + "type": "cexostring", + "value": "" + }, + "Script": { + "type": "resref", + "value": "dante_letodel_at" + }, + "Sound": { + "type": "resref", + "value": "" + }, + "Text": { + "type": "cexolocstring", + "value": { + "0": "Yes, proceed." + } + } + } + ] + }, + "StartingList": { + "type": "list", + "value": [ + { + "__struct_id": 0, + "Active": { + "type": "resref", + "value": "" + }, + "ConditionParams": { + "type": "list", + "value": [] + }, + "Index": { + "type": "dword", + "value": 0 + } + } + ] + } +} diff --git a/_module/gic/aschentryandooc.gic.json b/_module/gic/aschentryandooc.gic.json index e4cfebdc..7e86c5a2 100644 --- a/_module/gic/aschentryandooc.gic.json +++ b/_module/gic/aschentryandooc.gic.json @@ -2,7 +2,15 @@ "__data_type": "GIC ", "Creature List": { "type": "list", - "value": [] + "value": [ + { + "__struct_id": 4, + "Comment": { + "type": "cexostring", + "value": "" + } + } + ] }, "Door List": { "type": "list", diff --git a/_module/git/aschentryandooc.git.json b/_module/git/aschentryandooc.git.json index 9ad70aa2..9f4826d7 100644 --- a/_module/git/aschentryandooc.git.json +++ b/_module/git/aschentryandooc.git.json @@ -45,7 +45,655 @@ }, "Creature List": { "type": "list", - "value": [] + "value": [ + { + "__struct_id": 4, + "Appearance_Type": { + "type": "word", + "value": 1096 + }, + "BodyBag": { + "type": "byte", + "value": 0 + }, + "Cha": { + "type": "byte", + "value": 18 + }, + "ChallengeRating": { + "type": "float", + "value": 7.0 + }, + "ClassList": { + "type": "list", + "value": [ + { + "__struct_id": 2, + "Class": { + "type": "int", + "value": 5 + }, + "ClassLevel": { + "type": "short", + "value": 1 + } + }, + { + "__struct_id": 2, + "Class": { + "type": "int", + "value": 4 + }, + "ClassLevel": { + "type": "short", + "value": 1 + } + }, + { + "__struct_id": 2, + "Class": { + "type": "int", + "value": 19 + }, + "ClassLevel": { + "type": "short", + "value": 1 + } + } + ] + }, + "Con": { + "type": "byte", + "value": 12 + }, + "Conversation": { + "type": "resref", + "value": "hs_del_pc" + }, + "CRAdjust": { + "type": "int", + "value": 0 + }, + "CurrentHitPoints": { + "type": "short", + "value": 308 + }, + "DecayTime": { + "type": "dword", + "value": 5000 + }, + "Deity": { + "type": "cexostring", + "value": "" + }, + "Description": { + "type": "cexolocstring", + "value": { + "0": "Talk to this creature if you need to delete your character." + } + }, + "Dex": { + "type": "byte", + "value": 22 + }, + "Disarmable": { + "type": "byte", + "value": 0 + }, + "Equip_ItemList": { + "type": "list", + "value": [] + }, + "FactionID": { + "type": "word", + "value": 3 + }, + "FeatList": { + "type": "list", + "value": [ + { + "__struct_id": 1, + "Feat": { + "type": "word", + "value": 2 + } + }, + { + "__struct_id": 1, + "Feat": { + "type": "word", + "value": 3 + } + }, + { + "__struct_id": 1, + "Feat": { + "type": "word", + "value": 4 + } + }, + { + "__struct_id": 1, + "Feat": { + "type": "word", + "value": 32 + } + }, + { + "__struct_id": 1, + "Feat": { + "type": "word", + "value": 45 + } + }, + { + "__struct_id": 1, + "Feat": { + "type": "word", + "value": 49 + } + }, + { + "__struct_id": 1, + "Feat": { + "type": "word", + "value": 46 + } + } + ] + }, + "FirstName": { + "type": "cexolocstring", + "value": { + "0": "Annihilus" + } + }, + "fortbonus": { + "type": "short", + "value": 0 + }, + "Gender": { + "type": "byte", + "value": 4 + }, + "GoodEvil": { + "type": "byte", + "value": 50 + }, + "HitPoints": { + "type": "short", + "value": 308 + }, + "Int": { + "type": "byte", + "value": 12 + }, + "Interruptable": { + "type": "byte", + "value": 1 + }, + "IsImmortal": { + "type": "byte", + "value": 1 + }, + "IsPC": { + "type": "byte", + "value": 0 + }, + "LastName": { + "type": "cexolocstring", + "value": { + "0": "" + } + }, + "LawfulChaotic": { + "type": "byte", + "value": 50 + }, + "Lootable": { + "type": "byte", + "value": 0 + }, + "MaxHitPoints": { + "type": "short", + "value": 311 + }, + "NaturalAC": { + "type": "byte", + "value": 40 + }, + "NoPermDeath": { + "type": "byte", + "value": 1 + }, + "PerceptionRange": { + "type": "byte", + "value": 8 + }, + "Phenotype": { + "type": "int", + "value": 0 + }, + "Plot": { + "type": "byte", + "value": 1 + }, + "PortraitId": { + "type": "word", + "value": 2236 + }, + "Race": { + "type": "byte", + "value": 24 + }, + "refbonus": { + "type": "short", + "value": 0 + }, + "ScriptAttacked": { + "type": "resref", + "value": "x2_def_attacked" + }, + "ScriptDamaged": { + "type": "resref", + "value": "x2_def_ondamage" + }, + "ScriptDeath": { + "type": "resref", + "value": "x2_def_ondeath" + }, + "ScriptDialogue": { + "type": "resref", + "value": "x2_def_onconv" + }, + "ScriptDisturbed": { + "type": "resref", + "value": "x2_def_ondisturb" + }, + "ScriptEndRound": { + "type": "resref", + "value": "x2_def_endcombat" + }, + "ScriptHeartbeat": { + "type": "resref", + "value": "x2_def_heartbeat" + }, + "ScriptOnBlocked": { + "type": "resref", + "value": "x2_def_onblocked" + }, + "ScriptOnNotice": { + "type": "resref", + "value": "x2_def_percept" + }, + "ScriptRested": { + "type": "resref", + "value": "x2_def_rested" + }, + "ScriptSpawn": { + "type": "resref", + "value": "x2_def_spawn" + }, + "ScriptSpellAt": { + "type": "resref", + "value": "x2_def_spellcast" + }, + "ScriptUserDefine": { + "type": "resref", + "value": "x2_def_userdef" + }, + "SkillList": { + "type": "list", + "value": [ + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 19 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 43 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 5 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 43 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 43 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 30 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 1 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 26 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 40 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + } + ] + }, + "SoundSetFile": { + "type": "word", + "value": 237 + }, + "SpecAbilityList": { + "type": "list", + "value": [] + }, + "StartingPackage": { + "type": "byte", + "value": 24 + }, + "Str": { + "type": "byte", + "value": 14 + }, + "Subrace": { + "type": "cexostring", + "value": "Undead" + }, + "Tag": { + "type": "cexostring", + "value": "NPC_ANNIHILUS001" + }, + "Tail_New": { + "type": "dword", + "value": 0 + }, + "TemplateList": { + "type": "list", + "value": [] + }, + "TemplateResRef": { + "type": "resref", + "value": "npc_annihilus001" + }, + "WalkRate": { + "type": "int", + "value": 1 + }, + "willbonus": { + "type": "short", + "value": 0 + }, + "Wings_New": { + "type": "dword", + "value": 0 + }, + "Wis": { + "type": "byte", + "value": 8 + }, + "XOrientation": { + "type": "float", + "value": -0.817584753036499 + }, + "XPosition": { + "type": "float", + "value": 52.74438858032227 + }, + "YOrientation": { + "type": "float", + "value": 0.5758082866668701 + }, + "YPosition": { + "type": "float", + "value": 17.56797981262207 + }, + "ZPosition": { + "type": "float", + "value": 0.9771342277526856 + } + } + ] }, "Door List": { "type": "list", diff --git a/_module/ifo/module.ifo.json b/_module/ifo/module.ifo.json index 56c9c079..6dbe1c68 100644 --- a/_module/ifo/module.ifo.json +++ b/_module/ifo/module.ifo.json @@ -1327,15 +1327,15 @@ }, "Mod_Entry_X": { "type": "float", - "value": 25.99450874328613 + "value": 25.0 }, "Mod_Entry_Y": { "type": "float", - "value": 51.19573593139648 + "value": 51.0 }, "Mod_Entry_Z": { "type": "float", - "value": 0.6348279118537903 + "value": 0.0 }, "Mod_Expan_List": { "type": "list", @@ -1895,6 +1895,66 @@ "type": "int", "value": 0 } + }, + { + "__struct_id": 0, + "Name": { + "type": "cexostring", + "value": "PRC_AUTO_IDENTIFY_ON_ACQUIRE" + }, + "Type": { + "type": "dword", + "value": 1 + }, + "Value": { + "type": "int", + "value": 1 + } + }, + { + "__struct_id": 0, + "Name": { + "type": "cexostring", + "value": "PRC_MULTISUMMON" + }, + "Type": { + "type": "dword", + "value": 1 + }, + "Value": { + "type": "int", + "value": 1 + } + }, + { + "__struct_id": 0, + "Name": { + "type": "cexostring", + "value": "PRC_PW_LOCATION_TRACKING" + }, + "Type": { + "type": "dword", + "value": 1 + }, + "Value": { + "type": "int", + "value": 1 + } + }, + { + "__struct_id": 0, + "Name": { + "type": "cexostring", + "value": "PRC_PW_MAPPIN_TRACKING" + }, + "Type": { + "type": "dword", + "value": 1 + }, + "Value": { + "type": "int", + "value": 1 + } } ] } diff --git a/_module/itp/creaturepalcus.itp.json b/_module/itp/creaturepalcus.itp.json index 7dae1177..5fac7c45 100644 --- a/_module/itp/creaturepalcus.itp.json +++ b/_module/itp/creaturepalcus.itp.json @@ -16048,6 +16048,25 @@ "LIST": { "type": "list", "value": [ + { + "__struct_id": 0, + "CR": { + "type": "float", + "value": 7.0 + }, + "FACTION": { + "type": "cexostring", + "value": "Merchant" + }, + "NAME": { + "type": "cexostring", + "value": "Annihilus" + }, + "RESREF": { + "type": "resref", + "value": "npc_annihilus001" + } + }, { "__struct_id": 0, "CR": { @@ -19433,6 +19452,25 @@ "value": "prc_pm_mage2" } }, + { + "__struct_id": 0, + "CR": { + "type": "float", + "value": 3.0 + }, + "FACTION": { + "type": "cexostring", + "value": "Defender" + }, + "NAME": { + "type": "cexostring", + "value": "Spiritual Weapon" + }, + "RESREF": { + "type": "resref", + "value": "prc_spirit_weapn" + } + }, { "__struct_id": 0, "CR": { diff --git a/_module/itp/itempalcus.itp.json b/_module/itp/itempalcus.itp.json index e6614262..1abed56c 100644 --- a/_module/itp/itempalcus.itp.json +++ b/_module/itp/itempalcus.itp.json @@ -11767,6 +11767,17 @@ "type": "dword", "value": 13146 } + }, + { + "__struct_id": 0, + "NAME": { + "type": "cexostring", + "value": "Unarmed Spiritual Weapon \"Fists\"" + }, + "RESREF": { + "type": "resref", + "value": "prc_sprtwp_armor" + } } ] }, @@ -19356,6 +19367,17 @@ "value": "servantprops4" } }, + { + "__struct_id": 0, + "NAME": { + "type": "cexostring", + "value": "Spiritual Weapon Properties" + }, + "RESREF": { + "type": "resref", + "value": "prc_sprtwpn_hide" + } + }, { "__struct_id": 0, "NAME": { @@ -21066,6 +21088,17 @@ "value": 16807690 } }, + { + "__struct_id": 0, + "NAME": { + "type": "cexostring", + "value": "Spirtual Weapon Slam" + }, + "RESREF": { + "type": "resref", + "value": "prc_sprtwpn_slam" + } + }, { "__struct_id": 0, "RESREF": { @@ -50325,11 +50358,88 @@ "__struct_id": 0, "RESREF": { "type": "resref", - "value": "prc_scr_997" + "value": "prc_scr_865" }, "STRREF": { "type": "dword", - "value": 16790493 + "value": 16790497 + } + }, + { + "__struct_id": 0, + "RESREF": { + "type": "resref", + "value": "prc_scr_868" + }, + "STRREF": { + "type": "dword", + "value": 16790502 + } + }, + { + "__struct_id": 0, + "RESREF": { + "type": "resref", + "value": "prc_scr_871" + }, + "STRREF": { + "type": "dword", + "value": 16790507 + } + }, + { + "__struct_id": 0, + "RESREF": { + "type": "resref", + "value": "prc_scr_874" + }, + "STRREF": { + "type": "dword", + "value": 16790512 + } + }, + { + "__struct_id": 0, + "RESREF": { + "type": "resref", + "value": "prc_scr_877" + }, + "STRREF": { + "type": "dword", + "value": 16790517 + } + }, + { + "__struct_id": 0, + "RESREF": { + "type": "resref", + "value": "prc_scr_880" + }, + "STRREF": { + "type": "dword", + "value": 16790522 + } + }, + { + "__struct_id": 0, + "RESREF": { + "type": "resref", + "value": "prc_scr_881" + }, + "STRREF": { + "type": "dword", + "value": 16790525 + } + }, + { + "__struct_id": 0, + "RESREF": { + "type": "resref", + "value": "prc_scr_884" + }, + "STRREF": { + "type": "dword", + "value": 16790530 } }, { @@ -52268,6 +52378,17 @@ "value": "scribe011" } }, + { + "__struct_id": 0, + "RESREF": { + "type": "resref", + "value": "prc_scr_997" + }, + "STRREF": { + "type": "dword", + "value": 16790493 + } + }, { "__struct_id": 0, "RESREF": { @@ -64827,7 +64948,7 @@ }, "RESREF": { "type": "resref", - "value": "mc_blckstickbloo" + "value": "mc_blckstickbld" } }, { @@ -65014,7 +65135,7 @@ }, "RESREF": { "type": "resref", - "value": "mc_pieceofleathe" + "value": "mc_pieceofleathr" } }, { @@ -69128,7 +69249,7 @@ }, "RESREF": { "type": "resref", - "value": "mc_grasshopperhl" + "value": "mc_grasshopprhlg" } }, { diff --git a/_module/ncs/_area_despawner.ncs b/_module/ncs/_area_despawner.ncs index 45440fa3..9953417c 100644 Binary files a/_module/ncs/_area_despawner.ncs and b/_module/ncs/_area_despawner.ncs differ diff --git a/_module/ncs/_chest_respawn.ncs b/_module/ncs/_chest_respawn.ncs index d1b5d6f7..32a3d818 100644 Binary files a/_module/ncs/_chest_respawn.ncs and b/_module/ncs/_chest_respawn.ncs differ diff --git a/_module/ncs/_closelockdoor.ncs b/_module/ncs/_closelockdoor.ncs index 8e50de9c..129e75b4 100644 Binary files a/_module/ncs/_closelockdoor.ncs and b/_module/ncs/_closelockdoor.ncs differ diff --git a/_module/ncs/_craft_alchemist.ncs b/_module/ncs/_craft_alchemist.ncs index dc426b72..137b139a 100644 Binary files a/_module/ncs/_craft_alchemist.ncs and b/_module/ncs/_craft_alchemist.ncs differ diff --git a/_module/ncs/_craft_anvil.ncs b/_module/ncs/_craft_anvil.ncs index 6573c588..b80eb69a 100644 Binary files a/_module/ncs/_craft_anvil.ncs and b/_module/ncs/_craft_anvil.ncs differ diff --git a/_module/ncs/_craft_beehive.ncs b/_module/ncs/_craft_beehive.ncs index e1cb473e..63c4c3c7 100644 Binary files a/_module/ncs/_craft_beehive.ncs and b/_module/ncs/_craft_beehive.ncs differ diff --git a/_module/ncs/_craft_bowyer.ncs b/_module/ncs/_craft_bowyer.ncs index fa4a34cc..ac51b070 100644 Binary files a/_module/ncs/_craft_bowyer.ncs and b/_module/ncs/_craft_bowyer.ncs differ diff --git a/_module/ncs/_craft_brewvat.ncs b/_module/ncs/_craft_brewvat.ncs index c9347683..ef65de05 100644 Binary files a/_module/ncs/_craft_brewvat.ncs and b/_module/ncs/_craft_brewvat.ncs differ diff --git a/_module/ncs/_craft_carpentry.ncs b/_module/ncs/_craft_carpentry.ncs index 056bdddc..babd6e03 100644 Binary files a/_module/ncs/_craft_carpentry.ncs and b/_module/ncs/_craft_carpentry.ncs differ diff --git a/_module/ncs/_craft_cook.ncs b/_module/ncs/_craft_cook.ncs index 22e71f27..e3eb90b3 100644 Binary files a/_module/ncs/_craft_cook.ncs and b/_module/ncs/_craft_cook.ncs differ diff --git a/_module/ncs/_craft_digester.ncs b/_module/ncs/_craft_digester.ncs index 4271067e..54380f9f 100644 Binary files a/_module/ncs/_craft_digester.ncs and b/_module/ncs/_craft_digester.ncs differ diff --git a/_module/ncs/_craft_dyetub.ncs b/_module/ncs/_craft_dyetub.ncs index 6623553e..c93cd654 100644 Binary files a/_module/ncs/_craft_dyetub.ncs and b/_module/ncs/_craft_dyetub.ncs differ diff --git a/_module/ncs/_craft_fishing.ncs b/_module/ncs/_craft_fishing.ncs index d2a15869..ab62d0e7 100644 Binary files a/_module/ncs/_craft_fishing.ncs and b/_module/ncs/_craft_fishing.ncs differ diff --git a/_module/ncs/_craft_fishing2.ncs b/_module/ncs/_craft_fishing2.ncs index b0b09af3..9ebf2eb3 100644 Binary files a/_module/ncs/_craft_fishing2.ncs and b/_module/ncs/_craft_fishing2.ncs differ diff --git a/_module/ncs/_craft_fletching.ncs b/_module/ncs/_craft_fletching.ncs index 1afdc615..ba28e5b1 100644 Binary files a/_module/ncs/_craft_fletching.ncs and b/_module/ncs/_craft_fletching.ncs differ diff --git a/_module/ncs/_craft_forge.ncs b/_module/ncs/_craft_forge.ncs index 04160a59..4f11651d 100644 Binary files a/_module/ncs/_craft_forge.ncs and b/_module/ncs/_craft_forge.ncs differ diff --git a/_module/ncs/_craft_forge_bak.ncs b/_module/ncs/_craft_forge_bak.ncs index 12680f6f..451f225c 100644 Binary files a/_module/ncs/_craft_forge_bak.ncs and b/_module/ncs/_craft_forge_bak.ncs differ diff --git a/_module/ncs/_craft_gembath.ncs b/_module/ncs/_craft_gembath.ncs index ef879a32..4bc6737b 100644 Binary files a/_module/ncs/_craft_gembath.ncs and b/_module/ncs/_craft_gembath.ncs differ diff --git a/_module/ncs/_craft_gemcutter.ncs b/_module/ncs/_craft_gemcutter.ncs index a3233eb1..53da6a7b 100644 Binary files a/_module/ncs/_craft_gemcutter.ncs and b/_module/ncs/_craft_gemcutter.ncs differ diff --git a/_module/ncs/_craft_gempolish.ncs b/_module/ncs/_craft_gempolish.ncs index 1150bc39..34cd1523 100644 Binary files a/_module/ncs/_craft_gempolish.ncs and b/_module/ncs/_craft_gempolish.ncs differ diff --git a/_module/ncs/_craft_hb_cook.ncs b/_module/ncs/_craft_hb_cook.ncs index f85eeeff..2f3d3566 100644 Binary files a/_module/ncs/_craft_hb_cook.ncs and b/_module/ncs/_craft_hb_cook.ncs differ diff --git a/_module/ncs/_craft_jeweler.ncs b/_module/ncs/_craft_jeweler.ncs index f645e10c..a56631c3 100644 Binary files a/_module/ncs/_craft_jeweler.ncs and b/_module/ncs/_craft_jeweler.ncs differ diff --git a/_module/ncs/_craft_juice.ncs b/_module/ncs/_craft_juice.ncs index 412bab36..9cbd35d1 100644 Binary files a/_module/ncs/_craft_juice.ncs and b/_module/ncs/_craft_juice.ncs differ diff --git a/_module/ncs/_craft_kiln.ncs b/_module/ncs/_craft_kiln.ncs index 5a5c608b..86326597 100644 Binary files a/_module/ncs/_craft_kiln.ncs and b/_module/ncs/_craft_kiln.ncs differ diff --git a/_module/ncs/_craft_lauter.ncs b/_module/ncs/_craft_lauter.ncs index bc30686e..c2c4c8b2 100644 Binary files a/_module/ncs/_craft_lauter.ncs and b/_module/ncs/_craft_lauter.ncs differ diff --git a/_module/ncs/_craft_leathrwrk.ncs b/_module/ncs/_craft_leathrwrk.ncs index 6e6ee138..c0d32eb9 100644 Binary files a/_module/ncs/_craft_leathrwrk.ncs and b/_module/ncs/_craft_leathrwrk.ncs differ diff --git a/_module/ncs/_craft_loom.ncs b/_module/ncs/_craft_loom.ncs index 3bb0b75a..5b9e9b96 100644 Binary files a/_module/ncs/_craft_loom.ncs and b/_module/ncs/_craft_loom.ncs differ diff --git a/_module/ncs/_craft_map.ncs b/_module/ncs/_craft_map.ncs index 77ff9022..5abd6f38 100644 Binary files a/_module/ncs/_craft_map.ncs and b/_module/ncs/_craft_map.ncs differ diff --git a/_module/ncs/_craft_mash.ncs b/_module/ncs/_craft_mash.ncs index ebf3738a..caa73bf3 100644 Binary files a/_module/ncs/_craft_mash.ncs and b/_module/ncs/_craft_mash.ncs differ diff --git a/_module/ncs/_craft_mill.ncs b/_module/ncs/_craft_mill.ncs index d8125e07..1debfe70 100644 Binary files a/_module/ncs/_craft_mill.ncs and b/_module/ncs/_craft_mill.ncs differ diff --git a/_module/ncs/_craft_papermill.ncs b/_module/ncs/_craft_papermill.ncs index c09a066e..2e38e094 100644 Binary files a/_module/ncs/_craft_papermill.ncs and b/_module/ncs/_craft_papermill.ncs differ diff --git a/_module/ncs/_craft_pulp.ncs b/_module/ncs/_craft_pulp.ncs index b459f182..0dfc09c9 100644 Binary files a/_module/ncs/_craft_pulp.ncs and b/_module/ncs/_craft_pulp.ncs differ diff --git a/_module/ncs/_craft_scribe.ncs b/_module/ncs/_craft_scribe.ncs index 53254e6e..eef4a311 100644 Binary files a/_module/ncs/_craft_scribe.ncs and b/_module/ncs/_craft_scribe.ncs differ diff --git a/_module/ncs/_craft_spider.ncs b/_module/ncs/_craft_spider.ncs index d78a038f..30a8489f 100644 Binary files a/_module/ncs/_craft_spider.ncs and b/_module/ncs/_craft_spider.ncs differ diff --git a/_module/ncs/_craft_spinwhl.ncs b/_module/ncs/_craft_spinwhl.ncs index ce7dfb5f..a93fddb1 100644 Binary files a/_module/ncs/_craft_spinwhl.ncs and b/_module/ncs/_craft_spinwhl.ncs differ diff --git a/_module/ncs/_craft_still.ncs b/_module/ncs/_craft_still.ncs index f15ffea7..e0c39a00 100644 Binary files a/_module/ncs/_craft_still.ncs and b/_module/ncs/_craft_still.ncs differ diff --git a/_module/ncs/_craft_tailor.ncs b/_module/ncs/_craft_tailor.ncs index cd488fc0..911ce660 100644 Binary files a/_module/ncs/_craft_tailor.ncs and b/_module/ncs/_craft_tailor.ncs differ diff --git a/_module/ncs/_craft_tailor2.ncs b/_module/ncs/_craft_tailor2.ncs index d1736fdd..8292030e 100644 Binary files a/_module/ncs/_craft_tailor2.ncs and b/_module/ncs/_craft_tailor2.ncs differ diff --git a/_module/ncs/_craft_tan_bath.ncs b/_module/ncs/_craft_tan_bath.ncs index 8a22ef00..d3dec85b 100644 Binary files a/_module/ncs/_craft_tan_bath.ncs and b/_module/ncs/_craft_tan_bath.ncs differ diff --git a/_module/ncs/_craft_tan_oven.ncs b/_module/ncs/_craft_tan_oven.ncs index bc6568ce..cfd38bf2 100644 Binary files a/_module/ncs/_craft_tan_oven.ncs and b/_module/ncs/_craft_tan_oven.ncs differ diff --git a/_module/ncs/_craft_tink.ncs b/_module/ncs/_craft_tink.ncs index e247dce4..9703c93f 100644 Binary files a/_module/ncs/_craft_tink.ncs and b/_module/ncs/_craft_tink.ncs differ diff --git a/_module/ncs/_craft_tink001.ncs b/_module/ncs/_craft_tink001.ncs index fca6b709..32ee994f 100644 Binary files a/_module/ncs/_craft_tink001.ncs and b/_module/ncs/_craft_tink001.ncs differ diff --git a/_module/ncs/_dmg_mine_rock.ncs b/_module/ncs/_dmg_mine_rock.ncs index 2757afaa..940712ae 100644 Binary files a/_module/ncs/_dmg_mine_rock.ncs and b/_module/ncs/_dmg_mine_rock.ncs differ diff --git a/_module/ncs/_dmg_plant.ncs b/_module/ncs/_dmg_plant.ncs index 9106912f..6fa96c7a 100644 Binary files a/_module/ncs/_dmg_plant.ncs and b/_module/ncs/_dmg_plant.ncs differ diff --git a/_module/ncs/_enchant_armor.ncs b/_module/ncs/_enchant_armor.ncs deleted file mode 100644 index c92e40bc..00000000 Binary files a/_module/ncs/_enchant_armor.ncs and /dev/null differ diff --git a/_module/ncs/_enchant_helm.ncs b/_module/ncs/_enchant_helm.ncs deleted file mode 100644 index 70851d96..00000000 Binary files a/_module/ncs/_enchant_helm.ncs and /dev/null differ diff --git a/_module/ncs/_enchant_shield.ncs b/_module/ncs/_enchant_shield.ncs deleted file mode 100644 index f4d1bbb2..00000000 Binary files a/_module/ncs/_enchant_shield.ncs and /dev/null differ diff --git a/_module/ncs/_enchant_weapon.ncs b/_module/ncs/_enchant_weapon.ncs deleted file mode 100644 index d7425bbf..00000000 Binary files a/_module/ncs/_enchant_weapon.ncs and /dev/null differ diff --git a/_module/ncs/_enter_field.ncs b/_module/ncs/_enter_field.ncs index 0d80b63e..ed99310e 100644 Binary files a/_module/ncs/_enter_field.ncs and b/_module/ncs/_enter_field.ncs differ diff --git a/_module/ncs/_exit_field.ncs b/_module/ncs/_exit_field.ncs index 49b9a635..c3f1b0e9 100644 Binary files a/_module/ncs/_exit_field.ncs and b/_module/ncs/_exit_field.ncs differ diff --git a/_module/ncs/_gen_treasure.ncs b/_module/ncs/_gen_treasure.ncs deleted file mode 100644 index ecb1c72d..00000000 Binary files a/_module/ncs/_gen_treasure.ncs and /dev/null differ diff --git a/_module/ncs/_kill_mine_rock.ncs b/_module/ncs/_kill_mine_rock.ncs index 5b8d40c6..030e6674 100644 Binary files a/_module/ncs/_kill_mine_rock.ncs and b/_module/ncs/_kill_mine_rock.ncs differ diff --git a/_module/ncs/_kill_plant.ncs b/_module/ncs/_kill_plant.ncs index 229f3553..b7c2a4de 100644 Binary files a/_module/ncs/_kill_plant.ncs and b/_module/ncs/_kill_plant.ncs differ diff --git a/_module/ncs/_map_chst_spawn.ncs b/_module/ncs/_map_chst_spawn.ncs index 641521ff..6acc8b65 100644 Binary files a/_module/ncs/_map_chst_spawn.ncs and b/_module/ncs/_map_chst_spawn.ncs differ diff --git a/_module/ncs/_map_chst_spawn2.ncs b/_module/ncs/_map_chst_spawn2.ncs index bea49947..6b382d2b 100644 Binary files a/_module/ncs/_map_chst_spawn2.ncs and b/_module/ncs/_map_chst_spawn2.ncs differ diff --git a/_module/ncs/_on_active_item.ncs b/_module/ncs/_on_active_item.ncs index a2889631..cb64825d 100644 Binary files a/_module/ncs/_on_active_item.ncs and b/_module/ncs/_on_active_item.ncs differ diff --git a/_module/ncs/_onclose_clear.ncs b/_module/ncs/_onclose_clear.ncs index 8ff9e388..c03e2373 100644 Binary files a/_module/ncs/_onclose_clear.ncs and b/_module/ncs/_onclose_clear.ncs differ diff --git a/_module/ncs/_onclose_clear2.ncs b/_module/ncs/_onclose_clear2.ncs index 5598511c..8edd4819 100644 Binary files a/_module/ncs/_onclose_clear2.ncs and b/_module/ncs/_onclose_clear2.ncs differ diff --git a/_module/ncs/_onclose_clear3.ncs b/_module/ncs/_onclose_clear3.ncs index 3f6748a1..c7bf5536 100644 Binary files a/_module/ncs/_onclose_clear3.ncs and b/_module/ncs/_onclose_clear3.ncs differ diff --git a/_module/ncs/_ondeath_clear.ncs b/_module/ncs/_ondeath_clear.ncs index d5fec494..8bc9c670 100644 Binary files a/_module/ncs/_ondeath_clear.ncs and b/_module/ncs/_ondeath_clear.ncs differ diff --git a/_module/ncs/_open_alchemist.ncs b/_module/ncs/_open_alchemist.ncs index a5f66dc7..4aaf13bb 100644 Binary files a/_module/ncs/_open_alchemist.ncs and b/_module/ncs/_open_alchemist.ncs differ diff --git a/_module/ncs/_open_anvil.ncs b/_module/ncs/_open_anvil.ncs index afd3f8ee..4a82dc15 100644 Binary files a/_module/ncs/_open_anvil.ncs and b/_module/ncs/_open_anvil.ncs differ diff --git a/_module/ncs/_open_anvil2.ncs b/_module/ncs/_open_anvil2.ncs index b1f13c97..b6af66cd 100644 Binary files a/_module/ncs/_open_anvil2.ncs and b/_module/ncs/_open_anvil2.ncs differ diff --git a/_module/ncs/_open_beehive.ncs b/_module/ncs/_open_beehive.ncs index f538f3f4..1f3c5e12 100644 Binary files a/_module/ncs/_open_beehive.ncs and b/_module/ncs/_open_beehive.ncs differ diff --git a/_module/ncs/_open_bowyer.ncs b/_module/ncs/_open_bowyer.ncs index 9ab47647..faa5f962 100644 Binary files a/_module/ncs/_open_bowyer.ncs and b/_module/ncs/_open_bowyer.ncs differ diff --git a/_module/ncs/_open_brewvat.ncs b/_module/ncs/_open_brewvat.ncs index 467931ca..c5f77781 100644 Binary files a/_module/ncs/_open_brewvat.ncs and b/_module/ncs/_open_brewvat.ncs differ diff --git a/_module/ncs/_open_carpentry.ncs b/_module/ncs/_open_carpentry.ncs index dd374e30..9b6d24e8 100644 Binary files a/_module/ncs/_open_carpentry.ncs and b/_module/ncs/_open_carpentry.ncs differ diff --git a/_module/ncs/_open_chest2.ncs b/_module/ncs/_open_chest2.ncs index bd0cef11..3787847c 100644 Binary files a/_module/ncs/_open_chest2.ncs and b/_module/ncs/_open_chest2.ncs differ diff --git a/_module/ncs/_open_cook.ncs b/_module/ncs/_open_cook.ncs index 312c65a9..b63653f9 100644 Binary files a/_module/ncs/_open_cook.ncs and b/_module/ncs/_open_cook.ncs differ diff --git a/_module/ncs/_open_dyetub.ncs b/_module/ncs/_open_dyetub.ncs index ec333e26..2caa6fbc 100644 Binary files a/_module/ncs/_open_dyetub.ncs and b/_module/ncs/_open_dyetub.ncs differ diff --git a/_module/ncs/_open_ench_armor.ncs b/_module/ncs/_open_ench_armor.ncs index e8d46c0c..b834f7bb 100644 Binary files a/_module/ncs/_open_ench_armor.ncs and b/_module/ncs/_open_ench_armor.ncs differ diff --git a/_module/ncs/_open_fishcorpse.ncs b/_module/ncs/_open_fishcorpse.ncs index f77af0c9..33de65fa 100644 Binary files a/_module/ncs/_open_fishcorpse.ncs and b/_module/ncs/_open_fishcorpse.ncs differ diff --git a/_module/ncs/_open_jeweler.ncs b/_module/ncs/_open_jeweler.ncs index b9366fef..67c6dcf6 100644 Binary files a/_module/ncs/_open_jeweler.ncs and b/_module/ncs/_open_jeweler.ncs differ diff --git a/_module/ncs/_open_kiln.ncs b/_module/ncs/_open_kiln.ncs index 6c5e851a..618e3fc2 100644 Binary files a/_module/ncs/_open_kiln.ncs and b/_module/ncs/_open_kiln.ncs differ diff --git a/_module/ncs/_open_loom.ncs b/_module/ncs/_open_loom.ncs index 9e80b829..d98638d6 100644 Binary files a/_module/ncs/_open_loom.ncs and b/_module/ncs/_open_loom.ncs differ diff --git a/_module/ncs/_open_lthrtable.ncs b/_module/ncs/_open_lthrtable.ncs index e07064ab..8296b166 100644 Binary files a/_module/ncs/_open_lthrtable.ncs and b/_module/ncs/_open_lthrtable.ncs differ diff --git a/_module/ncs/_open_pulp.ncs b/_module/ncs/_open_pulp.ncs index a11d4b14..be7a9e20 100644 Binary files a/_module/ncs/_open_pulp.ncs and b/_module/ncs/_open_pulp.ncs differ diff --git a/_module/ncs/_open_scribe.ncs b/_module/ncs/_open_scribe.ncs index a241804a..f3a79428 100644 Binary files a/_module/ncs/_open_scribe.ncs and b/_module/ncs/_open_scribe.ncs differ diff --git a/_module/ncs/_open_smelt.ncs b/_module/ncs/_open_smelt.ncs index 5a357aa3..af6530da 100644 Binary files a/_module/ncs/_open_smelt.ncs and b/_module/ncs/_open_smelt.ncs differ diff --git a/_module/ncs/_open_spider.ncs b/_module/ncs/_open_spider.ncs index b65419dc..5dfecfc5 100644 Binary files a/_module/ncs/_open_spider.ncs and b/_module/ncs/_open_spider.ncs differ diff --git a/_module/ncs/_open_spinwhl.ncs b/_module/ncs/_open_spinwhl.ncs index b1c7b8a7..12fa6002 100644 Binary files a/_module/ncs/_open_spinwhl.ncs and b/_module/ncs/_open_spinwhl.ncs differ diff --git a/_module/ncs/_open_tailor.ncs b/_module/ncs/_open_tailor.ncs index 9e9b549b..5976d26b 100644 Binary files a/_module/ncs/_open_tailor.ncs and b/_module/ncs/_open_tailor.ncs differ diff --git a/_module/ncs/_open_tailor2.ncs b/_module/ncs/_open_tailor2.ncs index 36fb7e2f..f4b19eee 100644 Binary files a/_module/ncs/_open_tailor2.ncs and b/_module/ncs/_open_tailor2.ncs differ diff --git a/_module/ncs/_open_tchest.ncs b/_module/ncs/_open_tchest.ncs index 2599579b..af2ad72e 100644 Binary files a/_module/ncs/_open_tchest.ncs and b/_module/ncs/_open_tchest.ncs differ diff --git a/_module/ncs/_open_tink.ncs b/_module/ncs/_open_tink.ncs index 9568e9dc..7a242618 100644 Binary files a/_module/ncs/_open_tink.ncs and b/_module/ncs/_open_tink.ncs differ diff --git a/_module/ncs/_openfletchlathe.ncs b/_module/ncs/_openfletchlathe.ncs index 90b12bc8..17ff3fdd 100644 Binary files a/_module/ncs/_openfletchlathe.ncs and b/_module/ncs/_openfletchlathe.ncs differ diff --git a/_module/ncs/_opn_ench_weapon.ncs b/_module/ncs/_opn_ench_weapon.ncs index c347c503..f67f12d2 100644 Binary files a/_module/ncs/_opn_ench_weapon.ncs and b/_module/ncs/_opn_ench_weapon.ncs differ diff --git a/_module/ncs/_persist_01a.ncs b/_module/ncs/_persist_01a.ncs deleted file mode 100644 index ecb1c72d..00000000 Binary files a/_module/ncs/_persist_01a.ncs and /dev/null differ diff --git a/_module/ncs/_plant_seed.ncs b/_module/ncs/_plant_seed.ncs index 6cfc78bc..dd002d66 100644 Binary files a/_module/ncs/_plant_seed.ncs and b/_module/ncs/_plant_seed.ncs differ diff --git a/_module/ncs/_plant_seed2.ncs b/_module/ncs/_plant_seed2.ncs index 99fe4fd3..20b2074d 100644 Binary files a/_module/ncs/_plant_seed2.ncs and b/_module/ncs/_plant_seed2.ncs differ diff --git a/_module/ncs/_seed_seed.ncs b/_module/ncs/_seed_seed.ncs index e97cd026..4a377a5d 100644 Binary files a/_module/ncs/_seed_seed.ncs and b/_module/ncs/_seed_seed.ncs differ diff --git a/_module/ncs/_skin_corpse.ncs b/_module/ncs/_skin_corpse.ncs index 20ff3a98..6639b423 100644 Binary files a/_module/ncs/_skin_corpse.ncs and b/_module/ncs/_skin_corpse.ncs differ diff --git a/_module/ncs/_spider_death.ncs b/_module/ncs/_spider_death.ncs index aba1862e..3ed60556 100644 Binary files a/_module/ncs/_spider_death.ncs and b/_module/ncs/_spider_death.ncs differ diff --git a/_module/ncs/_tmp_resourcebox.ncs b/_module/ncs/_tmp_resourcebox.ncs index e2bf24cf..3c765f25 100644 Binary files a/_module/ncs/_tmp_resourcebox.ncs and b/_module/ncs/_tmp_resourcebox.ncs differ diff --git a/_module/ncs/_treasure_spawn.ncs b/_module/ncs/_treasure_spawn.ncs index dc191fab..8cfb9b5a 100644 Binary files a/_module/ncs/_treasure_spawn.ncs and b/_module/ncs/_treasure_spawn.ncs differ diff --git a/_module/ncs/_unlock_skill1.ncs b/_module/ncs/_unlock_skill1.ncs index 7d59734a..d97f4425 100644 Binary files a/_module/ncs/_unlock_skill1.ncs and b/_module/ncs/_unlock_skill1.ncs differ diff --git a/_module/ncs/_uoa_alcohol.ncs b/_module/ncs/_uoa_alcohol.ncs index 511e97ad..11467bfe 100644 Binary files a/_module/ncs/_uoa_alcohol.ncs and b/_module/ncs/_uoa_alcohol.ncs differ diff --git a/_module/ncs/_uoa_check_com.ncs b/_module/ncs/_uoa_check_com.ncs index 02f9171f..d0fd2774 100644 Binary files a/_module/ncs/_uoa_check_com.ncs and b/_module/ncs/_uoa_check_com.ncs differ diff --git a/_module/ncs/_uoa_check_ncom.ncs b/_module/ncs/_uoa_check_ncom.ncs index adbd49ad..9944ecd8 100644 Binary files a/_module/ncs/_uoa_check_ncom.ncs and b/_module/ncs/_uoa_check_ncom.ncs differ diff --git a/_module/ncs/_uoa_com_add.ncs b/_module/ncs/_uoa_com_add.ncs index 85cd5a23..90f794f6 100644 Binary files a/_module/ncs/_uoa_com_add.ncs and b/_module/ncs/_uoa_com_add.ncs differ diff --git a/_module/ncs/_uoa_com_conv.ncs b/_module/ncs/_uoa_com_conv.ncs index 5a8fb2f8..f422c52e 100644 Binary files a/_module/ncs/_uoa_com_conv.ncs and b/_module/ncs/_uoa_com_conv.ncs differ diff --git a/_module/ncs/_uoa_com_dont.ncs b/_module/ncs/_uoa_com_dont.ncs index f1b4595e..5bf5e9cc 100644 Binary files a/_module/ncs/_uoa_com_dont.ncs and b/_module/ncs/_uoa_com_dont.ncs differ diff --git a/_module/ncs/_uoa_com_recv.ncs b/_module/ncs/_uoa_com_recv.ncs index 4e2921b9..a9dc5f71 100644 Binary files a/_module/ncs/_uoa_com_recv.ncs and b/_module/ncs/_uoa_com_recv.ncs differ diff --git a/_module/ncs/_uoa_drunk.ncs b/_module/ncs/_uoa_drunk.ncs index 7136187c..4d056cb9 100644 Binary files a/_module/ncs/_uoa_drunk.ncs and b/_module/ncs/_uoa_drunk.ncs differ diff --git a/_module/ncs/_uoa_enter_com.ncs b/_module/ncs/_uoa_enter_com.ncs index 054f7ae5..2cdd59ce 100644 Binary files a/_module/ncs/_uoa_enter_com.ncs and b/_module/ncs/_uoa_enter_com.ncs differ diff --git a/_module/ncs/_uoa_exit_com.ncs b/_module/ncs/_uoa_exit_com.ncs index f6dd77f5..cfc281ed 100644 Binary files a/_module/ncs/_uoa_exit_com.ncs and b/_module/ncs/_uoa_exit_com.ncs differ diff --git a/_module/ncs/_uoa_fix_station.ncs b/_module/ncs/_uoa_fix_station.ncs index 2f0b5da2..de91584c 100644 Binary files a/_module/ncs/_uoa_fix_station.ncs and b/_module/ncs/_uoa_fix_station.ncs differ diff --git a/_module/ncs/_uoa_skill_dotr2.ncs b/_module/ncs/_uoa_skill_dotr2.ncs index 30fbe9bb..4d9aeaf7 100644 Binary files a/_module/ncs/_uoa_skill_dotr2.ncs and b/_module/ncs/_uoa_skill_dotr2.ncs differ diff --git a/_module/ncs/_uoa_skill_dotrn.ncs b/_module/ncs/_uoa_skill_dotrn.ncs index 2dfff34f..af7d1982 100644 Binary files a/_module/ncs/_uoa_skill_dotrn.ncs and b/_module/ncs/_uoa_skill_dotrn.ncs differ diff --git a/_module/ncs/_uoa_skill_notr2.ncs b/_module/ncs/_uoa_skill_notr2.ncs index 7dd27bac..b3a591d3 100644 Binary files a/_module/ncs/_uoa_skill_notr2.ncs and b/_module/ncs/_uoa_skill_notr2.ncs differ diff --git a/_module/ncs/_uoa_skill_notr3.ncs b/_module/ncs/_uoa_skill_notr3.ncs index 5923a825..d4935242 100644 Binary files a/_module/ncs/_uoa_skill_notr3.ncs and b/_module/ncs/_uoa_skill_notr3.ncs differ diff --git a/_module/ncs/_uoa_skill_notrn.ncs b/_module/ncs/_uoa_skill_notrn.ncs index 06245262..4ad4e07c 100644 Binary files a/_module/ncs/_uoa_skill_notrn.ncs and b/_module/ncs/_uoa_skill_notrn.ncs differ diff --git a/_module/ncs/_uoa_skill_trai3.ncs b/_module/ncs/_uoa_skill_trai3.ncs index 20ae616f..0a3ec1ce 100644 Binary files a/_module/ncs/_uoa_skill_trai3.ncs and b/_module/ncs/_uoa_skill_trai3.ncs differ diff --git a/_module/ncs/_uoa_skill_trai4.ncs b/_module/ncs/_uoa_skill_trai4.ncs index 1dec39d8..cce632aa 100644 Binary files a/_module/ncs/_uoa_skill_trai4.ncs and b/_module/ncs/_uoa_skill_trai4.ncs differ diff --git a/_module/ncs/_uoa_skill_train.ncs b/_module/ncs/_uoa_skill_train.ncs index ae60acc0..142b2ba9 100644 Binary files a/_module/ncs/_uoa_skill_train.ncs and b/_module/ncs/_uoa_skill_train.ncs differ diff --git a/_module/ncs/_uoa_tchest_chk1.ncs b/_module/ncs/_uoa_tchest_chk1.ncs index c0ac39fa..934b47d3 100644 Binary files a/_module/ncs/_uoa_tchest_chk1.ncs and b/_module/ncs/_uoa_tchest_chk1.ncs differ diff --git a/_module/ncs/_uoa_tchest_chk2.ncs b/_module/ncs/_uoa_tchest_chk2.ncs index 8fa597d0..02daa13c 100644 Binary files a/_module/ncs/_uoa_tchest_chk2.ncs and b/_module/ncs/_uoa_tchest_chk2.ncs differ diff --git a/_module/ncs/_uoa_tchst_tlk1.ncs b/_module/ncs/_uoa_tchst_tlk1.ncs index 9c28bb4a..b5d33855 100644 Binary files a/_module/ncs/_uoa_tchst_tlk1.ncs and b/_module/ncs/_uoa_tchst_tlk1.ncs differ diff --git a/_module/ncs/_uoa_tchst_tlk2.ncs b/_module/ncs/_uoa_tchst_tlk2.ncs index 558fb550..dcb65390 100644 Binary files a/_module/ncs/_uoa_tchst_tlk2.ncs and b/_module/ncs/_uoa_tchst_tlk2.ncs differ diff --git a/_module/ncs/_uoa_tchst_tlk3.ncs b/_module/ncs/_uoa_tchst_tlk3.ncs index 06cb47f7..663b7512 100644 Binary files a/_module/ncs/_uoa_tchst_tlk3.ncs and b/_module/ncs/_uoa_tchst_tlk3.ncs differ diff --git a/_module/ncs/_uoacraft_enter.ncs b/_module/ncs/_uoacraft_enter.ncs index 8a066bd8..db96e037 100644 Binary files a/_module/ncs/_uoacraft_enter.ncs and b/_module/ncs/_uoacraft_enter.ncs differ diff --git a/_module/ncs/_use_bankbox.ncs b/_module/ncs/_use_bankbox.ncs index fcca45bd..50191bf5 100644 Binary files a/_module/ncs/_use_bankbox.ncs and b/_module/ncs/_use_bankbox.ncs differ diff --git a/_module/ncs/_use_commodity.ncs b/_module/ncs/_use_commodity.ncs index 5911eb60..8e65a214 100644 Binary files a/_module/ncs/_use_commodity.ncs and b/_module/ncs/_use_commodity.ncs differ diff --git a/_module/ncs/_use_filletknife.ncs b/_module/ncs/_use_filletknife.ncs index 0e416230..5d66ff2b 100644 Binary files a/_module/ncs/_use_filletknife.ncs and b/_module/ncs/_use_filletknife.ncs differ diff --git a/_module/ncs/_use_honeycomb.ncs b/_module/ncs/_use_honeycomb.ncs index 5e1eafbc..b31eaa7c 100644 Binary files a/_module/ncs/_use_honeycomb.ncs and b/_module/ncs/_use_honeycomb.ncs differ diff --git a/_module/ncs/_use_leveller.ncs b/_module/ncs/_use_leveller.ncs index 9186a2b3..9bc8fc8a 100644 Binary files a/_module/ncs/_use_leveller.ncs and b/_module/ncs/_use_leveller.ncs differ diff --git a/_module/ncs/_use_map.ncs b/_module/ncs/_use_map.ncs index 67f1786d..37e29305 100644 Binary files a/_module/ncs/_use_map.ncs and b/_module/ncs/_use_map.ncs differ diff --git a/_module/ncs/_use_map2.ncs b/_module/ncs/_use_map2.ncs index b7bd4406..4ebb6ff2 100644 Binary files a/_module/ncs/_use_map2.ncs and b/_module/ncs/_use_map2.ncs differ diff --git a/_module/ncs/_use_map3.ncs b/_module/ncs/_use_map3.ncs index 75eb27d3..0fa906b5 100644 Binary files a/_module/ncs/_use_map3.ncs and b/_module/ncs/_use_map3.ncs differ diff --git a/_module/ncs/_use_map4.ncs b/_module/ncs/_use_map4.ncs index 202c5528..446a9de5 100644 Binary files a/_module/ncs/_use_map4.ncs and b/_module/ncs/_use_map4.ncs differ diff --git a/_module/ncs/_use_mine_gem.ncs b/_module/ncs/_use_mine_gem.ncs index 7084abc8..5f44016b 100644 Binary files a/_module/ncs/_use_mine_gem.ncs and b/_module/ncs/_use_mine_gem.ncs differ diff --git a/_module/ncs/_use_rubble.ncs b/_module/ncs/_use_rubble.ncs index 5097963d..7b1c7d07 100644 Binary files a/_module/ncs/_use_rubble.ncs and b/_module/ncs/_use_rubble.ncs differ diff --git a/_module/ncs/_use_rubble2.ncs b/_module/ncs/_use_rubble2.ncs index 2d5b9cd5..923429a7 100644 Binary files a/_module/ncs/_use_rubble2.ncs and b/_module/ncs/_use_rubble2.ncs differ diff --git a/_module/ncs/_use_shroompatch.ncs b/_module/ncs/_use_shroompatch.ncs index 696713e5..63f1060f 100644 Binary files a/_module/ncs/_use_shroompatch.ncs and b/_module/ncs/_use_shroompatch.ncs differ diff --git a/_module/ncs/_use_skillbook.ncs b/_module/ncs/_use_skillbook.ncs index 035e0b6e..9695621f 100644 Binary files a/_module/ncs/_use_skillbook.ncs and b/_module/ncs/_use_skillbook.ncs differ diff --git a/_module/ncs/_use_skillbook2.ncs b/_module/ncs/_use_skillbook2.ncs index f3881283..b2760df4 100644 Binary files a/_module/ncs/_use_skillbook2.ncs and b/_module/ncs/_use_skillbook2.ncs differ diff --git a/_module/ncs/_use_skillbook3.ncs b/_module/ncs/_use_skillbook3.ncs index 9c2e984e..9db6ea3e 100644 Binary files a/_module/ncs/_use_skillbook3.ncs and b/_module/ncs/_use_skillbook3.ncs differ diff --git a/_module/ncs/_use_skillbook4.ncs b/_module/ncs/_use_skillbook4.ncs index c7e8abef..87f6a4b4 100644 Binary files a/_module/ncs/_use_skillbook4.ncs and b/_module/ncs/_use_skillbook4.ncs differ diff --git a/_module/ncs/_use_tchest_conv.ncs b/_module/ncs/_use_tchest_conv.ncs index a067cf23..1aed4b18 100644 Binary files a/_module/ncs/_use_tchest_conv.ncs and b/_module/ncs/_use_tchest_conv.ncs differ diff --git a/_module/ncs/_use_tchest_loot.ncs b/_module/ncs/_use_tchest_loot.ncs index 6286c3b0..39e5b73e 100644 Binary files a/_module/ncs/_use_tchest_loot.ncs and b/_module/ncs/_use_tchest_loot.ncs differ diff --git a/_module/ncs/_use_tinderbox.ncs b/_module/ncs/_use_tinderbox.ncs index cfbf9bc3..e9aabe86 100644 Binary files a/_module/ncs/_use_tinderbox.ncs and b/_module/ncs/_use_tinderbox.ncs differ diff --git a/_module/ncs/_use_waterwell.ncs b/_module/ncs/_use_waterwell.ncs index ffcd7f11..26329c3e 100644 Binary files a/_module/ncs/_use_waterwell.ncs and b/_module/ncs/_use_waterwell.ncs differ diff --git a/_module/ncs/areaopener.ncs b/_module/ncs/areaopener.ncs index 44ee2855..4ac1f69f 100644 Binary files a/_module/ncs/areaopener.ncs and b/_module/ncs/areaopener.ncs differ diff --git a/_module/ncs/at_caplvlup.ncs b/_module/ncs/at_caplvlup.ncs new file mode 100644 index 00000000..9b6ef389 Binary files /dev/null and b/_module/ncs/at_caplvlup.ncs differ diff --git a/_module/ncs/clean_store2.ncs b/_module/ncs/clean_store2.ncs index dc095b66..4b75864e 100644 Binary files a/_module/ncs/clean_store2.ncs and b/_module/ncs/clean_store2.ncs differ diff --git a/_module/ncs/cstm_mnstr_death.ncs b/_module/ncs/cstm_mnstr_death.ncs index c663479f..11827e7c 100644 Binary files a/_module/ncs/cstm_mnstr_death.ncs and b/_module/ncs/cstm_mnstr_death.ncs differ diff --git a/_module/ncs/dante_letodel_at.ncs b/_module/ncs/dante_letodel_at.ncs new file mode 100644 index 00000000..70344263 Binary files /dev/null and b/_module/ncs/dante_letodel_at.ncs differ diff --git a/_module/ncs/dm_reads_line.ncs b/_module/ncs/dm_reads_line.ncs index a27641ab..c66e34a9 100644 Binary files a/_module/ncs/dm_reads_line.ncs and b/_module/ncs/dm_reads_line.ncs differ diff --git a/_module/ncs/fake_conditional.ncs b/_module/ncs/fake_conditional.ncs index 8e9bfe28..81f5bce5 100644 Binary files a/_module/ncs/fake_conditional.ncs and b/_module/ncs/fake_conditional.ncs differ diff --git a/_module/ncs/is_guild.ncs b/_module/ncs/is_guild.ncs index 88e780de..d22f8f15 100644 Binary files a/_module/ncs/is_guild.ncs and b/_module/ncs/is_guild.ncs differ diff --git a/_module/ncs/ldf_isnotweap.ncs b/_module/ncs/ldf_isnotweap.ncs index 6d98d5b6..bdae2a6a 100644 Binary files a/_module/ncs/ldf_isnotweap.ncs and b/_module/ncs/ldf_isnotweap.ncs differ diff --git a/_module/ncs/ldf_isweapon.ncs b/_module/ncs/ldf_isweapon.ncs index 9dd86810..abf5ad51 100644 Binary files a/_module/ncs/ldf_isweapon.ncs and b/_module/ncs/ldf_isweapon.ncs differ diff --git a/_module/ncs/mk_cb_deity_chk.ncs b/_module/ncs/mk_cb_deity_chk.ncs new file mode 100644 index 00000000..3f8bd9f3 Binary files /dev/null and b/_module/ncs/mk_cb_deity_chk.ncs differ diff --git a/_module/ncs/mk_cb_hd_f_flt.ncs b/_module/ncs/mk_cb_hd_f_flt.ncs new file mode 100644 index 00000000..67152401 Binary files /dev/null and b/_module/ncs/mk_cb_hd_f_flt.ncs differ diff --git a/_module/ncs/mk_cb_hd_f_label.ncs b/_module/ncs/mk_cb_hd_f_label.ncs new file mode 100644 index 00000000..5d0644c3 Binary files /dev/null and b/_module/ncs/mk_cb_hd_f_label.ncs differ diff --git a/_module/ncs/mk_cb_hd_label.ncs b/_module/ncs/mk_cb_hd_label.ncs new file mode 100644 index 00000000..1b28ec0b Binary files /dev/null and b/_module/ncs/mk_cb_hd_label.ncs differ diff --git a/_module/ncs/mk_cb_ichrg_chk.ncs b/_module/ncs/mk_cb_ichrg_chk.ncs new file mode 100644 index 00000000..dc1b2f25 Binary files /dev/null and b/_module/ncs/mk_cb_ichrg_chk.ncs differ diff --git a/_module/ncs/mk_cb_ichrg_lbl.ncs b/_module/ncs/mk_cb_ichrg_lbl.ncs new file mode 100644 index 00000000..0fe3d073 Binary files /dev/null and b/_module/ncs/mk_cb_ichrg_lbl.ncs differ diff --git a/_module/ncs/mk_cb_iflag_chk.ncs b/_module/ncs/mk_cb_iflag_chk.ncs new file mode 100644 index 00000000..12c65508 Binary files /dev/null and b/_module/ncs/mk_cb_iflag_chk.ncs differ diff --git a/_module/ncs/mk_cb_iflag_lbl.ncs b/_module/ncs/mk_cb_iflag_lbl.ncs new file mode 100644 index 00000000..f13d4f16 Binary files /dev/null and b/_module/ncs/mk_cb_iflag_lbl.ncs differ diff --git a/_module/ncs/mk_cb_iprp_chk.ncs b/_module/ncs/mk_cb_iprp_chk.ncs new file mode 100644 index 00000000..891b21ea Binary files /dev/null and b/_module/ncs/mk_cb_iprp_chk.ncs differ diff --git a/_module/ncs/mk_cb_iprp_ctlbl.ncs b/_module/ncs/mk_cb_iprp_ctlbl.ncs new file mode 100644 index 00000000..4c67bdc9 Binary files /dev/null and b/_module/ncs/mk_cb_iprp_ctlbl.ncs differ diff --git a/_module/ncs/mk_cb_iprp_ftchk.ncs b/_module/ncs/mk_cb_iprp_ftchk.ncs new file mode 100644 index 00000000..b926de7e Binary files /dev/null and b/_module/ncs/mk_cb_iprp_ftchk.ncs differ diff --git a/_module/ncs/mk_cb_iprp_ftlbl.ncs b/_module/ncs/mk_cb_iprp_ftlbl.ncs new file mode 100644 index 00000000..7a8b5251 Binary files /dev/null and b/_module/ncs/mk_cb_iprp_ftlbl.ncs differ diff --git a/_module/ncs/mk_cb_iprp_iflbl.ncs b/_module/ncs/mk_cb_iprp_iflbl.ncs new file mode 100644 index 00000000..1df90643 Binary files /dev/null and b/_module/ncs/mk_cb_iprp_iflbl.ncs differ diff --git a/_module/ncs/mk_cb_iprp_inlbl.ncs b/_module/ncs/mk_cb_iprp_inlbl.ncs new file mode 100644 index 00000000..92622f3d Binary files /dev/null and b/_module/ncs/mk_cb_iprp_inlbl.ncs differ diff --git a/_module/ncs/mk_cb_iprp_iplbl.ncs b/_module/ncs/mk_cb_iprp_iplbl.ncs new file mode 100644 index 00000000..2536a69c Binary files /dev/null and b/_module/ncs/mk_cb_iprp_iplbl.ncs differ diff --git a/_module/ncs/mk_cb_iprp_itchk.ncs b/_module/ncs/mk_cb_iprp_itchk.ncs new file mode 100644 index 00000000..467ea467 Binary files /dev/null and b/_module/ncs/mk_cb_iprp_itchk.ncs differ diff --git a/_module/ncs/mk_cb_iprp_p1lbl.ncs b/_module/ncs/mk_cb_iprp_p1lbl.ncs new file mode 100644 index 00000000..f1b5d835 Binary files /dev/null and b/_module/ncs/mk_cb_iprp_p1lbl.ncs differ diff --git a/_module/ncs/mk_cb_iprp_sklbl.ncs b/_module/ncs/mk_cb_iprp_sklbl.ncs new file mode 100644 index 00000000..9bdf1e2a Binary files /dev/null and b/_module/ncs/mk_cb_iprp_sklbl.ncs differ diff --git a/_module/ncs/mk_cb_iprp_stlbl.ncs b/_module/ncs/mk_cb_iprp_stlbl.ncs new file mode 100644 index 00000000..0df89ae1 Binary files /dev/null and b/_module/ncs/mk_cb_iprp_stlbl.ncs differ diff --git a/_module/ncs/mk_cb_store_lbl.ncs b/_module/ncs/mk_cb_store_lbl.ncs new file mode 100644 index 00000000..284704bd Binary files /dev/null and b/_module/ncs/mk_cb_store_lbl.ncs differ diff --git a/_module/ncs/mk_cb_swpip_chk.ncs b/_module/ncs/mk_cb_swpip_chk.ncs new file mode 100644 index 00000000..ae3875bf Binary files /dev/null and b/_module/ncs/mk_cb_swpip_chk.ncs differ diff --git a/_module/ncs/mk_cb_vfx_check.ncs b/_module/ncs/mk_cb_vfx_check.ncs new file mode 100644 index 00000000..b8b9a95b Binary files /dev/null and b/_module/ncs/mk_cb_vfx_check.ncs differ diff --git a/_module/ncs/mk_cb_vfx_filter.ncs b/_module/ncs/mk_cb_vfx_filter.ncs new file mode 100644 index 00000000..ca5c0567 Binary files /dev/null and b/_module/ncs/mk_cb_vfx_filter.ncs differ diff --git a/_module/ncs/mk_cb_vfx_label.ncs b/_module/ncs/mk_cb_vfx_label.ncs new file mode 100644 index 00000000..97fa637f Binary files /dev/null and b/_module/ncs/mk_cb_vfx_label.ncs differ diff --git a/_module/ncs/mk_cond_00.ncs b/_module/ncs/mk_cond_00.ncs new file mode 100644 index 00000000..abd99b9f Binary files /dev/null and b/_module/ncs/mk_cond_00.ncs differ diff --git a/_module/ncs/mk_cond_01.ncs b/_module/ncs/mk_cond_01.ncs new file mode 100644 index 00000000..d1596c52 Binary files /dev/null and b/_module/ncs/mk_cond_01.ncs differ diff --git a/_module/ncs/mk_cond_02.ncs b/_module/ncs/mk_cond_02.ncs new file mode 100644 index 00000000..95ff0a55 Binary files /dev/null and b/_module/ncs/mk_cond_02.ncs differ diff --git a/_module/ncs/mk_cond_03.ncs b/_module/ncs/mk_cond_03.ncs new file mode 100644 index 00000000..57a77af8 Binary files /dev/null and b/_module/ncs/mk_cond_03.ncs differ diff --git a/_module/ncs/mk_cond_04.ncs b/_module/ncs/mk_cond_04.ncs new file mode 100644 index 00000000..afe2d945 Binary files /dev/null and b/_module/ncs/mk_cond_04.ncs differ diff --git a/_module/ncs/mk_cond_05.ncs b/_module/ncs/mk_cond_05.ncs new file mode 100644 index 00000000..cbbcfaff Binary files /dev/null and b/_module/ncs/mk_cond_05.ncs differ diff --git a/_module/ncs/mk_cond_06.ncs b/_module/ncs/mk_cond_06.ncs new file mode 100644 index 00000000..5f2629f4 Binary files /dev/null and b/_module/ncs/mk_cond_06.ncs differ diff --git a/_module/ncs/mk_cond_07.ncs b/_module/ncs/mk_cond_07.ncs new file mode 100644 index 00000000..9b1069f3 Binary files /dev/null and b/_module/ncs/mk_cond_07.ncs differ diff --git a/_module/ncs/mk_cond_08.ncs b/_module/ncs/mk_cond_08.ncs new file mode 100644 index 00000000..04ebdceb Binary files /dev/null and b/_module/ncs/mk_cond_08.ncs differ diff --git a/_module/ncs/mk_cond_09.ncs b/_module/ncs/mk_cond_09.ncs new file mode 100644 index 00000000..4dcc3837 Binary files /dev/null and b/_module/ncs/mk_cond_09.ncs differ diff --git a/_module/ncs/mk_cond_10.ncs b/_module/ncs/mk_cond_10.ncs new file mode 100644 index 00000000..f2e93678 Binary files /dev/null and b/_module/ncs/mk_cond_10.ncs differ diff --git a/_module/ncs/mk_cond_100.ncs b/_module/ncs/mk_cond_100.ncs new file mode 100644 index 00000000..3c06a78f Binary files /dev/null and b/_module/ncs/mk_cond_100.ncs differ diff --git a/_module/ncs/mk_cond_101.ncs b/_module/ncs/mk_cond_101.ncs new file mode 100644 index 00000000..66989a29 Binary files /dev/null and b/_module/ncs/mk_cond_101.ncs differ diff --git a/_module/ncs/mk_cond_102.ncs b/_module/ncs/mk_cond_102.ncs new file mode 100644 index 00000000..69407fd8 Binary files /dev/null and b/_module/ncs/mk_cond_102.ncs differ diff --git a/_module/ncs/mk_cond_103.ncs b/_module/ncs/mk_cond_103.ncs new file mode 100644 index 00000000..792e31bd Binary files /dev/null and b/_module/ncs/mk_cond_103.ncs differ diff --git a/_module/ncs/mk_cond_11.ncs b/_module/ncs/mk_cond_11.ncs new file mode 100644 index 00000000..c67f6385 Binary files /dev/null and b/_module/ncs/mk_cond_11.ncs differ diff --git a/_module/ncs/mk_cond_12.ncs b/_module/ncs/mk_cond_12.ncs new file mode 100644 index 00000000..f6ccf395 Binary files /dev/null and b/_module/ncs/mk_cond_12.ncs differ diff --git a/_module/ncs/mk_cond_127.ncs b/_module/ncs/mk_cond_127.ncs new file mode 100644 index 00000000..8c8acec1 Binary files /dev/null and b/_module/ncs/mk_cond_127.ncs differ diff --git a/_module/ncs/mk_cond_13.ncs b/_module/ncs/mk_cond_13.ncs new file mode 100644 index 00000000..2048b81c Binary files /dev/null and b/_module/ncs/mk_cond_13.ncs differ diff --git a/_module/ncs/mk_cond_14.ncs b/_module/ncs/mk_cond_14.ncs new file mode 100644 index 00000000..f307a8f3 Binary files /dev/null and b/_module/ncs/mk_cond_14.ncs differ diff --git a/_module/ncs/mk_cond_15.ncs b/_module/ncs/mk_cond_15.ncs new file mode 100644 index 00000000..416db91e Binary files /dev/null and b/_module/ncs/mk_cond_15.ncs differ diff --git a/_module/ncs/mk_cond_16.ncs b/_module/ncs/mk_cond_16.ncs new file mode 100644 index 00000000..2198dc4b Binary files /dev/null and b/_module/ncs/mk_cond_16.ncs differ diff --git a/_module/ncs/mk_cond_17.ncs b/_module/ncs/mk_cond_17.ncs new file mode 100644 index 00000000..d5d06255 Binary files /dev/null and b/_module/ncs/mk_cond_17.ncs differ diff --git a/_module/ncs/mk_cond_18.ncs b/_module/ncs/mk_cond_18.ncs new file mode 100644 index 00000000..00a96646 Binary files /dev/null and b/_module/ncs/mk_cond_18.ncs differ diff --git a/_module/ncs/mk_cond_19.ncs b/_module/ncs/mk_cond_19.ncs new file mode 100644 index 00000000..4b44fbdb Binary files /dev/null and b/_module/ncs/mk_cond_19.ncs differ diff --git a/_module/ncs/mk_cond_20.ncs b/_module/ncs/mk_cond_20.ncs new file mode 100644 index 00000000..e845971a Binary files /dev/null and b/_module/ncs/mk_cond_20.ncs differ diff --git a/_module/ncs/mk_cond_21.ncs b/_module/ncs/mk_cond_21.ncs new file mode 100644 index 00000000..7331c8f6 Binary files /dev/null and b/_module/ncs/mk_cond_21.ncs differ diff --git a/_module/ncs/mk_cond_22.ncs b/_module/ncs/mk_cond_22.ncs new file mode 100644 index 00000000..3943e5fe Binary files /dev/null and b/_module/ncs/mk_cond_22.ncs differ diff --git a/_module/ncs/mk_cond_23.ncs b/_module/ncs/mk_cond_23.ncs new file mode 100644 index 00000000..15bac4fa Binary files /dev/null and b/_module/ncs/mk_cond_23.ncs differ diff --git a/_module/ncs/mk_cond_24.ncs b/_module/ncs/mk_cond_24.ncs new file mode 100644 index 00000000..13a44bbe Binary files /dev/null and b/_module/ncs/mk_cond_24.ncs differ diff --git a/_module/ncs/mk_cond_249.ncs b/_module/ncs/mk_cond_249.ncs new file mode 100644 index 00000000..7526ea0d Binary files /dev/null and b/_module/ncs/mk_cond_249.ncs differ diff --git a/_module/ncs/mk_cond_25.ncs b/_module/ncs/mk_cond_25.ncs new file mode 100644 index 00000000..90a49f43 Binary files /dev/null and b/_module/ncs/mk_cond_25.ncs differ diff --git a/_module/ncs/mk_cond_250.ncs b/_module/ncs/mk_cond_250.ncs new file mode 100644 index 00000000..12f66032 Binary files /dev/null and b/_module/ncs/mk_cond_250.ncs differ diff --git a/_module/ncs/mk_cond_251.ncs b/_module/ncs/mk_cond_251.ncs new file mode 100644 index 00000000..a991a34c Binary files /dev/null and b/_module/ncs/mk_cond_251.ncs differ diff --git a/_module/ncs/mk_cond_252.ncs b/_module/ncs/mk_cond_252.ncs new file mode 100644 index 00000000..6e7b2f17 Binary files /dev/null and b/_module/ncs/mk_cond_252.ncs differ diff --git a/_module/ncs/mk_cond_253.ncs b/_module/ncs/mk_cond_253.ncs new file mode 100644 index 00000000..c86cbdd0 Binary files /dev/null and b/_module/ncs/mk_cond_253.ncs differ diff --git a/_module/ncs/mk_cond_254.ncs b/_module/ncs/mk_cond_254.ncs new file mode 100644 index 00000000..38662841 Binary files /dev/null and b/_module/ncs/mk_cond_254.ncs differ diff --git a/_module/ncs/mk_cond_255.ncs b/_module/ncs/mk_cond_255.ncs new file mode 100644 index 00000000..e29333be Binary files /dev/null and b/_module/ncs/mk_cond_255.ncs differ diff --git a/_module/ncs/mk_cond_256.ncs b/_module/ncs/mk_cond_256.ncs new file mode 100644 index 00000000..3246cee1 Binary files /dev/null and b/_module/ncs/mk_cond_256.ncs differ diff --git a/_module/ncs/mk_cond_257.ncs b/_module/ncs/mk_cond_257.ncs new file mode 100644 index 00000000..ccae37b4 Binary files /dev/null and b/_module/ncs/mk_cond_257.ncs differ diff --git a/_module/ncs/mk_cond_26.ncs b/_module/ncs/mk_cond_26.ncs new file mode 100644 index 00000000..d054dbed Binary files /dev/null and b/_module/ncs/mk_cond_26.ncs differ diff --git a/_module/ncs/mk_cond_27.ncs b/_module/ncs/mk_cond_27.ncs new file mode 100644 index 00000000..b35ca056 Binary files /dev/null and b/_module/ncs/mk_cond_27.ncs differ diff --git a/_module/ncs/mk_cond_28.ncs b/_module/ncs/mk_cond_28.ncs new file mode 100644 index 00000000..854eb61e Binary files /dev/null and b/_module/ncs/mk_cond_28.ncs differ diff --git a/_module/ncs/mk_cond_29.ncs b/_module/ncs/mk_cond_29.ncs new file mode 100644 index 00000000..a8c05ffe Binary files /dev/null and b/_module/ncs/mk_cond_29.ncs differ diff --git a/_module/ncs/mk_cond_30.ncs b/_module/ncs/mk_cond_30.ncs new file mode 100644 index 00000000..a66a0aa6 Binary files /dev/null and b/_module/ncs/mk_cond_30.ncs differ diff --git a/_module/ncs/mk_cond_31.ncs b/_module/ncs/mk_cond_31.ncs new file mode 100644 index 00000000..c15c4f02 Binary files /dev/null and b/_module/ncs/mk_cond_31.ncs differ diff --git a/_module/ncs/mk_cond_32.ncs b/_module/ncs/mk_cond_32.ncs new file mode 100644 index 00000000..40401b51 Binary files /dev/null and b/_module/ncs/mk_cond_32.ncs differ diff --git a/_module/ncs/mk_cond_33.ncs b/_module/ncs/mk_cond_33.ncs new file mode 100644 index 00000000..95cfd724 Binary files /dev/null and b/_module/ncs/mk_cond_33.ncs differ diff --git a/_module/ncs/mk_cond_34.ncs b/_module/ncs/mk_cond_34.ncs new file mode 100644 index 00000000..4efe80c5 Binary files /dev/null and b/_module/ncs/mk_cond_34.ncs differ diff --git a/_module/ncs/mk_cond_35.ncs b/_module/ncs/mk_cond_35.ncs new file mode 100644 index 00000000..2ee643b9 Binary files /dev/null and b/_module/ncs/mk_cond_35.ncs differ diff --git a/_module/ncs/mk_cond_36.ncs b/_module/ncs/mk_cond_36.ncs new file mode 100644 index 00000000..e0f74ed0 Binary files /dev/null and b/_module/ncs/mk_cond_36.ncs differ diff --git a/_module/ncs/mk_cond_37.ncs b/_module/ncs/mk_cond_37.ncs new file mode 100644 index 00000000..d31b8827 Binary files /dev/null and b/_module/ncs/mk_cond_37.ncs differ diff --git a/_module/ncs/mk_cond_38.ncs b/_module/ncs/mk_cond_38.ncs new file mode 100644 index 00000000..8ade075c Binary files /dev/null and b/_module/ncs/mk_cond_38.ncs differ diff --git a/_module/ncs/mk_cond_39.ncs b/_module/ncs/mk_cond_39.ncs new file mode 100644 index 00000000..050ce260 Binary files /dev/null and b/_module/ncs/mk_cond_39.ncs differ diff --git a/_module/ncs/mk_cond_40.ncs b/_module/ncs/mk_cond_40.ncs new file mode 100644 index 00000000..8d5fcfc1 Binary files /dev/null and b/_module/ncs/mk_cond_40.ncs differ diff --git a/_module/ncs/mk_do_sel_target.ncs b/_module/ncs/mk_do_sel_target.ncs new file mode 100644 index 00000000..39098247 Binary files /dev/null and b/_module/ncs/mk_do_sel_target.ncs differ diff --git a/_module/ncs/mk_editor_main.ncs b/_module/ncs/mk_editor_main.ncs new file mode 100644 index 00000000..2cfeab3a Binary files /dev/null and b/_module/ncs/mk_editor_main.ncs differ diff --git a/_module/ncs/mk_get_version.ncs b/_module/ncs/mk_get_version.ncs new file mode 100644 index 00000000..286fb552 Binary files /dev/null and b/_module/ncs/mk_get_version.ncs differ diff --git a/_module/ncs/mk_im_cancel.ncs b/_module/ncs/mk_im_cancel.ncs new file mode 100644 index 00000000..327ef673 Binary files /dev/null and b/_module/ncs/mk_im_cancel.ncs differ diff --git a/_module/ncs/mk_im_finished.ncs b/_module/ncs/mk_im_finished.ncs new file mode 100644 index 00000000..99662d61 Binary files /dev/null and b/_module/ncs/mk_im_finished.ncs differ diff --git a/_module/ncs/mk_im_getchanged.ncs b/_module/ncs/mk_im_getchanged.ncs new file mode 100644 index 00000000..ce96017c Binary files /dev/null and b/_module/ncs/mk_im_getchanged.ncs differ diff --git a/_module/ncs/mk_im_start.ncs b/_module/ncs/mk_im_start.ncs new file mode 100644 index 00000000..eef7d5dd Binary files /dev/null and b/_module/ncs/mk_im_start.ncs differ diff --git a/_module/ncs/mk_ncond_27.ncs b/_module/ncs/mk_ncond_27.ncs new file mode 100644 index 00000000..25907d1f Binary files /dev/null and b/_module/ncs/mk_ncond_27.ncs differ diff --git a/_module/ncs/mk_ncond_28.ncs b/_module/ncs/mk_ncond_28.ncs new file mode 100644 index 00000000..ed7f57f5 Binary files /dev/null and b/_module/ncs/mk_ncond_28.ncs differ diff --git a/_module/ncs/mk_ncond_29.ncs b/_module/ncs/mk_ncond_29.ncs new file mode 100644 index 00000000..4606f1b3 Binary files /dev/null and b/_module/ncs/mk_ncond_29.ncs differ diff --git a/_module/ncs/mk_ncond_30.ncs b/_module/ncs/mk_ncond_30.ncs new file mode 100644 index 00000000..29e06b08 Binary files /dev/null and b/_module/ncs/mk_ncond_30.ncs differ diff --git a/_module/ncs/mk_ncond_31.ncs b/_module/ncs/mk_ncond_31.ncs new file mode 100644 index 00000000..71e8d0fc Binary files /dev/null and b/_module/ncs/mk_ncond_31.ncs differ diff --git a/_module/ncs/mk_ncond_32.ncs b/_module/ncs/mk_ncond_32.ncs new file mode 100644 index 00000000..28d52592 Binary files /dev/null and b/_module/ncs/mk_ncond_32.ncs differ diff --git a/_module/ncs/mk_ncond_33.ncs b/_module/ncs/mk_ncond_33.ncs new file mode 100644 index 00000000..897df2ec Binary files /dev/null and b/_module/ncs/mk_ncond_33.ncs differ diff --git a/_module/ncs/mk_ncond_34.ncs b/_module/ncs/mk_ncond_34.ncs new file mode 100644 index 00000000..8b0072e2 Binary files /dev/null and b/_module/ncs/mk_ncond_34.ncs differ diff --git a/_module/ncs/mk_ncond_35.ncs b/_module/ncs/mk_ncond_35.ncs new file mode 100644 index 00000000..428196a7 Binary files /dev/null and b/_module/ncs/mk_ncond_35.ncs differ diff --git a/_module/ncs/mk_ncond_36.ncs b/_module/ncs/mk_ncond_36.ncs new file mode 100644 index 00000000..d885ecdd Binary files /dev/null and b/_module/ncs/mk_ncond_36.ncs differ diff --git a/_module/ncs/mk_ncond_37.ncs b/_module/ncs/mk_ncond_37.ncs new file mode 100644 index 00000000..59d7bd1a Binary files /dev/null and b/_module/ncs/mk_ncond_37.ncs differ diff --git a/_module/ncs/mk_ncond_38.ncs b/_module/ncs/mk_ncond_38.ncs new file mode 100644 index 00000000..34ad7fa5 Binary files /dev/null and b/_module/ncs/mk_ncond_38.ncs differ diff --git a/_module/ncs/mk_ncond_39.ncs b/_module/ncs/mk_ncond_39.ncs new file mode 100644 index 00000000..d39a1e25 Binary files /dev/null and b/_module/ncs/mk_ncond_39.ncs differ diff --git a/_module/ncs/mk_on_dismount.ncs b/_module/ncs/mk_on_dismount.ncs new file mode 100644 index 00000000..ddfa85b5 Binary files /dev/null and b/_module/ncs/mk_on_dismount.ncs differ diff --git a/_module/ncs/mk_on_dismounted.ncs b/_module/ncs/mk_on_dismounted.ncs new file mode 100644 index 00000000..2eb9e9e4 Binary files /dev/null and b/_module/ncs/mk_on_dismounted.ncs differ diff --git a/_module/ncs/mk_on_mount.ncs b/_module/ncs/mk_on_mount.ncs new file mode 100644 index 00000000..3ad383e3 Binary files /dev/null and b/_module/ncs/mk_on_mount.ncs differ diff --git a/_module/ncs/mk_on_mounted.ncs b/_module/ncs/mk_on_mounted.ncs new file mode 100644 index 00000000..8211ec10 Binary files /dev/null and b/_module/ncs/mk_on_mounted.ncs differ diff --git a/_module/ncs/mk_onplayerchat.ncs b/_module/ncs/mk_onplayerchat.ncs new file mode 100644 index 00000000..b71ff966 Binary files /dev/null and b/_module/ncs/mk_onplayerchat.ncs differ diff --git a/_module/ncs/mk_onplayertargt.ncs b/_module/ncs/mk_onplayertargt.ncs new file mode 100644 index 00000000..18221b0b Binary files /dev/null and b/_module/ncs/mk_onplayertargt.ncs differ diff --git a/_module/ncs/mk_pre_app.ncs b/_module/ncs/mk_pre_app.ncs new file mode 100644 index 00000000..35b51502 Binary files /dev/null and b/_module/ncs/mk_pre_app.ncs differ diff --git a/_module/ncs/mk_pre_armorpart.ncs b/_module/ncs/mk_pre_armorpart.ncs new file mode 100644 index 00000000..44728f88 Binary files /dev/null and b/_module/ncs/mk_pre_armorpart.ncs differ diff --git a/_module/ncs/mk_pre_body.ncs b/_module/ncs/mk_pre_body.ncs new file mode 100644 index 00000000..ba563a7c Binary files /dev/null and b/_module/ncs/mk_pre_body.ncs differ diff --git a/_module/ncs/mk_pre_cheats.ncs b/_module/ncs/mk_pre_cheats.ncs new file mode 100644 index 00000000..53086a13 Binary files /dev/null and b/_module/ncs/mk_pre_cheats.ncs differ diff --git a/_module/ncs/mk_pre_color2.ncs b/_module/ncs/mk_pre_color2.ncs new file mode 100644 index 00000000..b47245a1 Binary files /dev/null and b/_module/ncs/mk_pre_color2.ncs differ diff --git a/_module/ncs/mk_pre_crafting.ncs b/_module/ncs/mk_pre_crafting.ncs new file mode 100644 index 00000000..7244752c Binary files /dev/null and b/_module/ncs/mk_pre_crafting.ncs differ diff --git a/_module/ncs/mk_pre_critem.ncs b/_module/ncs/mk_pre_critem.ncs new file mode 100644 index 00000000..dc04f8ff Binary files /dev/null and b/_module/ncs/mk_pre_critem.ncs differ diff --git a/_module/ncs/mk_pre_db_item.ncs b/_module/ncs/mk_pre_db_item.ncs new file mode 100644 index 00000000..cb8c0ac5 Binary files /dev/null and b/_module/ncs/mk_pre_db_item.ncs differ diff --git a/_module/ncs/mk_pre_deity.ncs b/_module/ncs/mk_pre_deity.ncs new file mode 100644 index 00000000..991f2548 Binary files /dev/null and b/_module/ncs/mk_pre_deity.ncs differ diff --git a/_module/ncs/mk_pre_dye.ncs b/_module/ncs/mk_pre_dye.ncs new file mode 100644 index 00000000..7ca18c73 Binary files /dev/null and b/_module/ncs/mk_pre_dye.ncs differ diff --git a/_module/ncs/mk_pre_edit_desc.ncs b/_module/ncs/mk_pre_edit_desc.ncs new file mode 100644 index 00000000..96187a1f Binary files /dev/null and b/_module/ncs/mk_pre_edit_desc.ncs differ diff --git a/_module/ncs/mk_pre_footstep.ncs b/_module/ncs/mk_pre_footstep.ncs new file mode 100644 index 00000000..d4b1ce68 Binary files /dev/null and b/_module/ncs/mk_pre_footstep.ncs differ diff --git a/_module/ncs/mk_pre_head.ncs b/_module/ncs/mk_pre_head.ncs new file mode 100644 index 00000000..8f42b811 Binary files /dev/null and b/_module/ncs/mk_pre_head.ncs differ diff --git a/_module/ncs/mk_pre_itemlist.ncs b/_module/ncs/mk_pre_itemlist.ncs new file mode 100644 index 00000000..69b352cc Binary files /dev/null and b/_module/ncs/mk_pre_itemlist.ncs differ diff --git a/_module/ncs/mk_pre_itemprop.ncs b/_module/ncs/mk_pre_itemprop.ncs new file mode 100644 index 00000000..ec17eb6c Binary files /dev/null and b/_module/ncs/mk_pre_itemprop.ncs differ diff --git a/_module/ncs/mk_pre_material.ncs b/_module/ncs/mk_pre_material.ncs new file mode 100644 index 00000000..4ab903a6 Binary files /dev/null and b/_module/ncs/mk_pre_material.ncs differ diff --git a/_module/ncs/mk_pre_perpart_s.ncs b/_module/ncs/mk_pre_perpart_s.ncs new file mode 100644 index 00000000..2a046148 Binary files /dev/null and b/_module/ncs/mk_pre_perpart_s.ncs differ diff --git a/_module/ncs/mk_pre_pheno.ncs b/_module/ncs/mk_pre_pheno.ncs new file mode 100644 index 00000000..e7f39d59 Binary files /dev/null and b/_module/ncs/mk_pre_pheno.ncs differ diff --git a/_module/ncs/mk_pre_ren_item.ncs b/_module/ncs/mk_pre_ren_item.ncs new file mode 100644 index 00000000..4aa95268 Binary files /dev/null and b/_module/ncs/mk_pre_ren_item.ncs differ diff --git a/_module/ncs/mk_pre_scale.ncs b/_module/ncs/mk_pre_scale.ncs new file mode 100644 index 00000000..9661e00a Binary files /dev/null and b/_module/ncs/mk_pre_scale.ncs differ diff --git a/_module/ncs/mk_pre_swp_iprop.ncs b/_module/ncs/mk_pre_swp_iprop.ncs new file mode 100644 index 00000000..14ec585b Binary files /dev/null and b/_module/ncs/mk_pre_swp_iprop.ncs differ diff --git a/_module/ncs/mk_pre_tail.ncs b/_module/ncs/mk_pre_tail.ncs new file mode 100644 index 00000000..d4595dc1 Binary files /dev/null and b/_module/ncs/mk_pre_tail.ncs differ diff --git a/_module/ncs/mk_pre_vfx.ncs b/_module/ncs/mk_pre_vfx.ncs new file mode 100644 index 00000000..b75b6c2e Binary files /dev/null and b/_module/ncs/mk_pre_vfx.ncs differ diff --git a/_module/ncs/mk_pre_weaponpar.ncs b/_module/ncs/mk_pre_weaponpar.ncs new file mode 100644 index 00000000..0b810944 Binary files /dev/null and b/_module/ncs/mk_pre_weaponpar.ncs differ diff --git a/_module/ncs/mk_pre_wings.ncs b/_module/ncs/mk_pre_wings.ncs new file mode 100644 index 00000000..d4b8984c Binary files /dev/null and b/_module/ncs/mk_pre_wings.ncs differ diff --git a/_module/ncs/mk_set_00.ncs b/_module/ncs/mk_set_00.ncs new file mode 100644 index 00000000..7f882d34 Binary files /dev/null and b/_module/ncs/mk_set_00.ncs differ diff --git a/_module/ncs/mk_set_01.ncs b/_module/ncs/mk_set_01.ncs new file mode 100644 index 00000000..17693b3f Binary files /dev/null and b/_module/ncs/mk_set_01.ncs differ diff --git a/_module/ncs/mk_set_02.ncs b/_module/ncs/mk_set_02.ncs new file mode 100644 index 00000000..39ac9fa9 Binary files /dev/null and b/_module/ncs/mk_set_02.ncs differ diff --git a/_module/ncs/mk_set_03.ncs b/_module/ncs/mk_set_03.ncs new file mode 100644 index 00000000..f2cb3628 Binary files /dev/null and b/_module/ncs/mk_set_03.ncs differ diff --git a/_module/ncs/mk_set_04.ncs b/_module/ncs/mk_set_04.ncs new file mode 100644 index 00000000..f70707ca Binary files /dev/null and b/_module/ncs/mk_set_04.ncs differ diff --git a/_module/ncs/mk_set_05.ncs b/_module/ncs/mk_set_05.ncs new file mode 100644 index 00000000..15190dac Binary files /dev/null and b/_module/ncs/mk_set_05.ncs differ diff --git a/_module/ncs/mk_set_06.ncs b/_module/ncs/mk_set_06.ncs new file mode 100644 index 00000000..1b7e2d3d Binary files /dev/null and b/_module/ncs/mk_set_06.ncs differ diff --git a/_module/ncs/mk_set_07.ncs b/_module/ncs/mk_set_07.ncs new file mode 100644 index 00000000..84c8a56a Binary files /dev/null and b/_module/ncs/mk_set_07.ncs differ diff --git a/_module/ncs/mk_set_08.ncs b/_module/ncs/mk_set_08.ncs new file mode 100644 index 00000000..e1aba172 Binary files /dev/null and b/_module/ncs/mk_set_08.ncs differ diff --git a/_module/ncs/mk_set_09.ncs b/_module/ncs/mk_set_09.ncs new file mode 100644 index 00000000..b3fc7320 Binary files /dev/null and b/_module/ncs/mk_set_09.ncs differ diff --git a/_module/ncs/mk_set_10.ncs b/_module/ncs/mk_set_10.ncs new file mode 100644 index 00000000..7153ca14 Binary files /dev/null and b/_module/ncs/mk_set_10.ncs differ diff --git a/_module/ncs/mk_set_100.ncs b/_module/ncs/mk_set_100.ncs new file mode 100644 index 00000000..d69626c9 Binary files /dev/null and b/_module/ncs/mk_set_100.ncs differ diff --git a/_module/ncs/mk_set_101.ncs b/_module/ncs/mk_set_101.ncs new file mode 100644 index 00000000..2ff9d6c5 Binary files /dev/null and b/_module/ncs/mk_set_101.ncs differ diff --git a/_module/ncs/mk_set_11.ncs b/_module/ncs/mk_set_11.ncs new file mode 100644 index 00000000..e6aff5ba Binary files /dev/null and b/_module/ncs/mk_set_11.ncs differ diff --git a/_module/ncs/mk_set_12.ncs b/_module/ncs/mk_set_12.ncs new file mode 100644 index 00000000..fd8ba5ae Binary files /dev/null and b/_module/ncs/mk_set_12.ncs differ diff --git a/_module/ncs/mk_set_127.ncs b/_module/ncs/mk_set_127.ncs new file mode 100644 index 00000000..38bea0d9 Binary files /dev/null and b/_module/ncs/mk_set_127.ncs differ diff --git a/_module/ncs/mk_set_13.ncs b/_module/ncs/mk_set_13.ncs new file mode 100644 index 00000000..091ffef1 Binary files /dev/null and b/_module/ncs/mk_set_13.ncs differ diff --git a/_module/ncs/mk_set_14.ncs b/_module/ncs/mk_set_14.ncs new file mode 100644 index 00000000..7356fad4 Binary files /dev/null and b/_module/ncs/mk_set_14.ncs differ diff --git a/_module/ncs/mk_set_15.ncs b/_module/ncs/mk_set_15.ncs new file mode 100644 index 00000000..a426728d Binary files /dev/null and b/_module/ncs/mk_set_15.ncs differ diff --git a/_module/ncs/mk_set_16.ncs b/_module/ncs/mk_set_16.ncs new file mode 100644 index 00000000..aab6ce02 Binary files /dev/null and b/_module/ncs/mk_set_16.ncs differ diff --git a/_module/ncs/mk_set_17.ncs b/_module/ncs/mk_set_17.ncs new file mode 100644 index 00000000..b2fe5982 Binary files /dev/null and b/_module/ncs/mk_set_17.ncs differ diff --git a/_module/ncs/mk_set_18.ncs b/_module/ncs/mk_set_18.ncs new file mode 100644 index 00000000..f4970544 Binary files /dev/null and b/_module/ncs/mk_set_18.ncs differ diff --git a/_module/ncs/mk_set_19.ncs b/_module/ncs/mk_set_19.ncs new file mode 100644 index 00000000..ffb5fae8 Binary files /dev/null and b/_module/ncs/mk_set_19.ncs differ diff --git a/_module/ncs/mk_set_20.ncs b/_module/ncs/mk_set_20.ncs new file mode 100644 index 00000000..c379e76a Binary files /dev/null and b/_module/ncs/mk_set_20.ncs differ diff --git a/_module/ncs/mk_set_21.ncs b/_module/ncs/mk_set_21.ncs new file mode 100644 index 00000000..50aaa2cf Binary files /dev/null and b/_module/ncs/mk_set_21.ncs differ diff --git a/_module/ncs/mk_set_22.ncs b/_module/ncs/mk_set_22.ncs new file mode 100644 index 00000000..853954c2 Binary files /dev/null and b/_module/ncs/mk_set_22.ncs differ diff --git a/_module/ncs/mk_set_23.ncs b/_module/ncs/mk_set_23.ncs new file mode 100644 index 00000000..09b125a1 Binary files /dev/null and b/_module/ncs/mk_set_23.ncs differ diff --git a/_module/ncs/mk_set_24.ncs b/_module/ncs/mk_set_24.ncs new file mode 100644 index 00000000..3a088146 Binary files /dev/null and b/_module/ncs/mk_set_24.ncs differ diff --git a/_module/ncs/mk_set_249.ncs b/_module/ncs/mk_set_249.ncs new file mode 100644 index 00000000..3f360774 Binary files /dev/null and b/_module/ncs/mk_set_249.ncs differ diff --git a/_module/ncs/mk_set_25.ncs b/_module/ncs/mk_set_25.ncs new file mode 100644 index 00000000..0de0b189 Binary files /dev/null and b/_module/ncs/mk_set_25.ncs differ diff --git a/_module/ncs/mk_set_250.ncs b/_module/ncs/mk_set_250.ncs new file mode 100644 index 00000000..0ebb4ba7 Binary files /dev/null and b/_module/ncs/mk_set_250.ncs differ diff --git a/_module/ncs/mk_set_251.ncs b/_module/ncs/mk_set_251.ncs new file mode 100644 index 00000000..0c94672d Binary files /dev/null and b/_module/ncs/mk_set_251.ncs differ diff --git a/_module/ncs/mk_set_252.ncs b/_module/ncs/mk_set_252.ncs new file mode 100644 index 00000000..f83c5f4c Binary files /dev/null and b/_module/ncs/mk_set_252.ncs differ diff --git a/_module/ncs/mk_set_253.ncs b/_module/ncs/mk_set_253.ncs new file mode 100644 index 00000000..d52b63ad Binary files /dev/null and b/_module/ncs/mk_set_253.ncs differ diff --git a/_module/ncs/mk_set_254.ncs b/_module/ncs/mk_set_254.ncs new file mode 100644 index 00000000..5b1dbf6d Binary files /dev/null and b/_module/ncs/mk_set_254.ncs differ diff --git a/_module/ncs/mk_set_255.ncs b/_module/ncs/mk_set_255.ncs new file mode 100644 index 00000000..0796594f Binary files /dev/null and b/_module/ncs/mk_set_255.ncs differ diff --git a/_module/ncs/mk_set_257.ncs b/_module/ncs/mk_set_257.ncs new file mode 100644 index 00000000..70273869 Binary files /dev/null and b/_module/ncs/mk_set_257.ncs differ diff --git a/_module/ncs/mk_set_26.ncs b/_module/ncs/mk_set_26.ncs new file mode 100644 index 00000000..a293d512 Binary files /dev/null and b/_module/ncs/mk_set_26.ncs differ diff --git a/_module/ncs/mk_set_27.ncs b/_module/ncs/mk_set_27.ncs new file mode 100644 index 00000000..45f674f0 Binary files /dev/null and b/_module/ncs/mk_set_27.ncs differ diff --git a/_module/ncs/mk_set_28.ncs b/_module/ncs/mk_set_28.ncs new file mode 100644 index 00000000..39d8df33 Binary files /dev/null and b/_module/ncs/mk_set_28.ncs differ diff --git a/_module/ncs/mk_set_29.ncs b/_module/ncs/mk_set_29.ncs new file mode 100644 index 00000000..1170eb33 Binary files /dev/null and b/_module/ncs/mk_set_29.ncs differ diff --git a/_module/ncs/mk_set_30.ncs b/_module/ncs/mk_set_30.ncs new file mode 100644 index 00000000..f0bb2ae3 Binary files /dev/null and b/_module/ncs/mk_set_30.ncs differ diff --git a/_module/ncs/mk_set_31.ncs b/_module/ncs/mk_set_31.ncs new file mode 100644 index 00000000..6eefe8b4 Binary files /dev/null and b/_module/ncs/mk_set_31.ncs differ diff --git a/_module/ncs/mk_set_32.ncs b/_module/ncs/mk_set_32.ncs new file mode 100644 index 00000000..a3d2df68 Binary files /dev/null and b/_module/ncs/mk_set_32.ncs differ diff --git a/_module/ncs/mk_set_33.ncs b/_module/ncs/mk_set_33.ncs new file mode 100644 index 00000000..e2cbfaa9 Binary files /dev/null and b/_module/ncs/mk_set_33.ncs differ diff --git a/_module/ncs/mk_set_34.ncs b/_module/ncs/mk_set_34.ncs new file mode 100644 index 00000000..5ddf65bb Binary files /dev/null and b/_module/ncs/mk_set_34.ncs differ diff --git a/_module/ncs/mk_set_35.ncs b/_module/ncs/mk_set_35.ncs new file mode 100644 index 00000000..b21fc713 Binary files /dev/null and b/_module/ncs/mk_set_35.ncs differ diff --git a/_module/ncs/mk_set_36.ncs b/_module/ncs/mk_set_36.ncs new file mode 100644 index 00000000..f5c2b7a1 Binary files /dev/null and b/_module/ncs/mk_set_36.ncs differ diff --git a/_module/ncs/mk_set_37.ncs b/_module/ncs/mk_set_37.ncs new file mode 100644 index 00000000..f1a1ab03 Binary files /dev/null and b/_module/ncs/mk_set_37.ncs differ diff --git a/_module/ncs/mk_set_38.ncs b/_module/ncs/mk_set_38.ncs new file mode 100644 index 00000000..2db33cdf Binary files /dev/null and b/_module/ncs/mk_set_38.ncs differ diff --git a/_module/ncs/mk_set_39.ncs b/_module/ncs/mk_set_39.ncs new file mode 100644 index 00000000..e3675f8e Binary files /dev/null and b/_module/ncs/mk_set_39.ncs differ diff --git a/_module/ncs/mk_set_40.ncs b/_module/ncs/mk_set_40.ncs new file mode 100644 index 00000000..b0cda1c6 Binary files /dev/null and b/_module/ncs/mk_set_40.ncs differ diff --git a/_module/ncs/mk_set_invalid.ncs b/_module/ncs/mk_set_invalid.ncs new file mode 100644 index 00000000..f3c549d2 Binary files /dev/null and b/_module/ncs/mk_set_invalid.ncs differ diff --git a/_module/ncs/mk_start_acp.ncs b/_module/ncs/mk_start_acp.ncs new file mode 100644 index 00000000..c7bbea14 Binary files /dev/null and b/_module/ncs/mk_start_acp.ncs differ diff --git a/_module/ncs/nw_c2_default3.ncs b/_module/ncs/nw_c2_default3.ncs index a5700fa5..a4ccc56a 100644 Binary files a/_module/ncs/nw_c2_default3.ncs and b/_module/ncs/nw_c2_default3.ncs differ diff --git a/_module/ncs/nw_c2_default4.ncs b/_module/ncs/nw_c2_default4.ncs index d3d76f72..211a2efa 100644 Binary files a/_module/ncs/nw_c2_default4.ncs and b/_module/ncs/nw_c2_default4.ncs differ diff --git a/_module/ncs/nw_c2_default5.ncs b/_module/ncs/nw_c2_default5.ncs index b3f611bd..61b37ff2 100644 Binary files a/_module/ncs/nw_c2_default5.ncs and b/_module/ncs/nw_c2_default5.ncs differ diff --git a/_module/ncs/nw_c2_default6.ncs b/_module/ncs/nw_c2_default6.ncs index c2561c86..72ba74c5 100644 Binary files a/_module/ncs/nw_c2_default6.ncs and b/_module/ncs/nw_c2_default6.ncs differ diff --git a/_module/ncs/nw_c2_default7.ncs b/_module/ncs/nw_c2_default7.ncs deleted file mode 100644 index 0e12f4e6..00000000 Binary files a/_module/ncs/nw_c2_default7.ncs and /dev/null differ diff --git a/_module/ncs/nw_c2_default8.ncs b/_module/ncs/nw_c2_default8.ncs index 8eb9d7e3..d2e3160f 100644 Binary files a/_module/ncs/nw_c2_default8.ncs and b/_module/ncs/nw_c2_default8.ncs differ diff --git a/_module/ncs/nw_c2_default9.ncs b/_module/ncs/nw_c2_default9.ncs deleted file mode 100644 index 5ee7a28f..00000000 Binary files a/_module/ncs/nw_c2_default9.ncs and /dev/null differ diff --git a/_module/ncs/nw_c2_defaultb.ncs b/_module/ncs/nw_c2_defaultb.ncs index 25370352..e1c07979 100644 Binary files a/_module/ncs/nw_c2_defaultb.ncs and b/_module/ncs/nw_c2_defaultb.ncs differ diff --git a/_module/ncs/nw_c2_defaulte.ncs b/_module/ncs/nw_c2_defaulte.ncs index b95ac13b..1eb98734 100644 Binary files a/_module/ncs/nw_c2_defaulte.ncs and b/_module/ncs/nw_c2_defaulte.ncs differ diff --git a/_module/ncs/nw_c2_dropin9.ncs b/_module/ncs/nw_c2_dropin9.ncs index 9cf8094b..611f57b9 100644 Binary files a/_module/ncs/nw_c2_dropin9.ncs and b/_module/ncs/nw_c2_dropin9.ncs differ diff --git a/_module/ncs/nw_c2_herbivore.ncs b/_module/ncs/nw_c2_herbivore.ncs index 15a6db17..6ab245b6 100644 Binary files a/_module/ncs/nw_c2_herbivore.ncs and b/_module/ncs/nw_c2_herbivore.ncs differ diff --git a/_module/ncs/nw_o0_death.ncs b/_module/ncs/nw_o0_death.ncs index 7fcc5ab6..be4a2190 100644 Binary files a/_module/ncs/nw_o0_death.ncs and b/_module/ncs/nw_o0_death.ncs differ diff --git a/_module/ncs/nw_s2_divprot.ncs b/_module/ncs/nw_s2_divprot.ncs index a61f911c..b28c6e6e 100644 Binary files a/_module/ncs/nw_s2_divprot.ncs and b/_module/ncs/nw_s2_divprot.ncs differ diff --git a/_module/ncs/nw_s3_balordeth.ncs b/_module/ncs/nw_s3_balordeth.ncs index b1c3419f..65837869 100644 Binary files a/_module/ncs/nw_s3_balordeth.ncs and b/_module/ncs/nw_s3_balordeth.ncs differ diff --git a/_module/ncs/nw_walk_wp.ncs b/_module/ncs/nw_walk_wp.ncs index 87f617df..08231bdc 100644 Binary files a/_module/ncs/nw_walk_wp.ncs and b/_module/ncs/nw_walk_wp.ncs differ diff --git a/_module/ncs/on_acquire.ncs b/_module/ncs/on_acquire.ncs index 2e0b084b..ad38dd15 100644 Binary files a/_module/ncs/on_acquire.ncs and b/_module/ncs/on_acquire.ncs differ diff --git a/_module/ncs/on_client_enter.ncs b/_module/ncs/on_client_enter.ncs index 2e8f4c7f..8c4801b7 100644 Binary files a/_module/ncs/on_client_enter.ncs and b/_module/ncs/on_client_enter.ncs differ diff --git a/_module/ncs/on_unacquire.ncs b/_module/ncs/on_unacquire.ncs index b106aedf..9b84f875 100644 Binary files a/_module/ncs/on_unacquire.ncs and b/_module/ncs/on_unacquire.ncs differ diff --git a/_module/ncs/openstore003.ncs b/_module/ncs/openstore003.ncs index be2484cb..34a17f15 100644 Binary files a/_module/ncs/openstore003.ncs and b/_module/ncs/openstore003.ncs differ diff --git a/_module/ncs/openstore01.ncs b/_module/ncs/openstore01.ncs index c07fbfeb..b74eba53 100644 Binary files a/_module/ncs/openstore01.ncs and b/_module/ncs/openstore01.ncs differ diff --git a/_module/ncs/openstore018.ncs b/_module/ncs/openstore018.ncs index d8c153d9..33b7e3bd 100644 Binary files a/_module/ncs/openstore018.ncs and b/_module/ncs/openstore018.ncs differ diff --git a/_module/ncs/port_to_aschb.ncs b/_module/ncs/port_to_aschb.ncs index bd5c18a0..ae29e753 100644 Binary files a/_module/ncs/port_to_aschb.ncs and b/_module/ncs/port_to_aschb.ncs differ diff --git a/_module/ncs/port_to_crat_bay.ncs b/_module/ncs/port_to_crat_bay.ncs index 5d3fc402..9cc4c9ca 100644 Binary files a/_module/ncs/port_to_crat_bay.ncs and b/_module/ncs/port_to_crat_bay.ncs differ diff --git a/_module/ncs/port_to_del.ncs b/_module/ncs/port_to_del.ncs index a64f9250..22063b4e 100644 Binary files a/_module/ncs/port_to_del.ncs and b/_module/ncs/port_to_del.ncs differ diff --git a/_module/ncs/port_to_ever.ncs b/_module/ncs/port_to_ever.ncs index 963c95a6..814091e1 100644 Binary files a/_module/ncs/port_to_ever.ncs and b/_module/ncs/port_to_ever.ncs differ diff --git a/_module/ncs/port_to_leader.ncs b/_module/ncs/port_to_leader.ncs index 800a3537..fddaa2fa 100644 Binary files a/_module/ncs/port_to_leader.ncs and b/_module/ncs/port_to_leader.ncs differ diff --git a/_module/ncs/port_to_lust_lag.ncs b/_module/ncs/port_to_lust_lag.ncs index 8efc07dc..70aa489f 100644 Binary files a/_module/ncs/port_to_lust_lag.ncs and b/_module/ncs/port_to_lust_lag.ncs differ diff --git a/_module/ncs/port_to_ooc_area.ncs b/_module/ncs/port_to_ooc_area.ncs index 93a565f3..b8a16a8c 100644 Binary files a/_module/ncs/port_to_ooc_area.ncs and b/_module/ncs/port_to_ooc_area.ncs differ diff --git a/_module/ncs/port_to_schamed.ncs b/_module/ncs/port_to_schamed.ncs index f77216f2..33e91de1 100644 Binary files a/_module/ncs/port_to_schamed.ncs and b/_module/ncs/port_to_schamed.ncs differ diff --git a/_module/ncs/port_to_tanzia.ncs b/_module/ncs/port_to_tanzia.ncs index 74e798ad..692f9bd5 100644 Binary files a/_module/ncs/port_to_tanzia.ncs and b/_module/ncs/port_to_tanzia.ncs differ diff --git a/_module/ncs/sfpb_close.ncs b/_module/ncs/sfpb_close.ncs index e31bcc9e..7094ab07 100644 Binary files a/_module/ncs/sfpb_close.ncs and b/_module/ncs/sfpb_close.ncs differ diff --git a/_module/ncs/sfpb_open.ncs b/_module/ncs/sfpb_open.ncs index f43aa474..badb97b2 100644 Binary files a/_module/ncs/sfpb_open.ncs and b/_module/ncs/sfpb_open.ncs differ diff --git a/_module/ncs/sfpb_used.ncs b/_module/ncs/sfpb_used.ncs index 42e4cafb..f7b08e3f 100644 Binary files a/_module/ncs/sfpb_used.ncs and b/_module/ncs/sfpb_used.ncs differ diff --git a/_module/ncs/skinnable_corpse.ncs b/_module/ncs/skinnable_corpse.ncs index 353f2106..ccec6330 100644 Binary files a/_module/ncs/skinnable_corpse.ncs and b/_module/ncs/skinnable_corpse.ncs differ diff --git a/_module/ncs/stoneport2guild.ncs b/_module/ncs/stoneport2guild.ncs index 6e5234fe..8e90933d 100644 Binary files a/_module/ncs/stoneport2guild.ncs and b/_module/ncs/stoneport2guild.ncs differ diff --git a/_module/ncs/stonerecallspc.ncs b/_module/ncs/stonerecallspc.ncs index 1694872f..77c35a19 100644 Binary files a/_module/ncs/stonerecallspc.ncs and b/_module/ncs/stonerecallspc.ncs differ diff --git a/_module/ncs/stonestoresloc.ncs b/_module/ncs/stonestoresloc.ncs index 7db3377d..540716bb 100644 Binary files a/_module/ncs/stonestoresloc.ncs and b/_module/ncs/stonestoresloc.ncs differ diff --git a/_module/ncs/vamp_only.ncs b/_module/ncs/vamp_only.ncs index 64e3aef6..a3821e21 100644 Binary files a/_module/ncs/vamp_only.ncs and b/_module/ncs/vamp_only.ncs differ diff --git a/_module/ncs/zep_use_chair.ncs b/_module/ncs/zep_use_chair.ncs index 6009fc44..2c24df28 100644 Binary files a/_module/ncs/zep_use_chair.ncs and b/_module/ncs/zep_use_chair.ncs differ diff --git a/_module/ncs/zep_use_chair2.ncs b/_module/ncs/zep_use_chair2.ncs index 463d664a..432ff0db 100644 Binary files a/_module/ncs/zep_use_chair2.ncs and b/_module/ncs/zep_use_chair2.ncs differ diff --git a/_module/nss/_enchant_armor.nss b/_module/nss/_enchant_armor.nss deleted file mode 100644 index ba977aa7..00000000 --- a/_module/nss/_enchant_armor.nss +++ /dev/null @@ -1,1063 +0,0 @@ -//New enchantarmor 10-21-05 -//#include "_persist_01a" -#include "x2_inc_itemprop" -#include "aps_include" - -void GetNextItemPossessedBy(object oPC, string sItemTag); -void GetNextStackedItem(object oPC, string sEssenceTag, int iCount); -void CreateAnObject(string sResource, object oPC, int iStackSize); -object CreatePlaceable(string sObject, location lPlace, float fDuration); -object oTestValid=OBJECT_INVALID; -void EnchantArmor(object oItem,int wBonus); -void EnPowerArmor(object oItem,int DamageType,int DamageQty); -void GiveToPC(object oItem, object oPC); - -string sDialogResRef=""; -string sEssence; -void main() -{ - object oPC = GetLastDisturbed(); - object oItem = GetInventoryDisturbItem(); - string sItemTag = GetTag(oItem); - string sReEnchantMessage = "INVALID"; - int iReEnchant = 0; - int iBaseItem=0; - int iMaxReEnchant; - int iMaxReEnchant2; - int iMaxReEnchant3; - int wBonus=1; - int wEffect=0; - int iEnpower=0; - -int iEnchantSkill = GetPersistentInt(oPC,"iEnchantSkill","UOACraft"); -int iEnchantChance = iEnchantSkill; - - - if (GetInventoryDisturbType()!= INVENTORY_DISTURB_TYPE_ADDED) - { - if (sItemTag=="ENCHANT_ARMOR1") - { - SetLocalInt(oPC,"iEnchant",1); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant ARMOR to +1.",oPC,FALSE); - } - - if (sItemTag=="ENCHANT_ARMOR2") - { - if (iEnchantChance >= 100) - { - SetLocalInt(oPC,"iEnchant",2); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant ARMOR to +2.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENCHANT_ARMOR3") - { - if (iEnchantChance >= 157) - { - SetLocalInt(oPC,"iEnchant",3); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant ARMOR to +3.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENCHANT_ARMOR4") - { - if (iEnchantChance >= 214) - { - SetLocalInt(oPC,"iEnchant",4); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant ARMOR to +4.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENCHANT_ARMOR5") - { - if (iEnchantChance >= 271) - { - SetLocalInt(oPC,"iEnchant",5); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant ARMOR to +5",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENCHANT_ARMOR6") - { - if (iEnchantChance >= 328) - { - SetLocalInt(oPC,"iEnchant",6); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant ARMOR to +6.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENCHANT_ARMOR7") - { - if (iEnchantChance >= 385) - { - SetLocalInt(oPC,"iEnchant",7); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant ARMOR to +7.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant Armor with this.",oPC,FALSE); - } - if (sItemTag=="ENCHANT_ARMOR8") - { - if (iEnchantChance >= 442) - { - SetLocalInt(oPC,"iEnchant",8); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant ARMOR to +8.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant Armor with this.",oPC,FALSE); - } - if (sItemTag=="ENCHANT_ARMOR9") - { - if (iEnchantChance >= 500) - { - SetLocalInt(oPC,"iEnchant",9); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant ARMOR to +9.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant Armor with this.",oPC,FALSE); - } - if (sItemTag=="ENCHANT_ARMOR10") - { - if (iEnchantChance >= 590) - { - SetLocalInt(oPC,"iEnchant",10); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant ARMOR to +10.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant Armor with this.",oPC,FALSE); - } - if (sItemTag=="ENCHANT_ARMOR11") - { - if (iEnchantChance >= 640) - { - SetLocalInt(oPC,"iEnchant",11); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant ARMOR to +11.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant Armor with this.",oPC,FALSE); - } - if (sItemTag=="ENCHANT_ARMOR12") - { - if (iEnchantChance >= 730) - { - SetLocalInt(oPC,"iEnchant",12); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant ARMOR to +12.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant Armor with this.",oPC,FALSE); - } - if (sItemTag=="ENCHANT_ARMOR13") - { - if (iEnchantChance >= 840) - { - SetLocalInt(oPC,"iEnchant",13); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant ARMOR to +13.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant Armor with this.",oPC,FALSE); - } - if (sItemTag=="ENCHANT_ARMOR14") - { - if (iEnchantChance >= 950) - { - SetLocalInt(oPC,"iEnchant",14); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant ARMOR to +14.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant Armor with this.",oPC,FALSE); - } - if (sItemTag=="ENPOWER_ARMOR1") - { - if (iEnchantChance >= 500) - { - SetLocalInt(oPC,"iEnpower",1); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower ARMOR with Acid Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR2") - { - if (iEnchantChance >= 500) - { - SetLocalInt(oPC,"iEnpower",2); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower ARMOR with Cold Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR3") - { - if (iEnchantChance >= 500) - { - SetLocalInt(oPC,"iEnpower",3); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower ARMOR with Electrical Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR4") - { - if (iEnchantChance >= 500) - { - SetLocalInt(oPC,"iEnpower",4); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower ARMOR with Fire Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR5") - { - if (iEnchantChance >= 700) - { - SetLocalInt(oPC,"iEnpower",5); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower ARMOR with Acid Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR6") - { - if (iEnchantChance >= 700) - { - SetLocalInt(oPC,"iEnpower",6); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower ARMOR with Cold Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR7") - { - if (iEnchantChance >= 700) - { - SetLocalInt(oPC,"iEnpower",7); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower ARMOR with Electrical Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR8") - { - if (iEnchantChance >= 700) - { - SetLocalInt(oPC,"iEnpower",8); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower ARMOR with Fire Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR9") - { - if (iEnchantChance >= 800) - { - SetLocalInt(oPC,"iEnpower",9); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower ARMOR with Acid Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR10") - { - if (iEnchantChance >= 800) - { - SetLocalInt(oPC,"iEnpower",10); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower ARMOR with Cold Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR11") - { - if (iEnchantChance >= 800) - { - SetLocalInt(oPC,"iEnpower",12); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower ARMOR with Fire Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR12") - { - if (iEnchantChance >= 800) - { - SetLocalInt(oPC,"iEnpower",13); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower ARMOR with Slashing Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR13") - { - if (iEnchantChance >= 900) - { - SetLocalInt(oPC,"iEnpower",14); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower ARMOR with Piercing Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR14") - { - if (iEnchantChance >= 900) - { - SetLocalInt(oPC,"iEnpower",15); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower ARMOR with Bludgeoning Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR15") - { - if (iEnchantChance >= 900) - { - SetLocalInt(oPC,"iEnpower",16); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower ARMOR with Negative Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR16") - { - if (iEnchantChance >= 800) - { - SetLocalInt(oPC,"iEnpower",11); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower ARMOR with Electrical Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - CopyObject(oItem,GetLocation(oPC),OBJECT_SELF,GetTag(oItem)); - DestroyObject(oItem); - return; - } - - - // The following 3 lines are to ensure compatability with UOAbigal's Persistent Token System. - // You can replace them with whatever 'no-drop' code you have or comment them out. - string sNoDropFlag = (GetStringLeft(GetTag(oItem),6)); - if (sNoDropFlag == "NoDrop" || sNoDropFlag == "TOKEN_"||sNoDropFlag=="_TBOX_") - return; - if (GetBaseItemType(oItem)==BASE_ITEM_LARGEBOX) - { - DestroyObject(oItem); - SendMessageToPC(oPC,"To avoid possible dupe exploits, the container placed in this bag may be destroyed."); - return; - } - // End of compatability portion. - - if (GetLocalInt(OBJECT_SELF,"iAmInUse")!=0) - { - FloatingTextStringOnCreature("You must wait for this item to finish enchanting..",oPC,FALSE); - CopyItem(oItem,oPC,TRUE); - DestroyObject(oItem); - return; - } - - iBaseItem = GetBaseItemType(oItem); - string sItemResRef = ""; - int iStackSize = 0; - int iMaxStack = 5; - string sSuccess = ""; - -// Determins the PC level in the class WIZARD (CLASS_TYPE_WIZARD) -/* int wizard_lvl = 0; - wizard_lvl = GetLevelByClass(CLASS_TYPE_WIZARD,oPC); - SendMessageToPC(oPC,"Your Level in Wizard == " + IntToString(wizard_lvl)); - - if (wizard_lvl <=7 ) - { - CopyItem(oItem,oPC,TRUE); - FloatingTextStringOnCreature("You are not a powerful enough wizard you cannot Enchant this item!",oPC,FALSE); - DestroyObject(oItem); - return; - } -*/ - - if (GetStringLeft(sItemTag,5) != "ARMR_" && GetStringLeft(sItemTag,6) != "CLOTH_") - { - CopyItem(oItem,oPC,TRUE); - FloatingTextStringOnCreature("You cannot Enchant this item!",oPC,FALSE); - DestroyObject(oItem); - return; - } - - //int iEnchantChance = GetTokenPair(oPC,14,2); -// int iEnchantSkill = GetCampaignInt("UOACraft","iEnchantSkill",oPC); -// int iEnchantChance = iEnchantSkill; - - - if (iEnchantChance <=350) - { - iEnchantChance = GetAbilityScore(oPC,ABILITY_INTELLIGENCE)*3; - iEnchantChance = iEnchantChance + GetAbilityScore(oPC,ABILITY_DEXTERITY) + GetAbilityScore(oPC,ABILITY_WISDOM); - iEnchantChance = iEnchantChance * 3; - if (iEnchantChance >350) iEnchantChance = 350; - if (iEnchantSkill > iEnchantChance) iEnchantChance = iEnchantSkill; - } - - if (sItemResRef=="INVALID") - { - SendMessageToPC(oPC,"You cannot Enchant this item!"); - CopyItem(oItem,oPC,TRUE); - DestroyObject(oItem,0.1); - return; - } - - if (iEnchantChance < 1) - { - if (iReEnchant==0) - { - FloatingTextStringOnCreature("You have no idea how to Enchant this item.",oPC,FALSE); - } - else - { - FloatingTextStringOnCreature("You have no idea how to reEnchant this item.",oPC,FALSE); - } - CopyItem(oItem,oPC,TRUE); - DestroyObject(oItem); - return; - } - - string sFlame= ""; - int iEnchant = GetLocalInt(oPC,"iEnchant"); - float fAngleToVector = 0.4; - - switch(iEnchant) //se chance of success - { - case 1: - { - fAngleToVector = 0.5; - // iMaxStack = iMaxStack+3; - if (iReEnchant==0)iEnchantChance = iEnchantChance+150; - // sFlame = "plc_flamesmall"; - break; - } - case 2: - { - fAngleToVector = 0.6; - // iMaxStack = iMaxStack+1; - if (iReEnchant==0)iEnchantChance = iEnchantChance+100; - // sFlame = "plc_flamesmall"; - break; - } - case 3: - { - fAngleToVector = 0.6; -// iMaxStack = iMaxStack+1; - if (iReEnchant==0)iEnchantChance = iEnchantChance+75; - // sFlame = "plc_flamesmall"; - break; - } - case 4: - { - fAngleToVector = 0.2; -// iMaxStack = iMaxStack-2; - if (iReEnchant==0)iEnchantChance = iEnchantChance+50; -// DelayCommand(6.0,SendMessageToPC(oPC,"Current Enchanting chance : "+ IntToString(iEnchantChance)+"%")); - // sFlame = "plc_flamelarge"; - break; - } - case 5: - { - fAngleToVector = 0.3; - // iMaxStack = iMaxStack -3; - if (iReEnchant==0)iEnchantChance = iEnchantChance; - // sFlame = "plc_flamelarge"; - break; - } - case 6: - { - fAngleToVector = 0.3; - // iMaxStack = iMaxStack -3; - if (iReEnchant==0)iEnchantChance = iEnchantChance-100; - // sFlame = "plc_flamelarge"; - break; - } - case 7: - { - fAngleToVector = 0.3; - // iMaxStack = iMaxStack -3; - if (iReEnchant==0)iEnchantChance = iEnchantChance-250; - // sFlame = "plc_flamelarge"; - break; - } - case 8: - { - fAngleToVector = 0.4; - // iMaxStack = iMaxStack -3; - if (iReEnchant==0)iEnchantChance = iEnchantChance-270; - //DelayCommand(6.0,SendMessageToPC(oPC,"Value of iEnchant : " + IntToString(iEnchant))); - //DelayCommand(6.0,SendMessageToPC(oPC,"Current Enchanting chance : "+ IntToString(iEnchantChance)+"%")); - sFlame = "plc_flamemedium"; - break; - } - case 9: - { - fAngleToVector = 0.4; - // iMaxStack = iMaxStack -3; - if (iReEnchant==0)iEnchantChance = iEnchantChance-290; - sFlame = "plc_flamemedium"; - break; - } - case 10: - { - fAngleToVector = 0.4; - // iMaxStack = iMaxStack -3; - if (iReEnchant==0)iEnchantChance = iEnchantChance-310; - sFlame = "plc_flamemedium"; - break; - } - case 11: - { - fAngleToVector = 0.4; - // iMaxStack = iMaxStack -3; - if (iReEnchant==0)iEnchantChance = iEnchantChance-330; - sFlame = "plc_flamelarge"; - break; - } - case 12: - { - fAngleToVector = 0.4; - // iMaxStack = iMaxStack -3; - if (iReEnchant==0)iEnchantChance = iEnchantChance-350; - sFlame = "plc_flamelarge"; - break; - } - case 13: - { - fAngleToVector = 0.4; - // iMaxStack = iMaxStack -3; - if (iReEnchant==0)iEnchantChance = iEnchantChance-370; - sFlame = "plc_flamelarge"; - break; - } - case 14: - { - fAngleToVector = 0.4; - // iMaxStack = iMaxStack -3; - if (iReEnchant==0)iEnchantChance = iEnchantChance-390; - sFlame = "plc_flamelarge"; - break; - } - default: - { - sFlame = "plc_flamemedium"; - break; - } - } -//////////////////////////////////////////////////////////////////////// - iEnpower = GetLocalInt(oPC,"iEnpower"); - switch(iEnpower) - { - case 1: - { - sEssence = "essence001"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_ACID); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_10); - } - break; - } - case 2: - { - sEssence = "essence017"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_COLD); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_10); - } - break; - } - case 3: - { - sEssence = "essence006"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_ELECTRICAL); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_10); - } - break; - } - case 4: - { - sEssence = "essence011"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_FIRE); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_10); - } - break; - } - case 5: - { - sEssence = "essence001"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_ACID); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_15); - } - break; - } - case 6: - { - sEssence = "essence017"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_COLD); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_15); - } - break; - } - case 7: - { - sEssence = "essence006"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_ELECTRICAL); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_15); - } - break; - } - case 8: - { - sEssence = "essence011"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_FIRE); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_15); - } - break; - } - case 9: - { - sEssence = "essence001"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_ACID); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_20); - } - break; - } - case 10: - { - sEssence = "essence017"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_COLD); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_20); - } - break; - } - case 11: - { - sEssence = "essence006"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_ELECTRICAL); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_20); - } - break; - } - case 12: - { - sEssence = "essence011"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_FIRE); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_20); - } - break; - } - case 13: - { - sEssence = "essence016"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_SLASHING); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_15); - } - break; - } - case 14: - { - sEssence = "essence016"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_PIERCING); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_15); - } - break; - } - case 15: - { - sEssence = "essence016"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_BLUDGEONING); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_15); - } - break; - } - case 16: - { - sEssence = "essence016"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_NEGATIVE); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_15); - } - break; - } - default: - { - int DamageType=0; - int DamageQty=0; - break; - } - } //end of switch - -////////////////////////////////////////////////////////////////////////////// - - location lSelf = GetLocation(OBJECT_SELF); - float fSelf = GetFacing(OBJECT_SELF); - vector vSelf = GetPosition(OBJECT_SELF); - object oArea = GetArea(OBJECT_SELF); - vector vFire; - int vDirection; - vFire = vSelf + (AngleToVector(fSelf) * fAngleToVector); - location lFire = Location(oArea,vFire,fSelf); - object oFire = CreatePlaceable(sFlame, lFire, 6.0); - - AssignCommand(oPC,PlaySound("al_mg_chntmagic1")); - AssignCommand(oPC,PlaySound("al_mg_crystalgd1")); - AssignCommand(oPC,PlaySound("al_mg_jacobs1")); - AssignCommand(oPC,ActionPlayAnimation(ANIMATION_LOOPING_GET_MID,1.0,4.0)); - PlayAnimation(ANIMATION_PLACEABLE_ACTIVATE,1.0,6.0); - - SetLocalInt(OBJECT_SELF,"iAmInUse",99); - DelayCommand(7.0,SetLocalInt(OBJECT_SELF,"iAmInUse",0)); - //ensure at least 1 respawn 10 minutes after used... - //this is to prevent a broken placeable that is used, with a 'in use' delay - //which would cancel the respawn - if (GetLocalInt(OBJECT_SELF,"iAmSetToRespawn")!=99) - { - SetLocalInt(OBJECT_SELF,"iAmSetToRespawn",99); - DelayCommand(600.0,ExecuteScript("_onclose_clear",OBJECT_SELF)); - } - - int iRandom = 0; - - int iSuccess = 0; - int iSkillGain = 0; - -////////////////////////////////////////////begin stackables - object oTemp = OBJECT_INVALID; - oTemp = GetItemPossessedBy(oPC,sEssence); - object oEssence = oTemp; - string sEssenceTag = GetTag(oEssence); - int iCount = 0; - int iEssence = 1; - iCount = GetNumStackedItems(oTemp); - DestroyObject(oTemp); - if (iCount iEssence) - { - iCount = iCount - iEssence; - SendMessageToPC(oPC,"You should get back "+IntToString(iCount)+" essences"); - DelayCommand(1.0,CreateAnObject(sEssence,oPC,iCount)); - } - } -////////////////////////////////////////////////////////////////end stackables - - iEnpower = GetLocalInt(oPC,"iEnpower"); - iEnchantChance = iEnchantChance - (iEnchantSkill * iEnpower/100); - //SendMessageToPC(oPC,"Value of iEnpower : " + IntToString(iEnpower)); - //SendMessageToPC(oPC,"Current Enchanting chance : "+ IntToString(iEnchantChance)+"%"); - - if (Random(1000) <= iEnchantChance) - { - iSuccess = 1; - iStackSize = 1; - if (iEnchant>=1) - { - DelayCommand(5.0,AssignCommand(oPC,ActionPlayAnimation(ANIMATION_LOOPING_CONJURE1,1.0,1.0))); - DelayCommand(5.0,AssignCommand(oPC,ActionPlayAnimation(ANIMATION_FIREFORGET_VICTORY1,1.0,1.0))); - DelayCommand(5.0,EnchantArmor(oItem,iEnchant)); -// DelayCommand(5.0,EnchantItem(oItem)); - DelayCommand(6.0, GiveToPC(oItem,oPC)); - sSuccess = "You successfully Enchant the Item"; - DelayCommand(6.0,FloatingTextStringOnCreature(sSuccess,oPC,FALSE)); - DelayCommand(5.8,PlaySound("vs_chant_conj_lm")); - DelayCommand(6.0,ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_DUR_BLUR,FALSE),OBJECT_SELF,2.0)); - } //end of iEnchant if - - int iEnpower = GetLocalInt(oPC,"iEnpower"); - int DamageType =GetLocalInt(oPC,"DamageType"); - int DamageQty =GetLocalInt(oPC,"DamageQty"); - if (iEnpower>=1) - { - DelayCommand(5.0,AssignCommand(oPC,ActionPlayAnimation(ANIMATION_LOOPING_CONJURE2,1.0,1.0))); - DelayCommand(5.0,AssignCommand(oPC,ActionPlayAnimation(ANIMATION_FIREFORGET_VICTORY2,1.0,1.0))); - DelayCommand(5.0,EnPowerArmor(oItem,DamageType,DamageQty)); - DelayCommand(6.0, GiveToPC(oItem,oPC)); - sSuccess = "You successfully Enpower the Item"; - DelayCommand(6.0,FloatingTextStringOnCreature(sSuccess,oPC,FALSE)); - DelayCommand(5.8,PlaySound("vs_chant_ench_hm")); - DelayCommand(6.0,ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_BEAM_LIGHTNING,FALSE),OBJECT_SELF,2.0)); - } //end of iEnpower if - - } - else - { - DelayCommand(5.0,AssignCommand(oPC,ActionPlayAnimation(ANIMATION_LOOPING_PAUSE_TIRED,1.0,1.0))); - DelayCommand(6.0,FloatingTextStringOnCreature("The incantation fails and the item is lost.",oPC,FALSE)); - DelayCommand(5.8,PlaySound("as_na_steamshrt2")); - DelayCommand(6.0,ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_DUR_PARALYZED ,FALSE),OBJECT_SELF,2.0)); - } - DelayCommand(6.0,DestroyObject(oItem)); - - if (iSuccess == 1) - { - iRandom = Random(1000); - if (iEnchantSkill > 700) iRandom = iRandom + 25; - if (iEnchantSkill > 998) iRandom = iRandom - 20; - if (iEnchantSkill > 999) iRandom = 0; - if (iRandom > iEnchantSkill) - { - if (d10(1)+1 >= iEnchantChance/100) iSkillGain = 1; - } - } - -//Ensure no more than 1 skill gain every 10 seconds to avoid token droppage. - if (iSkillGain ==1) - { - if (GetLocalInt(oPC,"iSkillGain")!= 0) - { - iSkillGain = 0; - } - else - { - SetLocalInt(oPC,"iSkillGain",99); - DelayCommand(10.0,SetLocalInt(oPC,"iSkillGain",0)); - } - } // end of if iskill gain == 1 - - - if (iSkillGain ==1) - { - string sOldSkill = ""; - string sOldSkill2 = ""; - iEnchantSkill++; - sOldSkill2 = IntToString(iEnchantSkill); - sOldSkill = "."+GetStringRight(sOldSkill2,1); - if (iEnchantSkill > 9) - { - sOldSkill = GetStringLeft(sOldSkill2,GetStringLength(sOldSkill2)-1)+sOldSkill; - } - else - { - sOldSkill = "0"+sOldSkill; - } - if (iEnchantSkill <= 1000) - { -// DelayCommand(6.0,SetTokenPair(oPC,14,2,iEnchantSkill)); - DelayCommand(6.0,SetPersistentInt(oPC,"iEnchantSkill",iEnchantSkill,0,"UOACraft")); - DelayCommand(6.0,SendMessageToPC(oPC,"===================================")); - DelayCommand(6.0,SendMessageToPC(oPC,"Your skill in Enchanting has gone up!")); - DelayCommand(6.0,SendMessageToPC(oPC,"Current Enchanting skill : "+ sOldSkill+"%")); - DelayCommand(6.0,SendMessageToPC(oPC,"===================================")); - DelayCommand(6.0, GiveXPToCreature(oPC, 5)); - } - - } // end of skill gain -} //end of main -void CreateAnObject(string sResource, object oPC, int iStackSize) - { - - CreateItemOnObject(sResource,oPC,iStackSize); - return; - } - -object CreatePlaceable(string sObject, location lPlace, float fDuration) -{ - object oPlaceable = CreateObject(OBJECT_TYPE_PLACEABLE,sObject,lPlace,FALSE); - if (fDuration != 0.0) - DestroyObject(oPlaceable,fDuration); - return oPlaceable; -} - -void EnchantArmor(object oItem,int wBonus) - { - itemproperty iBonus = ItemPropertyACBonus(wBonus); - IPSafeAddItemProperty(oItem,iBonus); - } - -void GiveToPC(object oItem, object oPC) - { - CopyItem(oItem,oPC,TRUE); - } - void EnPowerArmor(object oItem,int DamageType,int DamageQty) - { - itemproperty iEffect = ItemPropertyDamageResistance(DamageType,DamageQty); - IPSafeAddItemProperty(oItem,iEffect); - } - - -/* -IP_CONST_DAMAGEBONUS_1 -IP_CONST_DAMAGEBONUS_10 -IP_CONST_DAMAGEBONUS_1d10 -IP_CONST_DAMAGEBONUS_1d12 -IP_CONST_DAMAGEBONUS_1d4 -IP_CONST_DAMAGEBONUS_1d6 -IP_CONST_DAMAGEBONUS_1d8 -IP_CONST_DAMAGEBONUS_2 -IP_CONST_DAMAGEBONUS_2d10 -IP_CONST_DAMAGEBONUS_2d12 -IP_CONST_DAMAGEBONUS_2d4 -IP_CONST_DAMAGEBONUS_2d6 -IP_CONST_DAMAGEBONUS_2d8 -IP_CONST_DAMAGEBONUS_3 -IP_CONST_DAMAGEBONUS_4 -IP_CONST_DAMAGEBONUS_5 -IP_CONST_DAMAGEBONUS_6 -IP_CONST_DAMAGEBONUS_7 -IP_CONST_DAMAGEBONUS_8 -IP_CONST_DAMAGEBONUS_9 - - -IP_CONST_DAMAGETYPE_ACID -Acid damagetype. -IP_CONST_DAMAGETYPE_BLUDGEONING -Bludgenoning damagetype. -IP_CONST_DAMAGETYPE_COLD -Cold damagetype. -IP_CONST_DAMAGETYPE_DIVINE -Divine energy damage type. -IP_CONST_DAMAGETYPE_ELECTRICAL -Electrical damage type. -IP_CONST_DAMAGETYPE_FIRE -Fire damage type. -IP_CONST_DAMAGETYPE_MAGICAL -Any magical (i.e. not physical) damage type. -IP_CONST_DAMAGETYPE_NEGATIVE -Negative energy damage type. -IP_CONST_DAMAGETYPE_PHYSICAL -Physical (i.e. not magical) damage type. -IP_CONST_DAMAGETYPE_PIERCING -Piercing damage type. -IP_CONST_DAMAGETYPE_POSITIVE -Positive energy damage type. -IP_CONST_DAMAGETYPE_SLASHING -Slashing damage type. -IP_CONST_DAMAGETYPE_SONIC -Sonic damage type. -IP_CONST_DAMAGETYPE_SUBDUAL -Subdual damage type. -*/ - -/* -IP_CONST_DAMAGERESIST_10 Resist 10 damage. - -IP_CONST_DAMAGERESIST_15 Resist 15 damage. - -IP_CONST_DAMAGERESIST_20 Resist 20 damage. - -IP_CONST_DAMAGERESIST_25 Resist 25 damage. - -IP_CONST_DAMAGERESIST_30 Resist 30 damage. - -*/ -/* -IP_CONST_DAMAGETYPE_ACID Acid damagetype. - -IP_CONST_DAMAGETYPE_BLUDGEONING Bludgenoning damagetype. - -IP_CONST_DAMAGETYPE_COLD Cold damagetype. - -IP_CONST_DAMAGETYPE_DIVINE Divine energy damage type. - -IP_CONST_DAMAGETYPE_ELECTRICAL Electrical damage type. - -IP_CONST_DAMAGETYPE_FIRE Fire damage type. - -IP_CONST_DAMAGETYPE_MAGICAL Any magical (i.e. not physical) damage type. - -IP_CONST_DAMAGETYPE_NEGATIVE Negative energy damage type. - -IP_CONST_DAMAGETYPE_PHYSICAL Physical (i.e. not magical) damage type. - -IP_CONST_DAMAGETYPE_PIERCING Piercing damage type. - -IP_CONST_DAMAGETYPE_POSITIVE Positive energy damage type. - -IP_CONST_DAMAGETYPE_SLASHING Slashing damage type. - -IP_CONST_DAMAGETYPE_SONIC Sonic damage type. - -IP_CONST_DAMAGETYPE_SUBDUAL Subdual damage type - -*/ diff --git a/_module/nss/_enchant_helm.nss b/_module/nss/_enchant_helm.nss deleted file mode 100644 index eb4fae20..00000000 --- a/_module/nss/_enchant_helm.nss +++ /dev/null @@ -1,1061 +0,0 @@ -//New enchantarmor 10-21-05 -//#include "_persist_01a" -#include "x2_inc_itemprop" -#include "aps_include" -void GetNextItemPossessedBy(object oPC, string sItemTag); -void GetNextStackedItem(object oPC, string sEssenceTag, int iCount); -void CreateAnObject(string sResource, object oPC, int iStackSize); -object CreatePlaceable(string sObject, location lPlace, float fDuration); -object oTestValid=OBJECT_INVALID; -void EnchantArmor(object oItem,int wBonus); -void EnPowerArmor(object oItem,int DamageType,int DamageQty); -void GiveToPC(object oItem, object oPC); -void GetItemPossessedBy(object oPC,string sEssence); -string sDialogResRef=""; -string sEssence; -void main() -{ - object oPC = GetLastDisturbed(); - object oItem = GetInventoryDisturbItem(); - string sItemTag = GetTag(oItem); - string sReEnchantMessage = "INVALID"; - int iReEnchant = 0; - int iBaseItem=0; - int iMaxReEnchant; - int iMaxReEnchant2; - int iMaxReEnchant3; - int wBonus=1; - int wEffect=0; - int iEnpower=0; - -int iEnchantSkill = GetPersistentInt(oPC,"iEnchantSkill","UOACraft"); -int iEnchantChance = iEnchantSkill; - - - if (GetInventoryDisturbType()!= INVENTORY_DISTURB_TYPE_ADDED) - { - if (sItemTag=="ENCHANT_ARMOR1") - { - SetLocalInt(oPC,"iEnchant",1); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant a HELM to +1.",oPC,FALSE); - } - - if (sItemTag=="ENCHANT_ARMOR2") - { - if (iEnchantChance >= 100) - { - SetLocalInt(oPC,"iEnchant",2); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant a HELM to +2.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENCHANT_ARMOR3") - { - if (iEnchantChance >= 157) - { - SetLocalInt(oPC,"iEnchant",3); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant a HELM to +3.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENCHANT_ARMOR4") - { - if (iEnchantChance >= 214) - { - SetLocalInt(oPC,"iEnchant",4); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant a HELM to +4.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENCHANT_ARMOR5") - { - if (iEnchantChance >= 271) - { - SetLocalInt(oPC,"iEnchant",5); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant a HELM to +5",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENCHANT_ARMOR6") - { - if (iEnchantChance >= 328) - { - SetLocalInt(oPC,"iEnchant",6); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant a HELM to +6.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENCHANT_ARMOR7") - { - if (iEnchantChance >= 385) - { - SetLocalInt(oPC,"iEnchant",7); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant a HELM to +7.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant Armor with this.",oPC,FALSE); - } - if (sItemTag=="ENCHANT_ARMOR8") - { - if (iEnchantChance >= 442) - { - SetLocalInt(oPC,"iEnchant",8); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant a HELM to +8.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant Armor with this.",oPC,FALSE); - } - if (sItemTag=="ENCHANT_ARMOR9") - { - if (iEnchantChance >= 500) - { - SetLocalInt(oPC,"iEnchant",9); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant a HELM to +9.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant Armor with this.",oPC,FALSE); - } - if (sItemTag=="ENCHANT_ARMOR10") - { - if (iEnchantChance >= 590) - { - SetLocalInt(oPC,"iEnchant",10); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant a HELM to +10.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant Armor with this.",oPC,FALSE); - } - if (sItemTag=="ENCHANT_ARMOR11") - { - if (iEnchantChance >= 640) - { - SetLocalInt(oPC,"iEnchant",11); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant a HELM to +11.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant Armor with this.",oPC,FALSE); - } - if (sItemTag=="ENCHANT_ARMOR12") - { - if (iEnchantChance >= 730) - { - SetLocalInt(oPC,"iEnchant",12); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant a HELM to +12.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant Armor with this.",oPC,FALSE); - } - if (sItemTag=="ENCHANT_ARMOR13") - { - if (iEnchantChance >= 840) - { - SetLocalInt(oPC,"iEnchant",13); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant a HELM to +13.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant Armor with this.",oPC,FALSE); - } - if (sItemTag=="ENCHANT_ARMOR14") - { - if (iEnchantChance >= 950) - { - SetLocalInt(oPC,"iEnchant",14); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant a HELM to +14.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant Armor with this.",oPC,FALSE); - } - if (sItemTag=="ENPOWER_ARMOR1") - { - if (iEnchantChance >= 500) - { - SetLocalInt(oPC,"iEnpower",1); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a HELM with Acid Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR2") - { - if (iEnchantChance >= 500) - { - SetLocalInt(oPC,"iEnpower",2); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a HELM with Cold Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR3") - { - if (iEnchantChance >= 500) - { - SetLocalInt(oPC,"iEnpower",3); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a HELM with Electrical Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR4") - { - if (iEnchantChance >= 500) - { - SetLocalInt(oPC,"iEnpower",4); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a HELM with Fire Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR5") - { - if (iEnchantChance >= 700) - { - SetLocalInt(oPC,"iEnpower",5); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a HELM with Acid Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR6") - { - if (iEnchantChance >= 700) - { - SetLocalInt(oPC,"iEnpower",6); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a HELM with Cold Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR7") - { - if (iEnchantChance >= 700) - { - SetLocalInt(oPC,"iEnpower",7); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a HELM with Electrical Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR8") - { - if (iEnchantChance >= 700) - { - SetLocalInt(oPC,"iEnpower",8); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a HELM with Fire Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR9") - { - if (iEnchantChance >= 800) - { - SetLocalInt(oPC,"iEnpower",9); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a HELM with Acid Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR10") - { - if (iEnchantChance >= 800) - { - SetLocalInt(oPC,"iEnpower",10); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a HELM with Cold Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR11") - { - if (iEnchantChance >= 800) - { - SetLocalInt(oPC,"iEnpower",12); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a HELM with Fire Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR12") - { - if (iEnchantChance >= 800) - { - SetLocalInt(oPC,"iEnpower",13); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a HELM with Slashing Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR13") - { - if (iEnchantChance >= 900) - { - SetLocalInt(oPC,"iEnpower",14); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a HELM with Piercing Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR14") - { - if (iEnchantChance >= 900) - { - SetLocalInt(oPC,"iEnpower",15); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a HELM with Bludgeoning Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR15") - { - if (iEnchantChance >= 900) - { - SetLocalInt(oPC,"iEnpower",16); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a HELM with Negative Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR16") - { - if (iEnchantChance >= 800) - { - SetLocalInt(oPC,"iEnpower",11); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a HELM with Electrical Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - CopyObject(oItem,GetLocation(oPC),OBJECT_SELF,GetTag(oItem)); - DestroyObject(oItem); - return; - } - - - // The following 3 lines are to ensure compatability with UOAbigal's Persistent Token System. - // You can replace them with whatever 'no-drop' code you have or comment them out. - string sNoDropFlag = (GetStringLeft(GetTag(oItem),6)); - if (sNoDropFlag == "NoDrop" || sNoDropFlag == "TOKEN_"||sNoDropFlag=="_TBOX_") - return; - if (GetBaseItemType(oItem)==BASE_ITEM_LARGEBOX) - { - DestroyObject(oItem); - SendMessageToPC(oPC,"To avoid possible dupe exploits, the container placed in this bag may be destroyed."); - return; - } - // End of compatability portion. - - if (GetLocalInt(OBJECT_SELF,"iAmInUse")!=0) - { - FloatingTextStringOnCreature("You must wait for this item to finish enchanting..",oPC,FALSE); - CopyItem(oItem,oPC,TRUE); - DestroyObject(oItem); - return; - } - - iBaseItem = GetBaseItemType(oItem); - string sItemResRef = ""; - int iStackSize = 0; - int iMaxStack = 5; - string sSuccess = ""; - -// Determins the PC level in the class WIZARD (CLASS_TYPE_WIZARD) -/* int wizard_lvl = 0; - wizard_lvl = GetLevelByClass(CLASS_TYPE_WIZARD,oPC); - SendMessageToPC(oPC,"Your Level in Wizard == " + IntToString(wizard_lvl)); - - if (wizard_lvl <=7 ) - { - CopyItem(oItem,oPC,TRUE); - FloatingTextStringOnCreature("You are not a powerful enough wizard you cannot Enchant this item!",oPC,FALSE); - DestroyObject(oItem); - return; - } -*/ - - if (GetStringLeft(sItemTag,5) != "HELM_") - { - CopyItem(oItem,oPC,TRUE); - FloatingTextStringOnCreature("You cannot Enchant this item!",oPC,FALSE); - DestroyObject(oItem); - return; - } - - //int iEnchantChance = GetTokenPair(oPC,14,2); -// int iEnchantSkill = GetCampaignInt("UOACraft","iEnchantSkill",oPC); -// int iEnchantChance = iEnchantSkill; - - - if (iEnchantChance <=350) - { - iEnchantChance = GetAbilityScore(oPC,ABILITY_INTELLIGENCE)*3; - iEnchantChance = iEnchantChance + GetAbilityScore(oPC,ABILITY_DEXTERITY) + GetAbilityScore(oPC,ABILITY_WISDOM); - iEnchantChance = iEnchantChance * 3; - if (iEnchantChance >350) iEnchantChance = 350; - if (iEnchantSkill > iEnchantChance) iEnchantChance = iEnchantSkill; - } - - if (sItemResRef=="INVALID") - { - SendMessageToPC(oPC,"You cannot Enchant this item!"); - CopyItem(oItem,oPC,TRUE); - DestroyObject(oItem,0.1); - return; - } - - if (iEnchantChance < 1) - { - if (iReEnchant==0) - { - FloatingTextStringOnCreature("You have no idea how to Enchant this item.",oPC,FALSE); - } - else - { - FloatingTextStringOnCreature("You have no idea how to reEnchant this item.",oPC,FALSE); - } - CopyItem(oItem,oPC,TRUE); - DestroyObject(oItem); - return; - } - - string sFlame= ""; - int iEnchant = GetLocalInt(oPC,"iEnchant"); - float fAngleToVector = 0.4; - - switch(iEnchant) //se chance of success - { - case 1: - { - fAngleToVector = 0.5; - // iMaxStack = iMaxStack+3; - if (iReEnchant==0)iEnchantChance = iEnchantChance+150; - // sFlame = "plc_flamesmall"; - break; - } - case 2: - { - fAngleToVector = 0.6; - // iMaxStack = iMaxStack+1; - if (iReEnchant==0)iEnchantChance = iEnchantChance+100; - // sFlame = "plc_flamesmall"; - break; - } - case 3: - { - fAngleToVector = 0.6; -// iMaxStack = iMaxStack+1; - if (iReEnchant==0)iEnchantChance = iEnchantChance+75; - // sFlame = "plc_flamesmall"; - break; - } - case 4: - { - fAngleToVector = 0.2; -// iMaxStack = iMaxStack-2; - if (iReEnchant==0)iEnchantChance = iEnchantChance+50; -// sFlame = "plc_flamelarge"; - break; - } - case 5: - { - fAngleToVector = 0.3; - // iMaxStack = iMaxStack -3; - if (iReEnchant==0)iEnchantChance = iEnchantChance; - // sFlame = "plc_flamelarge"; - break; - } - case 6: - { - fAngleToVector = 0.3; - // iMaxStack = iMaxStack -3; - if (iReEnchant==0)iEnchantChance = iEnchantChance-100; - // sFlame = "plc_flamelarge"; - break; - } - case 7: - { - fAngleToVector = 0.3; - // iMaxStack = iMaxStack -3; - if (iReEnchant==0)iEnchantChance = iEnchantChance-250; - // sFlame = "plc_flamelarge"; - break; - } - case 8: - { - fAngleToVector = 0.4; - // iMaxStack = iMaxStack -3; - if (iReEnchant==0)iEnchantChance = iEnchantChance-270; - //DelayCommand(6.0,SendMessageToPC(oPC,"Value of iEnchant : " + IntToString(iEnchant))); - //DelayCommand(6.0,SendMessageToPC(oPC,"Current Enchanting chance : "+ IntToString(iEnchantChance)+"%")); - sFlame = "plc_flamemedium"; - break; - } - case 9: - { - fAngleToVector = 0.4; - // iMaxStack = iMaxStack -3; - if (iReEnchant==0)iEnchantChance = iEnchantChance-290; - sFlame = "plc_flamemedium"; - break; - } - case 10: - { - fAngleToVector = 0.4; - // iMaxStack = iMaxStack -3; - if (iReEnchant==0)iEnchantChance = iEnchantChance-310; - sFlame = "plc_flamemedium"; - break; - } - case 11: - { - fAngleToVector = 0.4; - // iMaxStack = iMaxStack -3; - if (iReEnchant==0)iEnchantChance = iEnchantChance-330; - sFlame = "plc_flamelarge"; - break; - } - case 12: - { - fAngleToVector = 0.4; - // iMaxStack = iMaxStack -3; - if (iReEnchant==0)iEnchantChance = iEnchantChance-350; - sFlame = "plc_flamelarge"; - break; - } - case 13: - { - fAngleToVector = 0.4; - // iMaxStack = iMaxStack -3; - if (iReEnchant==0)iEnchantChance = iEnchantChance-370; - sFlame = "plc_flamelarge"; - break; - } - case 14: - { - fAngleToVector = 0.4; - // iMaxStack = iMaxStack -3; - if (iReEnchant==0)iEnchantChance = iEnchantChance-390; - sFlame = "plc_flamelarge"; - break; - } - default: - { - sFlame = "plc_flamemedium"; - break; - } - } -//////////////////////////////////////////////////////////////////////// - iEnpower = GetLocalInt(oPC,"iEnpower"); - switch(iEnpower) - { - case 1: - { - sEssence = "essence001"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_ACID); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_10); - } - break; - } - case 2: - { - sEssence = "essence017"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_COLD); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_10); - } - break; - } - case 3: - { - sEssence = "essence006"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_ELECTRICAL); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_10); - } - break; - } - case 4: - { - sEssence = "essence011"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_FIRE); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_10); - } - break; - } - case 5: - { - sEssence = "essence001"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_ACID); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_15); - } - break; - } - case 6: - { - sEssence = "essence017"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_COLD); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_15); - } - break; - } - case 7: - { - sEssence = "essence006"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_ELECTRICAL); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_15); - } - break; - } - case 8: - { - sEssence = "essence011"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_FIRE); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_15); - } - break; - } - case 9: - { - sEssence = "essence001"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_ACID); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_20); - } - break; - } - case 10: - { - sEssence = "essence017"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_COLD); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_20); - } - break; - } - case 11: - { - sEssence = "essence006"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_ELECTRICAL); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_20); - } - break; - } - case 12: - { - sEssence = "essence011"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_FIRE); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_20); - } - break; - } - case 13: - { - sEssence = "essence016"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_SLASHING); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_15); - } - break; - } - case 14: - { - sEssence = "essence016"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_PIERCING); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_15); - } - break; - } - case 15: - { - sEssence = "essence016"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_BLUDGEONING); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_15); - } - break; - } - case 16: - { - sEssence = "essence016"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_NEGATIVE); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_15); - } - break; - } - default: - { - int DamageType=0; - int DamageQty=0; - break; - } - } //end of switch - -////////////////////////////////////////////////////////////////////////////// - - location lSelf = GetLocation(OBJECT_SELF); - float fSelf = GetFacing(OBJECT_SELF); - vector vSelf = GetPosition(OBJECT_SELF); - object oArea = GetArea(OBJECT_SELF); - vector vFire; - int vDirection; - vFire = vSelf + (AngleToVector(fSelf) * fAngleToVector); - location lFire = Location(oArea,vFire,fSelf); - object oFire = CreatePlaceable(sFlame, lFire, 6.0); - - AssignCommand(oPC,PlaySound("al_mg_chntmagic1")); - AssignCommand(oPC,PlaySound("al_mg_crystalgd1")); - AssignCommand(oPC,PlaySound("al_mg_jacobs1")); - AssignCommand(oPC,ActionPlayAnimation(ANIMATION_LOOPING_GET_MID,1.0,4.0)); - PlayAnimation(ANIMATION_PLACEABLE_ACTIVATE,1.0,6.0); - - SetLocalInt(OBJECT_SELF,"iAmInUse",99); - DelayCommand(7.0,SetLocalInt(OBJECT_SELF,"iAmInUse",0)); - //ensure at least 1 respawn 10 minutes after used... - //this is to prevent a broken placeable that is used, with a 'in use' delay - //which would cancel the respawn - if (GetLocalInt(OBJECT_SELF,"iAmSetToRespawn")!=99) - { - SetLocalInt(OBJECT_SELF,"iAmSetToRespawn",99); - DelayCommand(600.0,ExecuteScript("_onclose_clear",OBJECT_SELF)); - } - - int iRandom = 0; - - int iSuccess = 0; - int iSkillGain = 0; - -////////////////////////////////////////////begin stackables - object oTemp = OBJECT_INVALID; - oTemp = GetItemPossessedBy(oPC,sEssence); - object oEssence = oTemp; - string sEssenceTag = GetTag(oEssence); - int iCount = 0; - int iEssence = 1; - iCount = GetNumStackedItems(oTemp); - DestroyObject(oTemp); - if (iCount iEssence) - { - iCount = iCount - iEssence; - SendMessageToPC(oPC,"You should get back "+IntToString(iCount)+" essences"); - DelayCommand(1.0,CreateAnObject(sEssence,oPC,iCount)); - } - } -////////////////////////////////////////////////////////////////end stackables - - iEnpower = GetLocalInt(oPC,"iEnpower"); - iEnchantChance = iEnchantChance - (iEnchantSkill * iEnpower/100); - //SendMessageToPC(oPC,"Value of iEnpower : " + IntToString(iEnpower)); - SendMessageToPC(oPC,"Current Enchanting chance : "+ IntToString(iEnchantChance)+"%"); - - if (Random(1000) <= iEnchantChance) - { - iSuccess = 1; - iStackSize = 1; - if (iEnchant>=1) - { - DelayCommand(5.0,AssignCommand(oPC,ActionPlayAnimation(ANIMATION_LOOPING_CONJURE1,1.0,1.0))); - DelayCommand(5.0,AssignCommand(oPC,ActionPlayAnimation(ANIMATION_FIREFORGET_VICTORY1,1.0,1.0))); - DelayCommand(5.0,EnchantArmor(oItem,iEnchant)); -// DelayCommand(5.0,EnchantItem(oItem)); - DelayCommand(6.0, GiveToPC(oItem,oPC)); - sSuccess = "You successfully Enchant the Item"; - DelayCommand(6.0,FloatingTextStringOnCreature(sSuccess,oPC,FALSE)); - DelayCommand(5.8,PlaySound("vs_chant_conj_lm")); - DelayCommand(6.0,ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_DUR_BLUR,FALSE),OBJECT_SELF,2.0)); - } //end of iEnchant if - - int iEnpower = GetLocalInt(oPC,"iEnpower"); - int DamageType =GetLocalInt(oPC,"DamageType"); - int DamageQty =GetLocalInt(oPC,"DamageQty"); - if (iEnpower>=1) - { - DelayCommand(5.0,AssignCommand(oPC,ActionPlayAnimation(ANIMATION_LOOPING_CONJURE2,1.0,1.0))); - DelayCommand(5.0,AssignCommand(oPC,ActionPlayAnimation(ANIMATION_FIREFORGET_VICTORY2,1.0,1.0))); - DelayCommand(5.0,EnPowerArmor(oItem,DamageType,DamageQty)); - DelayCommand(6.0, GiveToPC(oItem,oPC)); - sSuccess = "You successfully Enpower the Item"; - DelayCommand(6.0,FloatingTextStringOnCreature(sSuccess,oPC,FALSE)); - DelayCommand(5.8,PlaySound("vs_chant_ench_hm")); - DelayCommand(6.0,ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_BEAM_LIGHTNING,FALSE),OBJECT_SELF,2.0)); - } //end of iEnpower if - - } - else - { - DelayCommand(5.0,AssignCommand(oPC,ActionPlayAnimation(ANIMATION_LOOPING_PAUSE_TIRED,1.0,1.0))); - DelayCommand(6.0,FloatingTextStringOnCreature("The incantation fails and the item is lost.",oPC,FALSE)); - DelayCommand(5.8,PlaySound("as_na_steamshrt2")); - DelayCommand(6.0,ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_DUR_PARALYZED ,FALSE),OBJECT_SELF,2.0)); - } - DelayCommand(6.0,DestroyObject(oItem)); - - if (iSuccess == 1) - { - iRandom = Random(1000); - if (iEnchantSkill > 700) iRandom = iRandom + 25; - if (iEnchantSkill > 998) iRandom = iRandom - 20; - if (iEnchantSkill > 999) iRandom = 0; - if (iRandom > iEnchantSkill) - { - if (d10(1)+1 >= iEnchantChance/100) iSkillGain = 1; - } - } - -//Ensure no more than 1 skill gain every 10 seconds to avoid token droppage. - if (iSkillGain ==1) - { - if (GetLocalInt(oPC,"iSkillGain")!= 0) - { - iSkillGain = 0; - } - else - { - SetLocalInt(oPC,"iSkillGain",99); - DelayCommand(10.0,SetLocalInt(oPC,"iSkillGain",0)); - } - } // end of if iskill gain == 1 - - - if (iSkillGain ==1) - { - string sOldSkill = ""; - string sOldSkill2 = ""; - iEnchantSkill++; - sOldSkill2 = IntToString(iEnchantSkill); - sOldSkill = "."+GetStringRight(sOldSkill2,1); - if (iEnchantSkill > 9) - { - sOldSkill = GetStringLeft(sOldSkill2,GetStringLength(sOldSkill2)-1)+sOldSkill; - } - else - { - sOldSkill = "0"+sOldSkill; - } - if (iEnchantSkill <= 1000) - { -// DelayCommand(6.0,SetTokenPair(oPC,14,2,iEnchantSkill)); - DelayCommand(6.0,SetPersistentInt(oPC,"iEnchantSkill",iEnchantSkill,0,"UOACraft")); - DelayCommand(6.0,SendMessageToPC(oPC,"===================================")); - DelayCommand(6.0,SendMessageToPC(oPC,"Your skill in Enchanting has gone up!")); - DelayCommand(6.0,SendMessageToPC(oPC,"Current Enchanting skill : "+ sOldSkill+"%")); - DelayCommand(6.0,SendMessageToPC(oPC,"===================================")); - DelayCommand(6.0, GiveXPToCreature(oPC, 5)); - } - - } // end of skill gain -} //end of main -void CreateAnObject(string sResource, object oPC, int iStackSize) - { - - CreateItemOnObject(sResource,oPC,iStackSize); - return; - } - -object CreatePlaceable(string sObject, location lPlace, float fDuration) -{ - object oPlaceable = CreateObject(OBJECT_TYPE_PLACEABLE,sObject,lPlace,FALSE); - if (fDuration != 0.0) - DestroyObject(oPlaceable,fDuration); - return oPlaceable; -} - -void EnchantArmor(object oItem,int wBonus) - { - itemproperty iBonus = ItemPropertyACBonus(wBonus); - IPSafeAddItemProperty(oItem,iBonus); - } - -void GiveToPC(object oItem, object oPC) - { - CopyItem(oItem,oPC,TRUE); - } - void EnPowerArmor(object oItem,int DamageType,int DamageQty) - { - itemproperty iEffect = ItemPropertyDamageResistance(DamageType,DamageQty); - IPSafeAddItemProperty(oItem,iEffect); - } - - -/* -IP_CONST_DAMAGEBONUS_1 -IP_CONST_DAMAGEBONUS_10 -IP_CONST_DAMAGEBONUS_1d10 -IP_CONST_DAMAGEBONUS_1d12 -IP_CONST_DAMAGEBONUS_1d4 -IP_CONST_DAMAGEBONUS_1d6 -IP_CONST_DAMAGEBONUS_1d8 -IP_CONST_DAMAGEBONUS_2 -IP_CONST_DAMAGEBONUS_2d10 -IP_CONST_DAMAGEBONUS_2d12 -IP_CONST_DAMAGEBONUS_2d4 -IP_CONST_DAMAGEBONUS_2d6 -IP_CONST_DAMAGEBONUS_2d8 -IP_CONST_DAMAGEBONUS_3 -IP_CONST_DAMAGEBONUS_4 -IP_CONST_DAMAGEBONUS_5 -IP_CONST_DAMAGEBONUS_6 -IP_CONST_DAMAGEBONUS_7 -IP_CONST_DAMAGEBONUS_8 -IP_CONST_DAMAGEBONUS_9 - - -IP_CONST_DAMAGETYPE_ACID -Acid damagetype. -IP_CONST_DAMAGETYPE_BLUDGEONING -Bludgenoning damagetype. -IP_CONST_DAMAGETYPE_COLD -Cold damagetype. -IP_CONST_DAMAGETYPE_DIVINE -Divine energy damage type. -IP_CONST_DAMAGETYPE_ELECTRICAL -Electrical damage type. -IP_CONST_DAMAGETYPE_FIRE -Fire damage type. -IP_CONST_DAMAGETYPE_MAGICAL -Any magical (i.e. not physical) damage type. -IP_CONST_DAMAGETYPE_NEGATIVE -Negative energy damage type. -IP_CONST_DAMAGETYPE_PHYSICAL -Physical (i.e. not magical) damage type. -IP_CONST_DAMAGETYPE_PIERCING -Piercing damage type. -IP_CONST_DAMAGETYPE_POSITIVE -Positive energy damage type. -IP_CONST_DAMAGETYPE_SLASHING -Slashing damage type. -IP_CONST_DAMAGETYPE_SONIC -Sonic damage type. -IP_CONST_DAMAGETYPE_SUBDUAL -Subdual damage type. -*/ - -/* -IP_CONST_DAMAGERESIST_10 Resist 10 damage. - -IP_CONST_DAMAGERESIST_15 Resist 15 damage. - -IP_CONST_DAMAGERESIST_20 Resist 20 damage. - -IP_CONST_DAMAGERESIST_25 Resist 25 damage. - -IP_CONST_DAMAGERESIST_30 Resist 30 damage. - -*/ -/* -IP_CONST_DAMAGETYPE_ACID Acid damagetype. - -IP_CONST_DAMAGETYPE_BLUDGEONING Bludgenoning damagetype. - -IP_CONST_DAMAGETYPE_COLD Cold damagetype. - -IP_CONST_DAMAGETYPE_DIVINE Divine energy damage type. - -IP_CONST_DAMAGETYPE_ELECTRICAL Electrical damage type. - -IP_CONST_DAMAGETYPE_FIRE Fire damage type. - -IP_CONST_DAMAGETYPE_MAGICAL Any magical (i.e. not physical) damage type. - -IP_CONST_DAMAGETYPE_NEGATIVE Negative energy damage type. - -IP_CONST_DAMAGETYPE_PHYSICAL Physical (i.e. not magical) damage type. - -IP_CONST_DAMAGETYPE_PIERCING Piercing damage type. - -IP_CONST_DAMAGETYPE_POSITIVE Positive energy damage type. - -IP_CONST_DAMAGETYPE_SLASHING Slashing damage type. - -IP_CONST_DAMAGETYPE_SONIC Sonic damage type. - -IP_CONST_DAMAGETYPE_SUBDUAL Subdual damage type - -*/ diff --git a/_module/nss/_enchant_shield.nss b/_module/nss/_enchant_shield.nss deleted file mode 100644 index 5f3750c1..00000000 --- a/_module/nss/_enchant_shield.nss +++ /dev/null @@ -1,1063 +0,0 @@ -//New enchantarmor 10-21-05 -//#include "_persist_01a" -#include "x2_inc_itemprop" -#include "aps_include" - -void GetNextItemPossessedBy(object oPC, string sItemTag); -void GetNextStackedItem(object oPC, string sEssenceTag, int iCount); -void CreateAnObject(string sResource, object oPC, int iStackSize); -object CreatePlaceable(string sObject, location lPlace, float fDuration); -object oTestValid=OBJECT_INVALID; -void EnchantArmor(object oItem,int wBonus); -void EnPowerArmor(object oItem,int DamageType,int DamageQty); -void GiveToPC(object oItem, object oPC); -void GetItemPossessedBy(object oPC,string sEssence); -string sDialogResRef=""; -string sEssence; -void main() -{ - object oPC = GetLastDisturbed(); - object oItem = GetInventoryDisturbItem(); - string sItemTag = GetTag(oItem); - string sReEnchantMessage = "INVALID"; - int iReEnchant = 0; - int iBaseItem=0; - int iMaxReEnchant; - int iMaxReEnchant2; - int iMaxReEnchant3; - int wBonus=1; - int wEffect=0; - int iEnpower=0; - -int iEnchantSkill = GetPersistentInt(oPC,"iEnchantSkill","UOACraft"); -int iEnchantChance = iEnchantSkill; - - - if (GetInventoryDisturbType()!= INVENTORY_DISTURB_TYPE_ADDED) - { - if (sItemTag=="ENCHANT_ARMOR1") - { - SetLocalInt(oPC,"iEnchant",1); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant a SHIELD to +1.",oPC,FALSE); - } - - if (sItemTag=="ENCHANT_ARMOR2") - { - if (iEnchantChance >= 100) - { - SetLocalInt(oPC,"iEnchant",2); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant a SHIELD to +2.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENCHANT_ARMOR3") - { - if (iEnchantChance >= 157) - { - SetLocalInt(oPC,"iEnchant",3); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant a SHIELD to +3.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENCHANT_ARMOR4") - { - if (iEnchantChance >= 214) - { - SetLocalInt(oPC,"iEnchant",4); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant a SHIELD to +4.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENCHANT_ARMOR5") - { - if (iEnchantChance >= 271) - { - SetLocalInt(oPC,"iEnchant",5); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant a SHIELD to +5",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENCHANT_ARMOR6") - { - if (iEnchantChance >= 328) - { - SetLocalInt(oPC,"iEnchant",6); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant a SHIELD to +6.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENCHANT_ARMOR7") - { - if (iEnchantChance >= 385) - { - SetLocalInt(oPC,"iEnchant",7); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant a SHIELD to +7.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant Armor with this.",oPC,FALSE); - } - if (sItemTag=="ENCHANT_ARMOR8") - { - if (iEnchantChance >= 442) - { - SetLocalInt(oPC,"iEnchant",8); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant a SHIELD to +8.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant Armor with this.",oPC,FALSE); - } - if (sItemTag=="ENCHANT_ARMOR9") - { - if (iEnchantChance >= 500) - { - SetLocalInt(oPC,"iEnchant",9); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant a SHIELD to +9.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant Armor with this.",oPC,FALSE); - } - if (sItemTag=="ENCHANT_ARMOR10") - { - if (iEnchantChance >= 590) - { - SetLocalInt(oPC,"iEnchant",10); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant a SHIELD to +10.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant Armor with this.",oPC,FALSE); - } - if (sItemTag=="ENCHANT_ARMOR11") - { - if (iEnchantChance >= 640) - { - SetLocalInt(oPC,"iEnchant",11); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant a SHIELD to +11.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant Armor with this.",oPC,FALSE); - } - if (sItemTag=="ENCHANT_ARMOR12") - { - if (iEnchantChance >= 730) - { - SetLocalInt(oPC,"iEnchant",12); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant a SHIELD to +12.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant Armor with this.",oPC,FALSE); - } - if (sItemTag=="ENCHANT_ARMOR13") - { - if (iEnchantChance >= 840) - { - SetLocalInt(oPC,"iEnchant",13); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant a SHIELD to +13.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant Armor with this.",oPC,FALSE); - } - if (sItemTag=="ENCHANT_ARMOR14") - { - if (iEnchantChance >= 950) - { - SetLocalInt(oPC,"iEnchant",14); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant a SHIELD to +14.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant Armor with this.",oPC,FALSE); - } - if (sItemTag=="ENPOWER_ARMOR1") - { - if (iEnchantChance >= 500) - { - SetLocalInt(oPC,"iEnpower",1); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a SHIELD with Acid Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR2") - { - if (iEnchantChance >= 500) - { - SetLocalInt(oPC,"iEnpower",2); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a SHIELD with Cold Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR3") - { - if (iEnchantChance >= 500) - { - SetLocalInt(oPC,"iEnpower",3); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a SHIELD with Electrical Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR4") - { - if (iEnchantChance >= 500) - { - SetLocalInt(oPC,"iEnpower",4); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a SHIELD with Fire Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR5") - { - if (iEnchantChance >= 700) - { - SetLocalInt(oPC,"iEnpower",5); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a SHIELD with Acid Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR6") - { - if (iEnchantChance >= 700) - { - SetLocalInt(oPC,"iEnpower",6); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a SHIELD with Cold Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR7") - { - if (iEnchantChance >= 700) - { - SetLocalInt(oPC,"iEnpower",7); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a SHIELD with Electrical Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR8") - { - if (iEnchantChance >= 700) - { - SetLocalInt(oPC,"iEnpower",8); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a SHIELD with Fire Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR9") - { - if (iEnchantChance >= 800) - { - SetLocalInt(oPC,"iEnpower",9); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a SHIELD with Acid Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR10") - { - if (iEnchantChance >= 800) - { - SetLocalInt(oPC,"iEnpower",10); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a SHIELD with Cold Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR11") - { - if (iEnchantChance >= 800) - { - SetLocalInt(oPC,"iEnpower",12); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a SHIELD with Fire Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR12") - { - if (iEnchantChance >= 800) - { - SetLocalInt(oPC,"iEnpower",13); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a SHIELD with Slashing Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR13") - { - if (iEnchantChance >= 900) - { - SetLocalInt(oPC,"iEnpower",14); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a SHIELD with Piercing Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR14") - { - if (iEnchantChance >= 900) - { - SetLocalInt(oPC,"iEnpower",15); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a SHIELD with Bludgeoning Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR15") - { - if (iEnchantChance >= 900) - { - SetLocalInt(oPC,"iEnpower",16); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a SHIELD with Negative Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_ARMOR16") - { - if (iEnchantChance >= 800) - { - SetLocalInt(oPC,"iEnpower",11); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a SHIELD with Electrical Resist.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower Armor with this.",oPC,FALSE); - } - - CopyObject(oItem,GetLocation(oPC),OBJECT_SELF,GetTag(oItem)); - DestroyObject(oItem); - return; - } - - - // The following 3 lines are to ensure compatability with UOAbigal's Persistent Token System. - // You can replace them with whatever 'no-drop' code you have or comment them out. - string sNoDropFlag = (GetStringLeft(GetTag(oItem),6)); - if (sNoDropFlag == "NoDrop" || sNoDropFlag == "TOKEN_"||sNoDropFlag=="_TBOX_") - return; - if (GetBaseItemType(oItem)==BASE_ITEM_LARGEBOX) - { - DestroyObject(oItem); - SendMessageToPC(oPC,"To avoid possible dupe exploits, the container placed in this bag may be destroyed."); - return; - } - // End of compatability portion. - - if (GetLocalInt(OBJECT_SELF,"iAmInUse")!=0) - { - FloatingTextStringOnCreature("You must wait for this item to finish enchanting..",oPC,FALSE); - CopyItem(oItem,oPC,TRUE); - DestroyObject(oItem); - return; - } - - iBaseItem = GetBaseItemType(oItem); - string sItemResRef = ""; - int iStackSize = 0; - int iMaxStack = 5; - string sSuccess = ""; - -// Determins the PC level in the class WIZARD (CLASS_TYPE_WIZARD) -/* int wizard_lvl = 0; - wizard_lvl = GetLevelByClass(CLASS_TYPE_WIZARD,oPC); - SendMessageToPC(oPC,"Your Level in Wizard == " + IntToString(wizard_lvl)); - - if (wizard_lvl <=7 ) - { - CopyItem(oItem,oPC,TRUE); - FloatingTextStringOnCreature("You are not a powerful enough wizard you cannot Enchant this item!",oPC,FALSE); - DestroyObject(oItem); - return; - } -*/ - - if (GetStringLeft(sItemTag,5) != "SHLD_") - { - - CopyItem(oItem,oPC,TRUE); - FloatingTextStringOnCreature("You cannot Enchant this item!",oPC,FALSE); - DestroyObject(oItem); - return; - } - - //int iEnchantChance = GetTokenPair(oPC,14,2); -// int iEnchantSkill = GetCampaignInt("UOACraft","iEnchantSkill",oPC); -// int iEnchantChance = iEnchantSkill; - - - if (iEnchantChance <=350) - { - iEnchantChance = GetAbilityScore(oPC,ABILITY_INTELLIGENCE)*3; - iEnchantChance = iEnchantChance + GetAbilityScore(oPC,ABILITY_DEXTERITY) + GetAbilityScore(oPC,ABILITY_WISDOM); - iEnchantChance = iEnchantChance * 3; - if (iEnchantChance >350) iEnchantChance = 350; - if (iEnchantSkill > iEnchantChance) iEnchantChance = iEnchantSkill; - } - - if (sItemResRef=="INVALID") - { - SendMessageToPC(oPC,"You cannot Enchant this item!"); - CopyItem(oItem,oPC,TRUE); - DestroyObject(oItem,0.1); - return; - } - - if (iEnchantChance < 1) - { - if (iReEnchant==0) - { - FloatingTextStringOnCreature("You have no idea how to Enchant this item.",oPC,FALSE); - } - else - { - FloatingTextStringOnCreature("You have no idea how to reEnchant this item.",oPC,FALSE); - } - CopyItem(oItem,oPC,TRUE); - DestroyObject(oItem); - return; - } - - string sFlame= ""; - int iEnchant = GetLocalInt(oPC,"iEnchant"); - float fAngleToVector = 0.4; - - switch(iEnchant) //se chance of success - { - case 1: - { - fAngleToVector = 0.5; - // iMaxStack = iMaxStack+3; - if (iReEnchant==0)iEnchantChance = iEnchantChance+150; -// DelayCommand(6.0,SendMessageToPC(oPC,"Current Enchanting chance : "+ IntToString(iEnchantChance)+"%")); -// if (iEnchantChance <1) iEnchantChance=1; - // sFlame = "plc_flamesmall"; - break; - } - case 2: - { - fAngleToVector = 0.6; - // iMaxStack = iMaxStack+1; - if (iReEnchant==0)iEnchantChance = iEnchantChance+100; - // sFlame = "plc_flamesmall"; - break; - } - case 3: - { - fAngleToVector = 0.6; -// iMaxStack = iMaxStack+1; - if (iReEnchant==0)iEnchantChance = iEnchantChance+75; - // sFlame = "plc_flamesmall"; - break; - } - case 4: - { - fAngleToVector = 0.2; -// iMaxStack = iMaxStack-2; - if (iReEnchant==0)iEnchantChance = iEnchantChance+50; - // sFlame = "plc_flamelarge"; - break; - } - case 5: - { - fAngleToVector = 0.3; - // iMaxStack = iMaxStack -3; - if (iReEnchant==0)iEnchantChance = iEnchantChance; - // sFlame = "plc_flamelarge"; - break; - } - case 6: - { - fAngleToVector = 0.3; - // iMaxStack = iMaxStack -3; - if (iReEnchant==0)iEnchantChance = iEnchantChance-100; - // sFlame = "plc_flamelarge"; - break; - } - case 7: - { - fAngleToVector = 0.3; - // iMaxStack = iMaxStack -3; - if (iReEnchant==0)iEnchantChance = iEnchantChance-250; - // sFlame = "plc_flamelarge"; - break; - } - case 8: - { - fAngleToVector = 0.4; - // iMaxStack = iMaxStack -3; - if (iReEnchant==0)iEnchantChance = iEnchantChance-270; - sFlame = "plc_flamemedium"; - break; - } - case 9: - { - fAngleToVector = 0.4; - // iMaxStack = iMaxStack -3; - if (iReEnchant==0)iEnchantChance = iEnchantChance-290; - sFlame = "plc_flamemedium"; - break; - } - case 10: - { - fAngleToVector = 0.4; - // iMaxStack = iMaxStack -3; - if (iReEnchant==0)iEnchantChance = iEnchantChance-310; - sFlame = "plc_flamemedium"; - break; - } - case 11: - { - fAngleToVector = 0.4; - // iMaxStack = iMaxStack -3; - if (iReEnchant==0)iEnchantChance = iEnchantChance-330; - sFlame = "plc_flamelarge"; - break; - } - case 12: - { - fAngleToVector = 0.4; - // iMaxStack = iMaxStack -3; - if (iReEnchant==0)iEnchantChance = iEnchantChance-350; - sFlame = "plc_flamelarge"; - break; - } - case 13: - { - fAngleToVector = 0.4; - // iMaxStack = iMaxStack -3; - if (iReEnchant==0)iEnchantChance = iEnchantChance-370; - sFlame = "plc_flamelarge"; - break; - } - case 14: - { - fAngleToVector = 0.4; - // iMaxStack = iMaxStack -3; - if (iReEnchant==0)iEnchantChance = iEnchantChance-390; - sFlame = "plc_flamelarge"; - break; - } - default: - { - sFlame = "plc_flamemedium"; - break; - } - } -//////////////////////////////////////////////////////////////////////// - iEnpower = GetLocalInt(oPC,"iEnpower"); - switch(iEnpower) - { - case 1: - { - sEssence = "essence001"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_ACID); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_10); - } - break; - } - case 2: - { - sEssence = "essence017"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_COLD); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_10); - } - break; - } - case 3: - { - sEssence = "essence006"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_ELECTRICAL); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_10); - } - break; - } - case 4: - { - sEssence = "essence011"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_FIRE); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_10); - } - break; - } - case 5: - { - sEssence = "essence001"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_ACID); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_15); - } - break; - } - case 6: - { - sEssence = "essence017"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_COLD); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_15); - } - break; - } - case 7: - { - sEssence = "essence006"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_ELECTRICAL); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_15); - } - break; - } - case 8: - { - sEssence = "essence011"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_FIRE); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_15); - } - break; - } - case 9: - { - sEssence = "essence001"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_ACID); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_20); - } - break; - } - case 10: - { - sEssence = "essence017"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_COLD); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_20); - } - break; - } - case 11: - { - sEssence = "essence006"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_ELECTRICAL); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_20); - } - break; - } - case 12: - { - sEssence = "essence011"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_FIRE); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_20); - } - break; - } - case 13: - { - sEssence = "essence016"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_SLASHING); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_15); - } - break; - } - case 14: - { - sEssence = "essence016"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_PIERCING); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_15); - } - break; - } - case 15: - { - sEssence = "essence016"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_BLUDGEONING); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_15); - } - break; - } - case 16: - { - sEssence = "essence016"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_NEGATIVE); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGERESIST_15); - } - break; - } - default: - { - int DamageType=0; - int DamageQty=0; - break; - } - } //end of switch - -////////////////////////////////////////////////////////////////////////////// - - location lSelf = GetLocation(OBJECT_SELF); - float fSelf = GetFacing(OBJECT_SELF); - vector vSelf = GetPosition(OBJECT_SELF); - object oArea = GetArea(OBJECT_SELF); - vector vFire; - int vDirection; - vFire = vSelf + (AngleToVector(fSelf) * fAngleToVector); - location lFire = Location(oArea,vFire,fSelf); - object oFire = CreatePlaceable(sFlame, lFire, 6.0); - - AssignCommand(oPC,PlaySound("al_mg_chntmagic1")); - AssignCommand(oPC,PlaySound("al_mg_crystalgd1")); - AssignCommand(oPC,PlaySound("al_mg_jacobs1")); - AssignCommand(oPC,ActionPlayAnimation(ANIMATION_LOOPING_GET_MID,1.0,4.0)); - PlayAnimation(ANIMATION_PLACEABLE_ACTIVATE,1.0,6.0); - - SetLocalInt(OBJECT_SELF,"iAmInUse",99); - DelayCommand(7.0,SetLocalInt(OBJECT_SELF,"iAmInUse",0)); - //ensure at least 1 respawn 10 minutes after used... - //this is to prevent a broken placeable that is used, with a 'in use' delay - //which would cancel the respawn - if (GetLocalInt(OBJECT_SELF,"iAmSetToRespawn")!=99) - { - SetLocalInt(OBJECT_SELF,"iAmSetToRespawn",99); - DelayCommand(600.0,ExecuteScript("_onclose_clear",OBJECT_SELF)); - } - - int iRandom = 0; - - int iSuccess = 0; - int iSkillGain = 0; - -////////////////////////////////////////////begin stackables - object oTemp = OBJECT_INVALID; - oTemp = GetItemPossessedBy(oPC,sEssence); - object oEssence = oTemp; - string sEssenceTag = GetTag(oEssence); - int iCount = 0; - int iEssence = 1; - iCount = GetNumStackedItems(oTemp); - DestroyObject(oTemp); - if (iCount iEssence) - { - iCount = iCount - iEssence; - SendMessageToPC(oPC,"You should get back "+IntToString(iCount)+" essences"); - DelayCommand(1.0,CreateAnObject(sEssence,oPC,iCount)); - } - } -////////////////////////////////////////////////////////////////end stackables - - iEnpower = GetLocalInt(oPC,"iEnpower"); - iEnchantChance = iEnchantChance - (iEnchantSkill * iEnpower/100); - // SendMessageToPC(oPC,"Value of iEnpower : " + IntToString(iEnpower)); - //SendMessageToPC(oPC,"Current Enchanting chance : "+ IntToString(iEnchantChance)+"%"); - - if (Random(1000) <= iEnchantChance) - { - iSuccess = 1; - iStackSize = 1; - if (iEnchant>=1) - { - DelayCommand(5.0,AssignCommand(oPC,ActionPlayAnimation(ANIMATION_LOOPING_CONJURE1,1.0,1.0))); - DelayCommand(5.0,AssignCommand(oPC,ActionPlayAnimation(ANIMATION_FIREFORGET_VICTORY1,1.0,1.0))); - DelayCommand(5.0,EnchantArmor(oItem,iEnchant)); -// DelayCommand(5.0,EnchantItem(oItem)); - DelayCommand(6.0, GiveToPC(oItem,oPC)); - sSuccess = "You successfully Enchant the Item"; - DelayCommand(6.0,FloatingTextStringOnCreature(sSuccess,oPC,FALSE)); - DelayCommand(5.8,PlaySound("vs_chant_conj_lm")); - DelayCommand(6.0,ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_DUR_BLUR,FALSE),OBJECT_SELF,2.0)); - } //end of iEnchant if - - int iEnpower = GetLocalInt(oPC,"iEnpower"); - int DamageType =GetLocalInt(oPC,"DamageType"); - int DamageQty =GetLocalInt(oPC,"DamageQty"); - if (iEnpower>=1) - { - DelayCommand(5.0,AssignCommand(oPC,ActionPlayAnimation(ANIMATION_LOOPING_CONJURE2,1.0,1.0))); - DelayCommand(5.0,AssignCommand(oPC,ActionPlayAnimation(ANIMATION_FIREFORGET_VICTORY2,1.0,1.0))); - DelayCommand(5.0,EnPowerArmor(oItem,DamageType,DamageQty)); - DelayCommand(6.0, GiveToPC(oItem,oPC)); - sSuccess = "You successfully Enpower the Item"; - DelayCommand(6.0,FloatingTextStringOnCreature(sSuccess,oPC,FALSE)); - DelayCommand(5.8,PlaySound("vs_chant_ench_hm")); - DelayCommand(6.0,ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_BEAM_LIGHTNING,FALSE),OBJECT_SELF,2.0)); - } //end of iEnpower if - - } - else - { - DelayCommand(5.0,AssignCommand(oPC,ActionPlayAnimation(ANIMATION_LOOPING_PAUSE_TIRED,1.0,1.0))); - DelayCommand(6.0,FloatingTextStringOnCreature("The incantation fails and the item is lost.",oPC,FALSE)); - DelayCommand(5.8,PlaySound("as_na_steamshrt2")); - DelayCommand(6.0,ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_DUR_PARALYZED ,FALSE),OBJECT_SELF,2.0)); - } - DelayCommand(6.0,DestroyObject(oItem)); - - if (iSuccess == 1) - { - iRandom = Random(1000); - if (iEnchantSkill > 700) iRandom = iRandom + 25; - if (iEnchantSkill > 998) iRandom = iRandom - 20; - if (iEnchantSkill > 999) iRandom = 0; - if (iRandom > iEnchantSkill) - { - if (d10(1)+1 >= iEnchantChance/100) iSkillGain = 1; - } - } - -//Ensure no more than 1 skill gain every 10 seconds to avoid token droppage. - if (iSkillGain ==1) - { - if (GetLocalInt(oPC,"iSkillGain")!= 0) - { - iSkillGain = 0; - } - else - { - SetLocalInt(oPC,"iSkillGain",99); - DelayCommand(10.0,SetLocalInt(oPC,"iSkillGain",0)); - } - } // end of if iskill gain == 1 - - - if (iSkillGain ==1) - { - string sOldSkill = ""; - string sOldSkill2 = ""; - iEnchantSkill++; - sOldSkill2 = IntToString(iEnchantSkill); - sOldSkill = "."+GetStringRight(sOldSkill2,1); - if (iEnchantSkill > 9) - { - sOldSkill = GetStringLeft(sOldSkill2,GetStringLength(sOldSkill2)-1)+sOldSkill; - } - else - { - sOldSkill = "0"+sOldSkill; - } - if (iEnchantSkill <= 1000) - { -// DelayCommand(6.0,SetTokenPair(oPC,14,2,iEnchantSkill)); - DelayCommand(6.0,SetPersistentInt(oPC,"iEnchantSkill",iEnchantSkill,0,"UOACraft")); - DelayCommand(6.0,SendMessageToPC(oPC,"===================================")); - DelayCommand(6.0,SendMessageToPC(oPC,"Your skill in Enchanting has gone up!")); - DelayCommand(6.0,SendMessageToPC(oPC,"Current Enchanting skill : "+ sOldSkill+"%")); - DelayCommand(6.0,SendMessageToPC(oPC,"===================================")); - DelayCommand(6.0, GiveXPToCreature(oPC, 5)); - } - - } // end of skill gain -} //end of main -void CreateAnObject(string sResource, object oPC, int iStackSize) - { - - CreateItemOnObject(sResource,oPC,iStackSize); - return; - } - -object CreatePlaceable(string sObject, location lPlace, float fDuration) -{ - object oPlaceable = CreateObject(OBJECT_TYPE_PLACEABLE,sObject,lPlace,FALSE); - if (fDuration != 0.0) - DestroyObject(oPlaceable,fDuration); - return oPlaceable; -} - -void EnchantArmor(object oItem,int wBonus) - { - itemproperty iBonus = ItemPropertyACBonus(wBonus); - IPSafeAddItemProperty(oItem,iBonus); - } - -void GiveToPC(object oItem, object oPC) - { - CopyItem(oItem,oPC,TRUE); - } - void EnPowerArmor(object oItem,int DamageType,int DamageQty) - { - itemproperty iEffect = ItemPropertyDamageResistance(DamageType,DamageQty); - IPSafeAddItemProperty(oItem,iEffect); - } - - -/* -IP_CONST_DAMAGEBONUS_1 -IP_CONST_DAMAGEBONUS_10 -IP_CONST_DAMAGEBONUS_1d10 -IP_CONST_DAMAGEBONUS_1d12 -IP_CONST_DAMAGEBONUS_1d4 -IP_CONST_DAMAGEBONUS_1d6 -IP_CONST_DAMAGEBONUS_1d8 -IP_CONST_DAMAGEBONUS_2 -IP_CONST_DAMAGEBONUS_2d10 -IP_CONST_DAMAGEBONUS_2d12 -IP_CONST_DAMAGEBONUS_2d4 -IP_CONST_DAMAGEBONUS_2d6 -IP_CONST_DAMAGEBONUS_2d8 -IP_CONST_DAMAGEBONUS_3 -IP_CONST_DAMAGEBONUS_4 -IP_CONST_DAMAGEBONUS_5 -IP_CONST_DAMAGEBONUS_6 -IP_CONST_DAMAGEBONUS_7 -IP_CONST_DAMAGEBONUS_8 -IP_CONST_DAMAGEBONUS_9 - - -IP_CONST_DAMAGETYPE_ACID -Acid damagetype. -IP_CONST_DAMAGETYPE_BLUDGEONING -Bludgenoning damagetype. -IP_CONST_DAMAGETYPE_COLD -Cold damagetype. -IP_CONST_DAMAGETYPE_DIVINE -Divine energy damage type. -IP_CONST_DAMAGETYPE_ELECTRICAL -Electrical damage type. -IP_CONST_DAMAGETYPE_FIRE -Fire damage type. -IP_CONST_DAMAGETYPE_MAGICAL -Any magical (i.e. not physical) damage type. -IP_CONST_DAMAGETYPE_NEGATIVE -Negative energy damage type. -IP_CONST_DAMAGETYPE_PHYSICAL -Physical (i.e. not magical) damage type. -IP_CONST_DAMAGETYPE_PIERCING -Piercing damage type. -IP_CONST_DAMAGETYPE_POSITIVE -Positive energy damage type. -IP_CONST_DAMAGETYPE_SLASHING -Slashing damage type. -IP_CONST_DAMAGETYPE_SONIC -Sonic damage type. -IP_CONST_DAMAGETYPE_SUBDUAL -Subdual damage type. -*/ - -/* -IP_CONST_DAMAGERESIST_10 Resist 10 damage. - -IP_CONST_DAMAGERESIST_15 Resist 15 damage. - -IP_CONST_DAMAGERESIST_20 Resist 20 damage. - -IP_CONST_DAMAGERESIST_25 Resist 25 damage. - -IP_CONST_DAMAGERESIST_30 Resist 30 damage. - -*/ -/* -IP_CONST_DAMAGETYPE_ACID Acid damagetype. - -IP_CONST_DAMAGETYPE_BLUDGEONING Bludgenoning damagetype. - -IP_CONST_DAMAGETYPE_COLD Cold damagetype. - -IP_CONST_DAMAGETYPE_DIVINE Divine energy damage type. - -IP_CONST_DAMAGETYPE_ELECTRICAL Electrical damage type. - -IP_CONST_DAMAGETYPE_FIRE Fire damage type. - -IP_CONST_DAMAGETYPE_MAGICAL Any magical (i.e. not physical) damage type. - -IP_CONST_DAMAGETYPE_NEGATIVE Negative energy damage type. - -IP_CONST_DAMAGETYPE_PHYSICAL Physical (i.e. not magical) damage type. - -IP_CONST_DAMAGETYPE_PIERCING Piercing damage type. - -IP_CONST_DAMAGETYPE_POSITIVE Positive energy damage type. - -IP_CONST_DAMAGETYPE_SLASHING Slashing damage type. - -IP_CONST_DAMAGETYPE_SONIC Sonic damage type. - -IP_CONST_DAMAGETYPE_SUBDUAL Subdual damage type - -*/ diff --git a/_module/nss/_enchant_weapon.nss b/_module/nss/_enchant_weapon.nss deleted file mode 100644 index 866cb08a..00000000 --- a/_module/nss/_enchant_weapon.nss +++ /dev/null @@ -1,1234 +0,0 @@ -//new enchant script - Oct 18,2005 - - - -//#include "_persist_01a" -#include "x2_inc_itemprop" -#include "aps_include" - -void GetNextItemPossessedBy(object oPC, string sItemTag); -void GetNextStackedItem(object oPC, string sEssenceTag, int iCount); -void CreateAnObject(string sResource, object oPC, int iStackSize); -object CreatePlaceable(string sObject, location lPlace, float fDuration); -object oTestValid=OBJECT_INVALID; -void EnchantWeapon(object oItem,int wBonus); -void EnPowerWeapon(object oItem,int DamageType,int DamageQty); -void GiveToPC(object oItem, object oPC); -string sDialogResRef=""; -string sEssence; -int iEnpower=0; -void main() -{ - - object oPC = GetLastDisturbed(); - object oItem = GetInventoryDisturbItem(); - - - string sItemTag = GetTag(oItem); - string sReEnchantMessage = "INVALID"; - - int iReEnchant = 0; - int iBaseItem=0; - int iMaxReEnchant; - int iMaxReEnchant2; - int iMaxReEnchant3; - int wBonus=1; - int wEffect=0; - - - int iEnchantSkill = GetPersistentInt(oPC,"iEnchantSkill","UOACraft"); - int iEnchantChance = iEnchantSkill; - - if (GetInventoryDisturbType()!= INVENTORY_DISTURB_TYPE_ADDED) - { - if (sItemTag=="ENCHANT_WEAPON1") - - { - SetLocalInt(oPC,"iEnchant",1); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant a weapon to +1.",oPC,FALSE); - } - - if (sItemTag=="ENCHANT_WEAPON2") - { - if (iEnchantChance >= 100) - { - SetLocalInt(oPC,"iEnchant",2); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant a weapon to +2.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant this.",oPC,FALSE); - } - - if (sItemTag=="ENCHANT_WEAPON3") - { - if (iEnchantChance >= 157) - { - SetLocalInt(oPC,"iEnchant",3); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant a weapon to +3.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant this.",oPC,FALSE); - } - - if (sItemTag=="ENCHANT_WEAPON4") - { - if (iEnchantChance >= 214) - { - SetLocalInt(oPC,"iEnchant",4); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant a weapon to +4.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant this.",oPC,FALSE); - } - - if (sItemTag=="ENCHANT_WEAPON5") - { - if (iEnchantChance >= 271) - { - SetLocalInt(oPC,"iEnchant",5); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant a weapon to +5",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant this.",oPC,FALSE); - } - - if (sItemTag=="ENCHANT_WEAPON6") - { - if (iEnchantChance >= 328) - { - SetLocalInt(oPC,"iEnchant",6); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant a weapon to +6.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant this.",oPC,FALSE); - } - - if (sItemTag=="ENCHANT_WEAPON7") - { - if (iEnchantChance >= 385) - { - SetLocalInt(oPC,"iEnchant",7); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant a weapon to +7.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant this.",oPC,FALSE); - } - - if (sItemTag=="ENCHANT_WEAPON8") - { - if (iEnchantChance >= 442) - { - SetLocalInt(oPC,"iEnchant",8); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant a weapon to +8.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant this.",oPC,FALSE); - } - - if (sItemTag=="ENCHANT_WEAPON9") - { - if (iEnchantChance >= 500) - { - SetLocalInt(oPC,"iEnchant",9); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant a weapon to +9.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant this.",oPC,FALSE); - } - - if (sItemTag=="ENCHANT_WEAPON10") - { - if (iEnchantChance >= 590) - { - SetLocalInt(oPC,"iEnchant",10); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant a weapon to +10.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant this.",oPC,FALSE); - } - - if (sItemTag=="ENCHANT_WEAPON11") - { - if (iEnchantChance >= 640) - { - SetLocalInt(oPC,"iEnchant",11); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant a weapon to +11.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant this.",oPC,FALSE); - } - - if (sItemTag=="ENCHANT_WEAPON12") - { - if (iEnchantChance >= 730) - { - SetLocalInt(oPC,"iEnchant",12); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant a weapon to +12.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant this.",oPC,FALSE); - } - - if (sItemTag=="ENCHANT_WEAPON13") - { - if (iEnchantChance >= 840) - { - SetLocalInt(oPC,"iEnchant",13); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant a weapon to +13.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant this.",oPC,FALSE); - } - - if (sItemTag=="ENCHANT_WEAPON14") - { - if (iEnchantChance >= 950) - { - SetLocalInt(oPC,"iEnchant",14); - SetLocalInt(oPC,"iEnpower",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enchant a weapon to +14.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enchant this.",oPC,FALSE); - } - - - -//XXXXX the following is Bows XXXXXXXXXXXX -// this is a brand new section new tags and ienchant goes to higher numbers - - - -//end of bows - - if (sItemTag=="ENPOWER_WEAPON1") - { - if (iEnchantChance >= 700) - { - SetLocalInt(oPC,"iEnpower",1); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a weapon with Acid.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_WEAPON2") - { - if (iEnchantChance >= 700) - { - SetLocalInt(oPC,"iEnpower",2); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a weapon with Cold.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_WEAPON3") - { - if (iEnchantChance >= 700) - { - SetLocalInt(oPC,"iEnpower",3); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a weapon with Electricity.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_WEAPON4") - { - if (iEnchantChance >= 700) - { - SetLocalInt(oPC,"iEnpower",4); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a weapon with Fire.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_WEAPON5") - { - if (iEnchantChance >= 800) - { - SetLocalInt(oPC,"iEnpower",5); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a weapon with Acid.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_WEAPON6") - { - if (iEnchantChance >= 800) - { - SetLocalInt(oPC,"iEnpower",6); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a weapon with Cold.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_WEAPON7") - { - if (iEnchantChance >= 800) - { - SetLocalInt(oPC,"iEnpower",7); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a weapon with Electricity.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_WEAPON8") - { - if (iEnchantChance >= 800) - { - SetLocalInt(oPC,"iEnpower",8); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a weapon with Fire.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_WEAPON9") - { - if (iEnchantChance >= 900) - { - SetLocalInt(oPC,"iEnpower",9); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a weapon with Acid.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_WEAPON10") - { - if (iEnchantChance >= 900) - { - SetLocalInt(oPC,"iEnpower",10); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a weapon with Cold.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_WEAPON11") - { - if (iEnchantChance >= 900) - { - SetLocalInt(oPC,"iEnpower",11); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a weapon with Electricity.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_WEAPON12") - { - if (iEnchantChance >= 900) - { - SetLocalInt(oPC,"iEnpower",12); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a weapon with Fire.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_WEAPON13") - { - if (iEnchantChance >= 900) - { - SetLocalInt(oPC,"iEnpower",13); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a weapon with Acid.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_WEAPON14") - { - if (iEnchantChance >= 900) - { - SetLocalInt(oPC,"iEnpower",14); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a weapon with Cold.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_WEAPON15") - { - if (iEnchantChance >= 900) - { - SetLocalInt(oPC,"iEnpower",15); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a weapon with Electricity.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower this.",oPC,FALSE); - } - - if (sItemTag=="ENPOWER_WEAPON16") - { - if (iEnchantChance >= 900) - { - SetLocalInt(oPC,"iEnpower",16); - SetLocalInt(oPC,"iEnchant",0); - FloatingTextStringOnCreature("Enchanting forge is now set to Enpower a weapon with Fire.",oPC,FALSE); - } - else - FloatingTextStringOnCreature("You do not have sufficient skill to enpower this.",oPC,FALSE); - } - CopyObject(oItem,GetLocation(oPC),OBJECT_SELF,GetTag(oItem)); - DestroyObject(oItem); - return; - } - - // The following 3 lines are to ensure compatability with UOAbigal's Persistent Token System. - // You can replace them with whatever 'no-drop' code you have or comment them out. - string sNoDropFlag = (GetStringLeft(GetTag(oItem),6)); - if (sNoDropFlag == "NoDrop" || sNoDropFlag == "TOKEN_"||sNoDropFlag=="_TBOX_") - return; - if (GetBaseItemType(oItem)==BASE_ITEM_LARGEBOX) - { - DestroyObject(oItem); - SendMessageToPC(oPC,"To avoid possible dupe exploits, the container placed in this table has been destroyed."); - return; - } - // End of compatability portion. - - if (GetLocalInt(OBJECT_SELF,"iAmInUse")!=0) - { - FloatingTextStringOnCreature("You must wait for this item to finish enchanting..",oPC,FALSE); - CopyItem(oItem,oPC,TRUE); - DestroyObject(oItem); - return; - } - - iBaseItem = GetBaseItemType(oItem); - string sItemResRef = ""; - int iStackSize = 0; - int iMaxStack = 5; - string sSuccess = ""; - - if (GetStringLeft(sItemTag,5) != "WEAP_" && GetStringLeft(sItemTag,5) != "GLOV_") - { - CopyItem(oItem,oPC,TRUE); - FloatingTextStringOnCreature("You cannot Enchant this item!.",oPC,FALSE); - DestroyObject(oItem); - return; - } - - if (iEnchantChance <350) - { - - iEnchantChance = GetAbilityScore(oPC,ABILITY_INTELLIGENCE)*3; - iEnchantChance = iEnchantChance + GetAbilityScore(oPC,ABILITY_DEXTERITY) + GetAbilityScore(oPC,ABILITY_WISDOM); - iEnchantChance = iEnchantChance * 3; - if (iEnchantChance >350) iEnchantChance = 350; - if (iEnchantSkill > iEnchantChance) iEnchantChance = iEnchantSkill; - } - - if (sItemResRef=="INVALID") - { - SendMessageToPC(oPC,"You cannot Enchant this item!"); - CopyItem(oItem,oPC,TRUE); - DestroyObject(oItem,0.1); - return; - } - - - if (iEnchantChance < 1) - { - if (iReEnchant==0) - { - FloatingTextStringOnCreature("You have no idea how to Enchant this item.",oPC,FALSE); - } - else - { - FloatingTextStringOnCreature("You have no idea how to reEnchant this item.",oPC,FALSE); - } - CopyItem(oItem,oPC,TRUE); - DestroyObject(oItem); - return; - } - - string sFlame= ""; - int iEnchant = GetLocalInt(oPC,"iEnchant"); - float fAngleToVector = 0.4; - - switch(iEnchant) //se chance of success - { - case 1: - { - fAngleToVector = 0.5; - if (iReEnchant==0)iEnchantChance = iEnchantChance+150; - break; - } - case 2: - { - fAngleToVector = 0.6; - if (iReEnchant==0)iEnchantChance = iEnchantChance+100; - break; - } - case 3: - { - fAngleToVector = 0.6; - if (iReEnchant==0)iEnchantChance = iEnchantChance+75; - break; - } - case 4: - { - fAngleToVector = 0.2; - if (iReEnchant==0)iEnchantChance = iEnchantChance+50; - break; - } - case 5: - { - fAngleToVector = 0.3; - if (iReEnchant==0)iEnchantChance = iEnchantChance; - break; - } - case 6: - { - fAngleToVector = 0.3; - if (iReEnchant==0)iEnchantChance = iEnchantChance-100; - break; - } - case 7: - { - fAngleToVector = 0.3; - if (iReEnchant==0)iEnchantChance = iEnchantChance-250; - break; - } - case 8: - { - fAngleToVector = 0.4; - if (iReEnchant==0)iEnchantChance = iEnchantChance-270; - sFlame = "plc_flamemedium"; - break; - } - case 9: - { - fAngleToVector = 0.4; - if (iReEnchant==0)iEnchantChance = iEnchantChance-290; - sFlame = "plc_flamemedium"; - break; - } - case 10: - { - fAngleToVector = 0.4; - if (iReEnchant==0)iEnchantChance = iEnchantChance-310; - sFlame = "plc_flamemedium"; - break; - } - case 11: - { - fAngleToVector = 0.4; - if (iReEnchant==0)iEnchantChance = iEnchantChance-330; - sFlame = "plc_flamelarge"; - break; - } - case 12: - { - fAngleToVector = 0.4; - if (iReEnchant==0)iEnchantChance = iEnchantChance-350; - sFlame = "plc_flamelarge"; - break; - } - case 13: - { - fAngleToVector = 0.4; - if (iReEnchant==0)iEnchantChance = iEnchantChance-370; - sFlame = "plc_flamelarge"; - break; - } - case 14: - { - fAngleToVector = 0.4; - if (iReEnchant==0)iEnchantChance = iEnchantChance-390; - sFlame = "plc_flamelarge"; - break; - } - default: - { - sFlame = "plc_flamemedium"; - break; - } - } - int iEnpower = GetLocalInt(oPC,"iEnpower"); - - switch(iEnpower) - { - case 1: - { - sEssence = "essence001"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_ACID); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGEBONUS_1d6); - FloatingTextStringOnCreature("Item valid. Damage set.",oPC,FALSE); - } - else - { - SetLocalInt(oPC,"DamageType",0); - SetLocalInt(oPC,"DamageQty",0); - FloatingTextStringOnCreature("You do not have enough essence for this.",oPC,FALSE); - CopyItem(oItem,oPC,TRUE); - DestroyObject(oItem,0.1); - return; - } - break; - } - case 2: - { - sEssence = "essence017"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_COLD); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGEBONUS_1d6); - FloatingTextStringOnCreature("Item valid. Damage set.",oPC,FALSE); - } - else - { - SetLocalInt(oPC,"DamageType",0); - SetLocalInt(oPC,"DamageQty",0); - FloatingTextStringOnCreature("You do not have enough essence for this.",oPC,FALSE); - CopyItem(oItem,oPC,TRUE); - DestroyObject(oItem,0.1); - return; - } - break; - } - case 3: - { - sEssence = "essence006"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_ELECTRICAL); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGEBONUS_1d6); - } - else - { - SetLocalInt(oPC,"DamageType",0); - SetLocalInt(oPC,"DamageQty",0); - FloatingTextStringOnCreature("You do not have enough essence for this.",oPC,FALSE); - CopyItem(oItem,oPC,TRUE); - DestroyObject(oItem,0.1); - return; - } - break; - } - case 4: - { - sEssence = "essence011"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_FIRE); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGEBONUS_1d6); - } - else - { - SetLocalInt(oPC,"DamageType",0); - SetLocalInt(oPC,"DamageQty",0); - FloatingTextStringOnCreature("You do not have enough essence for this.",oPC,FALSE); - CopyItem(oItem,oPC,TRUE); - DestroyObject(oItem,0.1); - return; - - } - break; - } - case 5: - { - sEssence = "essence001"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_ACID); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGEBONUS_1d8); - } - else - { - SetLocalInt(oPC,"DamageType",0); - SetLocalInt(oPC,"DamageQty",0); - FloatingTextStringOnCreature("You do not have enough essence for this.",oPC,FALSE); - CopyItem(oItem,oPC,TRUE); - DestroyObject(oItem,0.1); - return; - - } - break; - } - case 6: - { - sEssence = "essence017"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_COLD); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGEBONUS_1d8); - } - else - { - SetLocalInt(oPC,"DamageType",0); - SetLocalInt(oPC,"DamageQty",0); - FloatingTextStringOnCreature("You do not have enough essence for this.",oPC,FALSE); - CopyItem(oItem,oPC,TRUE); - DestroyObject(oItem,0.1); - return; - - } - break; - } - case 7: - { - sEssence = "essence006"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_ELECTRICAL); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGEBONUS_1d8); - } - else - { - SetLocalInt(oPC,"DamageType",0); - SetLocalInt(oPC,"DamageQty",0); - FloatingTextStringOnCreature("You do not have enough essence for this.",oPC,FALSE); - CopyItem(oItem,oPC,TRUE); - DestroyObject(oItem,0.1); - return; - - } - break; - } - case 8: - { - sEssence = "essence011"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_FIRE); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGEBONUS_1d8); - return; - } - else - { - SetLocalInt(oPC,"DamageType",0); - SetLocalInt(oPC,"DamageQty",0); - CopyItem(oItem,oPC,TRUE); - DestroyObject(oItem,0.1); - FloatingTextStringOnCreature("You do not have enough essence for this.",oPC,FALSE); - return; - } - break; - } - case 9: - { - sEssence = "essence001"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_ACID); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGEBONUS_1d10); - } - else - { - SetLocalInt(oPC,"DamageType",0); - SetLocalInt(oPC,"DamageQty",0); - CopyItem(oItem,oPC,TRUE); - DestroyObject(oItem,0.1); - FloatingTextStringOnCreature("You do not have enough essence for this.",oPC,FALSE); - return; - } - break; - } - case 10: - { - sEssence = "essence017"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_COLD); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGEBONUS_1d10); - } - else - { - SetLocalInt(oPC,"DamageType",0); - SetLocalInt(oPC,"DamageQty",0); - CopyItem(oItem,oPC,TRUE); - DestroyObject(oItem,0.1); - FloatingTextStringOnCreature("You do not have enough essence for this.",oPC,FALSE); - return; - } - break; - } - case 11: - { - sEssence = "essence006"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_ELECTRICAL); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGEBONUS_1d10); - } - else - { - SetLocalInt(oPC,"DamageType",0); - SetLocalInt(oPC,"DamageQty",0); - CopyItem(oItem,oPC,TRUE); - DestroyObject(oItem,0.1); - FloatingTextStringOnCreature("You do not have enough essence for this.",oPC,FALSE); - return; - } - break; - } - case 12: - { - sEssence = "essence011"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_FIRE); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGEBONUS_1d10); - } - else - { - SetLocalInt(oPC,"DamageType",0); - SetLocalInt(oPC,"DamageQty",0); - CopyItem(oItem,oPC,TRUE); - DestroyObject(oItem,0.1); - FloatingTextStringOnCreature("You do not have enough essence for this.",oPC,FALSE); - return; - } - break; - } - case 13: - { - sEssence = "essence001"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_ACID); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGEBONUS_1d12); - } - else - { - SetLocalInt(oPC,"DamageType",0); - SetLocalInt(oPC,"DamageQty",0); - CopyItem(oItem,oPC,TRUE); - DestroyObject(oItem,0.1); - FloatingTextStringOnCreature("You do not have enough essence for this.",oPC,FALSE); - return; - } - break; - } - case 14: - { - sEssence = "essence017"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_COLD); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGEBONUS_1d12); - } - else - { - SetLocalInt(oPC,"DamageType",0); - SetLocalInt(oPC,"DamageQty",0); - CopyItem(oItem,oPC,TRUE); - DestroyObject(oItem,0.1); - FloatingTextStringOnCreature("You do not have enough essence for this.",oPC,FALSE); - return; - } - break; - } - case 15: - { - sEssence = "essence006"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_ELECTRICAL); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGEBONUS_1d12); - } - else - { - SetLocalInt(oPC,"DamageType",0); - SetLocalInt(oPC,"DamageQty",0); - CopyItem(oItem,oPC,TRUE); - DestroyObject(oItem,0.1); - FloatingTextStringOnCreature("You do not have enough essence for this.",oPC,FALSE); - return; - } - break; - } - case 16: - { - sEssence = "essence011"; - if(GetItemPossessedBy(oPC,sEssence) != oTestValid) - { - SetLocalInt(oPC,"DamageType",IP_CONST_DAMAGETYPE_FIRE); - SetLocalInt(oPC,"DamageQty",IP_CONST_DAMAGEBONUS_1d12); - } - else - { - SetLocalInt(oPC,"DamageType",0); - SetLocalInt(oPC,"DamageQty",0); - CopyItem(oItem,oPC,TRUE); - DestroyObject(oItem,0.1); - FloatingTextStringOnCreature("You do not have enough essence for this.",oPC,FALSE); - return; - } - break; - } - default: - { - int DamageType=0; - int DamageQty=0; - break; - } - } //end of switch - - location lSelf = GetLocation(OBJECT_SELF); - float fSelf = GetFacing(OBJECT_SELF); - vector vSelf = GetPosition(OBJECT_SELF); - object oArea = GetArea(OBJECT_SELF); - vector vFire; - int vDirection; - vFire = vSelf + (AngleToVector(fSelf) * fAngleToVector); - location lFire = Location(oArea,vFire,fSelf); - object oFire = CreatePlaceable(sFlame, lFire, 6.0); - - AssignCommand(oPC,PlaySound("al_mg_chntmagic1")); - AssignCommand(oPC,PlaySound("al_mg_crystalgd1")); - AssignCommand(oPC,PlaySound("al_mg_jacobs1")); - - AssignCommand(oPC,ActionPlayAnimation(ANIMATION_LOOPING_GET_MID,1.0,4.0)); - PlayAnimation(ANIMATION_PLACEABLE_ACTIVATE,1.0,6.0); - - SetLocalInt(OBJECT_SELF,"iAmInUse",99); - DelayCommand(7.0,SetLocalInt(OBJECT_SELF,"iAmInUse",0)); - //ensure at least 1 respawn 10 minutes after used... - //this is to prevent a broken placeable that is used, with a 'in use'delay - //which would cancel the respawn - if (GetLocalInt(OBJECT_SELF,"iAmSetToRespawn")!=99) - { - SetLocalInt(OBJECT_SELF,"iAmSetToRespawn",99); - DelayCommand(600.0,ExecuteScript("_onclose_clear",OBJECT_SELF)); - } - - int iRandom = 0; - - int iSuccess = 0; - int iSkillGain = 0; -///////////////////////////////////////////begin stackables - object oTemp = OBJECT_INVALID; - oTemp = GetItemPossessedBy(oPC,sEssence); - object oEssence = oTemp; - string sEssenceTag = GetTag(oEssence); - int iCount = 0; - int iEssence = 1; - iCount = GetNumStackedItems(oTemp); - DestroyObject(oTemp); - if (iCount iEssence) - { - iCount = iCount - iEssence; - SendMessageToPC(oPC,"You should get back "+IntToString(iCount)+" essences"); - DelayCommand(1.0,CreateAnObject(sEssence,oPC,iCount)); - } - } - - - //DestroyObject(GetItemPossessedBy(oPC,sEssence)); //Comment out - - -////////////////////////////////////////////////////////////////end stackables - iEnpower = GetLocalInt(oPC,"iEnpower"); - if (iEnpower > 0) iEnchantChance = iEnchantChance - (iEnchantSkill * iEnpower/100); - //SendMessageToPC(oPC,"Value of iEnchantChance : " + IntToString(iEnchantChance)); - - if (Random(1000) <= iEnchantChance) - { - iSuccess = 1; - iStackSize = 1; - if (iEnchant>=1) - { - - DelayCommand(5.0,AssignCommand(oPC,ActionPlayAnimation(ANIMATION_LOOPING_CONJURE1,1.0,1.0))); - - DelayCommand(5.0,AssignCommand(oPC,ActionPlayAnimation(ANIMATION_FIREFORGET_VICTORY1,1.0,1.0))); - DelayCommand(5.0,EnchantWeapon(oItem,iEnchant)); - DelayCommand(6.0, GiveToPC(oItem,oPC)); - sSuccess = "You successfully Enchant the Item"; - - DelayCommand(6.0,FloatingTextStringOnCreature(sSuccess,oPC,FALSE)); - DelayCommand(5.8,PlaySound("vs_chant_conj_lm")); - - DelayCommand(6.0,ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_DUR_BLUR,FALSE),OBJECT_SELF,2.0)); - } //end of iEnchant if - - - int DamageType =GetLocalInt(oPC,"DamageType"); - int DamageQty =GetLocalInt(oPC,"DamageQty"); - if (iEnpower>=1) - { - - DelayCommand(5.0,AssignCommand(oPC,ActionPlayAnimation(ANIMATION_LOOPING_CONJURE2,1.0,1.0))); - DelayCommand(5.0,AssignCommand(oPC,ActionPlayAnimation(ANIMATION_FIREFORGET_VICTORY2,1.0,1.0))); - DelayCommand(5.0,EnPowerWeapon(oItem,DamageType,DamageQty)); - DelayCommand(6.0, GiveToPC(oItem,oPC)); - sSuccess = "You successfully Enpower the Item"; - SetLocalInt(oPC,"DamageType",0); - SetLocalInt(oPC,"DamageQty",0); - - DelayCommand(6.0,FloatingTextStringOnCreature(sSuccess,oPC,FALSE)); - DelayCommand(5.8,PlaySound("vs_chant_ench_hm")); - - DelayCommand(6.0,ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_BEAM_LIGHTNING,FALSE),OBJECT_SELF,2.0)); - } //end of iEnpower if - - } - else - { - DelayCommand(5.0,AssignCommand(oPC,ActionPlayAnimation(ANIMATION_LOOPING_PAUSE_TIRED,1.0,1.0))); - DelayCommand(6.0,FloatingTextStringOnCreature("The incantation fails and the item is lost.",oPC,FALSE)); - DelayCommand(5.8,PlaySound("as_na_steamshrt2")); - - DelayCommand(6.0,ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_DUR_PARALYZED,FALSE),OBJECT_SELF,2.0)); - } - DelayCommand(6.0,DestroyObject(oItem)); - - if (iSuccess == 1) - { - iRandom = Random(1000); - if (iEnchantSkill > 700) iRandom = iRandom + 30; - if (iEnchantSkill > 998) iRandom = iRandom - 25; - if (iEnchantSkill > 999) iRandom = 0; - if (iRandom > iEnchantSkill) - { - if (d10(1)+1 >= iEnchantChance/100) iSkillGain = 1; - } - } - - //Ensure no more than 1 skill gain every 10 seconds to avoid token droppage. - if (iSkillGain ==1) - { - if (GetLocalInt(oPC,"iSkillGain")!= 0) - { - iSkillGain = 0; - } - else - { - SetLocalInt(oPC,"iSkillGain",99); - DelayCommand(10.0,SetLocalInt(oPC,"iSkillGain",0)); - } - } // end of if iskill gain == 1 - - - if (iSkillGain ==1) - { - string sOldSkill = ""; - string sOldSkill2 = ""; - iEnchantSkill++; - sOldSkill2 = IntToString(iEnchantSkill); - sOldSkill = "."+GetStringRight(sOldSkill2,1); - if (iEnchantSkill > 9) - { - sOldSkill = -GetStringLeft(sOldSkill2,GetStringLength(sOldSkill2)-1)+sOldSkill; - } - else - { - sOldSkill = "0"+sOldSkill; - } - if (iEnchantSkill <= 1000) - { - -DelayCommand(6.0,SetPersistentInt(oPC,"iEnchantSkill",iEnchantSkill,0,"UOACraft")); - -DelayCommand(6.0,SendMessageToPC(oPC,"===================================")); - DelayCommand(6.0,SendMessageToPC(oPC,"Your skill in Enchanting has gone up!")); - DelayCommand(6.0,SendMessageToPC(oPC,"Current Enchanting skill :"+ sOldSkill+"%")); - -DelayCommand(6.0,SendMessageToPC(oPC,"===================================")); - DelayCommand(6.0, GiveXPToCreature(oPC, 5)); - } - - } // end of skill gain -} //end of main - -void CreateAnObject(string sResource, object oPC, int iStackSize) -{ - CreateItemOnObject(sResource,oPC,iStackSize); - return; -} - -object CreatePlaceable(string sObject, location lPlace, float fDuration) -{ - object oPlaceable = CreateObject(OBJECT_TYPE_PLACEABLE,sObject,lPlace,FALSE); - if (fDuration != 0.0) - DestroyObject(oPlaceable,fDuration); - return oPlaceable; -} - -void EnchantWeapon(object oItem,int wBonus) -{ - itemproperty iBonus; - if (wBonus < 15) - { - if (IPGetIsRangedWeapon(oItem)) - { - iBonus = ItemPropertyAttackBonus(wBonus); - } - if (GetStringLeft(GetTag(oItem),5) == "GLOV_") - { - iBonus = ItemPropertyAttackBonus(wBonus); - } - if (IPGetIsMeleeWeapon(oItem)) - { - iBonus = ItemPropertyEnhancementBonus(wBonus); - } - } - else - { - if (IPGetIsRangedWeapon(oItem)) - { - switch(wBonus) - { - case 15: - { - iBonus = ItemPropertyUnlimitedAmmo(); - break; - } - case 16: - { - iBonus = ItemPropertyUnlimitedAmmo(IP_CONST_UNLIMITEDAMMO_PLUS1); - break; - } - case 17: - { - iBonus = ItemPropertyUnlimitedAmmo(IP_CONST_UNLIMITEDAMMO_PLUS2); - break; - } - case 18: - { - iBonus = ItemPropertyUnlimitedAmmo(IP_CONST_UNLIMITEDAMMO_PLUS3); - break; - } - case 19: - { - iBonus = ItemPropertyUnlimitedAmmo(IP_CONST_UNLIMITEDAMMO_PLUS4); - break; - } - case 20: - { - iBonus = ItemPropertyUnlimitedAmmo(IP_CONST_UNLIMITEDAMMO_PLUS5); - break; - } - case 21: - { - iBonus = ItemPropertyUnlimitedAmmo(IP_CONST_UNLIMITEDAMMO_1D6COLD); - break; - } - case 22: - { - iBonus = ItemPropertyUnlimitedAmmo(IP_CONST_UNLIMITEDAMMO_1D6FIRE); - break; - } - case 23: - { - iBonus = ItemPropertyUnlimitedAmmo(IP_CONST_UNLIMITEDAMMO_1D6LIGHT); - break; - } - default: - { - break; - } - } - } - - if (IPGetIsMeleeWeapon(oItem)) - { - iBonus = ItemPropertyKeen(); - } - } - IPSafeAddItemProperty(oItem,iBonus); -} - -void GiveToPC(object oItem, object oPC) -{ - CopyItem(oItem,oPC,TRUE); -} - -void EnPowerWeapon(object oItem,int DamageType,int DamageQty) -{ - itemproperty iEffect = ItemPropertyDamageBonus(DamageType,DamageQty); - IPSafeAddItemProperty(oItem,iEffect); -} - - -/* -IP_CONST_DAMAGEBONUS_1 -IP_CONST_DAMAGEBONUS_10 -IP_CONST_DAMAGEBONUS_1d10 -IP_CONST_DAMAGEBONUS_1d12 -IP_CONST_DAMAGEBONUS_1d4 -IP_CONST_DAMAGEBONUS_1d6 -IP_CONST_DAMAGEBONUS_1d8 -IP_CONST_DAMAGEBONUS_2 -IP_CONST_DAMAGEBONUS_2d10 -IP_CONST_DAMAGEBONUS_2d12 -IP_CONST_DAMAGEBONUS_2d4 -IP_CONST_DAMAGEBONUS_2d6 -IP_CONST_DAMAGEBONUS_2d8 -IP_CONST_DAMAGEBONUS_3 -IP_CONST_DAMAGEBONUS_4 -IP_CONST_DAMAGEBONUS_5 -IP_CONST_DAMAGEBONUS_6 -IP_CONST_DAMAGEBONUS_7 -IP_CONST_DAMAGEBONUS_8 -IP_CONST_DAMAGEBONUS_9 - - -IP_CONST_DAMAGETYPE_ACID -IP_CONST_DAMAGETYPE_BLUDGEONING -IP_CONST_DAMAGETYPE_COLD -IP_CONST_DAMAGETYPE_DIVINE -IP_CONST_DAMAGETYPE_ELECTRICAL -IP_CONST_DAMAGETYPE_FIRE -IP_CONST_DAMAGETYPE_MAGICAL Any magical (i.e. not physical) damage type. -IP_CONST_DAMAGETYPE_NEGATIVE -IP_CONST_DAMAGETYPE_PHYSICAL Physical (i.e. not magical) damage type. -IP_CONST_DAMAGETYPE_PIERCING -IP_CONST_DAMAGETYPE_POSITIVE -IP_CONST_DAMAGETYPE_SLASHING -IP_CONST_DAMAGETYPE_SONIC -IP_CONST_DAMAGETYPE_SUBDUAL -*/ - diff --git a/_module/nss/_kb_loot_corpse.nss b/_module/nss/_kb_loot_corpse.nss deleted file mode 100644 index 5a03d2bd..00000000 --- a/_module/nss/_kb_loot_corpse.nss +++ /dev/null @@ -1,904 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////// -// // // -// _kb_loot_corpse (include file) // VERSION 3.3 // -// // // -// by Scrotok on 9 Feb 03 //////////////////////////// -// Thanks to Keron Blackfeld for 99% of the work! // -// email Questions and Comments to: jnbplatte@intellisys.net // -// // -//////////////////////////////////////////////////////////////////////////////// -// // -// CAUTION: You MUST re-save/compile (F7 key) "nw_c2_default7" whenever // -// "_kb_loot_corpse" is modified! // -// // -// CAUTION: You MUST re-save (not the F7 key!) "_kb_loot_corpse" if you make // -// any changes to "_kb_inc_invmgmt" (for programmers only: because it is an // -// #include file). To re-save it, make a change to the script, then UNDO // -// the change, then re-save. // -// // -// NEWBIES: You don't need to place this script anywhere -- it's included as // -// part of "nw_c2_default7" using the #include command. All you need to do // -// is configure the script (see below) as desired. // -// // -//////////////////////////////////////////////////////////////////////////////// -// // -// // -// CONFIGURING THE SCRIPT // -// // -// This script supports some configuration by the user. Following the // -// void LeaveCorpse() of the _kb_loot_corpse, you'll find a section where // -// you can set a few things. These include: (with default values displayed) // -// // -// // -// int nUseLootable = TRUE This enables the script. Setting is to FALSE // -// disables it. // -// // -// int nMoveEquipped = TRUE Setting this to FALSE will stop the script // -// from moving equipped items (other than // -// Armour/Helmet and Weapons/Shield/Torch) to // -// the lootable corpse placeable. (To prevent // -// the move/copy of Armour/Helmet and Weapons/ // -// Shield/Torch, use the next four toggles.) // -// Remember that CREATURE SLOTTED items are // -// NEVER moved. // -// // -// int nCopyArmour = TRUE This will use the ResRef to create a copy of // -// the Armour/Helmet the creature is wearing. // -// If you do not want to use this function, you // -// may want to consider the next one (called // -// nMoveArmour). nCopyArmour takes precedence // -// over nMoveArmour if both are TRUE. // -// // -// int nMoveArmour = FALSE Setting this TRUE will just move the armour // -// from the Chest slot to the lootable corpse // -// placeable on death; it will also move the // -// helmet from the Head slot to the lootable // -// corpse placeable. This can be a visual issue // -// when used with NPCs - since when the armour // -// is moved, the NPC will become 'naked'. // -// // -// *** If you do not wish to use either of the armour functions, just set // -// both values to FALSE. Then just add an additional suit of armour // -// and/or helmet to the inventory of creatures you want to have drop // -// their armour/helmet. // -// // -// int nDropWeapons = TRUE This will use the ResRef for dropping the // -// weapons on the ground - which is accomplished // -// by creating new ones on the ground and // -// destroying the ones in the creature's // -// inventory. NOTE: Even though the parameter // -// is called nDropWeapons, anything held in the // -// left or right hand (shield, torch, etc.) is // -// affected by this parameter. nDropWeapons // -// takes precedence over nMoveWeapons if both // -// are TRUE. // -// // -// int nMoveWeapons = FALSE Setting this TRUE will just move the weapons // -// to the Lootable Object just as the rest of // -// inventory is handled. NOTE: Even though the // -// parameter is called nMoveWeapons, anything // -// held in the left or right hand (shield, // -// torch, etc.) is affected by this parameter. // -// // -// *** If you do not wish to use either of the weapon functions, just set // -// both values to FALSE. Then just add additional weapons/shields/ // -// torches to the inventory of creatures you want to have drop those // -// items. // -// // -// int nUseBlood = TRUE Set this to TRUE if you want a Bloodspot to // -// appear under the corpse for a little extra // -// gory appeal. In addition, it will allow for // -// a grisly display if the corpse is destroyed. // -// Undead/constructs/elementals will not leave a // -// Bloodspot or "gib" when bashed. // -// // -// int nTinyBlood = FALSE Set this to FALSE if you don't want Tiny- // -// sized creatures (rats, bats, etc.) to leave a // -// Bloodspot, scorch mark, or small flame. They // -// will still "gib" normally. Only applies if // -// nUseBlood = TRUE. // -// // -// int nUseFlame = TRUE Set this to TRUE if you want a scorch mark or // -// a small flame (which burns out after 10-120 // -// seconds, and is replaced by a scorch mark) to // -// appear if 1/3 or more of the damage which // -// killed the creature was fire or electrical. // -// Scorch mark or flame will appear instead of // -// Bloodspot. If the total fire or electrical // -// damage exceeds the creature's max HP, a small // -// flame appears instead of a scorch mark. The // -// corpse will still gib normally. Undead, // -// constructs, and elementals will leave a // -// scorch mark, small flame, or nothing. Only // -// applies if nUseBlood = TRUE. // -// // -// int nCorpseFade = 0 This is the delay in actual seconds that the // -// corpse will remain before it fades. If you // -// set this to 0 (zero) it will turn off the // -// corpse fade - allowing all bodies and loot // -// to remain indefinitely. // -// // -// int nUseBonesBash = TRUE Set this to TRUE if you want bones to appear // -// when the corpse is bashed. The bones cannot // -// be bashed; they will only disappear if // -// nBonesFade > 0. // -// // -// int nUseBonesFade = TRUE Set this to TRUE if you want bones to appear // -// when the corpse fades. The bones cannot // -// be bashed; they will only disappear if // -// nBonesFade > 0. // -// // -// int nBonesFade = 60 This is the delay in actual seconds that the // -// bones will remain before they fade. If you // -// set this to 0 (zero) it will turn off the // -// bones fade - allowing all bones (and loot, // -// if the bones contain any) to remain forever. // -// // -// int nTinyBones = FALSE Set this to FALSE if you don't want Tiny- // -// sized creatures (rats, bats, etc.) to turn // -// into bones when their corpse is bashed or // -// fades. Only applies if nUseBonesBash and/or // -// nUseBonesFade = TRUE. // -// // -// int nKeepInventoryBash = FALSE Set this to TRUE if you want all items // -// in a creature's inventory to remain when // -// its corpse is bashed. If installed, // -// DOA's "Bashed Loot Breakage" plugin // -// ("doa_bashbreak") takes precedence over // -// nKeepInventoryBash. // -// // -// int nKeepInventoryFade = FALSE Set this to TRUE if you want all items // -// in a creature's inventory to remain when // -// its corpse fades. // -// // -// int nKeepEmpties = TRUE Set this to FALSE if you want EMPTY corpses // -// to fade immediately after their inventory is // -// emptied (and dropped weapons are claimed, // -// unless nKeepWeaponsEmpty is TRUE). // -// // -// int nKeepWeaponsBonesFade = FALSE Set this to FALSE if you want // -// dropped, unclaimed, non-plot weapons // -// to be destroyed when bones fade. // -// Only valid if nBonesFade > 0. // -// // -// int nKeepWeaponsCorpseFade = TRUE Set this to FALSE if you want // -// dropped, unclaimed, non-plot weapons // -// to be destroyed when corpses fade. // -// Only valid if nCorpseFade > 0. // -// // -// int nKeepWeaponsBash = TRUE Set this to FALSE if you want // -// dropped, unclaimed, non-plot weapons // -// to be destroyed when corpses are // -// bashed. // -// // -// int nKeepWeaponsEmpty = TRUE Set this to TRUE if you want empty // -// corpses to be destroyed even if // -// dropped weapons are unclaimed. // -// // -// *** Even though the 4 parameters listed above start with "nKeepWeapons", // -// anything held in the left or right hand (shield, torch, etc.) is // -// affected by these parameters, not just weapons. // -// // -// int nOverrideForPlacedCorpses = TRUE Set this to TRUE if you want the // -// 'Spawned Corpses' you place to be // -// permament. Setting it to FALSE // -// will cause your Placed Dead // -// creatures to act as the settings // -// above dictate. (i.e. Fading Out // -// after the delay or being emptied) // -// To use this functionality, you // -// should place the _kb_plc_corpse // -// script in the OnSpawn of the // -// critter you want to spawn dead. // -// // -//////////////////////////////////////////////////////////////////////////////// - -/* Version 3.3 Change Log: - - added SetPlotFlag to ensure oLootCorpse can't be destroyed before oHostBody is emptied (and weapons are dropped) - - fixed comments to clarify that "doa_bashbreak" script refers to DOA's "Bashed Loot Breakage" plugin -/* Version 3.2 Change Log: - - consolidated inventory management functions to _kb_inc_invmgmt - - DestroyInventory function calls changed to DestroyInventory + DestroyDroppedWeapons in _kb_inc_invmgmt (identical) - - added nTinyBlood and nUseFlame (added Flameout function and rewrote Bloodspot routine) - - added GetIsObjectValid check before destroying Bloodspot - - removed ActionWait (wasn't needed) - - combined several DelayCommand's into a single function (FadeCorpse) to improve performance - - improved FadeCorpse to take advantage of new functionality (nKeepInventoryFade, nUseBonesFade, etc.) - - fixed bug in DropLeftWeapon/DropRightWeapon that caused dropped weapons to have incorrect GetIdentified value - - fixed bug where 2 copies of droppable, equipped, Plot armor were created instead of 1 when corpse was bashed - - fixed bug that caused copied armor to have incorrect GetPlotFlag and GetIdentified values - - added nUseBonesBash to create bones when corpse is bashed - - added nUseBonesFade to create bones when corpse fades - - added nBonesFade to determine when bones fade (if ever) - - added nTinyBones to prevent bones from appearing for tiny-sized creatures - - added nKeepInventoryBash to keep all items in a creature's inventory when its corpse is bashed - - added nKeepInventoryFade to keep all items in a creature's inventory when its corpse fades - - replaced nKeepWeapons with: nKeepWeaponsBonesFade, nKeepWeaponsCorpseFade, nKeepWeaponsBash, and nKeepWeaponsEmpty - - changed comments to clarify weapons/shields/torches are affected by "weapons" parameters/functions - - changed comments to reflect that undead/constructs/elementals will not leave Bloodspot or "gib" when bashed - - fixed bug so that nCopyArmour takes precedence over nMoveArmour if both are TRUE - - added comments to clarify that nCopyArmour takes precedence over nMoveArmour if both are TRUE - - added comments to clarify that nDropWeapons takes precedence over nMoveWeapons if both are TRUE - - renamed oDeadNPC to oHostBody, and vDeadNPCLoc to vHostBodyLoc for consistency - - fixed bug so that nCopyArmour/nMoveArmour affect helmets equipped in the creature's Head slot, as well - - added support for "Destroy Target" command of DM's Helper wand (used to destroy the corpse or bones) - - added code to pass oLeftWpn/oRightWpn from oHostBody to oLootCorpse for use with Scrotok's Raise Dead/Ressurection Plugin -*/ - -#include "_kb_inc_invmgmt" -#include "sd_lootsystem" - - - -/******************************************************************************* - ** This script was borrowed from the Hard Core Ruleset, where they use it to ** - ** move a Dead PC's inventory to a lootable corpse object. Credit where ** - ** credit is due, I always say. :) ** - *******************************************************************************/ -object strip_equipped(object oHostBody, object oLootCorpse, object oEquip) -{ - if(GetIsObjectValid(oEquip) && GetDroppableFlag(oEquip)) - { - AssignCommand(oLootCorpse, ActionTakeItem(oEquip, oHostBody)); - } - return oEquip; -} - -/******************************************************************************* - ** These scripts drop weapons/shields/torches held in the corpse's hands. ** - ** ** - ** SPECIAL THANKS TO DREZDAR and MOJO for their help in getting these two ** - ** drop weapon scripts written. I never would have gotten the vectors right, ** - ** but THEY sure did! ** - ** ** - ** (East = 0, North = 90, West = 180, South = 270) ** - ** ** - *******************************************************************************/ -void DropLeftWeapon(object oLeftWpn, object oLootCorpse) -{ - if(GetIsObjectValid(oLeftWpn) && GetDroppableFlag(oLeftWpn)) - { - vector vCorpseLoc = GetPositionFromLocation(GetLocation(oLootCorpse)); - float fDifferential = 45.0f + IntToFloat(d20());//Randomize the Drop Angle - float fDistance = 0.5f + (IntToFloat(d10())/10);//Randomize the Drop Distance - float fVarWpnFace = -20.0f - IntToFloat(d20(2));//Randomize the Drop Facing - float fFacing = GetFacing(oLootCorpse); - fFacing = fFacing + fDifferential; - if (fFacing > 360.0f) - { fFacing = 720.0f - fFacing; } - if (fFacing < 0.0f) - { fFacing = 360.0f + fFacing; } - float fWpnFacing = GetFacing(oLootCorpse) + fVarWpnFace; - if (fWpnFacing > 360.0f) - { fWpnFacing = 720.0f - fWpnFacing; } - if (fWpnFacing < 0.0f) - { fWpnFacing = 360.0f + fWpnFacing; } - object oArea = GetArea(oLootCorpse); - //Generate New Location - float fNewX; - float fNewY; - float fNewZ; - if ((fFacing > 0.0f) && (fFacing < 90.0f)) - { fNewX = vCorpseLoc.x + ((cos(fFacing))*fDistance); fNewY = vCorpseLoc.y + ((sin(fFacing))*fDistance); fNewZ = vCorpseLoc.z; } - else if ((fFacing > 90.0f) && (fFacing < 180.0f)) - { fNewX = vCorpseLoc.x - ((cos(180.0f - fFacing))*fDistance); fNewY = vCorpseLoc.y + ((sin(180.0f - fFacing))*fDistance); fNewZ = vCorpseLoc.z; } - else if ((fFacing > 180.0f) && (fFacing < 270.0f)) - { fNewX = vCorpseLoc.x - ((cos(fFacing - 180.0f))*fDistance); fNewY = vCorpseLoc.y - ((sin(fFacing - 180.0f))*fDistance); fNewZ = vCorpseLoc.z; } - else if ((fFacing > 270.0f) && (fFacing < 360.0f)) - { fNewX = vCorpseLoc.x + ((cos(360.0f - fFacing))*fDistance); fNewY = vCorpseLoc.y - ((sin(360.0f - fFacing))*fDistance); fNewZ = vCorpseLoc.z; } - else if (fFacing == 0.0f) - { fNewX = vCorpseLoc.x + fDistance; fNewY = vCorpseLoc.y; fNewZ = vCorpseLoc.z; } - else if (fFacing == 90.0f) - { fNewX = vCorpseLoc.x; fNewY = vCorpseLoc.y + fDistance; fNewZ = vCorpseLoc.z; } - else if (fFacing == 180.0f) - { fNewX = vCorpseLoc.x - fDistance; fNewY = vCorpseLoc.y; fNewZ = vCorpseLoc.z; } - else if (fFacing == 270.0f) - { fNewX = vCorpseLoc.x; fNewY = vCorpseLoc.y - fDistance; fNewZ = vCorpseLoc.z; } - vector vNewFinal = Vector(fNewX, fNewY, fNewZ); - location lDropLeft = Location(oArea, vNewFinal, fWpnFacing); - //Drop Weapon - string sLeftWpnRef = GetResRef(oLeftWpn); - int nID = GetIdentified(oLeftWpn); - if (GetPlotFlag(oLeftWpn)) - { - SetPlotFlag(oLeftWpn, FALSE); - DestroyObject(oLeftWpn); - oLeftWpn = CreateObject(OBJECT_TYPE_ITEM, sLeftWpnRef, lDropLeft, FALSE); - SetPlotFlag(oLeftWpn, TRUE); - } - else - { - DestroyObject(oLeftWpn); - oLeftWpn = CreateObject(OBJECT_TYPE_ITEM, sLeftWpnRef, lDropLeft, FALSE); - } - SetIdentified(oLeftWpn, nID); - SetLocalObject(oLootCorpse, "oLeftWpn", oLeftWpn); - } - // We're done with oHostBody, so allow oLootCorpse to be destroyable - AssignCommand(oLootCorpse, ActionDoCommand(SetPlotFlag(oLootCorpse, FALSE))); -} - -void DropRightWeapon(object oRightWpn, object oLootCorpse) -{ - if(GetIsObjectValid(oRightWpn) && GetDroppableFlag(oRightWpn)) - { - vector vCorpseLoc = GetPositionFromLocation(GetLocation(oLootCorpse)); - float fDifferential = -45.0f + IntToFloat(d20());//Randomize the Drop Angle - float fDistance = 0.5f + (IntToFloat(d10())/10);//Randomize the Drop Distance - float fVarWpnFace = 20.0f - IntToFloat(d20(2));//Randomize the Drop Facing - float fFacing = GetFacing(oLootCorpse); - fFacing = fFacing + fDifferential; - if (fFacing > 360.0f) - { fFacing = 720.0f - fFacing; } - if (fFacing < 0.0f) - { fFacing = 360.0f + fFacing; } - float fWpnFacing = GetFacing(oLootCorpse) + fVarWpnFace; - if (fWpnFacing > 360.0f) - { fWpnFacing = 720.0f - fWpnFacing; } - if (fWpnFacing < 0.0f) - { fWpnFacing = 360.0f + fWpnFacing; } - object oArea = GetArea(oLootCorpse); - //Generate New Location - float fNewX; - float fNewY; - float fNewZ; - if ((fFacing > 0.0f) && (fFacing < 90.0f)) - { fNewX = vCorpseLoc.x + ((cos(fFacing))*fDistance); fNewY = vCorpseLoc.y + ((sin(fFacing))*fDistance); fNewZ = vCorpseLoc.z; } - else if ((fFacing > 90.0f) && (fFacing < 180.0f)) - { fNewX = vCorpseLoc.x - ((cos(180.0f - fFacing))*fDistance); fNewY = vCorpseLoc.y + ((sin(180.0f - fFacing))*fDistance); fNewZ = vCorpseLoc.z; } - else if ((fFacing > 180.0f) && (fFacing < 270.0f)) - { fNewX = vCorpseLoc.x - ((cos(fFacing - 180.0f))*fDistance); fNewY = vCorpseLoc.y - ((sin(fFacing - 180.0f))*fDistance); fNewZ = vCorpseLoc.z; } - else if ((fFacing > 270.0f) && (fFacing < 360.0f)) - { fNewX = vCorpseLoc.x + ((cos(360.0f - fFacing))*fDistance); fNewY = vCorpseLoc.y - ((sin(360.0f - fFacing))*fDistance); fNewZ = vCorpseLoc.z; } - else if (fFacing == 0.0f) - { fNewX = vCorpseLoc.x + fDistance; fNewY = vCorpseLoc.y; fNewZ = vCorpseLoc.z; } - else if (fFacing == 90.0f) - { fNewX = vCorpseLoc.x; fNewY = vCorpseLoc.y + fDistance; fNewZ = vCorpseLoc.z; } - else if (fFacing == 180.0f) - { fNewX = vCorpseLoc.x - fDistance; fNewY = vCorpseLoc.y; fNewZ = vCorpseLoc.z; } - else if (fFacing == 270.0f) - { fNewX = vCorpseLoc.x; fNewY = vCorpseLoc.y - fDistance; fNewZ = vCorpseLoc.z; } - vector vNewFinal = Vector(fNewX, fNewY, fNewZ); - location lDropRight = Location(oArea, vNewFinal, fWpnFacing); - //Drop Weapon - string sRightWpnRef = GetResRef(oRightWpn); - int nID = GetIdentified(oRightWpn); - if (GetPlotFlag(oRightWpn)) - { - SetPlotFlag(oRightWpn, FALSE); - DestroyObject(oRightWpn); - oRightWpn = CreateObject(OBJECT_TYPE_ITEM, sRightWpnRef, lDropRight, FALSE); - SetPlotFlag(oRightWpn, TRUE); - } - else - { - DestroyObject(oRightWpn); - oRightWpn = CreateObject(OBJECT_TYPE_ITEM, sRightWpnRef, lDropRight, FALSE); - } - SetIdentified(oRightWpn, nID); - SetLocalObject(oLootCorpse, "oRightWpn", oRightWpn); - } -} - -/******************************************************************************* - ** This script gets rid of the bloodspot, lootable corpse, and creature body ** - *******************************************************************************/ -void FadeCorpse(object oCorpseBlood, object oLootCorpse, object oHostBody) -{ - //Delete the BloodSpot (if created) - if (GetIsObjectValid(oCorpseBlood)) - { - DestroyObject(oCorpseBlood); - } - // Empty (or don't empty) the lootable corpse placeable - if (GetLocalInt(oLootCorpse, "nKeepInventoryFade") == FALSE) - // Delete all items (except Plot) from lootable corpse placeable - DestroyInventory(oLootCorpse); - else - { - // Do nothing (delete nothing from lootable corpse placeable) - } - // If user wants bones to be created when corpse fades... - if (GetLocalInt(oLootCorpse, "nUseBonesFade")) - { - if ((GetLocalInt(oLootCorpse, "nTinyBones") == FALSE) && (GetCreatureSize(oHostBody) == CREATURE_SIZE_TINY)) - { - // Do nothing -- no bones for tiny creatures if nTinyBones is FALSE - } - else - { - // Create the bones - object oBones = CreateObject(OBJECT_TYPE_PLACEABLE, "loot_bones_obj", GetLocation(oLootCorpse), FALSE); - // Move inventory to bones - TransferToBones(oLootCorpse, oBones); - // Fade bones after nBoneFade seconds - if (GetLocalInt(oLootCorpse, "nBonesFade") > 0) - { - // Remember racial type and Blueprint ResRef for use with Scrotok's Raise Dead/Resurrection plugin - SetLocalInt(oBones, "nRacialType", GetLocalInt(oLootCorpse, "nRacialType")); - SetLocalString(oBones, "sHostBodyResRef", GetLocalString(oLootCorpse, "sHostBodyResRef")); - // Pass dropped weapon/shield/torch info to bones - SetLocalObject(oBones, "oLeftWpn", GetLocalObject(oLootCorpse, "oLeftWpn")); - SetLocalObject(oBones, "oRightWpn", GetLocalObject(oLootCorpse, "oRightWpn")); - int nKeepWeaponsBonesFade = GetLocalInt(oLootCorpse, "nKeepWeaponsBonesFade"); - // Remember nKeepWeaponsBonesFade for use with DM's Helper wand - SetLocalInt(oBones, "nKeepWeaponsBonesFade", nKeepWeaponsBonesFade); - float fBonesFade = IntToFloat(GetLocalInt(oLootCorpse, "nBonesFade")); - AssignCommand(oBones, DelayCommand(fBonesFade, BonesCleanup(oBones, nKeepWeaponsBonesFade))); - } - } - } - // Delete unclaimed, dropped, non-Plot weapons unless nKeepWeaponsCorpseFade = 1 - if (!GetLocalInt(oLootCorpse, "nKeepWeaponsCorpseFade")) - DestroyDroppedWeapons(oLootCorpse); - // Delete the lootable corpse placeable - DestroyObject(oLootCorpse); - // Empty and delete actual creature corpse (body) - DestroyInventory(oHostBody); - /* There is no call to DestroyDroppedWeapons since if the weapons are - dropped, they are already deleted from oHostBody. If the weapons are - not dropped, then the function would still not delete the weapons - since GetItemPossessor would be a valid object */ - SetIsDestroyable(TRUE,FALSE,FALSE); - // NOTE: The following line MUST be last in this script, since oHostBody - // is the same as OBJECT_SELF - DestroyObject(oHostBody); -} - -/******************************************************************************* - ** This script replaces the small flame with a scorch mark ** - *******************************************************************************/ -void Flameout(object oCorpseBlood, object oLootCorpse) -{ - location lBloodLoc = GetLocation(oCorpseBlood); -/* - // Used for debugging - SendMessageToPC(GetFirstPC(), "Flame script started..."); - if (!GetIsObjectValid(oCorpseBlood)) - { - // This should never happen (if you bash/fade corpse, oHostBody is - // destroyed, so Flameout won't run (can't add to action queue of invalid - // object) - SendMessageToPC(GetFirstPC(), "Flame already destroyed... location for new scorch unknown?"); - } -*/ - // Get rid of small flame - DestroyObject(oCorpseBlood); - // ... and turn it into a scorch mark - oCorpseBlood = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_weathmark", lBloodLoc, FALSE); - ExecuteScript("sl_destroyself2", oCorpseBlood); - //Set Local for deletion later if needed - SetLocalObject(oLootCorpse, "oBloodSpot", oCorpseBlood); -} - -void BodyFade(object oHostBody, object oBlood) -{ - object oBones; - location lLoc = GetLocation(oHostBody); - SetPlotFlag(oHostBody, FALSE); - AssignCommand(oHostBody, SetIsDestroyable(TRUE,FALSE,FALSE)); - if ((GetRacialType(oHostBody) != RACIAL_TYPE_CONSTRUCT) && - (GetRacialType(oHostBody) != RACIAL_TYPE_ELEMENTAL)&& - (GetRacialType(oHostBody) != RACIAL_TYPE_DRAGON)&& - (GetRacialType(oHostBody) != RACIAL_TYPE_ANIMAL)&& - GetTag(oHostBody)!="sd_coff_mummy") - - { - oBones = CreateObject(OBJECT_TYPE_PLACEABLE, "sd_remains", lLoc, FALSE); - ExecuteScript("sl_destroyself", oBones); - } - DestroyObject(oBlood); - if (GetIsDead(oHostBody))DestroyObject(oHostBody, 0.2f); - } - -void LeaveCorpse() -{ - //SET YOUR LOOTABLE CORPSES PREFERENCES HERE /////////////// - // - int nUseLootable = TRUE; // Set this to FALSE if you want disable the lootable corpse functionality // - int nMoveEquipped = FALSE; // Set this to FALSE if you don't want to move Equipped items to the corpse // - int nCopyArmour = FALSE; // This will use the ResRef to create a copy of the armour/helmet // - int nMoveArmour = FALSE; // Setting this TRUE will just move the armour/helmet (Naked NPCs) // - int nDropWeapons = TRUE; // This will use the ResRef for dropping the weapons on the ground // - int nMoveWeapons = FALSE; // Setting this TRUE will just move the weapons to the Lootable Object // - int nUseBlood = FALSE; // Set this to TRUE if you want a Bloodspot to appear under the corpse and have // - // "gibs" when a corpse is destroyed. Undead/constructs/elementals won't leave a // - // Bloodspot or gib. // - int nTinyBlood = FALSE; // Set this to FALSE if you don't want Tiny-sized creatures (rats, bats, etc.) to // - // leave a Bloodspot, scorch mark, or small flame. They will still "gib" // - // normally. Only applies if nUseBlood = TRUE. // - int nUseFlame = FALSE; // Set this to TRUE if you want a scorch mark or a small flame (which burns out // - // after 10-120 seconds, and is replaced by a scorch mark) to appear if 1/3 or // - // more of the damage which killed the creature was fire or electrical. Scorch // - // mark or flame will appear instead of Bloodspot. If the total fire or // - // electrical damage exceeds the creature's max HP, a small flame appears instead // - // of a scorch mark. The corpse will still gib normally. Undead, constructs, // - // and elementals will leave a scorch mark, small flame, or nothing. Only // - // applies if nUseBlood = TRUE. // - int nCorpseFade = 0; // Set this to 0 (ZERO) if you DO NOT want the corpses to fade // - int nUseBonesBash = FALSE; // Set this to TRUE if you want bones to appear when the corpse is bashed. The // - // bones cannot be bashed; they will only disappear if nBonesFade > 0. // - int nUseBonesFade = TRUE; // Set this to TRUE if you want bones to appear when the corpse fades. The bones // - // cannot be bashed; they will only disappear if nBonesFade > 0. // - int nBonesFade = 120; // This is the delay in actual seconds that the bones will remain before they fade. // - // If you set this to 0 (zero) it will turn off the bones fade - allowing all // - // bones (and loot, if the bones contain any) to remain forever. // - int nTinyBones = FALSE; // Set this to FALSE if you don't want Tiny-sized creatures (rats, bats, etc.) to // - // turn into bones when their corpse is bashed or fades. Only applies if // - // nUseBonesBash and/or nUseBonesFade = TRUE. // - int nKeepInventoryBash = FALSE; // Set this to TRUE if you want all items in a creature's inventory to remain when // - // its corpse is bashed. If installed, DOA's "Bashed Loot Breakage" plugin // - // ("doa_bashbreak") takes precedence over nKeepInventoryBash. // - int nKeepInventoryFade = FALSE; // Set this to TRUE if you want all items in a creature's inventory to remain when // - // its corpse fades. // - int nKeepEmpties = TRUE; // Set this to FALSE if you want EMPTY corpses to fade immediately. // - int nKeepWeaponsBonesFade = FALSE; // Set this to FALSE if you want dropped, unclaimed, non-plot weapons to be // - // destroyed when bones fade. Only valid if nBonesFade > 0. // - int nKeepWeaponsCorpseFade = FALSE; // Set this to FALSE if you want dropped, unclaimed, non-plot weapons to be // - // destroyed when corpses fade. Only valid if nCorpseFade > 0. // - int nKeepWeaponsBash = TRUE; // Set this to FALSE if you want dropped, unclaimed, non-plot weapons to be // - // destroyed when corpses are bashed. // - int nKeepWeaponsEmpty = TRUE; // Set this to TRUE if you want empty corpses to be destroyed even if dropped // - // weapons are unclaimed. // - int nOverrideForPlacedCorpses = FALSE;// Set this to TRUE if you want the 'Spawned Corpses' you // - // place to be permament. Setting it to FALSE will cause // - // your Placed Dead creatures to act as the settings above dictate. // - - - float lsDelay = 240.0; // Corpse & loot fade delay - - - ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - //ALTER THE FOLLOWING AT YOUR OWN RISK :) - object oHostBody = OBJECT_SELF; //Get the Dead Creature Object - object oBlood; - object oSaveBlood; - string sBaseTag = GetTag(oHostBody); //Get that TAG of the dead creature - string sPrefix = GetStringLeft(sBaseTag, 4); //Look for Dead Prefix - location lLoc = GetLocation(oHostBody); - - if ((GetRacialType(oHostBody) != RACIAL_TYPE_UNDEAD) && - (GetRacialType(oHostBody) != RACIAL_TYPE_CONSTRUCT) && - (GetRacialType(oHostBody) != RACIAL_TYPE_ELEMENTAL)&& - (GetRacialType(oHostBody) != RACIAL_TYPE_DRAGON)) - { - oBlood = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_bloodstain", lLoc, FALSE); - } - DelayCommand(lsDelay, BodyFade(oHostBody, oBlood)); - - - - if(nUseLootable) //If False, do nothing - { - - //Do 'spawned corpse' settings if desired - if (sPrefix == "Dead") - { - if (nOverrideForPlacedCorpses) - { - nKeepEmpties = TRUE; //Set 'Spawned Dead' corpses to Keep Empties - nCorpseFade = 0; //Disable Corpse Fade for 'Spawned Dead' corpses - } - } - - SetIsDestroyable(FALSE,TRUE,FALSE); //Protect our corpse from decaying - -/* -UNDER CONSTRUCTION :) - - // Create lootable corpse object only if oHostBody has something to loot - if (GetIsObjectValid(GetFirstItemInInventory(oHostBody))) - { - - } - else - { - // Don't create lootable corpse object(nothing to loot) - if (nKeepEmpties == FALSE) - { - // Get rid of corpse immediately, since it's already empty - nCorpseFade = 1; - } - else - { - // Ensure oHostBody is destroyed/fades properly - // Ensure blood spot is created and destroyed/fades properly - } - } -*/ - - //Set the spawnpoint for our lootable object and sink it - float fSinkCorpseObj = 0.1f; //set depth to sink lootable object - vector vHostBodyLoc = GetPosition(oHostBody); //get original vector so we can change it - float fCorpseFacing = GetFacing(oHostBody); //get original facing - vector vCorpseLoc = Vector(vHostBodyLoc.x, vHostBodyLoc.y, vHostBodyLoc.z - fSinkCorpseObj); //adjust z-axis to sink lootable object - location lCorpseLoc = Location(GetArea(oHostBody), vCorpseLoc, fCorpseFacing); //create new location - - object oLootCorpse = CreateObject(OBJECT_TYPE_PLACEABLE, "rr_sack", lCorpseLoc, FALSE); //Spawn our lootable object - SetLocalObject(oLootCorpse, "oHostBody", oHostBody); //Set Local for deletion later if needed - SetLocalObject(oLootCorpse, "oBlood", oBlood); - NameSack(oLootCorpse); - DelayCommand(0.1,sd_droploot(oHostBody, oLootCorpse)); - DelayCommand(lsDelay, LootClear(oLootCorpse)); - - // Ensure oLootCorpse can't be destroyed until oHostBody is emptied (and weapons are dropped) - //SetPlotFlag(oLootCorpse, TRUE); - - SetLocalInt(oLootCorpse, "nKeepEmpty", nKeepEmpties); //Set Local for deletion later if needed - - SetLocalInt(oLootCorpse, "nUseBonesBash", nUseBonesBash); //Set Local for later use - SetLocalInt(oLootCorpse, "nUseBonesFade", nUseBonesFade); //Set Local for later use - SetLocalInt(oLootCorpse, "nBonesFade", nBonesFade); //Set Local for later use - SetLocalInt(oLootCorpse, "nTinyBones", nTinyBones); //Set Local for later use - - SetLocalInt(oLootCorpse, "nKeepInventoryBash", nKeepInventoryBash); //Set Local for later use - SetLocalInt(oLootCorpse, "nKeepInventoryFade", nKeepInventoryFade); //Set Local for later use - - // Remember racial type and Blueprint ResRef for use with Scrotok's Raise Dead/Resurrection plugin - SetLocalInt(oLootCorpse, "nRacialType", GetRacialType(oHostBody)); - SetLocalString(oLootCorpse, "sHostBodyResRef", GetResRef(oHostBody)); - - object oCorpseBlood; - // If nUseBlood is TRUE and oHostBody isn't Undead/Construct/Elemental, set Local for later "gibbing" if bashed - if ((nUseBlood) && (GetRacialType(oHostBody) != RACIAL_TYPE_UNDEAD) && (GetRacialType(oHostBody) != RACIAL_TYPE_CONSTRUCT) && (GetRacialType(oHostBody) != RACIAL_TYPE_ELEMENTAL)) - { - SetLocalInt(oLootCorpse, "nUseBlood", TRUE); - } - // If nUseBlood = TRUE, continue Bloodspot routine - if (nUseBlood) - { - location lBloodLoc = GetLocation(oHostBody); //get original location for placing blood spot - if ((nTinyBlood == FALSE) && (GetCreatureSize(oHostBody) == CREATURE_SIZE_TINY)) - { - // Do nothing -- no bloodspot for tiny creatures if nTinyBlood is FALSE - } - else - { - if (nUseFlame) - { - // If nUseFlame = TRUE, determine if scorch, flame, or bloodspot should appear - int nFireDam = GetDamageDealtByType(DAMAGE_TYPE_FIRE); - int nElecDam = GetDamageDealtByType(DAMAGE_TYPE_ELECTRICAL); - int nTotDam = GetTotalDamageDealt(); - int nMaxHP = GetMaxHitPoints(); - int nFlameout; - -/* - // Used for debugging - SendMessageToPC(GetFirstPC(), "nFireDam: "+IntToString(nFireDam)+" nElecDam: "+IntToString(nElecDam)+" nTotDam: "+IntToString(nTotDam)+" nMaxHP: "+IntToString(nMaxHP)+" nTotDam/3: "+IntToString(nTotDam/3)); -*/ - - // If 1/3 or more of the damage is due to fire or electricity... - // (only the final damage that actually killed the creature is - // considered; tracking the cumulative damage taken would require - // altering the default OnDamaged script for every creature, - // which is not desirable) - if ((nFireDam >= (nTotDam/3)) || (nElecDam >= (nTotDam/3))) - { - // If massive fire or electricity damage, spawn a small flame - // which turns into a scorch mark after 10-120 seconds - // ("massive" means >= max HP) - if ((nFireDam >= nMaxHP) || (nElecDam >= nMaxHP)) - { - oCorpseBlood = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_flamesmall", lBloodLoc, FALSE); - ExecuteScript("sl_destroyself", oCorpseBlood); -/* - // Used for debugging - nFlameout = 30; -*/ - nFlameout = d12(10); - DelayCommand(IntToFloat(nFlameout), Flameout(oCorpseBlood, oLootCorpse)); - } - else - { - // Otherwise, spawn a scorch mark - oCorpseBlood = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_weathmark", lBloodLoc, FALSE); - ExecuteScript("sl_destroyself", oCorpseBlood); - } - } - else - { - // Not enough (or zero) fire/electrical damage, so just spawn bloodspot (or do nothing for Undead/Constructs/Elementals) - if ((GetRacialType(oHostBody) != RACIAL_TYPE_UNDEAD) && (GetRacialType(oHostBody) != RACIAL_TYPE_CONSTRUCT) && (GetRacialType(oHostBody) != RACIAL_TYPE_ELEMENTAL)) - { - oCorpseBlood = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_bloodstain", lBloodLoc, FALSE); - ExecuteScript("sl_destroyself", oCorpseBlood); - } - } - } - else - { - // If nUseFlame = FALSE, just spawn the bloodspot (or do nothing for Undead/Constructs/Elementals) - if ((GetRacialType(oHostBody) != RACIAL_TYPE_UNDEAD) && (GetRacialType(oHostBody) != RACIAL_TYPE_CONSTRUCT) && (GetRacialType(oHostBody) != RACIAL_TYPE_ELEMENTAL)) - { - oCorpseBlood = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_bloodstain", lBloodLoc, FALSE); - ExecuteScript("sl_destroyself", oCorpseBlood); - } - } - // oBloodSpot will either be a bloodstain, scorch mark, small flame, or OBJECT_INVALID (for Undead/Constructs/Elementals) - SetLocalObject(oLootCorpse, "oBloodSpot", oCorpseBlood); //Set Local for deletion later if needed - } - } - - // Get DEAD CREATURE'S INVENTORY - Move to oLootCorpse - int nAmtGold = GetGold(oHostBody); //Get any gold from the dead creature - if(nAmtGold) - { - AssignCommand(oLootCorpse, TakeGoldFromCreature(nAmtGold, oHostBody, FALSE)); - } - - if (nMoveEquipped) - { - //Get any DROPPABLE loot the dead creature has equipped - object oEquip1 = strip_equipped(oHostBody, oLootCorpse, GetItemInSlot(INVENTORY_SLOT_ARMS, oHostBody)); - object oEquip2 = strip_equipped(oHostBody, oLootCorpse, GetItemInSlot(INVENTORY_SLOT_ARROWS, oHostBody)); - object oEquip3 = strip_equipped(oHostBody, oLootCorpse, GetItemInSlot(INVENTORY_SLOT_BELT, oHostBody)); - object oEquip4 = strip_equipped(oHostBody, oLootCorpse, GetItemInSlot(INVENTORY_SLOT_BOLTS, oHostBody)); - object oEquip5 = strip_equipped(oHostBody, oLootCorpse, GetItemInSlot(INVENTORY_SLOT_BOOTS, oHostBody)); - object oEquip6 = strip_equipped(oHostBody, oLootCorpse, GetItemInSlot(INVENTORY_SLOT_BULLETS, oHostBody)); - object oEquip7 = strip_equipped(oHostBody, oLootCorpse, GetItemInSlot(INVENTORY_SLOT_CLOAK, oHostBody)); - // Version 3.2: Moved oEquip8 (helmets) to the armour section (see below) - object oEquip9 = strip_equipped(oHostBody, oLootCorpse, GetItemInSlot(INVENTORY_SLOT_LEFTRING, oHostBody)); - object oEquip10 = strip_equipped(oHostBody, oLootCorpse, GetItemInSlot(INVENTORY_SLOT_NECK, oHostBody)); - object oEquip11 = strip_equipped(oHostBody, oLootCorpse, GetItemInSlot(INVENTORY_SLOT_RIGHTRING, oHostBody)); - - SetLocalObject(oLootCorpse, "oEquip1", oEquip1); - SetLocalObject(oLootCorpse, "oEquip2", oEquip2); - SetLocalObject(oLootCorpse, "oEquip3", oEquip3); - SetLocalObject(oLootCorpse, "oEquip4", oEquip4); - SetLocalObject(oLootCorpse, "oEquip5", oEquip5); - SetLocalObject(oLootCorpse, "oEquip6", oEquip6); - SetLocalObject(oLootCorpse, "oEquip7", oEquip7); - // Version 3.2: Moved oEquip8 (helmets) to the armour section (see below) - SetLocalObject(oLootCorpse, "oEquip9", oEquip9); - SetLocalObject(oLootCorpse, "oEquip10", oEquip10); - SetLocalObject(oLootCorpse, "oEquip11", oEquip11); - } - - // Handle Weapons/Shields/Torches equipped (held) in left/right hands - // NOTE: nDropWeapons takes precedence over nMoveWeapons if both are TRUE - /* - If oHostBody has nothing in left/right hand, and has oLeftWpn/ - oRightWpn set (due to Scrotok's Raise Dead/Resurrection plugin), - set oLeftWpn/oRightWpn (dropped weapon info) on oLootCorpse for - later use - */ - if (nDropWeapons) - { - if (GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oHostBody) == OBJECT_INVALID) - { - if (GetIsObjectValid(GetLocalObject(oHostBody, "oRightWpn"))) - { - SetLocalObject(oLootCorpse, "oRightWpn", GetLocalObject(oHostBody, "oRightWpn")); - } - } - if (GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oHostBody) == OBJECT_INVALID) - { - if (GetIsObjectValid(GetLocalObject(oHostBody, "oLeftWpn"))) - { - SetLocalObject(oLootCorpse, "oLeftWpn", GetLocalObject(oHostBody, "oLeftWpn")); - } - } - } - - if (nMoveWeapons || nDropWeapons) - { - //Move equipped Weapons/Shields/Torches from oHostBody to oLootCorpse - object oEquip12 = strip_equipped(oHostBody, oLootCorpse, GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oHostBody)); - object oEquip13 = strip_equipped(oHostBody, oLootCorpse, GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oHostBody)); - - // oEquip12/13 == OBJECT_INVALID if oHostBody has nothing in right/left hand slots - SetLocalObject(oLootCorpse, "oEquip12", oEquip12); - SetLocalObject(oLootCorpse, "oEquip13", oEquip13); - } - - if (nDropWeapons) - { - // oEquip12/13 == OBJECT_INVALID if oHostBody has nothing in right/left hand slots - object oEquip12 = GetLocalObject(oLootCorpse, "oEquip12"); - object oEquip13 = GetLocalObject(oLootCorpse, "oEquip13"); - - // Drop the weapons/shields/torches - /* - The following commands destroy oEquip12 and oEquip13, and store - the dropped weapons on oLootCorpse as "oLeftWpn" and "oRightWpn". - Nothing gets stored in oLeftWpn/oRightWpn if oEquip12/13 == - OBJECT_INVALID. - */ - // Make sure DropLeftWeapon comes after DropRightWeapon in the lines - // below, in order for the SetPlotFlag fix (version 3.3) to work - AssignCommand(oLootCorpse, ActionDoCommand(DropRightWeapon(oEquip12, oLootCorpse))); - AssignCommand(oLootCorpse, ActionDoCommand(DropLeftWeapon(oEquip13, oLootCorpse))); - - SetLocalInt(oLootCorpse, "nKeepWeaponsBonesFade", nKeepWeaponsBonesFade); //Set Local to prevent deletion later if needed - SetLocalInt(oLootCorpse, "nKeepWeaponsCorpseFade", nKeepWeaponsCorpseFade); //Set Local to prevent deletion later if needed - SetLocalInt(oLootCorpse, "nKeepWeaponsBash", nKeepWeaponsBash); //Set Local to prevent deletion later if needed - SetLocalInt(oLootCorpse, "nKeepWeaponsEmpty", nKeepWeaponsEmpty); //Set Local for later use - } - - // Handle Armour/Helmets - // NOTE: nCopyArmour takes precedence over nMoveArmour if both are TRUE - if(nCopyArmour) - { - nMoveArmour = FALSE; - // Handle armour - object oArmour = GetItemInSlot(INVENTORY_SLOT_CHEST, oHostBody); - SetLocalObject(oLootCorpse, "oOrigArmour", oArmour); - if (GetDroppableFlag(oArmour)) - { - string sArmourRef = GetResRef(oArmour); - object oLootArmour = CreateItemOnObject(sArmourRef, oLootCorpse); - - SetPlotFlag(oLootArmour, GetPlotFlag(oArmour)); - SetIdentified(oLootArmour, GetIdentified(oArmour)); - - // Set Plot flag to FALSE for original armor so it can be - // destroyed later if corpse is bashed - SetPlotFlag(oArmour, FALSE); - - SetLocalObject(oLootCorpse, "oLootArmour", oLootArmour); - SetLocalObject(oLootCorpse, "oEquip14", oLootArmour); - } - - // Handle helmet - object oHelmet = GetItemInSlot(INVENTORY_SLOT_HEAD, oHostBody); - SetLocalObject(oLootCorpse, "oOrigHelmet", oHelmet); - if (GetDroppableFlag(oHelmet)) - { - string sHelmetRef = GetResRef(oHelmet); - object oLootHelmet = CreateItemOnObject(sHelmetRef, oLootCorpse); - - SetPlotFlag(oLootHelmet, GetPlotFlag(oHelmet)); - SetIdentified(oLootHelmet, GetIdentified(oHelmet)); - - // Set Plot flag to FALSE for original helmet so it can be - // destroyed later if corpse is bashed - SetPlotFlag(oHelmet, FALSE); - - SetLocalObject(oLootCorpse, "oLootHelmet", oLootHelmet); - SetLocalObject(oLootCorpse, "oEquip8", oLootHelmet); - } - } - - if(nMoveArmour) - { - nCopyArmour = FALSE; - // Handle armour - object oEquip14 = strip_equipped(oHostBody, oLootCorpse, GetItemInSlot(INVENTORY_SLOT_CHEST, oHostBody)); - SetLocalObject(oLootCorpse, "oEquip14", oEquip14); - // Handle helmet - object oEquip8 = strip_equipped(oHostBody, oLootCorpse, GetItemInSlot(INVENTORY_SLOT_HEAD, oHostBody)); - SetLocalObject(oLootCorpse, "oEquip8", oEquip8); - } - - //Get the remaining loot from the dead creature and move it to oLootCorpse - int nEquipCount = 14; - object oLootEQ = GetFirstItemInInventory(oHostBody); - while(GetIsObjectValid(oLootEQ)) - { - nEquipCount++; - // AssignCommand(oLootCorpse, ActionDoCommand(SendMessageToPC(GetFirstPC(), "oEquip"+IntToString(nEquipCount)+": "+GetTag(oLootEQ)))); - - object oEquipTemp = strip_equipped(oHostBody, oLootCorpse, oLootEQ); - string sEquipCount = "oEquip" + IntToString(nEquipCount); - SetLocalObject(oLootCorpse, sEquipCount, oEquipTemp); - oLootEQ = GetNextItemInInventory(oHostBody); - } - - // We're done with oHostBody, so allow oLootCorpse to be destroyable - if (!nDropWeapons) - { - AssignCommand(oLootCorpse, ActionDoCommand(SetPlotFlag(oLootCorpse, FALSE))); - } - - // Fade corpse out of existence after specified delay (unless set to 0) - if (nCorpseFade > 0) - { - float fCorpseFade = IntToFloat(nCorpseFade); - // ActionWait(fCorpseFade); // Removed for version 3.2 - DelayCommand(fCorpseFade, FadeCorpse(oCorpseBlood, oLootCorpse, oHostBody)); - } - } -} -//void main(){} diff --git a/_module/nss/_spider_death.nss b/_module/nss/_spider_death.nss index ab711342..8c0f2312 100644 --- a/_module/nss/_spider_death.nss +++ b/_module/nss/_spider_death.nss @@ -37,6 +37,9 @@ void main() { SignalEvent(GetAreaFromLocation(GetLocation(OBJECT_SELF)), EventUserDefined(1007)); } + + ExecuteScript("prc_npc_death", OBJECT_SELF); + ExecuteScript("prc_pwondeath", OBJECT_SELF); } object CreatePlaceable(string sObject, location lPlace, float fDuration) diff --git a/_module/nss/aps_include.nss b/_module/nss/aps_include.nss index 36260a2d..0967ddc4 100644 --- a/_module/nss/aps_include.nss +++ b/_module/nss/aps_include.nss @@ -1,7 +1,7 @@ // Name : Avlis Persistence System include // Purpose : Various APS/NWNX2 related functions // Authors : Ingmar Stieger, Adam Colon, Josh Simon -// Modified : January 1st, 2005 +// Modified : December 21, 2003 // This file is licensed under the terms of the // GNU GENERAL PUBLIC LICENSE (GPL) Version 2 @@ -10,12 +10,13 @@ /* Return codes */ /************************************/ -const int SQL_ERROR = 0; -const int SQL_SUCCESS = 1; +int SQL_ERROR = 0; +int SQL_SUCCESS = 1; /************************************/ /* Function prototypes */ /************************************/ +sqlquery last_sql_query; // Setup placeholders for ODBC requests and responses void SQLInit(); @@ -61,45 +62,33 @@ vector APSStringToVector(string sVector); // Optional parameters: // iExpiration: Number of days the persistent variable should be kept in database (default: 0=forever) // sTable: Name of the table where variable should be stored (default: pwdata) -void SetPersistentString(object oObject, string sVarName, string sValue, int iExpiration = - 0, string sTable = "pwdata"); +void SetPersistentString(object oObject, string sVarName, string sValue, int iExpiration = 0, string sTable = "pwdata"); // Set oObject's persistent integer variable sVarName to iValue // Optional parameters: // iExpiration: Number of days the persistent variable should be kept in database (default: 0=forever) // sTable: Name of the table where variable should be stored (default: pwdata) -void SetPersistentInt(object oObject, string sVarName, int iValue, int iExpiration = - 0, string sTable = "pwdata"); +void SetPersistentInt(object oObject, string sVarName, int iValue, int iExpiration = 0, string sTable = "pwdata"); // Set oObject's persistent float variable sVarName to fValue // Optional parameters: // iExpiration: Number of days the persistent variable should be kept in database (default: 0=forever) // sTable: Name of the table where variable should be stored (default: pwdata) -void SetPersistentFloat(object oObject, string sVarName, float fValue, int iExpiration = - 0, string sTable = "pwdata"); +void SetPersistentFloat(object oObject, string sVarName, float fValue, int iExpiration = 0, string sTable = "pwdata"); // Set oObject's persistent location variable sVarName to lLocation // Optional parameters: // iExpiration: Number of days the persistent variable should be kept in database (default: 0=forever) // sTable: Name of the table where variable should be stored (default: pwdata) // This function converts location to a string for storage in the database. -void SetPersistentLocation(object oObject, string sVarName, location lLocation, int iExpiration = - 0, string sTable = "pwdata"); +void SetPersistentLocation(object oObject, string sVarName, location lLocation, int iExpiration = 0, string sTable = "pwdata"); // Set oObject's persistent vector variable sVarName to vVector // Optional parameters: // iExpiration: Number of days the persistent variable should be kept in database (default: 0=forever) // sTable: Name of the table where variable should be stored (default: pwdata) // This function converts vector to a string for storage in the database. -void SetPersistentVector(object oObject, string sVarName, vector vVector, int iExpiration = - 0, string sTable = "pwdata"); - -// Set oObject's persistent object with sVarName to sValue -// Optional parameters: -// iExpiration: Number of days the persistent variable should be kept in database (default: 0=forever) -// sTable: Name of the table where variable should be stored (default: pwobjdata) -void SetPersistentObject(object oObject, string sVarName, object oObject2, int iExpiration = - 0, string sTable = "pwobjdata"); +void SetPersistentVector(object oObject, string sVarName, vector vVector, int iExpiration = 0, string sTable = "pwdata"); // Get oObject's persistent string variable sVarName // Optional parameters: @@ -131,12 +120,6 @@ location GetPersistentLocation(object oObject, string sVarname, string sTable = // * Return value on error: 0 vector GetPersistentVector(object oObject, string sVarName, string sTable = "pwdata"); -// Get oObject's persistent object sVarName -// Optional parameters: -// sTable: Name of the table where object is stored (default: pwobjdata) -// * Return value on error: 0 -object GetPersistentObject(object oObject, string sVarName, object oOwner = OBJECT_INVALID, string sTable = "pwobjdata"); - // Delete persistent variable sVarName stored on oObject // Optional parameters: // sTable: Name of the table where variable is stored (default: pwdata) @@ -156,40 +139,22 @@ string SQLDecodeSpecialChars(string sString); void SQLInit() { - int i; - - // Placeholder for ODBC persistence - string sMemory; - - for (i = 0; i < 8; i++) // reserve 8*128 bytes - sMemory += - "................................................................................................................................"; - - SetLocalString(GetModule(), "NWNX!ODBC!SPACER", sMemory); + SQLExecDirect("CREATE TABLE IF NOT EXISTS pwdata(player varchar(64), tag varchar(64), name varchar(64), val text, expire int(11), last timestamp NOT NULL DEFAULT DEFAULT_TIMESTAMP, PRIMARY KEY (player,tag,name))"); } void SQLExecDirect(string sSQL) { - SetLocalString(GetModule(), "NWNX!ODBC!EXEC", sSQL); + sqlquery sql = SqlPrepareQueryCampaign("db",sSQL); + last_sql_query = sql; + if(GetStringLowerCase(GetStringLeft(sSQL,6)) != "select") + { + SqlStep(sql); + } } int SQLFetch() { - string sRow; - object oModule = GetModule(); - - SetLocalString(oModule, "NWNX!ODBC!FETCH", GetLocalString(oModule, "NWNX!ODBC!SPACER")); - sRow = GetLocalString(oModule, "NWNX!ODBC!FETCH"); - if (GetStringLength(sRow) > 0) - { - SetLocalString(oModule, "NWNX_ODBC_CurrentRow", sRow); - return SQL_SUCCESS; - } - else - { - SetLocalString(oModule, "NWNX_ODBC_CurrentRow", ""); - return SQL_ERROR; - } + return SqlStep(last_sql_query); } // deprecated. use SQLFetch(). @@ -206,45 +171,7 @@ int SQLNextRow() string SQLGetData(int iCol) { - int iPos; - string sResultSet = GetLocalString(GetModule(), "NWNX_ODBC_CurrentRow"); - - // find column in current row - int iCount = 0; - string sColValue = ""; - - iPos = FindSubString(sResultSet, "¬"); - if ((iPos == -1) && (iCol == 1)) - { - // only one column, return value immediately - sColValue = sResultSet; - } - else if (iPos == -1) - { - // only one column but requested column > 1 - sColValue = ""; - } - else - { - // loop through columns until found - while (iCount != iCol) - { - iCount++; - if (iCount == iCol) - sColValue = GetStringLeft(sResultSet, iPos); - else - { - sResultSet = GetStringRight(sResultSet, GetStringLength(sResultSet) - iPos - 1); - iPos = FindSubString(sResultSet, "¬"); - } - - // special case: last column in row - if (iPos == -1) - iPos = GetStringLength(sResultSet); - } - } - - return sColValue; + return SqlGetString(last_sql_query,iCol-1); } // These functions deal with various data types. Ultimately, all information @@ -364,7 +291,7 @@ void SetPersistentString(object oObject, string sVarName, string sValue, int iEx "' AND tag='" + sTag + "' AND name='" + sVarName + "'"; SQLExecDirect(sSQL); - if (SQLFetch() == SQL_SUCCESS) + if (SQLFirstRow() == SQL_SUCCESS) { // row exists sSQL = "UPDATE " + sTable + " SET val='" + sValue + @@ -404,7 +331,7 @@ string GetPersistentString(object oObject, string sVarName, string sTable = "pwd "' AND tag='" + sTag + "' AND name='" + sVarName + "'"; SQLExecDirect(sSQL); - if (SQLFetch() == SQL_SUCCESS) + if (SQLFirstRow() == SQL_SUCCESS) return SQLDecodeSpecialChars(SQLGetData(1)); else { @@ -426,30 +353,7 @@ void SetPersistentInt(object oObject, string sVarName, int iValue, int iExpirati int GetPersistentInt(object oObject, string sVarName, string sTable = "pwdata") { - string sPlayer; - string sTag; - object oModule; - - if (GetIsPC(oObject)) - { - sPlayer = SQLEncodeSpecialChars(GetPCPlayerName(oObject)); - sTag = SQLEncodeSpecialChars(GetName(oObject)); - } - else - { - sPlayer = "~"; - sTag = GetTag(oObject); - } - - sVarName = SQLEncodeSpecialChars(sVarName); - - string sSQL = "SELECT val FROM " + sTable + " WHERE player='" + sPlayer + - "' AND tag='" + sTag + "' AND name='" + sVarName + "'"; - SQLExecDirect(sSQL); - - oModule = GetModule(); - SetLocalString(oModule, "NWNX!ODBC!FETCH", "-2147483647"); - return StringToInt(GetLocalString(oModule, "NWNX!ODBC!FETCH")); + return StringToInt(GetPersistentString(oObject, sVarName, sTable)); } void SetPersistentFloat(object oObject, string sVarName, float fValue, int iExpiration = @@ -460,30 +364,7 @@ void SetPersistentFloat(object oObject, string sVarName, float fValue, int iExpi float GetPersistentFloat(object oObject, string sVarName, string sTable = "pwdata") { - string sPlayer; - string sTag; - object oModule; - - if (GetIsPC(oObject)) - { - sPlayer = SQLEncodeSpecialChars(GetPCPlayerName(oObject)); - sTag = SQLEncodeSpecialChars(GetName(oObject)); - } - else - { - sPlayer = "~"; - sTag = GetTag(oObject); - } - - sVarName = SQLEncodeSpecialChars(sVarName); - - string sSQL = "SELECT val FROM " + sTable + " WHERE player='" + sPlayer + - "' AND tag='" + sTag + "' AND name='" + sVarName + "'"; - SQLExecDirect(sSQL); - - oModule = GetModule(); - SetLocalString(oModule, "NWNX!ODBC!FETCH", "-340282306073709650000000000000000000000.000000000"); - return StringToFloat(GetLocalString(oModule, "NWNX!ODBC!FETCH")); + return StringToFloat(GetPersistentString(oObject, sVarName, sTable)); } void SetPersistentLocation(object oObject, string sVarName, location lLocation, int iExpiration = @@ -508,73 +389,6 @@ vector GetPersistentVector(object oObject, string sVarName, string sTable = "pwd return APSStringToVector(GetPersistentString(oObject, sVarName, sTable)); } -void SetPersistentObject(object oOwner, string sVarName, object oObject, int iExpiration = - 0, string sTable = "pwobjdata") -{ - string sPlayer; - string sTag; - - if (GetIsPC(oOwner)) - { - sPlayer = SQLEncodeSpecialChars(GetPCPlayerName(oOwner)); - sTag = SQLEncodeSpecialChars(GetName(oOwner)); - } - else - { - sPlayer = "~"; - sTag = GetTag(oOwner); - } - sVarName = SQLEncodeSpecialChars(sVarName); - - string sSQL = "SELECT player FROM " + sTable + " WHERE player='" + sPlayer + - "' AND tag='" + sTag + "' AND name='" + sVarName + "'"; - SQLExecDirect(sSQL); - - if (SQLFetch() == SQL_SUCCESS) - { - // row exists - sSQL = "UPDATE " + sTable + " SET val=%s,expire=" + IntToString(iExpiration) + - " WHERE player='" + sPlayer + "' AND tag='" + sTag + "' AND name='" + sVarName + "'"; - SetLocalString(GetModule(), "NWNX!ODBC!SETSCORCOSQL", sSQL); - StoreCampaignObject ("NWNX", "-", oObject); - } - else - { - // row doesn't exist - sSQL = "INSERT INTO " + sTable + " (player,tag,name,val,expire) VALUES" + - "('" + sPlayer + "','" + sTag + "','" + sVarName + "',%s," + IntToString(iExpiration) + ")"; - SetLocalString(GetModule(), "NWNX!ODBC!SETSCORCOSQL", sSQL); - StoreCampaignObject ("NWNX", "-", oObject); - } -} - -object GetPersistentObject(object oObject, string sVarName, object oOwner = OBJECT_INVALID, string sTable = "pwobjdata") -{ - string sPlayer; - string sTag; - object oModule; - - if (GetIsPC(oObject)) - { - sPlayer = SQLEncodeSpecialChars(GetPCPlayerName(oObject)); - sTag = SQLEncodeSpecialChars(GetName(oObject)); - } - else - { - sPlayer = "~"; - sTag = GetTag(oObject); - } - sVarName = SQLEncodeSpecialChars(sVarName); - - string sSQL = "SELECT val FROM " + sTable + " WHERE player='" + sPlayer + - "' AND tag='" + sTag + "' AND name='" + sVarName + "'"; - SetLocalString(GetModule(), "NWNX!ODBC!SETSCORCOSQL", sSQL); - - if (!GetIsObjectValid(oOwner)) - oOwner = oObject; - return RetrieveCampaignObject ("NWNX", "-", GetLocation(oOwner), oOwner); -} - void DeletePersistentVariable(object oObject, string sVarName, string sTable = "pwdata") { string sPlayer; @@ -642,52 +456,3 @@ string SQLDecodeSpecialChars(string sString) return sReturn; } -// Gets the current REAL WORLD time, uses NWNX2 -// Year-Month-Day Time -// 1997-12-15 23:50:26 -string GetSQLTime(); -string GetSQLTime() -{ - string sSQL = "SELECT CURRENT_TIME"; - SQLExecDirect(sSQL); - if(SQLFetch() == SQL_SUCCESS) - { - return SQLGetData(1); - } - else - { - return "Database error"; - } -} - -// Gets the current REAL WORLD date, uses NWNX2 -string GetSQLDate(); -string GetSQLDate() -{ - string sSQL = "SELECT CURRENT_DATE"; - SQLExecDirect(sSQL); - if(SQLFetch() == SQL_SUCCESS) - { - return SQLGetData(1); - } - else - { - return "Database error"; - } -} - -// Gets the current REAL WORLD time stamp, uses NWNX2 -string GetSQLTimeStamp(); -string GetSQLTimeStamp() -{ - string sSQL = "SELECT CURRENT_TIMESTAMP"; - SQLExecDirect(sSQL); - if(SQLFetch() == SQL_SUCCESS) - { - return SQLGetData(1); - } - else - { - return "Database error"; - } -} diff --git a/_module/nss/at_caplvlup.nss b/_module/nss/at_caplvlup.nss new file mode 100644 index 00000000..ee138b1b --- /dev/null +++ b/_module/nss/at_caplvlup.nss @@ -0,0 +1,19 @@ +#include "nw_i0_tool" +/* Script generated by +Lilac Soul's NWN Script Generator, v. 1.6 + +For download info, please visit: +http://www.lilacsoul.revility.com */ + +//Put this on action taken in the conversation editor +void main() +{ + +object oPC = GetPCSpeaker(); + +if (GetHitDice(oPC) <= 2) + { + RewardPartyXP(3000, oPC, FALSE); + + } +} diff --git a/_module/nss/cstm_mnstr_death.nss b/_module/nss/cstm_mnstr_death.nss index a3a53d56..7ff48936 100644 --- a/_module/nss/cstm_mnstr_death.nss +++ b/_module/nss/cstm_mnstr_death.nss @@ -2,8 +2,10 @@ void main() { ExecuteScript("prc_npc_death", OBJECT_SELF); - + object oKiller = GetLastKiller(); + object oVictim = OBJECT_SELF; + int noleech = 0; int nClass = GetLevelByClass(CLASS_TYPE_COMMONER); int nAlign = GetAlignmentGoodEvil(OBJECT_SELF); @@ -18,9 +20,9 @@ void main() { SignalEvent(OBJECT_SELF, EventUserDefined(1007)); } - float BaseEXP = ((GetChallengeRating(OBJECT_SELF)*3.0)+5); - float BonusEXP = GetChallengeRating(OBJECT_SELF)+5; - float BaseMonEXP = BaseEXP; + float BaseEXP = ((GetChallengeRating(oVictim)*5.0)+2); + float BonusEXP = ((GetChallengeRating(oVictim)*2.0)+5); + float BaseMonEXP = BaseEXP; int NumOfParty = 0; float PartyLevelSum = 0.0; object oPartyMember = GetFirstFactionMember(oKiller, TRUE); diff --git a/_module/nss/dante_letodel_at.nss b/_module/nss/dante_letodel_at.nss new file mode 100644 index 00000000..b614dcae --- /dev/null +++ b/_module/nss/dante_letodel_at.nss @@ -0,0 +1,20 @@ +#include "nwnx_admin" + +void main() +{ + object oPlayer = GetPCSpeaker(); + + string sName = GetName(oPlayer); + + string sPlayer = GetPCPlayerName(oPlayer); + + SendMessageToPC(oPlayer,"sPlayer = "+sPlayer); + SendMessageToPC(oPlayer,"sName = "+sName); + + NWNX_Administration_DeletePlayerCharacter(oPlayer, 1, "Character Deleted"); + SendMessageToPC(oPlayer,sPlayer+" has deleted "+sName); + SendMessageToAllDMs(sPlayer+" has deleted "+sName); +} + + + diff --git a/_module/nss/ms_name_inc.nss b/_module/nss/ms_name_inc.nss new file mode 100644 index 00000000..e4953212 --- /dev/null +++ b/_module/nss/ms_name_inc.nss @@ -0,0 +1,2470 @@ +//////////////////////////////////////////////////////////////////////////////// +// // +// Markshire's Nomenclature // +// ms_name_inc.nss // +// // +// By Thrym of Markshire 5/21/06 // +// Updated by: Jaysyn 2021/12/03 // +// // +//////////////////////////////////////////////////////////////////////////////// +/* +// FUNCTION: +// The Nomenclature is an include file placed in the spawn script +// nw_c2_default9 designed to assign a name to a generic NPC who may +// wander towns, roads, shops, etc. +// +// Utilizing both SetName and RandomName the system will name the NPC in +// one of two ways ... +// +// "SET_NAME": By setting the variable "SET_NAME" on the NPC and +// assigning it a string the creature will rename itself upon spawning. +// This is handy for DM's and builders to create more precisely named +// creatures for the palette and then generize them upon spawn. +// +// eg. Ancient White Dragon in the Creator becomes White Dragon on Spawn. +// +// "SET_NAME" = "RANDOM": By setting the same variable to the name "RANDOM" +// the NPC then is given a random name generated by RACE and GENDER using +// the RandomName function. +// +// eg. Male Dwarven Villager in the Aurora Toolset becomes Gloigan on spawn +// this time and perhaps Rufus on the next spawned Villager. +// +// "NAME_TYPE": Setting this int variable to "1" will cause a Full Name +// to be generated if the "SET_NAME" is set to "RANDOM". +// +// eg. Male Dwarven Villager becomes Gloigan Stonecutter or Rufus Mason. +// +// "TITLE": Prepends the defined string to the NPCs name. +// +// eg. "Lord" Brown +// +// "POSTFIX": Appends the defind string after the NPC's name. +// +// eg. Ralph "the Guard" +// + + + "RND_ROGUE" + "RND_BARBARIAN" + "RND_FIGHTER" + "RND_CLERIC" : Setting these to "1" will give the NPC a randomized class + "RND_MAGE" : appropriate postfix + "RND_DRUID" + "RND_RANGER" + + +// +// +//////////////////////////////////////////////////////////////////////////////*/ + +#include "prc_inc_racial" + + + +///// FUNCTION DECLARATIONS //////////////////////////////////////////////////// + +string GetClassLevelTitle(int nClassType); + +int GetHighestClassLevel(object oCreature = OBJECT_SELF); + +// Generates a Random First Name +// based on Race and Gender +// For all Standard PC Races and Animals +string ms_RandomFirstName(object oNPC = OBJECT_SELF); + +// Generates a Random Last Name +// based on Race For all +// Standard PC Races and Animals +string ms_RandomLastName(object oNPC = OBJECT_SELF); + +// Function designed to read the variable +// "SET_NAME" and assign a new name to the NPC +// If the variable is set to "RANDOM" a +// random name is assigned. +// A second variable can be assigned to +// have the random name be a random Full Name. +void ms_Nomenclature(object oNPC = OBJECT_SELF); + + +///// FUNCTIONS //////////////////////////////////////////////////////////////// + +void ms_Nomenclature(object oNPC = OBJECT_SELF) +{ + string sRandomName = GetLocalString(oNPC, "SET_NAME"); + string sTitle = GetLocalString(oNPC, "TITLE"); + string sPostfix = GetLocalString(oNPC, "POSTFIX"); + string sBaseRace = GetLocalString(oNPC, "BASE_RACE"); + + int nGender = GetGender(oNPC); + int bClassTitle = GetLocalInt(oNPC,"CLASS_TITLE"); + int nHighClass = GetHighestClassLevel(oNPC); + int nLevel = GetLevelByClass(nHighClass, oNPC); + +//:: Handles class level based NPC titles + if (bClassTitle) + { + string sTitle; + + switch (nHighClass) + { + case CLASS_TYPE_BARBARIAN: + switch(nLevel) + { + case 1: case 2: case 3: + sTitle = "Brute" ; + break; + + case 4: case 5: + sTitle = "Vandal"; break; + + case 6: + if (nGender == 1) + {sTitle = "Plunderess"; break;} + else + {sTitle = "Plunderer"; break;} + + case 7: + sTitle = "Pillager"; break; + + case 8: + sTitle = "Marauder"; break; + + case 9: + sTitle = "Reaver"; break; + + case 10: + sTitle = "Barbarian"; break; + + case 11: + sTitle = "Mauler"; break; + + case 12: + sTitle = "Ravager"; break; + + case 13: + sTitle = "Slaughterer"; break; + + case 14: + sTitle = "Destroyer"; break; + + case 15: + if (nGender == 1) + {sTitle = "Chieftainess"; break;} + else + {sTitle = "Chieftain"; break;} + + case 16: + sTitle = "Bloodletter"; break; + + case 17: + sTitle = "Rampager"; break; + + case 18: + sTitle = "Slayer"; break; + + case 19: + sTitle = "Warmonger"; break; + + case 20: + if (nGender == 1) + {sTitle = "High Chieftainess"; break;} + else + {sTitle = "High Chieftain"; break;} + + default: + if (nGender == 1) + {sTitle = "Conqueress"; break;} + else + {sTitle = "Conqueror"; break;} + + } + + case CLASS_TYPE_ROGUE: + switch(nLevel) + { + case 1: case 2: case 3: + sTitle = "Lookout" ; + break; + + case 4: case 5: + sTitle = "Outlaw"; break; + + case 6: + sTitle = "Scalawag"; break; + + case 7: + sTitle = "Creeper"; break; + + case 8: + sTitle = "Larker"; break; + + case 9: + sTitle = "Footpad"; break; + + case 10: + sTitle = "Rogue"; break; + + case 11: + sTitle = "Cutpurse"; break; + + case 12: + sTitle = "Thief"; break; + + case 13: + sTitle = "Pilferer"; break; + + case 14: + sTitle = "Robber"; break; + + case 15: + sTitle = "Sharper"; break; + + case 16: + sTitle = "Burglar"; break; + + case 17: + sTitle = "Filcher"; break; + + case 18: + sTitle = "Scoundrel"; break; + + case 19: + sTitle = "Knave"; break; + + case 20: + sTitle = "Prowler"; break; + + default: + sTitle = "Master Rogue"; break; + + } + + case CLASS_TYPE_BARD: + switch(nLevel) + { + case 1: case 2: case 3: + sTitle = "Crier" ; + break; + + case 4: case 5: + if (nGender == 1) + {sTitle = "Chantress"; break;} + else + {sTitle = "Chanter"; break;} + + case 6: + sTitle = "Skop"; break; + + case 7: + sTitle = "Accompanist"; break; + + case 8: + sTitle = "Rhymer"; break; + + case 9: + sTitle = "Singer"; break; + + case 10: + sTitle = "Balladeer"; break; + + case 11: + if (nGender == 1) + {sTitle = "Cantoress"; break;} + else + {sTitle = "Cantor"; break;} + + case 12: + sTitle = "Lutenist"; break; + + case 13: + sTitle = "Melodist"; break; + + case 14: + sTitle = "Lyrist"; break; + + case 15: + sTitle = "Jongleur"; break; + + case 16: + sTitle = "Loreweaver"; break; + + case 17: + sTitle = "Chronicler"; break; + + case 18: + sTitle = "Muse"; break; + + case 19: + if (nGender == 1) + {sTitle = "Rhapsode"; break;} + else + {sTitle = "Rhapsodist"; break;} + + case 20: + sTitle = "Bard"; break; + + case 21: + sTitle = "Raconteur"; break; + + case 22: + sTitle = "Siren"; break; + + case 23: + sTitle = "Songsmith"; break; + + case 24: + sTitle = "Versifer"; break; + + case 25: + sTitle = "Minstrel"; break; + + case 26: + sTitle = "Sonneteer"; break; + + case 27: + if (nGender == 1) + {sTitle = "Trobairitz"; break;} + else + {sTitle = "Troubadour"; break;} + + case 28: + sTitle = "Citharist"; break; + + case 29: + sTitle = "High Minstrel"; break; + + default: + sTitle = "Master Bard"; break; + + } + + case CLASS_TYPE_SORCERER: + case CLASS_TYPE_WIZARD: + switch(nLevel) + { + case 1: case 2: case 3: + sTitle = "Apprentice" ; + break; + + case 4: case 5: + sTitle = "Adept"; break; + + case 6: + sTitle = "Journeymage"; break; + + case 7: + sTitle = "Hedge Mage"; break; + + case 8: + sTitle = "Magician"; break; + + case 9: + sTitle = "Prestidigitator"; break; + + case 10: + sTitle = "Wizard"; break; + + case 11: + sTitle = "Sage"; break; + + case 12: + sTitle = "Visionary"; break; + + case 13: + sTitle = "Loremaster"; break; + + case 14: + sTitle = "Mage"; break; + + case 15: + sTitle = "Fatespinner"; break; + + case 16: + sTitle = "Cabalist"; break; + + case 17: + sTitle = "Thaumaturge"; break; + + case 18: + sTitle = "Theurgist"; break; + + case 19: + sTitle = "Augur"; break; + + case 20: + sTitle = "Spellbinder"; break; + + default: + sTitle = "Archmage"; break; + + } + + case CLASS_TYPE_CLERIC: + switch(nLevel) + { + case 1: case 2: case 3: + sTitle = "Candidate" ; + break; + + case 4: case 5: + sTitle = "Aspirant"; break; + + case 6: + sTitle = "Novice"; break; + + case 7: + sTitle = "Acolyte"; break; + + case 8: + sTitle = "Initiate"; break; + + case 9: + if (nGender == 1) + {sTitle = "Priestess"; break;} + else + {sTitle = "Priest"; break;} + + case 10: + sTitle = "Cleric"; break; + + case 11: + sTitle = "Curate"; break; + + case 12: + sTitle = "Apostle"; break; + + case 13: + sTitle = "Ovate"; break; + + case 14: + sTitle = "Missionary"; break; + + case 15: + if (nGender == 1) + {sTitle = "Canoness"; break;} + else + {sTitle = "Canon"; break;} + + case 16: + if (nGender == 1) + {sTitle = "Abbotess"; break;} + else + {sTitle = "Abbot"; break;} + + case 17: + sTitle = "Bishop"; break; + + case 18: + if (nGender == 1) + {sTitle = "Matriarch"; break;} + else + {sTitle = "Patriarch"; break;} + + case 19: + sTitle = "Preacher"; break; + + default: + if (nGender == 1) + {sTitle = "High Priestess"; break;} + else + {sTitle = "High Priest"; break;} + + } + + case CLASS_TYPE_DRUID: + switch(nLevel) + { + case 1: case 2: case 3: + sTitle = "Initiate" ; + break; + + case 4: case 5: + sTitle = "Devotee"; break; + + case 6: + sTitle = "Beastling"; break; + + case 7: + sTitle = "Grovelurker"; break; + + case 8: + sTitle = "Shaper"; break; + + case 9: + sTitle = "Springwalker"; break; + + case 10: + sTitle = "Druid"; break; + + case 11: + sTitle = "Naturekin"; break; + + case 12: + sTitle = "Treewarden"; break; + + case 13: + sTitle = "Auspex"; break; + + case 14: + sTitle = "Haruspex"; break; + + case 15: + sTitle = "Student of Stones"; break; + + case 16: + sTitle = "Student of Waters"; break; + + case 17: + sTitle = "Student of Forests"; break; + + case 18: + sTitle = "Student of Winds"; break; + + case 19: + sTitle = "Student of Changes"; break; + + case 20: + sTitle = "Pathwarden"; break; + + default: + sTitle = "Archdruid"; break; + + } + + case CLASS_TYPE_FIGHTER: + switch(nLevel) + { + case 1: case 2: case 3: + sTitle = "Guard"; + break; + + case 4: + sTitle = "Elite Guard"; break; + + case 5: case 6: + sTitle = "Warrior"; break; + + case 7: + sTitle = "Elite Warrior"; break; + + case 8: + sTitle = "Soldier"; break; + + case 9: + sTitle = "Enforcer"; break; + + case 10: + sTitle = "Fighter"; break; + + case 11: + sTitle = "Skirmisher"; break; + + case 12: + sTitle = "Veteran"; break; + + case 13: + sTitle = "Armiger"; break; + + case 14: + sTitle = "Myrmidon"; break; + + case 15: + sTitle = "Hero"; break; + + case 16: + sTitle = "Vanguard"; break; + + case 17: + sTitle = "Sentinel"; break; + + case 18: + sTitle = "Dominator"; break; + + case 19: + sTitle = "Warmonger"; break; + + case 20: + sTitle = "Champion"; break; + + default: + sTitle = "Grandmaster"; break; + + } + + case CLASS_TYPE_MONK: + switch(nLevel) + { + case 1: + sTitle = "Trainee"; break; + + case 2: + sTitle = "Initiate"; break; + + case 3: + sTitle = "Novice"; break; + + case 4: + sTitle = "Neophyte"; break; + + case 5: + sTitle = "Aspirant"; break; + + case 6: + sTitle = "Acolyte"; break; + + case 7: + sTitle = "Devotee"; break; + + case 8: + sTitle = "Disciple"; break; + + case 9: + sTitle = "Adept"; break; + + case 10: + sTitle = "Ascetic"; break; + + case 11: + sTitle = "Pilgrim"; break; + + case 12: + sTitle = "Master"; break; + + case 13: + sTitle = "Anchorite"; break; + + case 14: + sTitle = "Mystic"; break; + + case 15: + sTitle = "Meditator"; break; + + case 16: + sTitle = "Seeker"; break; + + case 17: + sTitle = "Guru"; break; + + case 18: + sTitle = "Sensei"; break; + + case 19: + sTitle = "Sannyasi"; break; + + case 20: + sTitle = "Exemplar"; break; + + case 21: + sTitle = "Transcendent"; break; + + default: + sTitle = "High Master"; break; + + } + + case CLASS_TYPE_PALADIN: + switch(nLevel) + { + case 1: + sTitle = "Advocate"; break; + + case 2: + sTitle = "Initiate"; break; + + case 3: + sTitle = "Squire"; break; + + case 4: + sTitle = "Gallant"; break; + + case 5: + sTitle = "Emissary"; break; + + case 6: + sTitle = "Guardian"; break; + + case 7: + sTitle = "Devotee"; break; + + case 8: + sTitle = "Disciple"; break; + + case 9: + sTitle = "Adept"; break; + + case 10: + sTitle = "Ascetic"; break; + + case 11: + sTitle = "Pilgrim"; break; + + case 12: + sTitle = "Master"; break; + + case 13: + sTitle = "Anchorite"; break; + + case 14: + sTitle = "Mystic"; break; + + case 15: + sTitle = "Meditator"; break; + + case 16: + sTitle = "Seeker"; break; + + case 17: + sTitle = "Guru"; break; + + case 18: + sTitle = "Sensei"; break; + + case 19: + sTitle = "Sannyasi"; break; + + case 20: + sTitle = "Exemplar"; break; + + case 21: + sTitle = "Transcendent"; break; + + default: + sTitle = "High Master"; break; + + } + + case CLASS_TYPE_RANGER: + switch(nLevel) + { + case 1: case 2: case 3: + sTitle = "Greenhorn" ; + break; + + case 4: case 5: + sTitle = "Tenderfoot"; break; + + case 6: + sTitle = "Vagrant"; break; + + case 7: + sTitle = "Tramp"; break; + + case 8: + sTitle = "Nomad"; break; + + case 9: + sTitle = "Wanderer"; break; + + case 10: + sTitle = "Ranger"; break; + + case 11: + sTitle = "Rambler"; break; + + case 12: + sTitle = "Traveler"; break; + + case 13: + sTitle = "Sojourner"; break; + + case 14: + sTitle = "Outrider"; break; + + case 15: + sTitle = "Wayfarer"; break; + + case 16: + sTitle = "Excursionist"; break; + + case 17: + sTitle = "Trekker"; break; + + case 18: + sTitle = "Trailblazer"; break; + + case 19: + sTitle = "Woodsman"; break; + + case 20: + sTitle = "High Ranger"; break; + + case 21: + sTitle = "Ranger"; break; + + case 22: + sTitle = "Rambler"; break; + + case 23: + sTitle = "Traveler"; break; + + case 24: + sTitle = "Sojourner"; break; + + case 25: + sTitle = "Outrider"; break; + + case 26: + sTitle = "Wayfarer"; break; + + case 27: + sTitle = "Excursionist"; break; + + case 28: + sTitle = "Trekker"; break; + + case 29: + sTitle = "Trailblazer"; break; + + default: + sTitle = "Ranger Lord"; break; + + } + + } + + //return sTitle; + } + +//:: Handles class based Henchman titles + int nRndRogue = GetLocalInt(OBJECT_SELF,"RND_ROGUE"); + if (nRndRogue == 1) + { + int nResult = Random(30) + 1; // Generate a random number between 1 and 30 + switch (nResult) + { + case 1: + sPostfix = "the Quick"; + break; + case 2: + sPostfix = "the Quiet"; + break; + case 3: + sPostfix = "the Sharp"; + break; + case 4: + sPostfix = "the Sneak"; + break; + case 5: + sPostfix = "the Rogue"; + break; + case 6: + sPostfix = "the Footpad"; + break; + case 7: + sPostfix = "the Shadow"; + break; + case 8: + sPostfix = "the Nimble"; + break; + case 9: + sPostfix = "the Swift"; + break; + case 10: + sPostfix = "the Silent"; + break; + case 11: + sPostfix = "the Sly"; + break; + case 12: + sPostfix = "the Crafty"; + break; + case 13: + sPostfix = "the Cunning"; + break; + case 14: + sPostfix = "the Elusive"; + break; + case 15: + sPostfix = "the Deft"; + break; + case 16: + sPostfix = "the Guileful"; + break; + case 17: + sPostfix = "the Lurker"; + break; + case 18: + sPostfix = "the Trickster"; + break; + case 19: + sPostfix = "the Prowler"; + break; + case 20: + sPostfix = "the Skulker"; + break; + case 21: + sPostfix = "the Phantom"; + break; + case 22: + sPostfix = "the Wily"; + break; + case 23: + sPostfix = "the Mysterious"; + break; + case 24: + sPostfix = "the Furtive"; + break; + case 25: + sPostfix = "the Discreet"; + break; + case 26: + sPostfix = "the Spy"; + break; + case 27: + sPostfix = "the Veiled"; + break; + case 28: + sPostfix = "the Artful"; + break; + case 29: + sPostfix = "the Sleuth"; + break; + case 30: + sPostfix = "the Masked"; + break; + } + } + + int nRndBarb = GetLocalInt(OBJECT_SELF,"RND_BARBARIAN"); + if (nRndBarb == 1) + { + int nResult = Random(30) + 1; // Generate a random number between 1 and 30 + switch (nResult) + { + case 1: + sPostfix = "the Barbarian"; + break; + case 2: + sPostfix = "the Destroyer"; + break; + case 3: + sPostfix = "of the Plains"; + break; + case 4: + sPostfix = "of Klar Clan"; + break; + case 5: + sPostfix = "the Rampager"; + break; + case 6: + sPostfix = "the Reaver"; + break; + case 7: + sPostfix = "the Savage"; + break; + case 8: + sPostfix = "the Berserker"; + break; + case 9: + sPostfix = "the Untamed"; + break; + case 10: + sPostfix = "the Fierce"; + break; + case 11: + sPostfix = "the Warbringer"; + break; + case 12: + sPostfix = "the Wild"; + break; + case 13: + sPostfix = "the Raider"; + break; + case 14: + sPostfix = "the Vicious"; + break; + case 15: + sPostfix = "the Ruthless"; + break; + case 16: + sPostfix = "the Savage"; + break; + case 17: + sPostfix = "the Bloodthirsty"; + break; + case 18: + sPostfix = "the Warlord"; + break; + case 19: + sPostfix = "the Brute"; + break; + case 20: + sPostfix = "the Fierce"; + break; + case 21: + sPostfix = "the Marauder"; + break; + case 22: + sPostfix = "the Howler"; + break; + case 23: + sPostfix = "the Ravager"; + break; + case 24: + sPostfix = "the Crusher"; + break; + case 25: + sPostfix = "the Frenzied"; + break; + case 26: + sPostfix = "the Beast"; + break; + case 27: + sPostfix = "the Juggernaut"; + break; + case 28: + sPostfix = "the Slayer"; + break; + case 29: + sPostfix = "the Rager"; + break; + case 30: + sPostfix = "the Conqueror"; + break; + } + } + + int nRndFight = GetLocalInt(OBJECT_SELF,"RND_FIGHTER"); + if (nRndFight == 1) + { + int nResult = Random(30) + 1; // Generate a random number between 1 and 30 + switch (nResult) + { + case 1: + sPostfix = "the Strong"; + break; + case 2: + sPostfix = "the Stout"; + break; + case 3: + sPostfix = "of the Blade"; + break; + case 4: + sPostfix = "of Tyr"; + break; + case 5: + sPostfix = "of Urik"; + break; + case 6: + sPostfix = "the Swordhand"; + break; + case 7: + sPostfix = "the Valiant"; + break; + case 8: + sPostfix = "the Brave"; + break; + case 9: + sPostfix = "the Defender"; + break; + case 10: + sPostfix = "the Just"; + break; + case 11: + sPostfix = "the Noble"; + break; + case 12: + sPostfix = "the Gallant"; + break; + case 13: + sPostfix = "the Protector"; + break; + case 14: + sPostfix = "the Shield"; + break; + case 15: + sPostfix = "the Champion"; + break; + case 16: + sPostfix = "the Guardian"; + break; + case 17: + sPostfix = "the Sentinel"; + break; + case 18: + sPostfix = "the Warrior"; + break; + case 19: + sPostfix = "the Stalwart"; + break; + case 20: + sPostfix = "the Ironclad"; + break; + case 21: + sPostfix = "the Blade"; + break; + case 22: + sPostfix = "the Swordsman"; + break; + case 23: + sPostfix = "the Vanguard"; + break; + case 24: + sPostfix = "the Lancer"; + break; + case 25: + sPostfix = "the Spearhead"; + break; + case 26: + sPostfix = "the Battlemaster"; + break; + case 27: + sPostfix = "the Blademaster"; + break; + case 28: + sPostfix = "the Warlord"; + break; + case 29: + sPostfix = "the Vanquisher"; + break; + case 30: + sPostfix = "the Swordmaster"; + break; + } + } + + int nRndCleric = GetLocalInt(OBJECT_SELF,"RND_CLERIC"); + if (nRndCleric == 1) + { + int nResult = Random(30) + 1; // Generate a random number between 1 and 30 + if (nResult == 1) + { + sPostfix = "the Pious"; + } + else if (nResult == 2) + { + sPostfix = "the Holy"; + } + else if (nResult == 3) + { + sPostfix = "the Priest"; + } + else if (nResult == 4) + { + sPostfix = "the Zealous"; + } + else if (nResult == 5) + { + sPostfix = "of Salt View"; + } + else if (nResult == 6) + { + sPostfix = "the Wise"; + } + else if (nResult == 7) + { + sPostfix = "the Devout"; + } + else if (nResult == 8) + { + sPostfix = "the Faithful"; + } + else if (nResult == 9) + { + sPostfix = "the Righteous"; + } + else if (nResult == 10) + { + sPostfix = "the Blessed"; + } + else if (nResult == 11) + { + sPostfix = "the Pure"; + } + else if (nResult == 12) + { + sPostfix = "the Sacred"; + } + else if (nResult == 13) + { + sPostfix = "the Benevolent"; + } + else if (nResult == 14) + { + sPostfix = "the Virtuous"; + } + else if (nResult == 15) + { + sPostfix = "the Saintly"; + } + else if (nResult == 16) + { + sPostfix = "the Healer"; + } + else if (nResult == 17) + { + sPostfix = "the Anointed"; + } + else if (nResult == 18) + { + sPostfix = "the Protector"; + } + else if (nResult == 19) + { + sPostfix = "the Merciful"; + } + else if (nResult == 20) + { + sPostfix = "the Revered"; + } + else if (nResult == 21) + { + sPostfix = "the Graceful"; + } + else if (nResult == 22) + { + sPostfix = "the Watchful"; + } + else if (nResult == 23) + { + sPostfix = "the Forgiving"; + } + else if (nResult == 24) + { + sPostfix = "the Humble"; + } + else if (nResult == 25) + { + sPostfix = "the Divine"; + } + else if (nResult == 26) + { + sPostfix = "the Preacher"; + } + else if (nResult == 27) + { + sPostfix = "the Illuminated"; + } + else if (nResult == 28) + { + sPostfix = "the Mystic"; + } + else if (nResult == 29) + { + sPostfix = "the Herald"; + } + else // nResult == 30 + { + sPostfix = "the Exalted"; + } + } + + int nRndMage = GetLocalInt(OBJECT_SELF,"RND_MAGE"); + if (nRndMage == 1) + { + int nResult = Random(30) + 1; // Generate a random number between 1 and 30 + switch (nResult) + { + case 1: + sPostfix = "the Mad"; + break; + case 2: + sPostfix = "the Arcane"; + break; + case 3: + sPostfix = "the Black"; + break; + case 4: + sPostfix = "the Wizard"; + break; + case 5: + sPostfix = "of Ur-Draxa"; + break; + case 6: + sPostfix = "the Mage"; + break; + case 7: + sPostfix = "the Enigmatic"; + break; + case 8: + sPostfix = "the Mystical"; + break; + case 9: + sPostfix = "the Eldritch"; + break; + case 10: + sPostfix = "the Runeweaver"; + break; + case 11: + sPostfix = "the Sorcerous"; + break; + case 12: + sPostfix = "the Seer"; + break; + case 13: + sPostfix = "the Arcanist"; + break; + case 14: + sPostfix = "the Illustrious"; + break; + case 15: + sPostfix = "the Sage"; + break; + case 16: + sPostfix = "the Sorcerous"; + break; + case 17: + sPostfix = "the Occult"; + break; + case 18: + sPostfix = "the Arcane Adept"; + break; + case 19: + sPostfix = "the Spellbinder"; + break; + case 20: + sPostfix = "the Occultist"; + break; + case 21: + sPostfix = "the Conjurer"; + break; + case 22: + sPostfix = "the Seer"; + break; + case 23: + sPostfix = "the Invoker"; + break; + case 24: + sPostfix = "the Mysterious"; + break; + case 25: + sPostfix = "the Shrouded"; + break; + case 26: + sPostfix = "the Visionary"; + break; + case 27: + sPostfix = "the Spellweaver"; + break; + case 28: + sPostfix = "the Willbreaker"; + break; + case 29: + sPostfix = "the Charmer"; + break; + case 30: + sPostfix = "the Elementalist"; + break; + } + } + + int nRndBard = GetLocalInt(OBJECT_SELF,"RND_BARD"); + if (nRndBard == 1) + { + int nResult = Random(25) + 1; // Generate a random number between 1 and 25 + switch (nResult) + { + case 1: + sPostfix = "the Subtle"; + break; + case 2: + sPostfix = "the Veiled"; + break; + case 3: + sPostfix = "the Shadowed"; + break; + case 4: + sPostfix = "the Intriguer"; + break; + case 5: + sPostfix = "of Altaruk"; + break; + case 6: + sPostfix = "the Elusive"; + break; + case 7: + sPostfix = "the Mysterious"; + break; + case 8: + sPostfix = "the Cryptic"; + break; + case 9: + sPostfix = "the Insidious"; + break; + case 10: + sPostfix = "the Quiet"; + break; + case 11: + sPostfix = "the Sly"; + break; + case 12: + sPostfix = "the Covert"; + break; + case 13: + sPostfix = "the Furtive"; + break; + case 14: + sPostfix = "the Discreet"; + break; + case 15: + sPostfix = "the Subversive"; + break; + case 16: + sPostfix = "the Shrouded"; + break; + case 17: + sPostfix = "the Obscured"; + break; + case 18: + sPostfix = "the Clever"; + break; + case 19: + sPostfix = "the Enigmatic"; + break; + case 20: + sPostfix = "of Balic"; + break; + case 21: + sPostfix = "of Tyr"; + break; + case 22: + sPostfix = "of Raam"; + break; + case 23: + sPostfix = "of Urik"; + break; + case 24: + sPostfix = "the Crafty"; + break; + case 25: + sPostfix = "of Draj"; + break; + } + } + + int nRndDruid = GetLocalInt(OBJECT_SELF,"RND_DRUID"); + if (nRndDruid == 1) + { + int nResult = Random(25) + 1; // Generate a random number between 1 and 25 + switch (nResult) + { + case 1: + sPostfix = "the Druid"; + break; + case 2: + sPostfix = "of the Forest"; + break; + case 3: + sPostfix = "of the Wild"; + break; + case 4: + sPostfix = "the Wolflord"; + break; + case 5: + sPostfix = "the Treelord"; + break; + case 6: + sPostfix = "the Verdant"; + break; + case 7: + sPostfix = "the Earthshaker"; + break; + case 8: + sPostfix = "the Feral"; + break; + case 9: + sPostfix = "of the Glade"; + break; + case 10: + sPostfix = "of the Crystal Forest"; + break; + case 11: + sPostfix = "the Thorned"; + break; + case 12: + sPostfix = "the Greenwarden"; + break; + case 13: + sPostfix = "the Naturebound"; + break; + case 14: + sPostfix = "the Forestborn"; + break; + case 15: + sPostfix = "the Spiritcaller"; + break; + case 16: + sPostfix = "the Leafblade"; + break; + case 17: + sPostfix = "the Mossy"; + break; + case 18: + sPostfix = "the Grovekeeper"; + break; + case 19: + sPostfix = "the Stormbringer"; + break; + case 20: + sPostfix = "the Earthshaper"; + break; + case 21: + sPostfix = "the Bramble"; + break; + case 22: + sPostfix = "of the Black Sands"; + break; + case 23: + sPostfix = "of the Silt Sea"; + break; + case 24: + sPostfix = "the Spiritbinder"; + break; + case 25: + sPostfix = "the Wildheart"; + break; + } + } + + int nRndRanger = GetLocalInt(OBJECT_SELF,"RND_RANGER"); + if (nRndRanger == 1) + { + int nResult = Random(25) + 1; // Generate a random number between 1 and 25 + switch (nResult) + { + case 1: + sPostfix = "the Ranger"; + break; + case 2: + sPostfix = "of the Forest"; + break; + case 3: + sPostfix = "of the Wild"; + break; + case 4: + sPostfix = "the Strider"; + break; + case 5: + sPostfix = "the Venger"; + break; + case 6: + sPostfix = "the Pathfinder"; + break; + case 7: + sPostfix = "the Woodsman"; + break; + case 8: + sPostfix = "the Trailblazer"; + break; + case 9: + sPostfix = "the Hunter"; + break; + case 10: + sPostfix = "the Scout"; + break; + case 11: + sPostfix = "the Wayfarer"; + break; + case 12: + sPostfix = "the Outrider"; + break; + case 13: + sPostfix = "the Seeker"; + break; + case 14: + sPostfix = "the Sentinel"; + break; + case 15: + sPostfix = "the Forestborn"; + break; + case 16: + sPostfix = "the Survivalist"; + break; + case 17: + sPostfix = "the Tracker"; + break; + case 18: + sPostfix = "the Forager"; + break; + case 19: + sPostfix = "the Warder"; + break; + case 20: + sPostfix = "the Greenblade"; + break; + case 21: + sPostfix = "the Beastmaster"; + break; + case 22: + sPostfix = "the Thornhunter"; + break; + case 23: + sPostfix = "of the Deepwood"; + break; + case 24: + sPostfix = "of the Roughlands"; + break; + case 25: + sPostfix = "the Wilderness Guide"; + break; + } + } + + + if (sRandomName != "") + { + if (sRandomName == "RANDOM") + { + switch (GetLocalInt(oNPC, "NAME_TYPE")) + { + case 1: sRandomName = sTitle + " " + ms_RandomFirstName(oNPC) + " " + ms_RandomLastName(oNPC)+ " " + sPostfix; break; + default: sRandomName = sTitle + " " + ms_RandomFirstName(oNPC) + " " + sPostfix; break; + } + } + + if (bClassTitle) + { + sRandomName = sBaseRace +" "+ sTitle; + } + + SetName(oNPC, (sRandomName)); + return; + } +} + +string ms_RandomFirstName(object oNPC = OBJECT_SELF) +{ + int Gender = GetGender(oNPC); + int Race = MyPRCGetRacialType(oNPC); + + string Name; + + switch (Race) + { + case RACIAL_TYPE_ANIMAL: Name = RandomName(0); break; + case RACIAL_TYPE_DWARF: + switch (Gender) + { default: Name = RandomName(2); break; + case GENDER_FEMALE: Name = RandomName(3); break; } break; + case RACIAL_TYPE_ELF: + switch (Gender) + { default: Name = RandomName(5); break; + case GENDER_FEMALE: Name = RandomName(6); break; } break; + case RACIAL_TYPE_GNOME: + switch (Gender) + { default: Name = RandomName(8); break; + case GENDER_FEMALE: Name = RandomName(9); break; } break; + case RACIAL_TYPE_HALFELF: + switch (Gender) + { default: Name = RandomName(11); break; + case GENDER_FEMALE: Name = RandomName(12); break; } break; + case RACIAL_TYPE_HALFLING: + switch (Gender) + { default: Name = RandomName(14); break; + case GENDER_FEMALE: Name = RandomName(15); break; } break; + case RACIAL_TYPE_HALFORC: + switch (Gender) + { default: Name = RandomName(17); break; + case GENDER_FEMALE: Name = RandomName(18); break; } break; + case RACIAL_TYPE_HUMAN: + switch (Gender) + { default: Name = RandomName(20); break; + case GENDER_FEMALE: Name = RandomName(21); break; } break; + default: + switch (Gender) + { default: Name = RandomName(-1); break; + case GENDER_FEMALE: Name = RandomName(0); break; } break; + } + + return Name; +} + +string ms_RandomLastName(object oNPC = OBJECT_SELF) +{ + int Race = MyPRCGetRacialType(oNPC); + + string Name; + + switch (Race) + { + case RACIAL_TYPE_DWARF: Name = RandomName(4); break; + case RACIAL_TYPE_ELF: Name = RandomName(7); break; + case RACIAL_TYPE_GNOME: Name = RandomName(10); break; + case RACIAL_TYPE_HALFELF: Name = RandomName(13); break; + case RACIAL_TYPE_HALFLING: Name = RandomName(16); break; + case RACIAL_TYPE_HALFORC: Name = RandomName(19); break; + case RACIAL_TYPE_HUMAN: Name = RandomName(22); break; + default: Name = RandomName(1); break; + } + + return Name; +} + +// Function to get the class-based level title based on the class type +string GetClassLevelTitle(int nClassType) +{ + object oCreature = OBJECT_SELF; // Assuming this function is called on a creature object + + int nLevel = GetLevelByClass(nClassType, oCreature); + int nGender = GetGender(oCreature); + + string sTitle; + + switch (nClassType) + { + case CLASS_TYPE_BARBARIAN: + switch(nLevel) + { + case 1: case 2: case 3: + sTitle = "Brute" ; + break; + + case 4: case 5: + sTitle = "Vandal"; break; + + case 6: + if (nGender == 1) + {sTitle = "Plunderess"; break;} + else + {sTitle = "Plunderer"; break;} + + case 7: + sTitle = "Pillager"; break; + + case 8: + sTitle = "Marauder"; break; + + case 9: + sTitle = "Reaver"; break; + + case 10: + sTitle = "Barbarian"; break; + + case 11: + sTitle = "Mauler"; break; + + case 12: + sTitle = "Ravager"; break; + + case 13: + sTitle = "Slaughterer"; break; + + case 14: + sTitle = "Destroyer"; break; + + case 15: + if (nGender == 1) + {sTitle = "Chieftainess"; break;} + else + {sTitle = "Chieftain"; break;} + + case 16: + sTitle = "Bloodletter"; break; + + case 17: + sTitle = "Rampager"; break; + + case 18: + sTitle = "Slayer"; break; + + case 19: + sTitle = "Warmonger"; break; + + case 20: + if (nGender == 1) + {sTitle = "High Chieftainess"; break;} + else + {sTitle = "High Chieftain"; break;} + + default: + if (nGender == 1) + {sTitle = "Conqueress"; break;} + else + {sTitle = "Conqueror"; break;} + + } + + case CLASS_TYPE_ROGUE: + switch(nLevel) + { + case 1: case 2: case 3: + sTitle = "Lookout" ; + break; + + case 4: case 5: + sTitle = "Outlaw"; break; + + case 6: + sTitle = "Scalawag"; break; + + case 7: + sTitle = "Creeper"; break; + + case 8: + sTitle = "Larker"; break; + + case 9: + sTitle = "Footpad"; break; + + case 10: + sTitle = "Rogue"; break; + + case 11: + sTitle = "Cutpurse"; break; + + case 12: + sTitle = "Thief"; break; + + case 13: + sTitle = "Pilferer"; break; + + case 14: + sTitle = "Robber"; break; + + case 15: + sTitle = "Sharper"; break; + + case 16: + sTitle = "Burglar"; break; + + case 17: + sTitle = "Filcher"; break; + + case 18: + sTitle = "Scoundrel"; break; + + case 19: + sTitle = "Knave"; break; + + case 20: + sTitle = "Prowler"; break; + + default: + sTitle = "Master Rogue"; break; + + } + + case CLASS_TYPE_BARD: + switch(nLevel) + { + case 1: case 2: case 3: + sTitle = "Crier" ; + break; + + case 4: case 5: + if (nGender == 1) + {sTitle = "Chantress"; break;} + else + {sTitle = "Chanter"; break;} + + case 6: + sTitle = "Skop"; break; + + case 7: + sTitle = "Accompanist"; break; + + case 8: + sTitle = "Rhymer"; break; + + case 9: + sTitle = "Singer"; break; + + case 10: + sTitle = "Balladeer"; break; + + case 11: + if (nGender == 1) + {sTitle = "Cantoress"; break;} + else + {sTitle = "Cantor"; break;} + + case 12: + sTitle = "Lutenist"; break; + + case 13: + sTitle = "Melodist"; break; + + case 14: + sTitle = "Lyrist"; break; + + case 15: + sTitle = "Jongleur"; break; + + case 16: + sTitle = "Loreweaver"; break; + + case 17: + sTitle = "Chronicler"; break; + + case 18: + sTitle = "Muse"; break; + + case 19: + if (nGender == 1) + {sTitle = "Rhapsode"; break;} + else + {sTitle = "Rhapsodist"; break;} + + case 20: + sTitle = "Bard"; break; + + case 21: + sTitle = "Raconteur"; break; + + case 22: + sTitle = "Siren"; break; + + case 23: + sTitle = "Songsmith"; break; + + case 24: + sTitle = "Versifer"; break; + + case 25: + sTitle = "Minstrel"; break; + + case 26: + sTitle = "Sonneteer"; break; + + case 27: + if (nGender == 1) + {sTitle = "Trobairitz"; break;} + else + {sTitle = "Troubadour"; break;} + + case 28: + sTitle = "Citharist"; break; + + case 29: + sTitle = "High Minstrel"; break; + + default: + sTitle = "Master Bard"; break; + + } + + case CLASS_TYPE_SORCERER: + case CLASS_TYPE_WIZARD: + switch(nLevel) + { + case 1: case 2: case 3: + sTitle = "Apprentice" ; + break; + + case 4: case 5: + sTitle = "Adept"; break; + + case 6: + sTitle = "Journeymage"; break; + + case 7: + sTitle = "Hedge Mage"; break; + + case 8: + sTitle = "Magician"; break; + + case 9: + sTitle = "Prestidigitator"; break; + + case 10: + sTitle = "Wizard"; break; + + case 11: + sTitle = "Sage"; break; + + case 12: + sTitle = "Visionary"; break; + + case 13: + sTitle = "Loremaster"; break; + + case 14: + sTitle = "Mage"; break; + + case 15: + sTitle = "Fatespinner"; break; + + case 16: + sTitle = "Cabalist"; break; + + case 17: + sTitle = "Thaumaturge"; break; + + case 18: + sTitle = "Theurgist"; break; + + case 19: + sTitle = "Augur"; break; + + case 20: + sTitle = "Spellbinder"; break; + + default: + sTitle = "Archmage"; break; + + } + + case CLASS_TYPE_CLERIC: + switch(nLevel) + { + case 1: case 2: case 3: + sTitle = "Candidate" ; + break; + + case 4: case 5: + sTitle = "Aspirant"; break; + + case 6: + sTitle = "Novice"; break; + + case 7: + sTitle = "Acolyte"; break; + + case 8: + sTitle = "Initiate"; break; + + case 9: + if (nGender == 1) + {sTitle = "Priestess"; break;} + else + {sTitle = "Priest"; break;} + + case 10: + sTitle = "Cleric"; break; + + case 11: + sTitle = "Curate"; break; + + case 12: + sTitle = "Apostle"; break; + + case 13: + sTitle = "Ovate"; break; + + case 14: + sTitle = "Missionary"; break; + + case 15: + if (nGender == 1) + {sTitle = "Canoness"; break;} + else + {sTitle = "Canon"; break;} + + case 16: + if (nGender == 1) + {sTitle = "Abbotess"; break;} + else + {sTitle = "Abbot"; break;} + + case 17: + sTitle = "Bishop"; break; + + case 18: + if (nGender == 1) + {sTitle = "Matriarch"; break;} + else + {sTitle = "Patriarch"; break;} + + case 19: + sTitle = "Preacher"; break; + + default: + if (nGender == 1) + {sTitle = "High Priestess"; break;} + else + {sTitle = "High Priest"; break;} + + } + + case CLASS_TYPE_DRUID: + switch(nLevel) + { + case 1: case 2: case 3: + sTitle = "Initiate" ; + break; + + case 4: case 5: + sTitle = "Devotee"; break; + + case 6: + sTitle = "Beastling"; break; + + case 7: + sTitle = "Grovelurker"; break; + + case 8: + sTitle = "Shaper"; break; + + case 9: + sTitle = "Springwalker"; break; + + case 10: + sTitle = "Druid"; break; + + case 11: + sTitle = "Naturekin"; break; + + case 12: + sTitle = "Treewarden"; break; + + case 13: + sTitle = "Auspex"; break; + + case 14: + sTitle = "Haruspex"; break; + + case 15: + sTitle = "Student of Stones"; break; + + case 16: + sTitle = "Student of Waters"; break; + + case 17: + sTitle = "Student of Forests"; break; + + case 18: + sTitle = "Student of Winds"; break; + + case 19: + sTitle = "Student of Changes"; break; + + case 20: + sTitle = "Pathwarden"; break; + + default: + sTitle = "Archdruid"; break; + + } + + case CLASS_TYPE_FIGHTER: + switch(nLevel) + { + case 1: case 2: case 3: + sTitle = "Guard"; + break; + + case 4: + sTitle = "Elite Guard"; break; + + case 5: case 6: + sTitle = "Warrior"; break; + + case 7: + sTitle = "Elite Warrior"; break; + + case 8: + sTitle = "Soldier"; break; + + case 9: + sTitle = "Enforcer"; break; + + case 10: + sTitle = "Fighter"; break; + + case 11: + sTitle = "Skirmisher"; break; + + case 12: + sTitle = "Veteran"; break; + + case 13: + sTitle = "Armiger"; break; + + case 14: + sTitle = "Myrmidon"; break; + + case 15: + sTitle = "Hero"; break; + + case 16: + sTitle = "Vanguard"; break; + + case 17: + sTitle = "Sentinel"; break; + + case 18: + sTitle = "Dominator"; break; + + case 19: + sTitle = "Warmonger"; break; + + case 20: + sTitle = "Champion"; break; + + default: + sTitle = "Grandmaster"; break; + + } + + case CLASS_TYPE_MONK: + switch(nLevel) + { + case 1: + sTitle = "Trainee"; break; + + case 2: + sTitle = "Initiate"; break; + + case 3: + sTitle = "Novice"; break; + + case 4: + sTitle = "Neophyte"; break; + + case 5: + sTitle = "Aspirant"; break; + + case 6: + sTitle = "Acolyte"; break; + + case 7: + sTitle = "Devotee"; break; + + case 8: + sTitle = "Disciple"; break; + + case 9: + sTitle = "Adept"; break; + + case 10: + sTitle = "Ascetic"; break; + + case 11: + sTitle = "Pilgrim"; break; + + case 12: + sTitle = "Master"; break; + + case 13: + sTitle = "Anchorite"; break; + + case 14: + sTitle = "Mystic"; break; + + case 15: + sTitle = "Meditator"; break; + + case 16: + sTitle = "Seeker"; break; + + case 17: + sTitle = "Guru"; break; + + case 18: + sTitle = "Sensei"; break; + + case 19: + sTitle = "Sannyasi"; break; + + case 20: + sTitle = "Exemplar"; break; + + case 21: + sTitle = "Transcendent"; break; + + default: + sTitle = "High Master"; break; + + } + + case CLASS_TYPE_PALADIN: + switch(nLevel) + { + case 1: + sTitle = "Advocate"; break; + + case 2: + sTitle = "Initiate"; break; + + case 3: + sTitle = "Squire"; break; + + case 4: + sTitle = "Gallant"; break; + + case 5: + sTitle = "Emissary"; break; + + case 6: + sTitle = "Guardian"; break; + + case 7: + sTitle = "Devotee"; break; + + case 8: + sTitle = "Disciple"; break; + + case 9: + sTitle = "Adept"; break; + + case 10: + sTitle = "Ascetic"; break; + + case 11: + sTitle = "Pilgrim"; break; + + case 12: + sTitle = "Master"; break; + + case 13: + sTitle = "Anchorite"; break; + + case 14: + sTitle = "Mystic"; break; + + case 15: + sTitle = "Meditator"; break; + + case 16: + sTitle = "Seeker"; break; + + case 17: + sTitle = "Guru"; break; + + case 18: + sTitle = "Sensei"; break; + + case 19: + sTitle = "Sannyasi"; break; + + case 20: + sTitle = "Exemplar"; break; + + case 21: + sTitle = "Transcendent"; break; + + default: + sTitle = "High Master"; break; + + } + + case CLASS_TYPE_RANGER: + switch(nLevel) + { + case 1: case 2: case 3: + sTitle = "Greenhorn" ; + break; + + case 4: case 5: + sTitle = "Tenderfoot"; break; + + case 6: + sTitle = "Vagrant"; break; + + case 7: + sTitle = "Tramp"; break; + + case 8: + sTitle = "Nomad"; break; + + case 9: + sTitle = "Wanderer"; break; + + case 10: + sTitle = "Ranger"; break; + + case 11: + sTitle = "Rambler"; break; + + case 12: + sTitle = "Traveler"; break; + + case 13: + sTitle = "Sojourner"; break; + + case 14: + sTitle = "Outrider"; break; + + case 15: + sTitle = "Wayfarer"; break; + + case 16: + sTitle = "Excursionist"; break; + + case 17: + sTitle = "Trekker"; break; + + case 18: + sTitle = "Trailblazer"; break; + + case 19: + sTitle = "Woodsman"; break; + + case 20: + sTitle = "High Ranger"; break; + + case 21: + sTitle = "Ranger"; break; + + case 22: + sTitle = "Rambler"; break; + + case 23: + sTitle = "Traveler"; break; + + case 24: + sTitle = "Sojourner"; break; + + case 25: + sTitle = "Outrider"; break; + + case 26: + sTitle = "Wayfarer"; break; + + case 27: + sTitle = "Excursionist"; break; + + case 28: + sTitle = "Trekker"; break; + + case 29: + sTitle = "Trailblazer"; break; + + default: + sTitle = "Ranger Lord"; break; + + } + + } + + return sTitle; +} + +//:: Function to get the highest class level of an object, excluding racialtype classes +int GetHighestClassLevel(object oCreature) +{ + int nHighestLevel = -1; + int nClassTypes = 254; // Maximum number of class types + int i; + + for (i = 0; i <= nClassTypes; i++) + { + // Check if the class type is excluded + if (i == CLASS_TYPE_ABERRATION || + i == CLASS_TYPE_ANIMAL || + i == CLASS_TYPE_BEAST || + i == CLASS_TYPE_CONSTRUCT || + i == CLASS_TYPE_DRAGON || + i == CLASS_TYPE_ELEMENTAL || + i == CLASS_TYPE_FEY || + i == CLASS_TYPE_GIANT || + i == CLASS_TYPE_HUMANOID || + i == CLASS_TYPE_MAGICAL_BEAST || + i == CLASS_TYPE_MONSTROUS || + i == CLASS_TYPE_OOZE || + i == CLASS_TYPE_OUTSIDER || + i == CLASS_TYPE_PLANT || + i == CLASS_TYPE_SHAPECHANGER || + i == CLASS_TYPE_UNDEAD || + i == CLASS_TYPE_VERMIN) + continue; + + int nLevel = GetLevelByClass(i, oCreature); + if (nLevel > 0) + { + if (nLevel > nHighestLevel) + { + nHighestLevel = nLevel; + } + } + else + { + break; // Reached an invalid class level, exit the loop + } + } + + return nHighestLevel; +} + +//::void main (){} diff --git a/_module/nss/nw_c2_default7.nss b/_module/nss/nw_c2_default7.nss deleted file mode 100644 index d53bf78c..00000000 --- a/_module/nss/nw_c2_default7.nss +++ /dev/null @@ -1,70 +0,0 @@ -//::////////////////////////////////////////////////////// -//:: NW_C2_DEFAULT7 -/* - Default OnDeath event handler for NPCs. - - Adjusts killer's alignment if appropriate and - alerts allies to our death. - */ -//:://///////////////////////////////////////////////////// -//:: Copyright (c) 2002 Floodgate Entertainment -//:: Created By: Naomi Novik -//:: Created On: 12/22/2002 -//:://///////////////////////////////////////////////////// -//:://///////////////////////////////////////////////////// -//:: Modified By: Deva Winblood -//:: Modified On: April 1st, 2008 -//:: Added Support for Dying Wile Mounted -//:: Modified By: Sir Elric -//:: Modified On: July 20th, 2008 -//:: Added Support for Sir Elric's Simple Creature Respawns -//:://///////////////////////////////////////////////////// - -#include "x2_inc_compon" -#include "x0_i0_spawncond" -#include "x3_inc_horse" -#include "se_respawn_inc" -#include "_kb_loot_corpse" - -void main() -{ - ExecuteScript("sf_xp", OBJECT_SELF); - int nClass = GetLevelByClass(CLASS_TYPE_COMMONER); - int nAlign = GetAlignmentGoodEvil(OBJECT_SELF); - object oKiller = GetLastKiller(); - - if (GetLocalInt(GetModule(),"X3_ENABLE_MOUNT_DB")&&GetIsObjectValid(GetMaster(OBJECT_SELF))) SetLocalInt(GetMaster(OBJECT_SELF),"bX3_STORE_MOUNT_INFO",TRUE); - - - // If we're a good/neutral commoner, - // adjust the killer's alignment evil - if(nClass > 0 && (nAlign == ALIGNMENT_GOOD || nAlign == ALIGNMENT_NEUTRAL)) - { - AdjustAlignment(oKiller, ALIGNMENT_EVIL, 5); - } - - // Call to allies to let them know we're dead - SpeakString("NW_I_AM_DEAD", TALKVOLUME_SILENT_TALK); - - //Shout Attack my target, only works with the On Spawn In setup - SpeakString("NW_ATTACK_MY_TARGET", TALKVOLUME_SILENT_TALK); - - // NOTE: the OnDeath user-defined event does not - // trigger reliably and should probably be removed - if(GetSpawnInCondition(NW_FLAG_DEATH_EVENT)) - { - SignalEvent(OBJECT_SELF, EventUserDefined(1007)); - } - craft_drop_items(oKiller); - LeaveCorpse(); - // ----------------------------------------------------------------------------- - // Sir Elric's Simple Creature Respawns additions - SE v2.0 - // ----------------------------------------------------------------------------- - - // Do not respawn creature if tagged with _NSP eg. NW_GOBLINA_NSP - if (FindSubString(GetTag(OBJECT_SELF), "NSP") > -1) - return; - - if(GetLocalInt(OBJECT_SELF, "PLACED"))// Only respawn original placed mobs - SE_DoCreatureRespawn(5, 10); -} diff --git a/_module/nss/nw_c2_default9.nss b/_module/nss/nw_c2_default9.nss deleted file mode 100644 index a6eb7217..00000000 --- a/_module/nss/nw_c2_default9.nss +++ /dev/null @@ -1,337 +0,0 @@ -//::////////////////////////////////////////////////// -//:: NW_C2_DEFAULT9 -/* - * Default OnSpawn handler with XP1 revisions. - * This corresponds to and produces the same results - * as the default OnSpawn handler in the OC. - * - * This can be used to customize creature behavior in three main ways: - * - * - Uncomment the existing lines of code to activate certain - * common desired behaviors from the moment when the creature - * spawns in. - * - * - Uncomment the user-defined event signals to cause the - * creature to fire events that you can then handle with - * a custom OnUserDefined event handler script. - * - * - Add new code _at the end_ to alter the initial - * behavior in a more customized way. - */ -//::////////////////////////////////////////////////// -//:: Copyright (c) 2002 Floodgate Entertainment -//:: Created By: Naomi Novik -//:: Created On: 12/11/2002 -//:: Modified By: Sir Elric -//:: Modified On: July 20th, 2008 -//:: Added Support for Sir Elric's Simple Creature Respawns -//::////////////////////////////////////////////////// -//:: Updated 2003-08-20 Georg Zoeller: Added check for variables to active spawn in conditions without changing the spawnscript - - -#include "x0_i0_anims" -// #include "x0_i0_walkway" - in x0_i0_anims -#include "x0_i0_treasure" - -#include "x2_inc_switches" - -void main() -{ - // ***** Spawn-In Conditions ***** // - ExecuteScript("spawn_rand_stats", OBJECT_SELF); - //ExecuteScript("wotr_npc_onspawn", OBJECT_SELF); - // * REMOVE COMMENTS (// ) before the "Set..." functions to activate - // * them. Do NOT touch lines commented out with // *, those are - // * real comments for information. - - // * This causes the creature to say a one-line greeting in their - // * conversation file upon perceiving the player. Put [NW_D2_GenCheck] - // * in the "Text Seen When" field of the greeting in the conversation - // * file. Don't attach any player responses. - // * - // SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION); - - // * Same as above, but for hostile creatures to make them say - // * a line before attacking. - // * - // SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION); - - // * This NPC will attack when its allies call for help - // * - // SetSpawnInCondition(NW_FLAG_SHOUT_ATTACK_MY_TARGET); - - // * If the NPC has the Hide skill they will go into stealth mode - // * while doing WalkWayPoints(). - // * - // SetSpawnInCondition(NW_FLAG_STEALTH); - - //-------------------------------------------------------------------------- - // Enable stealth mode by setting a variable on the creature - // Great for ambushes - // See x2_inc_switches for more information about this - //-------------------------------------------------------------------------- - if (GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_USE_SPAWN_STEALTH) == TRUE) - { - SetSpawnInCondition(NW_FLAG_STEALTH); - } - // * Same, but for Search mode - // * - // SetSpawnInCondition(NW_FLAG_SEARCH); - - //-------------------------------------------------------------------------- - // Make creature enter search mode after spawning by setting a variable - // Great for guards, etc - // See x2_inc_switches for more information about this - //-------------------------------------------------------------------------- - if (GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_USE_SPAWN_SEARCH) == TRUE) - { - SetSpawnInCondition(NW_FLAG_SEARCH); - } - // * This will set the NPC to give a warning to non-enemies - // * before attacking. - // * NN -- no clue what this really does yet - // * - // SetSpawnInCondition(NW_FLAG_SET_WARNINGS); - - // * Separate the NPC's waypoints into day & night. - // * See comment on WalkWayPoints() for use. - // * - // SetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING); - - // * If this is set, the NPC will appear using the "EffectAppear" - // * animation instead of fading in, *IF* SetListeningPatterns() - // * is called below. - // * - //SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION); - - // * This will cause an NPC to use common animations it possesses, - // * and use social ones to any other nearby friendly NPCs. - // * - // SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS); - - //-------------------------------------------------------------------------- - // Enable immobile ambient animations by setting a variable - // See x2_inc_switches for more information about this - //-------------------------------------------------------------------------- - if (GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_USE_SPAWN_AMBIENT_IMMOBILE) == TRUE) - { - SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS); - } - // * Same as above, except NPC will wander randomly around the - // * area. - // * - SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS); - - - //-------------------------------------------------------------------------- - // Enable mobile ambient animations by setting a variable - // See x2_inc_switches for more information about this - //-------------------------------------------------------------------------- - if (GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_USE_SPAWN_AMBIENT) == TRUE) - { - SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS); - } - // **** Animation Conditions **** // - // * These are extra conditions you can put on creatures with ambient - // * animations. - - // * Civilized creatures interact with placeables in - // * their area that have the tag "NW_INTERACTIVE" - // * and "talk" to each other. - // * - // * Humanoid races are civilized by default, so only - // * set this flag for monster races that you want to - // * behave the same way. - // SetAnimationCondition(NW_ANIM_FLAG_IS_CIVILIZED); - - // * If this flag is set, this creature will constantly - // * be acting. Otherwise, creatures will only start - // * performing their ambient animations when they - // * first perceive a player, and they will stop when - // * the player moves away. - SetAnimationCondition(NW_ANIM_FLAG_CONSTANT); - - // * Civilized creatures with this flag set will - // * randomly use a few voicechats. It's a good - // * idea to avoid putting this on multiple - // * creatures using the same voiceset. - // SetAnimationCondition(NW_ANIM_FLAG_CHATTER); - - // * Creatures with _immobile_ ambient animations - // * can have this flag set to make them mobile in a - // * close range. They will never leave their immediate - // * area, but will move around in it, frequently - // * returning to their starting point. - // * - // * Note that creatures spawned inside interior areas - // * that contain a waypoint with one of the tags - // * "NW_HOME", "NW_TAVERN", "NW_SHOP" will automatically - // * have this condition set. - // SetAnimationCondition(NW_ANIM_FLAG_IS_MOBILE_CLOSE_RANGE); - - - // **** Special Combat Tactics *****// - // * These are special flags that can be set on creatures to - // * make them follow certain specialized combat tactics. - // * NOTE: ONLY ONE OF THESE SHOULD BE SET ON A SINGLE CREATURE. - - // * Ranged attacker - // * Will attempt to stay at ranged distance from their - // * target. - // SetCombatCondition(X0_COMBAT_FLAG_RANGED); - - // * Defensive attacker - // * Will use defensive combat feats and parry - // SetCombatCondition(X0_COMBAT_FLAG_DEFENSIVE); - - // * Ambusher - // * Will go stealthy/invisible and attack, then - // * run away and try to go stealthy again before - // * attacking anew. - // SetCombatCondition(X0_COMBAT_FLAG_AMBUSHER); - - // * Cowardly - // * Cowardly creatures will attempt to flee - // * attackers. - // SetCombatCondition(X0_COMBAT_FLAG_COWARDLY); - - - // **** Escape Commands ***** // - // * NOTE: ONLY ONE OF THE FOLLOWING SHOULD EVER BE SET AT ONE TIME. - // * NOTE2: Not clear that these actually work. -- NN - - // * Flee to a way point and return a short time later. - // * - // SetSpawnInCondition(NW_FLAG_ESCAPE_RETURN); - - // * Flee to a way point and do not return. - // * - // SetSpawnInCondition(NW_FLAG_ESCAPE_LEAVE); - - // * Teleport to safety and do not return. - // * - // SetSpawnInCondition(NW_FLAG_TELEPORT_LEAVE); - - // * Teleport to safety and return a short time later. - // * - // SetSpawnInCondition(NW_FLAG_TELEPORT_RETURN); - - - - // ***** CUSTOM USER DEFINED EVENTS ***** / - - - /* - If you uncomment any of these conditions, the creature will fire - a specific user-defined event number on each event. That will then - allow you to write custom code in the "OnUserDefinedEvent" handler - script to go on top of the default NPC behaviors for that event. - - Example: I want to add some custom behavior to my NPC when they - are damaged. I uncomment the "NW_FLAG_DAMAGED_EVENT", then create - a new user-defined script that has something like this in it: - - if (GetUserDefinedEventNumber() == 1006) { - // Custom code for my NPC to execute when it's damaged - } - - These user-defined events are in the range 1001-1007. - */ - - // * Fire User Defined Event 1001 in the OnHeartbeat - // * - // SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT); - - // * Fire User Defined Event 1002 - // * - // SetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT); - - // * Fire User Defined Event 1005 - // * - // SetSpawnInCondition(NW_FLAG_ATTACK_EVENT); - - // * Fire User Defined Event 1006 - // * - // SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT); - - // * Fire User Defined Event 1008 - // * - // SetSpawnInCondition(NW_FLAG_DISTURBED_EVENT); - - // * Fire User Defined Event 1003 - // * - // SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT); - - // * Fire User Defined Event 1004 - // * - // SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT); - - - - // ***** DEFAULT GENERIC BEHAVIOR (DO NOT TOUCH) ***** // - - // * Goes through and sets up which shouts the NPC will listen to. - // * - SetListeningPatterns(); - - // * Walk among a set of waypoints. - // * 1. Find waypoints with the tag "WP_" + NPC TAG + "_##" and walk - // * among them in order. - // * 2. If the tag of the Way Point is "POST_" + NPC TAG, stay there - // * and return to it after combat. - // - // * Optional Parameters: - // * void WalkWayPoints(int nRun = FALSE, float fPause = 1.0) - // - // * If "NW_FLAG_DAY_NIGHT_POSTING" is set above, you can also - // * create waypoints with the tags "WN_" + NPC Tag + "_##" - // * and those will be walked at night. (The standard waypoints - // * will be walked during the day.) - // * The night "posting" waypoint tag is simply "NIGHT_" + NPC tag. - WalkWayPoints(); - - //* Create a small amount of treasure on the creature - //if ((GetLocalInt(GetModule(), "X2_L_NOTREASURE") == FALSE) && - // (GetLocalInt(OBJECT_SELF, "X2_L_NOTREASURE") == FALSE) ) - //{ - // CTG_GenerateNPCTreasure(TREASURE_TYPE_MONSTER, OBJECT_SELF); - //} - - - // ***** ADD ANY SPECIAL ON-SPAWN CODE HERE ***** // -// ----------------------------------------------------------------------------- -// Sir Elric's Simple Creature Respawns additions - SE v1.9 -// ----------------------------------------------------------------------------- - SetLocalLocation(OBJECT_SELF, "spawn", GetLocation(OBJECT_SELF)); - // Set as original placed mobs... - if(!GetLocalInt(GetModule(), "ORIGINAL_PLACED_MOBS")) - { - SetLocalInt(OBJECT_SELF, "PLACED", 1); - } - - // * If Incorporeal, apply changes - if (GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_IS_INCORPOREAL) == TRUE) - { - effect eConceal = EffectConcealment(50, MISS_CHANCE_TYPE_NORMAL); - eConceal = ExtraordinaryEffect(eConceal); - effect eGhost = EffectCutsceneGhost(); - eGhost = ExtraordinaryEffect(eGhost); - ApplyEffectToObject(DURATION_TYPE_PERMANENT, eConceal, OBJECT_SELF); - ApplyEffectToObject(DURATION_TYPE_PERMANENT, eGhost, OBJECT_SELF); - - } - // * Give the create a random name. - // * If you create a script named x3_name_gen in your module, you can - // * set the value of the variable X3_S_RANDOM_NAME on OBJECT_SELF inside - // * the script to override the creature's default name. - if (GetCreatureFlag(OBJECT_SELF, CREATURE_VAR_RANDOMIZE_NAME) == TRUE) - { - ExecuteScript("x3_name_gen",OBJECT_SELF); - string sName = GetLocalString(OBJECT_SELF,"X3_S_RANDOM_NAME"); - if ( sName == "" ) - { - sName = RandomName(); - } - SetName(OBJECT_SELF,sName); - } -} diff --git a/_module/nss/nwnx.nss b/_module/nss/nwnx.nss new file mode 100644 index 00000000..f7648213 --- /dev/null +++ b/_module/nss/nwnx.nss @@ -0,0 +1,137 @@ +/// @addtogroup nwnx NWNX +/// @brief Functions for plugin developers. +/// @{ +/// @file nwnx.nss + +const string NWNX_Core = "NWNX_Core"; ///< @private + +/// @brief Scripting interface to NWNX. +/// @param pluginName The plugin name. +/// @param functionName The function name (do not include NWNX_Plugin_). +void NWNX_CallFunction(string pluginName, string functionName); +/// @brief Pushes the specified type to the c++ side +/// @param value The value of specified type to push. +void NWNX_PushArgumentInt(int value); +/// @copydoc NWNX_PushArgumentInt() +void NWNX_PushArgumentFloat(float value); +/// @copydoc NWNX_PushArgumentInt() +void NWNX_PushArgumentObject(object value); +/// @copydoc NWNX_PushArgumentInt() +void NWNX_PushArgumentString(string value); +/// @copydoc NWNX_PushArgumentInt() +void NWNX_PushArgumentEffect(effect value); +/// @copydoc NWNX_PushArgumentInt() +void NWNX_PushArgumentItemProperty(itemproperty value); +/// @copydoc NWNX_PushArgumentInt() +void NWNX_PushArgumentJson(json value); +/// @brief Returns the specified type from the c++ side +/// @return The value of specified type. +int NWNX_GetReturnValueInt(); +/// @copydoc NWNX_GetReturnValueInt() +float NWNX_GetReturnValueFloat(); +/// @copydoc NWNX_GetReturnValueInt() +object NWNX_GetReturnValueObject(); +/// @copydoc NWNX_GetReturnValueInt() +string NWNX_GetReturnValueString(); +/// @copydoc NWNX_GetReturnValueInt() +effect NWNX_GetReturnValueEffect(); +/// @copydoc NWNX_GetReturnValueInt() +itemproperty NWNX_GetReturnValueItemProperty(); +/// @copydoc NWNX_GetReturnValueInt() +json NWNX_GetReturnValueJson(); + +/// @brief Determines if the given plugin exists and is enabled. +/// @param sPlugin The name of the plugin to check. This is the case sensitive plugin name as used by NWNX_CallFunction, NWNX_PushArgumentX +/// @note Example usage: NWNX_PluginExists("NWNX_Creature"); +/// @return TRUE if the plugin exists and is enabled, otherwise FALSE. +int NWNX_PluginExists(string sPlugin); + +/// @private +const string NWNX_PUSH = "NWNXEE!ABIv2!X!Y!PUSH"; +const string NWNX_POP = "NWNXEE!ABIv2!X!Y!POP"; +/// @} + +void NWNX_CallFunction(string pluginName, string functionName) +{ + PlaySound("NWNXEE!ABIv2!" + pluginName + "!" + functionName + "!CALL"); +} + +void NWNX_PushArgumentInt(int value) +{ + SetLocalInt(OBJECT_INVALID, NWNX_PUSH, value); +} + +void NWNX_PushArgumentFloat(float value) +{ + SetLocalFloat(OBJECT_INVALID, NWNX_PUSH, value); +} + +void NWNX_PushArgumentObject(object value) +{ + SetLocalObject(OBJECT_INVALID, NWNX_PUSH, value); +} + +void NWNX_PushArgumentString(string value) +{ + SetLocalString(OBJECT_INVALID, NWNX_PUSH, value); +} + +void NWNX_PushArgumentEffect(effect value) +{ + TagEffect(value, NWNX_PUSH); +} + +void NWNX_PushArgumentItemProperty(itemproperty value) +{ + TagItemProperty(value, NWNX_PUSH); +} + +void NWNX_PushArgumentJson(json value) +{ + SetLocalJson(OBJECT_INVALID, NWNX_PUSH, value); +} + +int NWNX_GetReturnValueInt() +{ + return GetLocalInt(OBJECT_INVALID, NWNX_POP); +} + +float NWNX_GetReturnValueFloat() +{ + return GetLocalFloat(OBJECT_INVALID, NWNX_POP); +} + +object NWNX_GetReturnValueObject() +{ + return GetLocalObject(OBJECT_INVALID, NWNX_POP); +} + +string NWNX_GetReturnValueString() +{ + return GetLocalString(OBJECT_INVALID, NWNX_POP); +} + +effect NWNX_GetReturnValueEffect() +{ + effect e; + return TagEffect(e, NWNX_POP); +} + +itemproperty NWNX_GetReturnValueItemProperty() +{ + itemproperty ip; + return TagItemProperty(ip, NWNX_POP); +} + +json NWNX_GetReturnValueJson() +{ + return GetLocalJson(OBJECT_INVALID, NWNX_POP); +} + +int NWNX_PluginExists(string sPlugin) +{ + string sFunc = "PluginExists"; + NWNX_PushArgumentString(sPlugin); + NWNX_CallFunction(NWNX_Core, sFunc); + return NWNX_GetReturnValueInt(); +} diff --git a/_module/nss/nwnx_admin.nss b/_module/nss/nwnx_admin.nss new file mode 100644 index 00000000..7cd016e5 --- /dev/null +++ b/_module/nss/nwnx_admin.nss @@ -0,0 +1,391 @@ +/// @addtogroup admin Administration +/// @brief Various admin related functions +/// @{ +/// @file nwnx_admin.nss +#include "nwnx" + +const string NWNX_Administration = "NWNX_Administration"; ///< @private + +/// @name Administration Options +/// @anchor admin_opts +/// +/// @{ +const int NWNX_ADMINISTRATION_OPTION_ALL_KILLABLE = 0; // DOES NOT DO ANYTHING +const int NWNX_ADMINISTRATION_OPTION_NON_PARTY_KILLABLE = 1; // DOES NOT DO ANYTHING +const int NWNX_ADMINISTRATION_OPTION_REQUIRE_RESURRECTION = 2; // DOES NOT DO ANYTHING +const int NWNX_ADMINISTRATION_OPTION_LOSE_STOLEN_ITEMS = 3; // DOES NOT DO ANYTHING +const int NWNX_ADMINISTRATION_OPTION_LOSE_ITEMS = 4; // DOES NOT DO ANYTHING +const int NWNX_ADMINISTRATION_OPTION_LOSE_EXP = 5; // DOES NOT DO ANYTHING +const int NWNX_ADMINISTRATION_OPTION_LOSE_GOLD = 6; // DOES NOT DO ANYTHING +const int NWNX_ADMINISTRATION_OPTION_LOSE_GOLD_NUM = 7; // DOES NOT DO ANYTHING +const int NWNX_ADMINISTRATION_OPTION_LOSE_EXP_NUM = 8; // DOES NOT DO ANYTHING +const int NWNX_ADMINISTRATION_OPTION_LOSE_ITEMS_NUM = 9; // DOES NOT DO ANYTHING +const int NWNX_ADMINISTRATION_OPTION_PVP_SETTING = 10; // 0 = No PVP, 1 = Party PVP, 2 = Full PVP +const int NWNX_ADMINISTRATION_OPTION_PAUSE_AND_PLAY = 11; // TRUE/FALSE +const int NWNX_ADMINISTRATION_OPTION_ONE_PARTY_ONLY = 12; // TRUE/FALSE +const int NWNX_ADMINISTRATION_OPTION_ENFORCE_LEGAL_CHARACTERS = 13; // TRUE/FALSE +const int NWNX_ADMINISTRATION_OPTION_ITEM_LEVEL_RESTRICTIONS = 14; // TRUE/FALSE +const int NWNX_ADMINISTRATION_OPTION_CDKEY_BANLIST_ALLOWLIST = 15; // TRUE/FALSE +const int NWNX_ADMINISTRATION_OPTION_DISALLOW_SHOUTING = 16; // TRUE/FALSE +const int NWNX_ADMINISTRATION_OPTION_SHOW_DM_JOIN_MESSAGE = 17; // TRUE/FALSE +const int NWNX_ADMINISTRATION_OPTION_BACKUP_SAVED_CHARACTERS = 18; // TRUE/FALSE +const int NWNX_ADMINISTRATION_OPTION_AUTO_FAIL_SAVE_ON_1 = 19; // TRUE/FALSE +const int NWNX_ADMINISTRATION_OPTION_VALIDATE_SPELLS = 20; // TRUE/FALSE +const int NWNX_ADMINISTRATION_OPTION_EXAMINE_EFFECTS = 21; // TRUE/FALSE +const int NWNX_ADMINISTRATION_OPTION_EXAMINE_CHALLENGE_RATING = 22; // TRUE/FALSE +const int NWNX_ADMINISTRATION_OPTION_USE_MAX_HITPOINTS = 23; // TRUE/FALSE +const int NWNX_ADMINISTRATION_OPTION_RESTORE_SPELLS_USES = 24; // TRUE/FALSE +const int NWNX_ADMINISTRATION_OPTION_RESET_ENCOUNTER_SPAWN_POOL = 25; // TRUE/FALSE +const int NWNX_ADMINISTRATION_OPTION_HIDE_HITPOINTS_GAINED = 26; // TRUE/FALSE +const int NWNX_ADMINISTRATION_OPTION_PLAYER_PARTY_CONTROL = 27; // TRUE/FALSE +const int NWNX_ADMINISTRATION_OPTION_SHOW_PLAYER_JOIN_MESSAGES = 28; // TRUE/FALSE +/// @} + +/// @name Administration Debug Types +/// @anchor admin_debug +/// +/// @{ +const int NWNX_ADMINISTRATION_DEBUG_COMBAT = 0; // TRUE/FALSE +const int NWNX_ADMINISTRATION_DEBUG_SAVING_THROW = 1; // TRUE/FALSE +const int NWNX_ADMINISTRATION_DEBUG_MOVEMENT_SPEED = 2; // TRUE/FALSE +const int NWNX_ADMINISTRATION_DEBUG_HIT_DIE = 3; // TRUE/FALSE +/// @} + +/// @brief Gets the current player password. +/// @return The current player password. +string NWNX_Administration_GetPlayerPassword(); + +/// @brief Sets the password for players to login. +/// @param password The password to use. +void NWNX_Administration_SetPlayerPassword(string password); + +/// @brief Clears the player password required to login. +void NWNX_Administration_ClearPlayerPassword(); + +/// @brief Gets the current DM password. +/// @return The current DM password. +string NWNX_Administration_GetDMPassword(); + +/// @brief Sets the password for DMs to login. +/// @param password The password to use. +void NWNX_Administration_SetDMPassword(string password); + +/// @brief Signals the server to immediately shut down. +void NWNX_Administration_ShutdownServer(); + +/// @brief Deletes the player character from the servervault +/// +/// The PC will be immediately booted from the game with a "Delete Character" message +/// +/// @param oPC The player to delete. +/// @param bPreserveBackup If true, it will leave the file on server, only appending ".deleted0" to the bic filename. +/// @param sKickMessage An optional kick message, if left blank it will default to "Delete Character" as reason. +void NWNX_Administration_DeletePlayerCharacter(object oPC, int bPreserveBackup = TRUE, string sKickMessage = ""); + +/// @brief Bans the provided IP. +/// @param ip The IP Address to ban. +void NWNX_Administration_AddBannedIP(string ip); + +/// @brief Removes the ban on the provided IP. +/// @param ip The IP Address to unban. +void NWNX_Administration_RemoveBannedIP(string ip); + +/// @brief Bans the provided Public CD Key. +/// @param key The Public CD Key to ban. +void NWNX_Administration_AddBannedCDKey(string key); + +/// @brief Removes the ban on the provided Public CD Key. +/// @param key The Public CD Key to unban. +void NWNX_Administration_RemoveBannedCDKey(string key); + +/// @brief Bans the provided playername. +/// @param playerName The player name (community name) to ban. +/// @warning A user can change their playername at will. +void NWNX_Administration_AddBannedPlayerName(string playerName); + +/// @brief Removes the ban on the provided playername. +/// @param playerName The player name (community name) to unban. +void NWNX_Administration_RemoveBannedPlayerName(string playerName); + +/// @brief Get a list of all banned IPs/Keys/names as a string. +/// @return A string with a listing of the banned IPs/Keys/names. +string NWNX_Administration_GetBannedList(); + +/// @brief Set the module's name as shown to the serverlist. +/// @param name The name to give the module. +void NWNX_Administration_SetModuleName(string name); + +/// @brief Set the server's name as shown to the serverlist. +/// @param name The name to give the server. +void NWNX_Administration_SetServerName(string name); + +/// @brief Returns the server's name as shown to the serverlist. +string NWNX_Administration_GetServerName(); + +/// @brief Get an @ref admin_opts "Administration Option" value. +/// @param option An @ref admin_opts "Administration Option". +/// @return The current setting for the supplied option from @ref admin_opts "Administration Options". +int NWNX_Administration_GetPlayOption(int option); + +/// @brief Set an @ref admin_opts "Administration Options" to a value. +/// @param option The option to adjust from @ref admin_opts "Administration Options". +/// @param value The new value for the option. +void NWNX_Administration_SetPlayOption(int option, int value); + +/// @brief Delete the TURD of playerName + characterName. +/// +/// At times a PC may get stuck in a permanent crash loop when attempting to log +/// in. This function allows administrators to delete their Temporary User +/// Resource Data where the PC's current location is stored allowing them to log +/// into the starting area. +/// +/// @param playerName The community (login name). +/// @param characterName The character name. +/// @return Returns TRUE if successful +int NWNX_Administration_DeleteTURD(string playerName, string characterName); + +/// @brief Get an @ref admin_debug "Administration Debug Type" value. +/// @param type An @ref admin_debug "Administration Debug Type". +/// @return The current value for the supplied debug type from @ref admin_debug "Administration Debug Types". +int NWNX_Administration_GetDebugValue(int type); + +/// @brief Set an @ref admin_debug "Administration Debug Type" to a value. +/// @param type The debug type to adjust from @ref admin_debug "Administration Debug Types". +/// @param state The new state for the debug type, TRUE or FALSE +void NWNX_Administration_SetDebugValue(int type, int state); + +/// @brief Reload all rules (2da stuff etc). +/// @warning DANGER, DRAGONS. Bad things may or may not happen. +void NWNX_Administration_ReloadRules(); + +/// @brief Get the servers minimum level. +/// @return The minimum level for the server. +int NWNX_Administration_GetMinLevel(); + +/// @brief Set the servers minimum level. +/// @param nLevel The minimum level for the server. +void NWNX_Administration_SetMinLevel(int nLevel); + +/// @brief Get the servers maximum level. +/// @return The maximum level for the server. +int NWNX_Administration_GetMaxLevel(); + +/// @brief Set the servers maximum level. +/// @note Attention when using this and the MaxLevel plugin. They both change the same value. +/// @param nLevel The maximum level for the server. +void NWNX_Administration_SetMaxLevel(int nLevel); + +/// @} + +string NWNX_Administration_GetPlayerPassword() +{ + string sFunc = "GetPlayerPassword"; + + NWNX_CallFunction(NWNX_Administration, sFunc); + return NWNX_GetReturnValueString(); +} + +void NWNX_Administration_SetPlayerPassword(string password) +{ + string sFunc = "SetPlayerPassword"; + + NWNX_PushArgumentString(password); + NWNX_CallFunction(NWNX_Administration, sFunc); +} + +void NWNX_Administration_ClearPlayerPassword() +{ + string sFunc = "ClearPlayerPassword"; + + NWNX_CallFunction(NWNX_Administration, sFunc); +} + +string NWNX_Administration_GetDMPassword() +{ + string sFunc = "GetDMPassword"; + + NWNX_CallFunction(NWNX_Administration, sFunc); + return NWNX_GetReturnValueString(); +} + +void NWNX_Administration_SetDMPassword(string password) +{ + string sFunc = "SetDMPassword"; + + NWNX_PushArgumentString(password); + NWNX_CallFunction(NWNX_Administration, sFunc); +} + +void NWNX_Administration_ShutdownServer() +{ + string sFunc = "ShutdownServer"; + + NWNX_CallFunction(NWNX_Administration, sFunc); +} + +void NWNX_Administration_DeletePlayerCharacter(object oPC, int bPreserveBackup = TRUE, string sKickMessage = "") +{ + string sFunc = "DeletePlayerCharacter"; + + NWNX_PushArgumentString(sKickMessage); + NWNX_PushArgumentInt(bPreserveBackup); + NWNX_PushArgumentObject(oPC); + NWNX_CallFunction(NWNX_Administration, sFunc); +} + +void NWNX_Administration_AddBannedIP(string ip) +{ + string sFunc = "AddBannedIP"; + + NWNX_PushArgumentString(ip); + NWNX_CallFunction(NWNX_Administration, sFunc); +} +void NWNX_Administration_RemoveBannedIP(string ip) +{ + string sFunc = "RemoveBannedIP"; + + NWNX_PushArgumentString(ip); + NWNX_CallFunction(NWNX_Administration, sFunc); +} +void NWNX_Administration_AddBannedCDKey(string key) +{ + string sFunc = "AddBannedCDKey"; + + NWNX_PushArgumentString(key); + NWNX_CallFunction(NWNX_Administration, sFunc); +} +void NWNX_Administration_RemoveBannedCDKey(string key) +{ + string sFunc = "RemoveBannedCDKey"; + + NWNX_PushArgumentString(key); + NWNX_CallFunction(NWNX_Administration, sFunc); +} +void NWNX_Administration_AddBannedPlayerName(string playerName) +{ + string sFunc = "AddBannedPlayerName"; + + NWNX_PushArgumentString(playerName); + NWNX_CallFunction(NWNX_Administration, sFunc); +} +void NWNX_Administration_RemoveBannedPlayerName(string playerName) +{ + string sFunc = "RemoveBannedPlayerName"; + + NWNX_PushArgumentString(playerName); + NWNX_CallFunction(NWNX_Administration, sFunc); +} +string NWNX_Administration_GetBannedList() +{ + string sFunc = "GetBannedList"; + + NWNX_CallFunction(NWNX_Administration, sFunc); + return NWNX_GetReturnValueString(); +} + +void NWNX_Administration_SetModuleName(string name) +{ + string sFunc = "SetModuleName"; + + NWNX_PushArgumentString(name); + NWNX_CallFunction(NWNX_Administration, sFunc); +} + +void NWNX_Administration_SetServerName(string name) +{ + string sFunc = "SetServerName"; + + NWNX_PushArgumentString(name); + NWNX_CallFunction(NWNX_Administration, sFunc); +} + +string NWNX_Administration_GetServerName() +{ + string sFunc = "GetServerName"; + NWNX_CallFunction(NWNX_Administration, sFunc); + return NWNX_GetReturnValueString(); +} + +int NWNX_Administration_GetPlayOption(int option) +{ + string sFunc = "GetPlayOption"; + + NWNX_PushArgumentInt(option); + NWNX_CallFunction(NWNX_Administration, sFunc); + + return NWNX_GetReturnValueInt(); +} + +void NWNX_Administration_SetPlayOption(int option, int value) +{ + string sFunc = "SetPlayOption"; + + NWNX_PushArgumentInt(value); + NWNX_PushArgumentInt(option); + NWNX_CallFunction(NWNX_Administration, sFunc); +} + +int NWNX_Administration_DeleteTURD(string playerName, string characterName) +{ + string sFunc = "DeleteTURD"; + + NWNX_PushArgumentString(characterName); + NWNX_PushArgumentString(playerName); + NWNX_CallFunction(NWNX_Administration, sFunc); + + return NWNX_GetReturnValueInt(); +} + +int NWNX_Administration_GetDebugValue(int type) +{ + string sFunc = "GetDebugValue"; + + NWNX_PushArgumentInt(type); + NWNX_CallFunction(NWNX_Administration, sFunc); + + return NWNX_GetReturnValueInt(); +} + +void NWNX_Administration_SetDebugValue(int type, int state) +{ + string sFunc = "SetDebugValue"; + + NWNX_PushArgumentInt(state); + NWNX_PushArgumentInt(type); + NWNX_CallFunction(NWNX_Administration, sFunc); +} + +void NWNX_Administration_ReloadRules() +{ + string sFunc = "ReloadRules"; + + NWNX_CallFunction(NWNX_Administration, sFunc); +} + +int NWNX_Administration_GetMinLevel() +{ + string sFunc = "GetMinLevel"; + NWNX_CallFunction(NWNX_Administration, sFunc); + return NWNX_GetReturnValueInt(); +} + +void NWNX_Administration_SetMinLevel(int nLevel) +{ + string sFunc = "SetMinLevel"; + NWNX_PushArgumentInt(nLevel); + NWNX_CallFunction(NWNX_Administration, sFunc); +} + +int NWNX_Administration_GetMaxLevel() +{ + string sFunc = "GetMaxLevel"; + NWNX_CallFunction(NWNX_Administration, sFunc); + return NWNX_GetReturnValueInt(); +} + +void NWNX_Administration_SetMaxLevel(int nLevel) +{ + string sFunc = "SetMaxLevel"; + NWNX_PushArgumentInt(nLevel); + NWNX_CallFunction(NWNX_Administration, sFunc); +} diff --git a/_module/nss/nwnx_creature.nss b/_module/nss/nwnx_creature.nss new file mode 100644 index 00000000..275638f4 --- /dev/null +++ b/_module/nss/nwnx_creature.nss @@ -0,0 +1,2613 @@ +/// @addtogroup creature Creature +/// @brief Functions exposing additional creature properties. +/// @{ +/// @file nwnx_creature.nss +#include "nwnx" + +const string NWNX_Creature = "NWNX_Creature"; ///< @private + +/// @name Creature Movement Rates +/// @anchor creature_movement_rates +/// +/// The various types of movement rates. +/// @{ +const int NWNX_CREATURE_MOVEMENT_RATE_PC = 0; +const int NWNX_CREATURE_MOVEMENT_RATE_IMMOBILE = 1; +const int NWNX_CREATURE_MOVEMENT_RATE_VERY_SLOW = 2; +const int NWNX_CREATURE_MOVEMENT_RATE_SLOW = 3; +const int NWNX_CREATURE_MOVEMENT_RATE_NORMAL = 4; +const int NWNX_CREATURE_MOVEMENT_RATE_FAST = 5; +const int NWNX_CREATURE_MOVEMENT_RATE_VERY_FAST = 6; +const int NWNX_CREATURE_MOVEMENT_RATE_DEFAULT = 7; +const int NWNX_CREATURE_MOVEMENT_RATE_DM_FAST = 8; +/// @} + +/// @name Creature Movement Types +/// @anchor creature_movement_types +/// +/// The various types of movement types. +/// @{ +const int NWNX_CREATURE_MOVEMENT_TYPE_STATIONARY = 0; +const int NWNX_CREATURE_MOVEMENT_TYPE_WALK = 1; +const int NWNX_CREATURE_MOVEMENT_TYPE_RUN = 2; +const int NWNX_CREATURE_MOVEMENT_TYPE_SIDESTEP = 3; +const int NWNX_CREATURE_MOVEMENT_TYPE_WALK_BACKWARDS = 4; +/// @} + +/// @name Bonus Types +/// @anchor bonus_types +/// +/// Used with NWNX_Creature_GetTotalEffectBonus() these are the types of temporary bonuses from effects. +/// @{ +const int NWNX_CREATURE_BONUS_TYPE_ATTACK = 1; +const int NWNX_CREATURE_BONUS_TYPE_DAMAGE = 2; +const int NWNX_CREATURE_BONUS_TYPE_SAVING_THROW = 3; +const int NWNX_CREATURE_BONUS_TYPE_ABILITY = 4; +const int NWNX_CREATURE_BONUS_TYPE_SKILL = 5; +const int NWNX_CREATURE_BONUS_TYPE_TOUCH_ATTACK = 6; +/// @} + +/// @name Ranged Projectile VFX +/// @anchor ranged_projectile_vfx +/// +/// Used with NWNX_Creature_OverrideRangedProjectileVFX() these are the projectile vfx types. +/// @{ +const int NWNX_CREATURE_PROJECTILE_VFX_NONE = 0; ///< No VFX +const int NWNX_CREATURE_PROJECTILE_VFX_ACID = 1; +const int NWNX_CREATURE_PROJECTILE_VFX_COLD = 2; +const int NWNX_CREATURE_PROJECTILE_VFX_ELECTRICAL = 3; +const int NWNX_CREATURE_PROJECTILE_VFX_FIRE = 4; +const int NWNX_CREATURE_PROJECTILE_VFX_SONIC = 5; +const int NWNX_CREATURE_PROJECTILE_VFX_RANDOM = 6; ///< Random Elemental VFX +/// @} + +const int NWNX_CREATURE_ABILITY_NONE = 6; + +/// @struct NWNX_Creature_SpecialAbility +/// @brief A creature special ability. +struct NWNX_Creature_SpecialAbility +{ + int id; ///< The spell id + int ready; ///< Whether it can be used + int level; ///< The level of the ability +}; + +/// @brief Gives the creature a feat. +/// @param creature The creature object. +/// @param feat The feat id. +/// @remark Consider also using NWNX_Creature_AddFeatByLevel() to properly allocate the feat to a level +void NWNX_Creature_AddFeat(object creature, int feat); + +/// @brief Gives the creature a feat assigned at a level +/// @param creature The creature object. +/// @param feat The feat id. +/// @param level The level they gained the feat. +/// @remark Adds the feat to the stat list at the provided level. +void NWNX_Creature_AddFeatByLevel(object creature, int feat, int level); + +/// @brief Removes a feat from a creature. +/// @param creature The creature object. +/// @param feat The feat id. +void NWNX_Creature_RemoveFeat(object creature, int feat); + +/// @brief Removes the creature a feat assigned at a level +/// @param creature The creature object. +/// @param feat The feat id. +/// @param level The level they gained the feat. +/// @remark Removes the feat from the stat list at the provided level. Does not remove the feat from the creature, use +/// NWNX_Creature_RemoveFeat for this. +void NWNX_Creature_RemoveFeatByLevel(object creature, int feat, int level); + +/// @brief Determines if the creature knows a feat. +/// @note This differs from native @nwn{GetHasFeat} which returns FALSE if the feat has no more uses per day. +/// @param creature The creature object. +/// @param feat The feat id. +/// @return TRUE if the creature has the feat, regardless if they have any usages left or not. +int NWNX_Creature_GetKnowsFeat(object creature, int feat); + +/// @brief Returns the count of feats learned at the provided level. +/// @param creature The creature object. +/// @param level The level. +/// @return The count of feats. +int NWNX_Creature_GetFeatCountByLevel(object creature, int level); + +/// @brief Returns the feat learned at the level and index. +/// @param creature The creature object. +/// @param level The level. +/// @param index The index. Index bounds: 0 <= index < NWNX_Creature_GetFeatCountByLevel(). +/// @return The feat id at the index. +int NWNX_Creature_GetFeatByLevel(object creature, int level, int index); + +/// @brief Returns the creature level where the specified feat was learned. +/// @param creature The creature object. +/// @param feat The feat id. +/// @return The character level that the specified feat was granted, otherwise 0 if the creature does not have this feat. +int NWNX_Creature_GetFeatGrantLevel(object creature, int feat); + +/// @brief Get the total number of feats known by creature. +/// @param creature The creature object. +/// @return The total feat count for the creature. +int NWNX_Creature_GetFeatCount(object creature); + +/// @brief Returns the creature's feat at a given index +/// @param creature The creature object. +/// @param index The index. Index bounds: 0 <= index < NWNX_Creature_GetFeatCount(); +/// @return The feat id at the index. +int NWNX_Creature_GetFeatByIndex(object creature, int index); + +/// @brief Gets if creature meets feat requirements. +/// @param creature The creature object. +/// @param feat The feat id. +/// @return TRUE if creature meets all requirements to take given feat +int NWNX_Creature_GetMeetsFeatRequirements(object creature, int feat); + +/// @brief Gets the count of special abilities of the creature. +/// @param creature The creature object. +/// @return The total special ability count. +int NWNX_Creature_GetSpecialAbilityCount(object creature); + +/// @brief Returns the creature's special ability at a given index. +/// @param creature The creature object. +/// @param index The index. Index bounds: 0 <= index < NWNX_Creature_GetSpecialAbilityCount(). +/// @return An NWNX_Creature_SpecialAbility struct. +struct NWNX_Creature_SpecialAbility NWNX_Creature_GetSpecialAbility(object creature, int index); + +/// @brief Adds a special ability to a creature. +/// @param creature The creature object. +/// @param ability An NWNX_Creature_SpecialAbility struct. +void NWNX_Creature_AddSpecialAbility(object creature, struct NWNX_Creature_SpecialAbility ability); + +/// @brief Removes a special ability from a creature. +/// @param creature The creature object. +/// @param index The index. Index bounds: 0 <= index < NWNX_Creature_GetSpecialAbilityCount(). +void NWNX_Creature_RemoveSpecialAbility(object creature, int index); + +/// @brief Sets a special ability at the index for the creature. +/// @param creature The creature object. +/// @param index The index. Index bounds: 0 <= index < NWNX_Creature_GetSpecialAbilityCount(). +/// @param ability An NWNX_Creature_SpecialAbility struct. +void NWNX_Creature_SetSpecialAbility(object creature, int index, struct NWNX_Creature_SpecialAbility ability); + +/// @brief Get the class taken by the creature at the provided level. +/// @param creature The creature object. +/// @param level The level. +/// @return The class id. +int NWNX_Creature_GetClassByLevel(object creature, int level); + +/// @brief Sets the base AC for the creature. +/// @param creature The creature object. +/// @param ac The base AC to set for the creature. +void NWNX_Creature_SetBaseAC(object creature, int ac); + +/// @brief Get the base AC for the creature. +/// @param creature The creature object. +/// @return The base AC. +int NWNX_Creature_GetBaseAC(object creature); + +/// @brief Sets the ability score of the creature to the provided value. +/// @note Does not apply racial bonuses/penalties. +/// @param creature The creature object. +/// @param ability The ability constant. +/// @param value The value to set. +void NWNX_Creature_SetRawAbilityScore(object creature, int ability, int value); + +/// @brief Gets the ability score of the creature. +/// @note Does not apply racial bonuses/penalties. +/// @param creature The creature object. +/// @param ability The ability constant. +/// @return The ability score. +int NWNX_Creature_GetRawAbilityScore(object creature, int ability); + +/// @brief Adjusts the ability score of a creature. +/// @note Does not apply racial bonuses/penalties. +/// @param creature The creature object. +/// @param ability The ability constant. +/// @param modifier The modifier value. +void NWNX_Creature_ModifyRawAbilityScore(object creature, int ability, int modifier); + +/// @brief Gets the raw ability score a polymorphed creature had prior to polymorphing. +/// @note For Strength, Dexterity and Constitution only. +/// @param creature The creature object. +/// @param ability The ability constant. +/// @return The raw ability score. +int NWNX_Creature_GetPrePolymorphAbilityScore(object creature, int ability); + +/// @brief Gets the remaining spell slots (innate casting) at a class level's index. +/// @param creature The creature object. +/// @param class The class id from classes.2da. (Not class index 0-2) +/// @param level The spell level. +/// @return The remaining spell slot count. +int NWNX_Creature_GetRemainingSpellSlots(object creature, int class, int level); + +/// @brief Sets the remaining spell slots (innate casting) at a class level. +/// @param creature The creature object. +/// @param class The class id from classes.2da. (Not class index 0-2) +/// @param level The spell level. +/// @param slots The remaining spell slots to set. +void NWNX_Creature_SetRemainingSpellSlots(object creature, int class, int level, int slots); + +/// @brief Gets the maximum spell slots (innate casting) at a class level. +/// @param creature The creature object. +/// @param class The class id from classes.2da. (Not class index 0-2) +/// @param level The spell level. +/// @return The maximum spell slot count. +int NWNX_Creature_GetMaxSpellSlots(object creature, int class, int level); + +/// @brief Add a spell to a creature's spellbook for class. +/// @param creature The creature object. +/// @param class The class id from classes.2da. (Not class index 0-2) +/// @param level The spell level. +/// @param spellId The spell to remove. +void NWNX_Creature_AddKnownSpell(object creature, int class, int level, int spellId); + +/// @brief Remove a spell from creature's spellbook for class. +/// @param creature The creature object. +/// @param class The class id from classes.2da. (Not class index 0-2) +/// @param level The spell level. +/// @param spellId The spell to remove. +void NWNX_Creature_RemoveKnownSpell(object creature, int class, int level, int spellId); + +/// @brief Gets the maximum hit points for creature for level. +/// @param creature The creature object. +/// @param level The level. +/// @return The maximum hit points a creature can have for the class at the provided level. +int NWNX_Creature_GetMaxHitPointsByLevel(object creature, int level); + +/// @brief Sets the maximum hit points for creature. +/// @param creature The creature object. +/// @param level The level. +/// @param value The amount to set the max hit points. +void NWNX_Creature_SetMaxHitPointsByLevel(object creature, int level, int value); + +/// @brief Set creature's movement rate. +/// @param creature The creature object. +/// @param rate The movement rate. +void NWNX_Creature_SetMovementRate(object creature, int rate); + +/// @brief Returns the creature's current movement rate factor. +/// @remark Base movement rate factor is 1.0. +/// @param creature The creature object. +/// @return The current movement rate factor. +float NWNX_Creature_GetMovementRateFactor(object creature); + +/// @brief Sets the creature's current movement rate factor. +/// @note Base movement rate factor is 1.0. +/// @param creature The creature object. +/// @param rate The rate to set. +void NWNX_Creature_SetMovementRateFactor(object creature, float rate); + +/// @brief Returns the creature's maximum movement rate cap. +/// @remark Default movement rate cap is 1.5. +/// @param creature The creature object. +/// @return The maximum movement rate cap. +float NWNX_Creature_GetMovementRateFactorCap(object creature); + +/// @brief Sets the creature's maximum movement rate cap. +/// @note Default movement rate cap is 1.5. +/// @param creature The creature object. +/// @param cap The cap to set. +void NWNX_Creature_SetMovementRateFactorCap(object creature, float cap); + +/// @brief Returns the creature's current movement type +/// @param creature The creature object. +/// @return An NWNX_CREATURE_MOVEMENT_TYPE_* constant. +int NWNX_Creature_GetMovementType(object creature); + +/// @brief Sets the maximum movement rate a creature can have while walking (not running) +/// @remark This allows a creature with movement speed enhancements to walk at a normal rate. +/// @param creature The creature object. +/// @param fWalkRate The walk rate to apply. Setting the value to -1.0 will remove the cap. +/// Default value is 2000.0, which is the base human walk speed. +void NWNX_Creature_SetWalkRateCap(object creature, float fWalkRate = 2000.0f); + +/// @brief Set creature's raw good/evil alignment value. +/// @param creature The creature object. +/// @param value The value to set. +void NWNX_Creature_SetAlignmentGoodEvil(object creature, int value); + +/// @brief Set creature's raw law/chaos alignment value. +/// @param creature The creature object. +/// @param value The value to set. +void NWNX_Creature_SetAlignmentLawChaos(object creature, int value); + +/// @brief Set the base ranks in a skill for creature +/// @param creature The creature object. +/// @param skill The skill id. +/// @param rank The value to set as the skill rank. +void NWNX_Creature_SetSkillRank(object creature, int skill, int rank); + +/// @brief Get the ranks in a skill for creature assigned at a level. +/// @param creature The creature object. +/// @param skill The skill id. +/// @param level The level they gained skill ranks. +/// @return The rank in a skill assigned at a level (-1 on error). +int NWNX_Creature_GetSkillRankByLevel(object creature, int skill, int level); + +/// @brief Set the ranks in a skill for creature assigned at a level. +/// @note It only affect the leveling array, to know what to do on level-down. To effectivly change the skill rank on the current level, NWNX_Creature_SetSkillRank is also needed. +/// @param creature The creature object. +/// @param skill The skill id. +/// @param level The level they gained skill ranks. +/// @param rank The value to set as the skill rank. +void NWNX_Creature_SetSkillRankByLevel(object creature, int skill, int rank, int level); + +/// @brief Set the class ID in a particular position for a creature. +/// @param creature The creature object. +/// @param position Should be 0, 1, or 2 depending on how many classes the creature +/// has and which is to be modified. +/// @param classID A valid ID number in classes.2da and between 0 and 255. +/// @param bUpdateLevels determines whether the method will replace all occurrences +/// of the old class in CNWLevelStats with the new classID. +void NWNX_Creature_SetClassByPosition(object creature, int position, int classID, int bUpdateLevels = TRUE); + +/// @brief Set the level at the given position for a creature. +/// @note A creature should already have a class in that position. +/// @param creature The creature object. +/// @param position Should be 0, 1, or 2 depending on how many classes the creature +/// has and which is to be modified. +/// @param level The level to set. +void NWNX_Creature_SetLevelByPosition(object creature, int position, int level); + +/// @brief Set creature's base attack bonus (BAB). +/// @note Modifying the BAB will also affect the creature's attacks per round and its +/// eligibility for feats, prestige classes, etc. +/// @param creature The creature object. +/// @param bab The BAB value. Should be between 0 and 254. Setting BAB to 0 will cause the +/// creature to revert to its original BAB based on its classes and levels. A creature can +/// never have an actual BAB of zero. +/// @remark The base game has a function @nwn{SetBaseAttackBonus}, which actually sets +/// the bonus attacks per round for a creature, not the BAB. +void NWNX_Creature_SetBaseAttackBonus(object creature, int bab); + +/// @brief Gets the creatures current attacks per round (using equipped weapon). +/// @param creature The creature object. +/// @param bBaseAPR If TRUE, will return the base attacks per round, based on BAB and +/// equipped weapons, regardless of overrides set by calls to @nwn{SetBaseAttackBonus} builtin function. +/// @return The attacks per round. +int NWNX_Creature_GetAttacksPerRound(object creature, int bBaseAPR = FALSE); + +/// @brief Restore all creature feat uses. +/// @param creature The creature object. +void NWNX_Creature_RestoreFeats(object creature); + +/// @brief Restore all creature special ability uses. +/// @param creature The creature object. +void NWNX_Creature_RestoreSpecialAbilities(object creature); + +/// @brief Restore uses for all items carried by the creature. +/// @param creature The creature object. +void NWNX_Creature_RestoreItems(object creature); + +/// @brief Sets the creature size. +/// @param creature The creature object. +/// @param size Use CREATURE_SIZE_* constants. +void NWNX_Creature_SetSize(object creature, int size); + +/// @brief Gets the creature's remaining unspent skill points. +/// @param creature The creature object. +/// @return The remaining unspent skill points. +int NWNX_Creature_GetSkillPointsRemaining(object creature); + +/// @brief Sets the creature's remaining unspent skill points. +/// @param creature The creature object. +/// @param skillpoints The value to set. +void NWNX_Creature_SetSkillPointsRemaining(object creature, int skillpoints); + +/// @brief Gets the creature's remaining unspent skill points for level. +/// @param creature The creature object. +/// @param level The level. +/// @return The remaining unspent skill points for level. +int NWNX_Creature_GetSkillPointsRemainingByLevel(object creature, int level); + +/// @brief Sets the creature's remaining unspent skill points for level. +/// @param creature The creature object. +/// @param level The level. +/// @param value The value to set for level. +void NWNX_Creature_SetSkillPointsRemainingByLevel(object creature, int level, int value); + +/// @brief Sets the creature's racial type +/// @param creature The creature object. +/// @param racialtype The racial type to set. +void NWNX_Creature_SetRacialType(object creature, int racialtype); + +/// @brief Sets the creature's gold without sending a feedback message +/// @param creature The creature object. +/// @param gold The amount of gold to set for their creature. +void NWNX_Creature_SetGold(object creature, int gold); + +/// @brief Sets corpse decay time in milliseconds +/// @param creature The creature object. +/// @param nDecayTime The corpse decay time. +void NWNX_Creature_SetCorpseDecayTime(object creature, int nDecayTime); + +/// @brief Gets the creature's base save. +/// @param creature The creature object. +/// @param which One of SAVING_THROW_FORT, SAVING_THROW_REFLEX or SAVING_THROW_WILL +/// @return The base save value. +/// @note This will include any modifiers set in the toolset. +int NWNX_Creature_GetBaseSavingThrow(object creature, int which); + +/// @brief Sets the creature's base save. +/// @param creature The creature object. +/// @param which One of SAVING_THROW_FORT, SAVING_THROW_REFLEX or SAVING_THROW_WILL +/// @param value The base save value. +void NWNX_Creature_SetBaseSavingThrow(object creature, int which, int value); + +/// @brief Add levels of class to the creature, bypassing all validation +/// @param creature The creature object. +/// @param class The class id. +/// @param count The amount of levels of class to add. +/// @param package The class package to use for leveling up (PACKAGE_INVALID = starting package) +/// @note This will not work on player characters. +void NWNX_Creature_LevelUp(object creature, int class, int count = 1, int package = PACKAGE_INVALID); + +/// @brief Remove last levels from a creature. +/// @param creature The creature object. +/// @param count The amount of levels to decrement. +/// @note This will not work on player characters. +void NWNX_Creature_LevelDown(object creature, int count=1); + +/// @brief Sets the creature's challenge rating +/// @param creature The creature object. +/// @param fCR The challenge rating. +void NWNX_Creature_SetChallengeRating(object creature, float fCR); + +/// @brief Returns the creature's highest attack bonus based on its own stats. +/// @note AB vs. Type and +AB on Gauntlets are excluded +/// @param creature The creature object. +/// @param isMelee +/// * TRUE: Get Melee/Unarmed Attack Bonus +/// * FALSE: Get Ranged Attack Bonus +/// * -1: Get Attack Bonus depending on the weapon creature has equipped in its right hand +/// Defaults to Melee Attack Bonus if weapon is invalid or no weapon +/// @param isTouchAttack If the attack was a touch attack. +/// @param isOffhand If the attack was with the offhand. +/// @param includeBaseAttackBonus Should the result include the base attack bonus. +/// @return The highest attack bonus. +int NWNX_Creature_GetAttackBonus(object creature, int isMelee = -1, int isTouchAttack = FALSE, int isOffhand = FALSE, int includeBaseAttackBonus = TRUE); + +/// @brief Get highest level version of feat possessed by creature. +/// @remark For feats that increment in power, for example, barbarian rage. +/// @param creature The creature object. +/// @param feat The feat id. +/// @return The highest level version of the feat. +int NWNX_Creature_GetHighestLevelOfFeat(object creature, int feat); + +/// @brief Get feat remaining uses. +/// @param creature The creature object. +/// @param feat The feat id. +/// @return The amount of remaining uses. +int NWNX_Creature_GetFeatRemainingUses(object creature, int feat); + +/// @brief Get feat total uses. +/// @param creature The creature object. +/// @param feat The feat id. +/// @return The total uses. +int NWNX_Creature_GetFeatTotalUses(object creature, int feat); + +/// @brief Set feat remaining uses. +/// @param creature The creature object. +/// @param feat The feat id. +/// @param uses The amount of remaining uses. +void NWNX_Creature_SetFeatRemainingUses(object creature, int feat, int uses); + +/// @brief Get total effect bonus +/// @remark This exposes the actual bonus value beyond a player's base scores to attack, damage bonus, saves, +/// skills, ability scores, and touch attack provided by spells, equipment, potions etc. +/// @param creature The creature object. +/// @param bonusType A @ref bonus_types "Bonus Type" +/// @param target A target object. Used to calculate bonuses versus specific races, alignments, etc. +/// @param isElemental If a damage bonus includes elemental damage. +/// @param isForceMax If the bonus should return the maximum possible. +/// @param savetype A SAVING_THROW_* constant. +/// @param saveSpecificType A SAVING_THROW_TYPE_* constant. +/// @param skill A skill id. +/// @param abilityScore An ABILITY_* constant. +/// @param isOffhand Whether the attack is an offhand attack. +/// @return The bonus value. +int NWNX_Creature_GetTotalEffectBonus(object creature, int bonusType=NWNX_CREATURE_BONUS_TYPE_ATTACK, object target=OBJECT_INVALID, int isElemental=0, int isForceMax=0, int savetype=-1, int saveSpecificType=-1, int skill=-1, int abilityScore=-1, int isOffhand=FALSE); + +/// @brief Set the original first or last name of creature +/// @param creature The creature object. +/// @param name The name to give the creature. +/// @param isLastName TRUE to change their last name, FALSE for first. +/// @note For PCs this will persist to the .bic file if saved. Requires a relog to update. +void NWNX_Creature_SetOriginalName(object creature, string name, int isLastName); + +/// @brief Get the original first or last name of creature +/// @param creature The creature object. +/// @param isLastName TRUE to get last name, FALSE for first name. +/// @return The original first or last name of the creature. +string NWNX_Creature_GetOriginalName(object creature, int isLastName); + +/// @brief Set creature's spell resistance +/// @param creature The creature object. +/// @param sr The spell resistance. +/// @warning This setting will be overwritten by effects and once those effects fade the old setting (typically 0) will be set. +void NWNX_Creature_SetSpellResistance(object creature, int sr); + +/// @brief Set creature's animal companion creature type +/// @param creature The master creature object. +/// @param type The type from ANIMAL_COMPANION_CREATURE_TYPE_*. +void NWNX_Creature_SetAnimalCompanionCreatureType(object creature, int type); + +/// @brief Set creature's familiar creature type +/// @param creature The master creature object. +/// @param type The type from FAMILIAR_CREATURE_TYPE_*. +void NWNX_Creature_SetFamiliarCreatureType(object creature, int type); + +/// @brief Set creature's animal companion's name +/// @param creature The master creature object. +/// @param name The name to give their animal companion. +void NWNX_Creature_SetAnimalCompanionName(object creature, string name); + +/// @brief Set creature's familiar's name +/// @param creature The master creature object. +/// @param name The name to give their familiar. +void NWNX_Creature_SetFamiliarName(object creature, string name); + +/// @brief Get whether the creature can be disarmed. +/// @param creature The creature object. +/// @return TRUE if the creature can be disarmed. +int NWNX_Creature_GetDisarmable(object creature); + +/// @brief Set whether a creature can be disarmed. +/// @param creature The creature object. +/// @param disarmable Set to TRUE if the creature can be disarmed. +void NWNX_Creature_SetDisarmable(object creature, int disarmable); + +/// @brief Sets one of creature's domains. +/// @param creature The creature object. +/// @param class The class id from classes.2da. (Not class index 0-2) +/// @param index The first or second domain. +/// @param domain The domain constant to set. +void NWNX_Creature_SetDomain(object creature, int class, int index, int domain); + +/// @brief Sets creature's specialist school. +/// @param creature The creature object. +/// @param class The class id from classes.2da. (Not class index 0-2) +/// @param school The school constant. +void NWNX_Creature_SetSpecialization(object creature, int class, int school); + +/// @brief Sets oCreatures faction to be the faction with id nFactionId. +/// @param oCreature The creature. +/// @param nFactionId The faction id we want the creature to join. +void NWNX_Creature_SetFaction(object oCreature, int nFactionId); + +/// @brief Gets the faction id from oCreature +/// @param oCreature the creature we wish to query against +/// @return faction id as an integer, -1 when used against invalid creature or invalid object. +int NWNX_Creature_GetFaction(object oCreature); + +/// @brief Get whether a creature is flat-footed. +/// @param oCreature The creature object. +/// @return TRUE if the creature is flat-footed. +int NWNX_Creature_GetFlatFooted(object oCreature); + +/// @brief Serialize oCreature's quickbar to a base64 string +/// @param oCreature The creature. +/// @return A base64 string representation of oCreature's quickbar. +string NWNX_Creature_SerializeQuickbar(object oCreature); + +/// @brief Deserialize sSerializedQuickbar for oCreature +/// @param oCreature The creature. +/// @param sSerializedQuickbar A base64 string of a quickbar +/// @return TRUE on success +int NWNX_Creature_DeserializeQuickbar(object oCreature, string sSerializedQuickbar); + +/// @brief Sets a caster level modifier for oCreature +/// @param oCreature the target creature +/// @param nClass the class that this modifier will apply to +/// @param nModifier the modifier to apply +/// @param bPersist whether the modifier should be persisted to the .bic file if applicable +void NWNX_Creature_SetCasterLevelModifier(object oCreature, int nClass, int nModifier, int bPersist = FALSE); + +/// @brief Gets the current caster level modifier for oCreature +/// @param oCreature the target creature +/// @param nClass the creature caster class +/// @return the current caster level modifier for the creature +int NWNX_Creature_GetCasterLevelModifier(object oCreature, int nClass); + +/// @brief Sets a caster level override for oCreature +/// @param oCreature the target creature +/// @param nClass the class that this modifier will apply to +/// @param nCasterLevel the caster level override to apply +/// @param bPersist whether the override should be persisted to the .bic file if applicable +void NWNX_Creature_SetCasterLevelOverride(object oCreature, int nClass, int nCasterLevel, int bPersist = FALSE); + +/// @brief Gets the current caster level override for oCreature +/// @param oCreature the target creature +/// @param nClass the creature caster class +/// @return the current caster level override for the creature or -1 if not set +int NWNX_Creature_GetCasterLevelOverride(object oCreature, int nClass); + +/// @brief Move a creature to limbo. +/// @param oCreature The creature object. +void NWNX_Creature_JumpToLimbo(object oCreature); + +/// @brief Sets the critical hit multiplier modifier for the Creature +/// @param oCreature The target creature +/// @param nModifier The modifier to apply +/// @param nHand 0 for all attacks, 1 for Mainhand, 2 for Offhand +/// @param bPersist Whether the modifier should persist to .bic file if applicable +/// @param nBaseItem Applies the.modifier only when the attack used this baseitem. BASE_ITEM_GLOVES for Unarmed, '-1' for all +/// @note Persistence is activated each server reset by the first use of either 'SetCriticalMultiplier*' functions. Recommended to trigger on a dummy target OnModuleLoad to enable persistence. +void NWNX_Creature_SetCriticalMultiplierModifier(object oCreature, int nModifier, int nHand = 0, int bPersist = FALSE, int nBaseItem = -1); + +/// @brief Gets the critical hit multiplier modifier for the Creature +/// @param oCreature The target creature +/// @param nHand 0 for all attacks, 1 for Mainhand, 2 for Offhand +/// @param nBaseItem The baseitem modifer to retrieve. BASE_ITEM_GLOVES for Unarmed, '-1' for all +/// @return the current critical hit multiplier modifier for the creature +int NWNX_Creature_GetCriticalMultiplierModifier(object oCreature, int nHand = 0, int nBaseItem = -1); + +/// @brief Sets the critical hit multiplier override for the Creature. +/// @param oCreature The target creature +/// @param nOverride The override value to apply. -1 to clear override. +/// @param nHand 0 for all attacks, 1 for Mainhand, 2 for Offhand +/// @param bPersist Whether the modifier should persist to .bic file if applicable +/// @param nBaseItem Applies the.Override only when the attack used this baseitem. BASE_ITEM_GLOVES for Unarmed, '-1' for all +/// @note Persistence is activated each server reset by the first use of either 'SetCriticalMultiplier*' functions. Recommended to trigger on a dummy target OnModuleLoad to enable persistence. +void NWNX_Creature_SetCriticalMultiplierOverride(object oCreature, int nOverride, int nHand = 0, int bPersist = FALSE, int nBaseItem = -1); + +/// @brief Gets the critical hit multiplier override for the Creature +/// @param oCreature The target creature +/// @param nHand 0 for all attacks, 1 for Mainhand, 2 for Offhand +/// @param nBaseItem The baseitem Override to retrieve. BASE_ITEM_GLOVES for Unarmed, '-1' for all +/// @return the current critical hit multiplier override for the creature. No override == -1 +int NWNX_Creature_GetCriticalMultiplierOverride(object oCreature, int nHand = 0, int nBaseItem = -1); + +/// @brief Sets the critical hit range modifier for the creature. +/// @param oCreature The target creature +/// @param nModifier The modifier to apply. Positive modifiers reduce critical chance. (I.e. From 18-20, a +1 results in crit range of 19-20) +/// @param nHand 0 for all attacks, 1 for Mainhand, 2 for Offhand +/// @param bPersist Whether the modifier should persist to .bic file if applicable +/// @param nBaseItem Applies the.modifier only when the attack used this baseitem. BASE_ITEM_GLOVES for Unarmed, '-1' for all +/// @note Persistence is activated each server reset by the first use of either 'SetCriticalRange*' functions. Recommended to trigger on a dummy target OnModuleLoad to enable persistence. +void NWNX_Creature_SetCriticalRangeModifier(object oCreature, int nModifier, int nHand = 0, int bPersist = FALSE, int nBaseItem = -1); + +/// @brief Gets the critical hit range modifier for the creature. +/// @param oCreature The target creature +/// @param nHand 0 for all attacks, 1 for Mainhand, 2 for Offhand +/// @param nBaseItem The baseitem modifer to retrieve. BASE_ITEM_GLOVES for Unarmed, '-1' for all +/// @return the current critical hit range modifier for the creature +int NWNX_Creature_GetCriticalRangeModifier(object oCreature, int nHand = 0, int nBaseItem = -1); + +/// @brief Sets the critical hit range Override for the creature. +/// @param oCreature The target creature +/// @param nOverride The new minimum roll to crit. i.e nOverride of 15 results in crit range of 15-20. -1 to clear override. +/// @param nHand 0 for all attacks, 1 for Mainhand, 2 for Offhand +/// @param bPersist Whether the modifier should persist to .bic file if applicable +/// @param nBaseItem Applies the.Override only when the attack used this baseitem. BASE_ITEM_GLOVES for Unarmed, '-1' for all +/// @note Persistence is activated each server reset by the first use of either 'SetCriticalRange*' functions. Recommended to trigger on a dummy target OnModuleLoad to enable persistence. +void NWNX_Creature_SetCriticalRangeOverride(object oCreature, int nOverride, int nHand = 0, int bPersist = FALSE, int nBaseItem = -1); + +/// @brief Sets the critical hit range Override for the creature. +/// @param oCreature The target creature +/// @param nHand 0 for all attacks, 1 for Mainhand, 2 for Offhand +/// @param nBaseItem The baseitem Override to retrieve. BASE_ITEM_GLOVES for Unarmed, '-1' for all +/// @return the current critical hit range override for the creature. No override == -1 +int NWNX_Creature_GetCriticalRangeOverride(object oCreature, int nHand = 0, int nBaseItem = -1); + +/// @brief Add oAssociate as nAssociateType to oCreature +/// @warning Only basic checks are done so care must be taken when using this function +/// @param oCreature The creature to add oAssociate to +/// @param oAssociate The associate, must be a NPC +/// @param nAssociateType The associate type, one of ASSOCIATE_TYPE_*, except _NONE +void NWNX_Creature_AddAssociate(object oCreature, object oAssociate, int nAssociateType); + +/// @brief Override the damage level of oCreature. +/// @note Damage levels are the damage state under a creature's name, for example: 'Near Death' +/// @param oCreature The target creature. +/// @param nDamageLevel A damage level, see damagelevels.2da. Allowed values: 0-255 or -1 to remove the override. +void NWNX_Creature_OverrideDamageLevel(object oCreature, int nDamageLevel); + +/// @brief Set the encounter source of oCreature. +/// @param oCreature The target creature. +/// @param oEncounter The source encounter +void NWNX_Creature_SetEncounter(object oCreature, object oEncounter); + +/// @brief Get the encounter source of oCreature. +/// @param oCreature The target creature. +/// @return The encounter, OBJECT_INVALID if not part of an encounter or on error +object NWNX_Creature_GetEncounter(object oCreature); + +/// @brief Get if oCreature is currently bartering. +/// @param oCreature The target creature. +/// @return TRUE if oCreature is bartering, FALSE if not or on error. +int NWNX_Creature_GetIsBartering(object oCreature); + +/// @brief Sets caster level for the last item used. Use in a spellhook or spell event before to set caster level for any spells cast from the item. +/// @param oCreature the creature who used the item. +/// @param nCasterLvl the desired caster level. +void NWNX_Creature_SetLastItemCasterLevel(object oCreature, int nCasterLvl); + +/// @brief Gets the caster level of the last item used. +/// @param oCreature the creature who used the item. +/// @return returns the creatures last used item's level. +int NWNX_Creature_GetLastItemCasterLevel(object oCreature); + +/// @brief Gets the Armor classed of attacked against versus +/// @param oAttacked The one being attacked +/// @param oVersus The one doing the attacking +/// @param nTouch TRUE for touch attacks +/// @return -255 on Error, Flat footed AC if oVersus is invalid or the Attacked AC versus oVersus. +int NWNX_Creature_GetArmorClassVersus(object oAttacked, object oVersus, int nTouch=FALSE); + +/// @brief Gets the current walk animation of oCreature. +/// @param oCreature The target creature. +/// @return -1 on Error, otherwise the walk animation number +int NWNX_Creature_GetWalkAnimation(object oCreature); + +/// @brief Sets the current walk animation of oCreature. +/// @param oCreature The target creature. +/// @param nAnimation The walk animation number. +void NWNX_Creature_SetWalkAnimation(object oCreature, int nAnimation); + +/// @brief Changes the attack modifier depending on the dice roll. Used to skip autofail on 1 and autosucceed on 20 as well. +/// @param oCreature The attacking creature, use OBJECT_INVALID for all. +/// @param nRoll The dice roll to modify. +/// @param nModifier The modifier to the attack, use 0 to turn off autofail for 1/autosucceed for 20 with no attack modifier value. +void NWNX_Creature_SetAttackRollOverride(object oCreature, int nRoll, int nModifier); + +/// @brief Works like the tweak but can be turned on and off for all creatures or single ones. +/// @param oCreature The parrying creature, use OBJECT_INVALID for all. +/// @param bParry TRUE to parry all attacks. +/// @note Use this command on_module_load instead of the NWNX_TWEAKS_PARRY_ALL_ATTACKS tweak if using NWNX_Creature_SetAttackRollOverride() +void NWNX_Creature_SetParryAllAttacks(object oCreature, int bParry); + +/// @brief Gets the NoPermanentDeath flag of oCreature. +/// @param oCreature The target creature. +/// @return TRUE/FALSE or -1 on error. +int NWNX_Creature_GetNoPermanentDeath(object oCreature); + +/// @brief Sets the NoPermanentDeath flag of oCreature. +/// @param oCreature The target creature. +/// @param bNoPermanentDeath TRUE/FALSE. +void NWNX_Creature_SetNoPermanentDeath(object oCreature, int bNoPermanentDeath); + +/// @brief Compute a safe location for oCreature. +/// @param oCreature The target creature. +/// @param vPosition The starting position. +/// @param fRadius The search radius around vPosition. +/// @param bWalkStraightLineRequired Whether the creature must be able to walk in a straight line to the position. +/// @return A safe location as vector, will return vPosition if one wasn't found. Returns {0.0, 0.0, 0.0} on error. +vector NWNX_Creature_ComputeSafeLocation(object oCreature, vector vPosition, float fRadius = 20.0f, int bWalkStraightLineRequired = TRUE); + +/// @brief Update oCreature's perception of oTargetCreature. +/// @param oCreature The creature. +/// @param oTargetCreature The target creature. +void NWNX_Creature_DoPerceptionUpdateOnCreature(object oCreature, object oTargetCreature); + +/// @brief Get a creatures personal space (meters from center to non-creature objects). +/// @param oCreature The creature. +/// @return The creatures personal space. +float NWNX_Creature_GetPersonalSpace(object oCreature); + +/// @brief Set a creatures personal space (meters from center to non-creature objects). +/// @param oCreature The creature. +/// @param fPerspace The creatures personal space. +void NWNX_Creature_SetPersonalSpace(object oCreature, float fPerspace); + +/// @brief Get a creatures creature personal space (meters from center to other creatures). +/// @param oCreature The creature. +/// @return The creatures creature personal space. +float NWNX_Creature_GetCreaturePersonalSpace(object oCreature); + +/// @brief Set a creatures creature personal space (meters from center to other creatures). +/// @param oCreature The creature. +/// @param fCrePerspace The creatures creature personal space. +void NWNX_Creature_SetCreaturePersonalSpace(object oCreature, float fCrePerspace); + +/// @brief Get a creatures height. +/// @param oCreature The creature. +/// @return The creatures height. +float NWNX_Creature_GetHeight(object oCreature); + +/// @brief Set a creatures height. +/// @param oCreature The creature. +/// @param fHeight The creatures height. +void NWNX_Creature_SetHeight(object oCreature, float fHeight); + +/// @brief Get a creatures hit distance. +/// @param oCreature The creature. +/// @return The creatures hit distance. +float NWNX_Creature_GetHitDistance(object oCreature); + +/// @brief Set a creatures hit distance. +/// @param oCreature The creature. +/// @param fHitDist The creatures hit distance. +void NWNX_Creature_SetHitDistance(object oCreature, float fHitDist); + +/// @brief Get a creatures preferred attack distance. +/// @param oCreature The creature. +/// @return The creatures preferred attack distance. +float NWNX_Creature_GetPreferredAttackDistance(object oCreature); + +/// @brief Set a creatures preferred attack distance. +/// @param oCreature The creature. +/// @param fPrefAtckDist The creatures preferred attack distance. +void NWNX_Creature_SetPreferredAttackDistance(object oCreature, float fPrefAtckDist); + +/// @brief Get the skill penalty from wearing armor. +/// @param oCreature The creature. +int NWNX_Creature_GetArmorCheckPenalty(object oCreature); + +/// @brief Get the skill penalty from wearing a shield. +/// @param oCreature The creature. +int NWNX_Creature_GetShieldCheckPenalty(object oCreature); + +/// @brief Sets a chance for normal Effect Immunities to be bypassed +/// @param oCreature The affected creature +/// @param nImmunityType 'IMMUNITY_TYPE_*' to bypass. By default affects outgoing effects (oCreature -> another creature). Use a negative (-IMMUNITY_TYPE_*) to affect incoming effects instead (another creature -> oCreature) use 255/-255 to bypass ALL Immunities. +/// @param nChance The chance (of 100%) to bypass the immunity check. A Positive chance results in NOT IMMUNE. A Negative chance results in IMMUNE. +/// @param bPersist Whether the modifier should persist to .bic file (for PCs) +/// @note Persistence is enabled after a server reset by the first use of this function. Recommended to trigger on a dummy target OnModuleLoad to enable persistence. +/// @note Where an Outgoing and Incoming bypass both attempt opposing outcomes, both are ignored and the immunity status without bypass will apply. +void NWNX_Creature_SetBypassEffectImmunity(object oCreature, int nImmunityType, int nChance = 100, int bPersist = FALSE); + +/// @brief Gets a chance for normal Effect Immunities to be bypassed +/// @param oCreature The target creature +/// @param nImmunityType 'IMMUNITY_TYPE_*' to retrieve the current chance for bypass: Positive gets outgoing effects (oCreature -> another creature). Negative (-IMMUNITY_TYPE_*) gets incoming effects (another creature -> oCreature). +/// @return the current critical hit multiplier modifier for the creature +int NWNX_Creature_GetBypassEffectImmunity(object oCreature, int nImmunityType); + +/// @brief Sets the killer of oCreature to oKiller. +/// @param oCreature The target creature. +/// @param oKiller The killer. +void NWNX_Creature_SetLastKiller(object oCreature, object oKiller); + +/// @brief Instantly cast a spell at a target or location. +/// @note oCreature must be in the same area as oTarget or locTarget. +/// @note Does not care if oCreature can't cast spells or doesn't know the spell. Does not consume spell slots. +/// @param oCreature The caster. +/// @param oTarget The target, use OBJECT_INVALID to cast at a location. +/// @param locTarget The location, only used when oTarget is OBJECT_INVALID. +/// @param nSpellID The spell ID. +/// @param nCasterLevel The caster level of the spell. +/// @param fProjectileTime The time in seconds for the projectile to reach the target. 0.0f for no projectile. +/// @param nProjectilePathType A PROJECTILE_PATH_TYPE_* constant. +/// @param nProjectileSpellID An optional spell ID which to use the projectile vfx of. -1 to use nSpellID's projectile vfx. +/// @param oItem The spell cast item retrieved by GetSpellCastItem(). +/// @param sImpactScript The spell impact script. Set to "****"" to not run any impact script. If left blank, will execute nSpellID's impact script. +void NWNX_Creature_DoItemCastSpell(object oCreature, object oTarget, location locTarget, int nSpellID, int nCasterLevel, float fProjectileTime, int nProjectilePathType = PROJECTILE_PATH_TYPE_DEFAULT, int nProjectileSpellID = -1, object oItem = OBJECT_INVALID, string sImpactScript = ""); + +/// @brief Have oCreature instantly equip oItem to nInventorySlot. +/// @param oCreature The creature. +/// @param oItem The item, must be possessed by oCreature. +/// @param nInventorySlot An INVENTORY_SLOT_* constant. +/// @return TRUE on success, FALSE on failure. +int NWNX_Creature_RunEquip(object oCreature, object oItem, int nInventorySlot); + +/// @brief Have oCreature instantly unequip oItem. +/// @param oCreature The creature. +/// @param oItem The item, must be possessed by oCreature. +/// @return TRUE on success, FALSE on failure. +int NWNX_Creature_RunUnequip(object oCreature, object oItem); + +/// @brief Override the elemental projectile visual effect of ranged/throwing weapons. +/// @param oCreature The creature. +/// @param nProjectileVFX A @ref ranged_projectile_vfx "NWNX_CREATURE_PROJECTILE_VFX_*" constant or -1 to remove the override. +/// @param bPersist Whether the vfx should persist to the .bic file (for PCs). +/// @note Persistence is enabled after a server reset by the first use of this function. Recommended to trigger on a dummy target OnModuleLoad to enable persistence. +void NWNX_Creature_OverrideRangedProjectileVFX(object oCreature, int nProjectileVFX, int bPersist = FALSE); + +/// @brief Sets a custom Initiative modifier +/// @param oCreature The affected creature +/// @param nMod The amount to adjust their initiative (+/-). +/// @param bPersist Whether the modifier should persist to .bic file (for PCs) +/// @note Persistence is enabled after a server reset by the first use of this function. Recommended to trigger on a dummy target OnModuleLoad to enable persistence. +/// @warning This modifier takes precedence over an NWNX_Race Initiative modifier; they're not additive +void NWNX_Creature_SetInitiativeModifier(object oCreature, int nMod, int bPersist = FALSE); + +/// @brief Gets the custom Initiative modifier. +/// @param oCreature The target creature +/// @return the current custom initiative modifier for the creature +int NWNX_Creature_GetInitiativeModifier(object oCreature); + +/// @brief Gets the Body Bag of a creature +/// @param oCreature The target creature +/// @return The creatures assigned Body Bag +object NWNX_Creature_GetBodyBag(object oCreature); + +/// @brief Add a cast spell action to oCreature's action queue. +/// @param oCreature The creature casting the spell. +/// @param oTarget The target, to cast at a location use the area as target. +/// @param vTargetLocation The target location. +/// @param nSpellID The spell ID. +/// @param nMultiClass The character class position to cast the spell as. 0 = First Class, 1 = Second Class, 3 = Third Class. To cast a cheat spell use 255 and to cast a special ability use 254. +/// @param nMetaMagic A METAMAGIC_* constant, except METAMAGIC_ANY. +/// @param nDomainLevel The domain level if casting a domain spell. +/// @param nProjectilePathType A PROJECTILE_PATH_TYPE_* constant. +/// @param bInstant TRUE to instantly cast the spell. +/// @param bClearActions TRUE to clear all actions. +/// @param bAddToFront TRUE to add the cast spell action to the front of the action queue. +/// @return TRUE if the action was successfully added to oCreature's action queue. +int NWNX_Creature_AddCastSpellActions(object oCreature, object oTarget, vector vTargetLocation, int nSpellID, int nMultiClass, int nMetaMagic = METAMAGIC_NONE, int nDomainLevel = 0, int nProjectilePathType = PROJECTILE_PATH_TYPE_DEFAULT, int bInstant = FALSE, int bClearActions = FALSE, int bAddToFront = FALSE); + +/// @brief Get whether oCreature is flanking oTargetCreature. +/// @param oCreature The creature object. +/// @param oTargetCreature The target creature object. +/// @return TRUE if oCreature is flanking oTargetCreature. +int NWNX_Creature_GetIsFlanking(object oCreature, object oTargetCreature); + +/// @brief Decrements the remaining spell slots (innate casting) at a class level. +/// @param oCreature The creature object. +/// @param nClass The class id from classes.2da. (Not class index 0-2) +/// @param nSpellLevel The spell level. +void NWNX_Creature_DecrementRemainingSpellSlots(object oCreature, int nClass, int nSpellLevel); + +/// @brief Increments the remaining spell slots (innate casting) at a class level. +/// @param oCreature The creature object. +/// @param nClass The class id from classes.2da. (Not class index 0-2) +/// @param nSpellLevel The spell level. +void NWNX_Creature_IncrementRemainingSpellSlots(object oCreature, int nClass, int nSpellLevel); + +/// @brief Gets the maximum number of bonus attacks a creature can have from EffectModifyAttacks(). +/// @param oCreature The creature. +/// @return The maximum number of bonus attacks or 0 on error. +int NWNX_Creature_GetMaximumBonusAttacks(object oCreature); + +/// @brief Sets the maximum number of bonus attacks a creature can have from EffectModifyAttacks(). +/// @note This function also removes the limit of 5 bonus attacks from EffectModifyAttacks(). +/// @param oCreature The creature. +/// @param nMaxBonusAttacks The maximum number of bonus attacks. Values < 0 will set the limit back to the default of 5. +/// @param bPersist Whether the modifier should persist to .bic file (for PCs). +/// @note Persistence is enabled after a server reset by the first use of this function. Recommended to trigger on a dummy target OnModuleLoad to enable persistence. +void NWNX_Creature_SetMaximumBonusAttacks(object oCreature, int nMaxBonusAttacks, int bPersist = FALSE); + +/// @brief Inserts a cleave or great cleave attack into oCreature's current attack round against the nearest enemy within melee reach. +/// @param oCreature The creature object. +/// @note oCreature must have the cleave or great cleave feats, must be in combat, and must have available attacks remaining in their combat round to use for cleave attack. +void NWNX_Creature_DoCleaveAttack(object oCreature); + +/// @brief Gets the current object oCreature's orientation is locked to. +/// @param oCreature The creature object. +/// @return The object oCreature's orientation is locked to, or OBJECT_INVALID if oCreature's orientation is not locked. +object NWNX_Creature_GetLockOrientationToObject(object oCreature); + +/// @brief Locks oCreature's orientation to always face oTarget. +/// @param oCreature The creature object. +/// @param oTarget The target to lock oCreature's orientation to. Use OBJECT_INVALID to remove the orientation lock. +void NWNX_Creature_SetLockOrientationToObject(object oCreature, object oTarget); + +/// @brief Causes oCreature to broadcast an Attack of Opportunity against themself. +/// @param oCreature The creature object. +/// @param oSingleCreature A single creature to broadcast the Attack of Opporunity to. Use OBJECT_INVALID to broadcast to all nearby enemies. +/// @param bMovement Whether the Attack of Opportunity was caused by movement. +void NWNX_Creature_BroadcastAttackOfOpportunity(object oCreature, object oSingleCreature = OBJECT_INVALID, int bMovement = FALSE); + +/// @brief Returns the maximum price oStore will buy items from oCreature for. +/// @param oCreature The creature object. +/// @param oStore The store object. +/// @return The max buy price override. -1 = No maximum buy price, -2 = No override set. +int NWNX_Creature_GetMaxSellToStorePriceOverride(object oCreature, object oStore); + +/// @brief Overrides the maximum price oStore will buy items from oCreature for. +/// @param oCreature The creature object. +/// @param oStore The store object. +/// @param nMaxSellToPrice The maximum buy price override. -1 = No maximum buy price, -2 = Remove the override. +void NWNX_Creature_SetMaxSellToStorePriceOverride(object oCreature, object oStore, int nMaxSellToPrice); + +/// @brief Returns the creature's ability increase for nLevel. +/// @param oCreature The creature object. +/// @param nLevel The level. +/// @return An ABILITY_* constant, NWNX_CREATURE_ABILITY_NONE or -1 on error +int NWNX_Creature_GetAbilityIncreaseByLevel(object oCreature, int nLevel); + +/// @brief Sets the creature's ability increase for nLevel. +/// @param oCreature The creature object. +/// @param nLevel The level. +/// @param nAbility ABILITY_* constant or NWNX_CREATURE_ABILITY_NONE +void NWNX_Creature_SetAbilityIncreaseByLevel(object oCreature, int nLevel, int nAbility); + +/// @brief Returns the creature's maximum attack range to a target +/// @param oCreature The creature object. +/// @param oTarget The target to get the maximum attack range to +/// @return The maximum attack range for oCreature to oTarget +float NWNX_Creature_GetMaxAttackRange(object oCreature, object oTarget); + +/// @} + +void NWNX_Creature_AddFeat(object creature, int feat) +{ + string sFunc = "AddFeat"; + NWNX_PushArgumentInt(feat); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +void NWNX_Creature_AddFeatByLevel(object creature, int feat, int level) +{ + string sFunc = "AddFeatByLevel"; + + NWNX_PushArgumentInt(level); + NWNX_PushArgumentInt(feat); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +void NWNX_Creature_RemoveFeat(object creature, int feat) +{ + string sFunc = "RemoveFeat"; + NWNX_PushArgumentInt(feat); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +void NWNX_Creature_RemoveFeatByLevel(object creature, int feat, int level) +{ + string sFunc = "RemoveFeatByLevel"; + + NWNX_PushArgumentInt(level); + NWNX_PushArgumentInt(feat); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +int NWNX_Creature_GetKnowsFeat(object creature, int feat) +{ + string sFunc = "GetKnowsFeat"; + + NWNX_PushArgumentInt(feat); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueInt(); +} + +int NWNX_Creature_GetFeatCountByLevel(object creature, int level) +{ + string sFunc = "GetFeatCountByLevel"; + + NWNX_PushArgumentInt(level); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueInt(); +} + +int NWNX_Creature_GetFeatByLevel(object creature, int level, int index) +{ + string sFunc = "GetFeatByLevel"; + + NWNX_PushArgumentInt(index); + NWNX_PushArgumentInt(level); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueInt(); +} + +int NWNX_Creature_GetFeatCount(object creature) +{ + string sFunc = "GetFeatCount"; + + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueInt(); +} + +int NWNX_Creature_GetFeatGrantLevel(object creature, int feat) +{ + string sFunc = "GetFeatGrantLevel"; + + NWNX_PushArgumentInt(feat); + NWNX_PushArgumentObject(creature); + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueInt(); +} + +int NWNX_Creature_GetFeatByIndex(object creature, int index) +{ + string sFunc = "GetFeatByIndex"; + + NWNX_PushArgumentInt(index); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueInt(); +} + +int NWNX_Creature_GetMeetsFeatRequirements(object creature, int feat) +{ + string sFunc = "GetMeetsFeatRequirements"; + + NWNX_PushArgumentInt(feat); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueInt(); +} + +struct NWNX_Creature_SpecialAbility NWNX_Creature_GetSpecialAbility(object creature, int index) +{ + string sFunc = "GetSpecialAbility"; + + struct NWNX_Creature_SpecialAbility ability; + + NWNX_PushArgumentInt(index); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); + + ability.level = NWNX_GetReturnValueInt(); + ability.ready = NWNX_GetReturnValueInt(); + ability.id = NWNX_GetReturnValueInt(); + + return ability; +} + +int NWNX_Creature_GetSpecialAbilityCount(object creature) +{ + string sFunc = "GetSpecialAbilityCount"; + + NWNX_PushArgumentObject(creature); + NWNX_CallFunction(NWNX_Creature, sFunc); + + return NWNX_GetReturnValueInt(); +} + +void NWNX_Creature_AddSpecialAbility(object creature, struct NWNX_Creature_SpecialAbility ability) +{ + string sFunc = "AddSpecialAbility"; + + NWNX_PushArgumentInt(ability.id); + NWNX_PushArgumentInt(ability.ready); + NWNX_PushArgumentInt(ability.level); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +void NWNX_Creature_RemoveSpecialAbility(object creature, int index) +{ + string sFunc = "RemoveSpecialAbility"; + + NWNX_PushArgumentInt(index); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +void NWNX_Creature_SetSpecialAbility(object creature, int index, struct NWNX_Creature_SpecialAbility ability) +{ + string sFunc = "SetSpecialAbility"; + + NWNX_PushArgumentInt(ability.id); + NWNX_PushArgumentInt(ability.ready); + NWNX_PushArgumentInt(ability.level); + NWNX_PushArgumentInt(index); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +int NWNX_Creature_GetClassByLevel(object creature, int level) +{ + string sFunc = "GetClassByLevel"; + + NWNX_PushArgumentInt(level); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueInt(); +} + +void NWNX_Creature_SetBaseAC(object creature, int ac) +{ + string sFunc = "SetBaseAC"; + + NWNX_PushArgumentInt(ac); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +int NWNX_Creature_GetBaseAC(object creature) +{ + string sFunc = "GetBaseAC"; + + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueInt(); +} + +void NWNX_Creature_SetRawAbilityScore(object creature, int ability, int value) +{ + string sFunc = "SetRawAbilityScore"; + + NWNX_PushArgumentInt(value); + NWNX_PushArgumentInt(ability); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +int NWNX_Creature_GetRawAbilityScore(object creature, int ability) +{ + string sFunc = "GetRawAbilityScore"; + + NWNX_PushArgumentInt(ability); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueInt(); +} + +void NWNX_Creature_ModifyRawAbilityScore(object creature, int ability, int modifier) +{ + string sFunc = "ModifyRawAbilityScore"; + + NWNX_PushArgumentInt(modifier); + NWNX_PushArgumentInt(ability); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +int NWNX_Creature_GetPrePolymorphAbilityScore(object creature, int ability) +{ + string sFunc = "GetPrePolymorphAbilityScore"; + + NWNX_PushArgumentInt(ability); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueInt(); +} + +int NWNX_Creature_GetRemainingSpellSlots(object creature, int class, int level) +{ + string sFunc = "GetRemainingSpellSlots"; + + NWNX_PushArgumentInt(level); + NWNX_PushArgumentInt(class); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueInt(); +} + +void NWNX_Creature_SetRemainingSpellSlots(object creature, int class, int level, int slots) +{ + string sFunc = "SetRemainingSpellSlots"; + + NWNX_PushArgumentInt(slots); + NWNX_PushArgumentInt(level); + NWNX_PushArgumentInt(class); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +void NWNX_Creature_RemoveKnownSpell(object creature, int class, int level, int spellId) +{ + string sFunc = "RemoveKnownSpell"; + + NWNX_PushArgumentInt(spellId); + NWNX_PushArgumentInt(level); + NWNX_PushArgumentInt(class); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +void NWNX_Creature_AddKnownSpell(object creature, int class, int level, int spellId) +{ + string sFunc = "AddKnownSpell"; + + NWNX_PushArgumentInt(spellId); + NWNX_PushArgumentInt(level); + NWNX_PushArgumentInt(class); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +int NWNX_Creature_GetMaxSpellSlots(object creature, int class, int level) +{ + string sFunc = "GetMaxSpellSlots"; + + NWNX_PushArgumentInt(level); + NWNX_PushArgumentInt(class); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueInt(); +} + + +int NWNX_Creature_GetMaxHitPointsByLevel(object creature, int level) +{ + string sFunc = "GetMaxHitPointsByLevel"; + + NWNX_PushArgumentInt(level); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueInt(); +} + +void NWNX_Creature_SetMaxHitPointsByLevel(object creature, int level, int value) +{ + string sFunc = "SetMaxHitPointsByLevel"; + + NWNX_PushArgumentInt(value); + NWNX_PushArgumentInt(level); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +void NWNX_Creature_SetMovementRate(object creature, int rate) +{ + string sFunc = "SetMovementRate"; + + NWNX_PushArgumentInt(rate); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +float NWNX_Creature_GetMovementRateFactor(object creature) +{ + string sFunc = "GetMovementRateFactor"; + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueFloat(); +} + +void NWNX_Creature_SetMovementRateFactor(object creature, float factor) +{ + string sFunc = "SetMovementRateFactor"; + + NWNX_PushArgumentFloat(factor); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +float NWNX_Creature_GetMovementRateFactorCap(object creature) +{ + string sFunc = "GetMovementRateFactorCap"; + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueFloat(); +} + +void NWNX_Creature_SetMovementRateFactorCap(object creature, float cap) +{ + string sFunc = "SetMovementRateFactorCap"; + + NWNX_PushArgumentFloat(cap); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +void NWNX_Creature_SetAlignmentGoodEvil(object creature, int value) +{ + string sFunc = "SetAlignmentGoodEvil"; + + NWNX_PushArgumentInt(value); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +void NWNX_Creature_SetAlignmentLawChaos(object creature, int value) +{ + string sFunc = "SetAlignmentLawChaos"; + + NWNX_PushArgumentInt(value); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +void NWNX_Creature_SetSkillRank(object creature, int skill, int rank) +{ + string sFunc = "SetSkillRank"; + NWNX_PushArgumentInt(rank); + NWNX_PushArgumentInt(skill); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +int NWNX_Creature_GetSkillRankByLevel(object creature, int skill, int level) +{ + string sFunc = "GetSkillRankByLevel"; + + NWNX_PushArgumentInt(level); + NWNX_PushArgumentInt(skill); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueInt(); +} + +void NWNX_Creature_SetSkillRankByLevel(object creature, int skill, int rank, int level) +{ + string sFunc = "SetSkillRankByLevel"; + + NWNX_PushArgumentInt(level); + NWNX_PushArgumentInt(rank); + NWNX_PushArgumentInt(skill); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +void NWNX_Creature_SetClassByPosition(object creature, int position, int classID, int bUpdateLevels = TRUE) +{ + string sFunc = "SetClassByPosition"; + NWNX_PushArgumentInt(bUpdateLevels); + NWNX_PushArgumentInt(classID); + NWNX_PushArgumentInt(position); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +void NWNX_Creature_SetLevelByPosition(object creature, int position, int level) +{ + string sFunc = "SetLevelByPosition"; + NWNX_PushArgumentInt(level); + NWNX_PushArgumentInt(position); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +void NWNX_Creature_SetBaseAttackBonus(object creature, int bab) +{ + string sFunc = "SetBaseAttackBonus"; + NWNX_PushArgumentInt(bab); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +int NWNX_Creature_GetAttacksPerRound(object creature, int bBaseAPR = FALSE) +{ + string sFunc = "GetAttacksPerRound"; + NWNX_PushArgumentInt(bBaseAPR); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueInt(); +} + +void NWNX_Creature_RestoreFeats(object creature) +{ + string sFunc = "RestoreFeats"; + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +void NWNX_Creature_RestoreSpecialAbilities(object creature) +{ + string sFunc = "RestoreSpecialAbilities"; + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +void NWNX_Creature_RestoreItems(object creature) +{ + string sFunc = "RestoreItems"; + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +void NWNX_Creature_SetSize(object creature, int size) +{ + string sFunc = "SetSize"; + NWNX_PushArgumentInt(size); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +int NWNX_Creature_GetSkillPointsRemaining(object creature) +{ + string sFunc = "GetSkillPointsRemaining"; + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueInt(); +} + + +void NWNX_Creature_SetSkillPointsRemaining(object creature, int skillpoints) +{ + string sFunc = "SetSkillPointsRemaining"; + NWNX_PushArgumentInt(skillpoints); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +int NWNX_Creature_GetSkillPointsRemainingByLevel(object creature, int level) +{ + string sFunc = "GetSkillPointsRemainingByLevel"; + + NWNX_PushArgumentInt(level); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueInt(); +} + +void NWNX_Creature_SetSkillPointsRemainingByLevel(object creature, int level, int value) +{ + string sFunc = "SetSkillPointsRemainingByLevel"; + + NWNX_PushArgumentInt(value); + NWNX_PushArgumentInt(level); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +void NWNX_Creature_SetRacialType(object creature, int racialtype) +{ + string sFunc = "SetRacialType"; + NWNX_PushArgumentInt(racialtype); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +int NWNX_Creature_GetMovementType(object creature) +{ + string sFunc = "GetMovementType"; + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueInt(); +} + +void NWNX_Creature_SetWalkRateCap(object creature, float fWalkRate = 2000.0f) +{ + string sFunc = "SetWalkRateCap"; + NWNX_PushArgumentFloat(fWalkRate); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +void NWNX_Creature_SetGold(object creature, int gold) +{ + string sFunc = "SetGold"; + NWNX_PushArgumentInt(gold); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +void NWNX_Creature_SetCorpseDecayTime(object creature, int nDecayTime) +{ + string sFunc = "SetCorpseDecayTime"; + NWNX_PushArgumentInt(nDecayTime); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + + +int NWNX_Creature_GetBaseSavingThrow(object creature, int which) +{ + string sFunc = "GetBaseSavingThrow"; + NWNX_PushArgumentInt(which); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueInt(); +} + +void NWNX_Creature_SetBaseSavingThrow(object creature, int which, int value) +{ + string sFunc = "SetBaseSavingThrow"; + NWNX_PushArgumentInt(value); + NWNX_PushArgumentInt(which); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +void NWNX_Creature_LevelUp(object creature, int class, int count = 1, int package = PACKAGE_INVALID) +{ + string sFunc = "LevelUp"; + NWNX_PushArgumentInt(package); + NWNX_PushArgumentInt(count); + NWNX_PushArgumentInt(class); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +void NWNX_Creature_LevelDown(object creature, int count=1) +{ + string sFunc = "LevelDown"; + NWNX_PushArgumentInt(count); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +void NWNX_Creature_SetChallengeRating(object creature, float fCR) +{ + string sFunc = "SetChallengeRating"; + NWNX_PushArgumentFloat(fCR); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +int NWNX_Creature_GetAttackBonus(object creature, int isMelee = -1, int isTouchAttack = FALSE, int isOffhand = FALSE, int includeBaseAttackBonus = TRUE) +{ + string sFunc = "GetAttackBonus"; + + if (isMelee == -1) + { + object oWeapon = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, creature); + + if (GetIsObjectValid(oWeapon)) + { + isMelee = !GetWeaponRanged(oWeapon); + } + else + {// Default to melee for unarmed + isMelee = TRUE; + } + } + + NWNX_PushArgumentInt(includeBaseAttackBonus); + NWNX_PushArgumentInt(isOffhand); + NWNX_PushArgumentInt(isTouchAttack); + NWNX_PushArgumentInt(isMelee); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueInt(); +} + +int NWNX_Creature_GetHighestLevelOfFeat(object creature, int feat) +{ + string sFunc = "GetHighestLevelOfFeat"; + + NWNX_PushArgumentInt(feat); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueInt(); +} + +int NWNX_Creature_GetFeatRemainingUses(object creature, int feat) +{ + string sFunc = "GetFeatRemainingUses"; + + NWNX_PushArgumentInt(feat); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueInt(); +} + +int NWNX_Creature_GetFeatTotalUses(object creature, int feat) +{ + string sFunc = "GetFeatTotalUses"; + + NWNX_PushArgumentInt(feat); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueInt(); +} + +void NWNX_Creature_SetFeatRemainingUses(object creature, int feat, int uses) +{ + string sFunc = "SetFeatRemainingUses"; + + NWNX_PushArgumentInt(uses); + NWNX_PushArgumentInt(feat); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +int NWNX_Creature_GetTotalEffectBonus(object creature, int bonusType=NWNX_CREATURE_BONUS_TYPE_ATTACK, object target=OBJECT_INVALID, int isElemental=0, int isForceMax=0, int savetype=-1, int saveSpecificType=-1, int skill=-1, int abilityScore=-1, int isOffhand=FALSE) +{ + string sFunc = "GetTotalEffectBonus"; + + NWNX_PushArgumentInt(isOffhand); + NWNX_PushArgumentInt(abilityScore); + NWNX_PushArgumentInt(skill); + NWNX_PushArgumentInt(saveSpecificType); + NWNX_PushArgumentInt(savetype); + NWNX_PushArgumentInt(isForceMax); + NWNX_PushArgumentInt(isElemental); + NWNX_PushArgumentObject(target); + NWNX_PushArgumentInt(bonusType); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueInt(); +} + +void NWNX_Creature_SetOriginalName(object creature, string name, int isLastName) +{ + string sFunc = "SetOriginalName"; + + NWNX_PushArgumentInt(isLastName); + NWNX_PushArgumentString(name); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +string NWNX_Creature_GetOriginalName(object creature, int isLastName) +{ + string sFunc = "GetOriginalName"; + + NWNX_PushArgumentInt(isLastName); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueString(); +} + +void NWNX_Creature_SetSpellResistance(object creature, int sr) +{ + string sFunc = "SetSpellResistance"; + + NWNX_PushArgumentInt(sr); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +void NWNX_Creature_SetAnimalCompanionCreatureType(object creature, int type) +{ + string sFunc = "SetAnimalCompanionCreatureType"; + + NWNX_PushArgumentInt(type); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +void NWNX_Creature_SetFamiliarCreatureType(object creature, int type) +{ + string sFunc = "SetFamiliarCreatureType"; + + NWNX_PushArgumentInt(type); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +void NWNX_Creature_SetAnimalCompanionName(object creature, string name) +{ + string sFunc = "SetAnimalCompanionName"; + + NWNX_PushArgumentString(name); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +void NWNX_Creature_SetFamiliarName(object creature, string name) +{ + string sFunc = "SetFamiliarName"; + + NWNX_PushArgumentString(name); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +int NWNX_Creature_GetDisarmable(object creature) +{ + string sFunc = "GetDisarmable"; + + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueInt(); +} + +void NWNX_Creature_SetDisarmable(object creature, int disarmable) +{ + string sFunc = "SetDisarmable"; + + NWNX_PushArgumentInt(disarmable); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +void NWNX_Creature_SetDomain(object creature, int class, int index, int domain) +{ + string sFunc = "SetDomain"; + + NWNX_PushArgumentInt(domain); + NWNX_PushArgumentInt(index); + NWNX_PushArgumentInt(class); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +void NWNX_Creature_SetSpecialization(object creature, int class, int school) +{ + string sFunc = "SetSpecialization"; + + NWNX_PushArgumentInt(school); + NWNX_PushArgumentInt(class); + NWNX_PushArgumentObject(creature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +void NWNX_Creature_SetFaction(object oCreature, int nFactionId) +{ + string sFunc = "SetFaction"; + NWNX_PushArgumentInt(nFactionId); + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +int NWNX_Creature_GetFaction(object oCreature) +{ + string sFunc = "GetFaction"; + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueInt(); +} + +int NWNX_Creature_GetFlatFooted(object oCreature) +{ + string sFunc = "GetFlatFooted"; + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueInt(); +} + +string NWNX_Creature_SerializeQuickbar(object oCreature) +{ + string sFunc = "SerializeQuickbar"; + + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); + + return NWNX_GetReturnValueString(); +} + +int NWNX_Creature_DeserializeQuickbar(object oCreature, string sSerializedQuickbar) +{ + string sFunc = "DeserializeQuickbar"; + + NWNX_PushArgumentString(sSerializedQuickbar); + NWNX_PushArgumentObject(oCreature); + + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueInt(); +} + +void NWNX_Creature_SetCasterLevelModifier(object oCreature, int nClass, int nModifier, int bPersist = FALSE) +{ + string sFunc = "SetCasterLevelModifier"; + + NWNX_PushArgumentInt(bPersist); + NWNX_PushArgumentInt(nModifier); + NWNX_PushArgumentInt(nClass); + NWNX_PushArgumentObject(oCreature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +int NWNX_Creature_GetCasterLevelModifier(object oCreature, int nClass) +{ + string sFunc = "GetCasterLevelModifier"; + + NWNX_PushArgumentInt(nClass); + NWNX_PushArgumentObject(oCreature); + + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueInt(); +} + +void NWNX_Creature_SetCasterLevelOverride(object oCreature, int nClass, int nCasterLevel, int bPersist = FALSE) +{ + string sFunc = "SetCasterLevelOverride"; + + NWNX_PushArgumentInt(bPersist); + NWNX_PushArgumentInt(nCasterLevel); + NWNX_PushArgumentInt(nClass); + NWNX_PushArgumentObject(oCreature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +int NWNX_Creature_GetCasterLevelOverride(object oCreature, int nClass) +{ + string sFunc = "GetCasterLevelOverride"; + + NWNX_PushArgumentInt(nClass); + NWNX_PushArgumentObject(oCreature); + + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueInt(); +} + +void NWNX_Creature_JumpToLimbo(object oCreature) +{ + string sFunc = "JumpToLimbo"; + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +void NWNX_Creature_SetCriticalMultiplierModifier(object oCreature, int nModifier, int nHand = 0, int bPersist = FALSE, int nBaseItem = -1) +{ + string sFunc = "SetCriticalMultiplierModifier"; + + NWNX_PushArgumentInt(nBaseItem); + NWNX_PushArgumentInt(bPersist); + NWNX_PushArgumentInt(nHand); + NWNX_PushArgumentInt(nModifier); + NWNX_PushArgumentObject(oCreature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +int NWNX_Creature_GetCriticalMultiplierModifier(object oCreature, int nHand = 0, int nBaseItem = -1) +{ + string sFunc = "GetCriticalMultiplierModifier"; + + NWNX_PushArgumentInt(nBaseItem); + NWNX_PushArgumentInt(nHand); + NWNX_PushArgumentObject(oCreature); + + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueInt(); +} + +void NWNX_Creature_SetCriticalMultiplierOverride(object oCreature, int nOverride, int nHand = 0, int bPersist = FALSE, int nBaseItem = -1) +{ + string sFunc = "SetCriticalMultiplierOverride"; + + NWNX_PushArgumentInt(nBaseItem); + NWNX_PushArgumentInt(bPersist); + NWNX_PushArgumentInt(nHand); + NWNX_PushArgumentInt(nOverride); + NWNX_PushArgumentObject(oCreature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +int NWNX_Creature_GetCriticalMultiplierOverride(object oCreature, int nHand = 0, int nBaseItem = -1) +{ + string sFunc = "GetCriticalMultiplierOverride"; + + NWNX_PushArgumentInt(nBaseItem); + NWNX_PushArgumentInt(nHand); + NWNX_PushArgumentObject(oCreature); + + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueInt(); +} + +void NWNX_Creature_SetCriticalRangeModifier(object oCreature, int nModifier, int nHand = 0, int bPersist = FALSE, int nBaseItem = -1) +{ + string sFunc = "SetCriticalRangeModifier"; + + NWNX_PushArgumentInt(nBaseItem); + NWNX_PushArgumentInt(bPersist); + NWNX_PushArgumentInt(nHand); + NWNX_PushArgumentInt(nModifier); + NWNX_PushArgumentObject(oCreature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +int NWNX_Creature_GetCriticalRangeModifier(object oCreature, int nHand = 0, int nBaseItem = -1) +{ + string sFunc = "GetCriticalRangeModifier"; + + NWNX_PushArgumentInt(nBaseItem); + NWNX_PushArgumentInt(nHand); + NWNX_PushArgumentObject(oCreature); + + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueInt(); +} + +void NWNX_Creature_SetCriticalRangeOverride(object oCreature, int nOverride, int nHand = 0, int bPersist = FALSE, int nBaseItem = -1) +{ + string sFunc = "SetCriticalRangeOverride"; + + NWNX_PushArgumentInt(nBaseItem); + NWNX_PushArgumentInt(bPersist); + NWNX_PushArgumentInt(nHand); + NWNX_PushArgumentInt(nOverride); + NWNX_PushArgumentObject(oCreature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +int NWNX_Creature_GetCriticalRangeOverride(object oCreature, int nHand = 0, int nBaseItem = -1) +{ + string sFunc = "GetCriticalRangeOverride"; + + NWNX_PushArgumentInt(nBaseItem); + NWNX_PushArgumentInt(nHand); + NWNX_PushArgumentObject(oCreature); + + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueInt(); +} + +void NWNX_Creature_AddAssociate(object oCreature, object oAssociate, int nAssociateType) +{ + string sFunc = "AddAssociate"; + + NWNX_PushArgumentInt(nAssociateType); + NWNX_PushArgumentObject(oAssociate); + NWNX_PushArgumentObject(oCreature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +void NWNX_Creature_OverrideDamageLevel(object oCreature, int nDamageLevel) +{ + string sFunc = "OverrideDamageLevel"; + + NWNX_PushArgumentInt(nDamageLevel); + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +void NWNX_Creature_SetEncounter(object oCreature, object oEncounter) +{ + string sFunc = "SetEncounter"; + + NWNX_PushArgumentObject(oEncounter); + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +object NWNX_Creature_GetEncounter(object oCreature) +{ + string sFunc = "GetEncounter"; + + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); + + return NWNX_GetReturnValueObject(); +} + +int NWNX_Creature_GetIsBartering(object oCreature) +{ + string sFunc = "GetIsBartering"; + + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); + + return NWNX_GetReturnValueInt(); +} + +void NWNX_Creature_SetLastItemCasterLevel(object oCreature, int nCasterLvl) +{ + string sFunc = "SetLastItemCasterLevel"; + NWNX_PushArgumentInt(nCasterLvl); + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); +} + + +int NWNX_Creature_GetLastItemCasterLevel(object oCreature) +{ + string sFunc = "GetLastItemCasterLevel"; + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); + + return NWNX_GetReturnValueInt(); +} + +int NWNX_Creature_GetArmorClassVersus(object oAttacked, object oVersus, int nTouch=FALSE) +{ + string sFunc = "GetArmorClassVersus"; + NWNX_PushArgumentInt(nTouch); + NWNX_PushArgumentObject(oVersus); + NWNX_PushArgumentObject(oAttacked); + NWNX_CallFunction(NWNX_Creature, sFunc); + + return NWNX_GetReturnValueInt(); +} + +int NWNX_Creature_GetWalkAnimation(object oCreature) +{ + string sFunc = "GetWalkAnimation"; + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); + + return NWNX_GetReturnValueInt(); +} + +void NWNX_Creature_SetWalkAnimation(object oCreature, int nAnimation) +{ + string sFunc = "SetWalkAnimation"; + NWNX_PushArgumentInt(nAnimation); + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +void NWNX_Creature_SetAttackRollOverride(object oCreature, int nRoll, int nModifier) +{ + string sFunc = "SetAttackRollOverride"; + NWNX_PushArgumentInt(nModifier); + NWNX_PushArgumentInt(nRoll); + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +void NWNX_Creature_SetParryAllAttacks(object oCreature, int bParry) +{ + string sFunc = "SetParryAllAttacks"; + NWNX_PushArgumentInt(bParry); + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +int NWNX_Creature_GetNoPermanentDeath(object oCreature) +{ + string sFunc = "GetNoPermanentDeath"; + + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); + + return NWNX_GetReturnValueInt(); +} + +void NWNX_Creature_SetNoPermanentDeath(object oCreature, int bNoPermanentDeath) +{ + string sFunc = "SetNoPermanentDeath"; + + NWNX_PushArgumentInt(bNoPermanentDeath); + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +vector NWNX_Creature_ComputeSafeLocation(object oCreature, vector vPosition, float fRadius = 20.0f, int bWalkStraightLineRequired = TRUE) +{ + string sFunc = "ComputeSafeLocation"; + + NWNX_PushArgumentInt(bWalkStraightLineRequired); + NWNX_PushArgumentFloat(fRadius); + NWNX_PushArgumentFloat(vPosition.x); + NWNX_PushArgumentFloat(vPosition.y); + NWNX_PushArgumentFloat(vPosition.z); + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); + + vector v; + v.z = NWNX_GetReturnValueFloat(); + v.y = NWNX_GetReturnValueFloat(); + v.x = NWNX_GetReturnValueFloat(); + + return v; +} + +void NWNX_Creature_DoPerceptionUpdateOnCreature(object oCreature, object oTargetCreature) +{ + string sFunc = "DoPerceptionUpdateOnCreature"; + + NWNX_PushArgumentObject(oTargetCreature); + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +float NWNX_Creature_GetPersonalSpace(object oCreature) +{ + string sFunc = "GetPersonalSpace"; + + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); + + return NWNX_GetReturnValueFloat(); +} + +void NWNX_Creature_SetPersonalSpace(object oCreature, float fPerspace) +{ + string sFunc = "SetPersonalSpace"; + + NWNX_PushArgumentFloat(fPerspace); + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +float NWNX_Creature_GetCreaturePersonalSpace(object oCreature) +{ + string sFunc = "GetCreaturePersonalSpace"; + + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); + + return NWNX_GetReturnValueFloat(); +} + +void NWNX_Creature_SetCreaturePersonalSpace(object oCreature, float fCrePerspace) +{ + string sFunc = "SetCreaturePersonalSpace"; + + NWNX_PushArgumentFloat(fCrePerspace); + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +float NWNX_Creature_GetHeight(object oCreature) +{ + string sFunc = "GetHeight"; + + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); + + return NWNX_GetReturnValueFloat(); +} + +void NWNX_Creature_SetHeight(object oCreature, float fHeight) +{ + string sFunc = "SetHeight"; + + NWNX_PushArgumentFloat(fHeight); + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +float NWNX_Creature_GetHitDistance(object oCreature) +{ + string sFunc = "GetHitDistance"; + + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); + + return NWNX_GetReturnValueFloat(); +} + +void NWNX_Creature_SetHitDistance(object oCreature, float fHitDist) +{ + string sFunc = "SetHitDistance"; + + NWNX_PushArgumentFloat(fHitDist); + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +float NWNX_Creature_GetPreferredAttackDistance(object oCreature) +{ + string sFunc = "GetPreferredAttackDistance"; + + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); + + return NWNX_GetReturnValueFloat(); +} + +void NWNX_Creature_SetPreferredAttackDistance(object oCreature, float fPrefAtckDist) +{ + string sFunc = "SetPreferredAttackDistance"; + + NWNX_PushArgumentFloat(fPrefAtckDist); + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +int NWNX_Creature_GetArmorCheckPenalty(object oCreature) +{ + string sFunc = "GetArmorCheckPenalty"; + + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueInt(); +} + +int NWNX_Creature_GetShieldCheckPenalty(object oCreature) +{ + string sFunc = "GetShieldCheckPenalty"; + + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueInt(); +} + +void NWNX_Creature_SetBypassEffectImmunity(object oCreature, int nImmunityType, int nChance = 100, int bPersist = FALSE) +{ + string sFunc = "SetBypassEffectImmunity"; + + NWNX_PushArgumentInt(bPersist); + NWNX_PushArgumentInt(nChance); + NWNX_PushArgumentInt(nImmunityType); + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +int NWNX_Creature_GetBypassEffectImmunity(object oCreature, int nImmunityType) +{ + string sFunc = "GetBypassEffectImmunity"; + + NWNX_PushArgumentInt(nImmunityType); + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueInt(); +} + +void NWNX_Creature_SetLastKiller(object oCreature, object oKiller) +{ + string sFunc = "SetLastKiller"; + + NWNX_PushArgumentObject(oKiller); + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +void NWNX_Creature_DoItemCastSpell(object oCreature, object oTarget, location locTarget, int nSpellID, int nCasterLevel, float fProjectileTime, int nProjectilePathType = PROJECTILE_PATH_TYPE_DEFAULT, int nProjectileSpellID = -1, object oItem = OBJECT_INVALID, string sImpactScript = "") +{ + string sFunc = "DoItemCastSpell"; + + object oArea = GetAreaFromLocation(locTarget); + vector vPosition = GetPositionFromLocation(locTarget); + + NWNX_PushArgumentString(sImpactScript); + NWNX_PushArgumentObject(oItem); + NWNX_PushArgumentInt(nProjectileSpellID); + NWNX_PushArgumentInt(nProjectilePathType); + NWNX_PushArgumentFloat(fProjectileTime); + NWNX_PushArgumentInt(nCasterLevel); + NWNX_PushArgumentInt(nSpellID); + NWNX_PushArgumentFloat(vPosition.z); + NWNX_PushArgumentFloat(vPosition.y); + NWNX_PushArgumentFloat(vPosition.x); + NWNX_PushArgumentObject(oArea); + NWNX_PushArgumentObject(oTarget); + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +int NWNX_Creature_RunEquip(object oCreature, object oItem, int nInventorySlot) +{ + string sFunc = "RunEquip"; + + NWNX_PushArgumentInt(nInventorySlot); + NWNX_PushArgumentObject(oItem); + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); + + return NWNX_GetReturnValueInt(); +} + +int NWNX_Creature_RunUnequip(object oCreature, object oItem) +{ + string sFunc = "RunUnequip"; + + NWNX_PushArgumentObject(oItem); + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); + + return NWNX_GetReturnValueInt(); +} + +void NWNX_Creature_OverrideRangedProjectileVFX(object oCreature, int nProjectileVFX, int bPersist = FALSE) +{ + string sFunc = "OverrideRangedProjectileVFX"; + + NWNX_PushArgumentInt(bPersist); + NWNX_PushArgumentInt(nProjectileVFX); + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +void NWNX_Creature_SetInitiativeModifier(object oCreature, int nMod, int bPersist = FALSE) +{ + string sFunc = "SetInitiativeModifier"; + + NWNX_PushArgumentInt(bPersist); + NWNX_PushArgumentInt(nMod); + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +int NWNX_Creature_GetInitiativeModifier(object oCreature) +{ + string sFunc = "GetInitiativeModifier"; + + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueInt(); +} + +object NWNX_Creature_GetBodyBag(object oCreature) +{ + string sFunc = "GetBodyBag"; + + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueObject(); +} + +int NWNX_Creature_AddCastSpellActions(object oCreature, object oTarget, vector vTargetLocation, int nSpellID, int nMultiClass, int nMetaMagic = METAMAGIC_NONE, int nDomainLevel = 0, int nProjectilePathType = PROJECTILE_PATH_TYPE_DEFAULT, int bInstant = FALSE, int bClearActions = FALSE, int bAddToFront = FALSE) +{ + string sFunc = "AddCastSpellActions"; + + NWNX_PushArgumentInt(bAddToFront); + NWNX_PushArgumentInt(bClearActions); + NWNX_PushArgumentInt(bInstant); + NWNX_PushArgumentInt(nProjectilePathType); + NWNX_PushArgumentInt(nDomainLevel); + NWNX_PushArgumentInt(nMetaMagic); + NWNX_PushArgumentInt(nMultiClass); + NWNX_PushArgumentInt(nSpellID); + NWNX_PushArgumentFloat(vTargetLocation.z); + NWNX_PushArgumentFloat(vTargetLocation.y); + NWNX_PushArgumentFloat(vTargetLocation.x); + NWNX_PushArgumentObject(oTarget); + NWNX_PushArgumentObject(oCreature); + + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueInt(); +} + +int NWNX_Creature_GetIsFlanking(object oCreature, object oTargetCreature) +{ + string sFunc = "GetIsFlanking"; + + NWNX_PushArgumentObject(oTargetCreature); + NWNX_PushArgumentObject(oCreature); + + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueInt(); +} + +void NWNX_Creature_DecrementRemainingSpellSlots(object oCreature, int nClass, int nSpellLevel) +{ + string sFunc = "DecrementRemainingSpellSlots"; + + NWNX_PushArgumentInt(nSpellLevel); + NWNX_PushArgumentInt(nClass); + NWNX_PushArgumentObject(oCreature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +void NWNX_Creature_IncrementRemainingSpellSlots(object oCreature, int nClass, int nSpellLevel) +{ + string sFunc = "IncrementRemainingSpellSlots"; + + NWNX_PushArgumentInt(nSpellLevel); + NWNX_PushArgumentInt(nClass); + NWNX_PushArgumentObject(oCreature); + + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +int NWNX_Creature_GetMaximumBonusAttacks(object oCreature) +{ + string sFunc = "GetMaximumBonusAttacks"; + + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); + return NWNX_GetReturnValueInt(); +} + +void NWNX_Creature_SetMaximumBonusAttacks(object oCreature, int nMaxBonusAttacks, int bPersist = FALSE) +{ + string sFunc = "SetMaximumBonusAttacks"; + + NWNX_PushArgumentInt(bPersist); + NWNX_PushArgumentInt(nMaxBonusAttacks); + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +void NWNX_Creature_DoCleaveAttack(object oCreature) +{ + string sFunc = "DoCleaveAttack"; + + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +object NWNX_Creature_GetLockOrientationToObject(object oCreature) +{ + string sFunc = "GetLockOrientationToObject"; + + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); + + return NWNX_GetReturnValueObject(); +} + +void NWNX_Creature_SetLockOrientationToObject(object oCreature, object oTarget) +{ + string sFunc = "SetLockOrientationToObject"; + + NWNX_PushArgumentObject(oTarget); + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +void NWNX_Creature_BroadcastAttackOfOpportunity(object oCreature, object oSingleCreature = OBJECT_INVALID, int bMovement = FALSE) +{ + string sFunc = "BroadcastAttackOfOpportunity"; + + NWNX_PushArgumentInt(bMovement); + NWNX_PushArgumentObject(oSingleCreature); + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +int NWNX_Creature_GetMaxSellToStorePriceOverride(object oCreature, object oStore) +{ + string sFunc = "GetMaxSellToStorePriceOverride"; + + NWNX_PushArgumentObject(oStore); + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); + + return NWNX_GetReturnValueInt(); +} + +void NWNX_Creature_SetMaxSellToStorePriceOverride(object oCreature, object oStore, int nMaxSellToPrice) +{ + string sFunc = "SetMaxSellToStorePriceOverride"; + + NWNX_PushArgumentInt(nMaxSellToPrice); + NWNX_PushArgumentObject(oStore); + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +int NWNX_Creature_GetAbilityIncreaseByLevel(object oCreature, int nLevel) +{ + string sFunc = "GetAbilityIncreaseByLevel"; + + NWNX_PushArgumentInt(nLevel); + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); + + return NWNX_GetReturnValueInt(); +} + +void NWNX_Creature_SetAbilityIncreaseByLevel(object oCreature, int nLevel, int nAbility) +{ + string sFunc = "SetAbilityIncreaseByLevel"; + + NWNX_PushArgumentInt(nAbility); + NWNX_PushArgumentInt(nLevel); + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); +} + +float NWNX_Creature_GetMaxAttackRange(object oCreature, object oTarget) +{ + string sFunc = "GetMaxAttackRange"; + + NWNX_PushArgumentObject(oTarget); + NWNX_PushArgumentObject(oCreature); + NWNX_CallFunction(NWNX_Creature, sFunc); + + return NWNX_GetReturnValueFloat(); +} diff --git a/_module/nss/skinnable_corpse.nss b/_module/nss/skinnable_corpse.nss index fd358ccc..474b2725 100644 --- a/_module/nss/skinnable_corpse.nss +++ b/_module/nss/skinnable_corpse.nss @@ -11,10 +11,17 @@ //:: Created On: Oct 25, 2001 //::////////////////////////////////////////////// #include "NW_I0_GENERIC" + object CreatePlaceable(string sObject, location lPlace, float fDuration); + +void RewardCombatXP(object oKiller, object oVictim = OBJECT_SELF); + + void main() { - SetIsDestroyable(FALSE,FALSE,FALSE); + object oKiller = GetLastKiller(); + + SetIsDestroyable(FALSE,FALSE,FALSE); DelayCommand(120.0,SetIsDestroyable(TRUE,FALSE,FALSE)); DelayCommand(121.0,DestroyObject(OBJECT_SELF)); object oTemp = CreatePlaceable("corpse",GetLocation(OBJECT_SELF),120.0); @@ -227,12 +234,120 @@ void main() { SignalEvent(GetAreaFromLocation(GetLocation(OBJECT_SELF)), EventUserDefined(1007)); } + + RewardCombatXP(oKiller); + + ExecuteScript("prc_npc_death", OBJECT_SELF); } object CreatePlaceable(string sObject, location lPlace, float fDuration) { object oPlaceable = CreateObject(OBJECT_TYPE_PLACEABLE,sObject,lPlace,FALSE); + if (fDuration != 0.0) DestroyObject(oPlaceable,fDuration); return oPlaceable; } + +void RewardCombatXP(object oKiller, object oVictim = OBJECT_SELF) +{ + int noleech = 0; + float BaseEXP = ((GetChallengeRating(oVictim)*5.0)+2); + float BonusEXP = ((GetChallengeRating(oVictim)*2.0)+5); + float BaseMonEXP = BaseEXP; + int NumOfParty = 0; + float PartyLevelSum = 0.0; + object oPartyMember = GetFirstFactionMember(oKiller, TRUE); + while(GetIsObjectValid(oPartyMember)) { + if (GetArea(oVictim) == GetArea(oPartyMember)) + { + int leech = GetHitDice(oPartyMember); + if (leech >= noleech){ + noleech = leech; + } + NumOfParty++; + PartyLevelSum += GetCharacterLevel(oPartyMember); + } + oPartyMember = GetNextFactionMember(oKiller, TRUE); + } + if (PartyLevelSum <= 1.0) + { + PartyLevelSum = 1.0; + } + if (NumOfParty <= 1) + { + NumOfParty = 1; + } + float PartyAvgLvl = PartyLevelSum / NumOfParty; + //Calculate Adjustment Value + if (PartyAvgLvl <= 1.0) + { + PartyAvgLvl = 1.0; + } + float x = GetChallengeRating(oVictim); + if (x <= 1.0) + { + x = 1.0; + } + float z = (x / PartyAvgLvl); + float AdjustValue = ((z+2)/3); + float FinalMonValue; + //Determine Final Experience Value + if (AdjustValue == 0.0) { + FinalMonValue = BaseMonEXP; + } else { + if (AdjustValue < 1.0) { + FinalMonValue = BaseMonEXP * AdjustValue; + } else { + FinalMonValue = BaseMonEXP + (BonusEXP * (AdjustValue * (1.10))); + } + } + //Determine the value of the Split EXP + if (NumOfParty >= 8) + { + NumOfParty = 8; + } + if (NumOfParty <= 1) + { + NumOfParty = 1; + } + if (FinalMonValue <= 1.0) + { + FinalMonValue = 1.0; + } + float SplitFinalEXP = FinalMonValue / NumOfParty; + if (SplitFinalEXP <= 1.0) + { + SplitFinalEXP = 1.0; + } + float y = (FinalMonValue - SplitFinalEXP); + if (y <= 1.0) + { + y = 1.0; + } + if (PartyAvgLvl >= 15.0) + { + FinalMonValue = FinalMonValue - ( PartyAvgLvl); + } + float PartyBonus = ((y +1)/ 1.75) + (FinalMonValue + ((21-PartyAvgLvl)/3)); + int SFEint = FloatToInt(PartyBonus); + //Distribute EXP to all PCs in the Party + oPartyMember = GetFirstFactionMember(oKiller, TRUE); + while (GetIsObjectValid(oPartyMember)) + { + if (GetArea(OBJECT_SELF) == GetArea(oPartyMember)) { + int nHD = GetHitDice(oPartyMember) + 1; + int nMax = (((nHD * (nHD - 1)) / 2) * 1000)+1; + if (nMax <= GetXP(oPartyMember) && nHD <= 40) { + SendMessageToPC(oPartyMember, "You cannot gain experience until you have leveled."); + } else if (GetIsDead(oPartyMember)) { + SendMessageToPC(oPartyMember, "You cannot gain experience while dead. Your XP has been reset."); + } else if ((GetHitDice(oPartyMember)) <= (noleech - 7) || (GetHitDice(oPartyMember)) >= FloatToInt(PartyAvgLvl) + 7) { + SendMessageToPC(oPartyMember, "All party members must be within 6 levels of each other."); + } else { + GiveXPToCreature(oPartyMember, SFEint); + } + } + oPartyMember = GetNextFactionMember(oKiller, TRUE); + } +} \ No newline at end of file diff --git a/_module/utc/npc_annihilus001.utc.json b/_module/utc/npc_annihilus001.utc.json new file mode 100644 index 00000000..15fd8239 --- /dev/null +++ b/_module/utc/npc_annihilus001.utc.json @@ -0,0 +1,635 @@ +{ + "__data_type": "UTC ", + "Appearance_Type": { + "type": "word", + "value": 1096 + }, + "BodyBag": { + "type": "byte", + "value": 0 + }, + "Cha": { + "type": "byte", + "value": 18 + }, + "ChallengeRating": { + "type": "float", + "value": 7.0 + }, + "ClassList": { + "type": "list", + "value": [ + { + "__struct_id": 2, + "Class": { + "type": "int", + "value": 5 + }, + "ClassLevel": { + "type": "short", + "value": 1 + } + }, + { + "__struct_id": 2, + "Class": { + "type": "int", + "value": 4 + }, + "ClassLevel": { + "type": "short", + "value": 1 + } + }, + { + "__struct_id": 2, + "Class": { + "type": "int", + "value": 19 + }, + "ClassLevel": { + "type": "short", + "value": 1 + } + } + ] + }, + "Comment": { + "type": "cexostring", + "value": "" + }, + "Con": { + "type": "byte", + "value": 12 + }, + "Conversation": { + "type": "resref", + "value": "hs_del_pc" + }, + "CRAdjust": { + "type": "int", + "value": 0 + }, + "CurrentHitPoints": { + "type": "short", + "value": 308 + }, + "DecayTime": { + "type": "dword", + "value": 5000 + }, + "Deity": { + "type": "cexostring", + "value": "" + }, + "Description": { + "type": "cexolocstring", + "value": { + "0": "Talk to this creature if you need to delete your character." + } + }, + "Dex": { + "type": "byte", + "value": 22 + }, + "Disarmable": { + "type": "byte", + "value": 0 + }, + "Equip_ItemList": { + "type": "list", + "value": [] + }, + "FactionID": { + "type": "word", + "value": 3 + }, + "FeatList": { + "type": "list", + "value": [ + { + "__struct_id": 1, + "Feat": { + "type": "word", + "value": 2 + } + }, + { + "__struct_id": 1, + "Feat": { + "type": "word", + "value": 3 + } + }, + { + "__struct_id": 1, + "Feat": { + "type": "word", + "value": 4 + } + }, + { + "__struct_id": 1, + "Feat": { + "type": "word", + "value": 32 + } + }, + { + "__struct_id": 1, + "Feat": { + "type": "word", + "value": 45 + } + }, + { + "__struct_id": 1, + "Feat": { + "type": "word", + "value": 49 + } + }, + { + "__struct_id": 1, + "Feat": { + "type": "word", + "value": 46 + } + } + ] + }, + "FirstName": { + "type": "cexolocstring", + "value": { + "0": "Annihilus" + } + }, + "fortbonus": { + "type": "short", + "value": 0 + }, + "Gender": { + "type": "byte", + "value": 4 + }, + "GoodEvil": { + "type": "byte", + "value": 50 + }, + "HitPoints": { + "type": "short", + "value": 308 + }, + "Int": { + "type": "byte", + "value": 12 + }, + "Interruptable": { + "type": "byte", + "value": 1 + }, + "IsImmortal": { + "type": "byte", + "value": 1 + }, + "IsPC": { + "type": "byte", + "value": 0 + }, + "LastName": { + "type": "cexolocstring", + "value": { + "0": "" + } + }, + "LawfulChaotic": { + "type": "byte", + "value": 50 + }, + "Lootable": { + "type": "byte", + "value": 0 + }, + "MaxHitPoints": { + "type": "short", + "value": 311 + }, + "NaturalAC": { + "type": "byte", + "value": 40 + }, + "NoPermDeath": { + "type": "byte", + "value": 1 + }, + "PaletteID": { + "type": "byte", + "value": 45 + }, + "PerceptionRange": { + "type": "byte", + "value": 8 + }, + "Phenotype": { + "type": "int", + "value": 0 + }, + "Plot": { + "type": "byte", + "value": 1 + }, + "PortraitId": { + "type": "word", + "value": 2236 + }, + "Race": { + "type": "byte", + "value": 24 + }, + "refbonus": { + "type": "short", + "value": 0 + }, + "ScriptAttacked": { + "type": "resref", + "value": "x2_def_attacked" + }, + "ScriptDamaged": { + "type": "resref", + "value": "x2_def_ondamage" + }, + "ScriptDeath": { + "type": "resref", + "value": "x2_def_ondeath" + }, + "ScriptDialogue": { + "type": "resref", + "value": "x2_def_onconv" + }, + "ScriptDisturbed": { + "type": "resref", + "value": "x2_def_ondisturb" + }, + "ScriptEndRound": { + "type": "resref", + "value": "x2_def_endcombat" + }, + "ScriptHeartbeat": { + "type": "resref", + "value": "x2_def_heartbeat" + }, + "ScriptOnBlocked": { + "type": "resref", + "value": "x2_def_onblocked" + }, + "ScriptOnNotice": { + "type": "resref", + "value": "x2_def_percept" + }, + "ScriptRested": { + "type": "resref", + "value": "x2_def_rested" + }, + "ScriptSpawn": { + "type": "resref", + "value": "x2_def_spawn" + }, + "ScriptSpellAt": { + "type": "resref", + "value": "x2_def_spellcast" + }, + "ScriptUserDefine": { + "type": "resref", + "value": "x2_def_userdef" + }, + "SkillList": { + "type": "list", + "value": [ + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 19 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 43 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 5 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 43 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 43 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 30 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 1 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 26 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 40 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + }, + { + "__struct_id": 0, + "Rank": { + "type": "byte", + "value": 0 + } + } + ] + }, + "SoundSetFile": { + "type": "word", + "value": 237 + }, + "SpecAbilityList": { + "type": "list", + "value": [] + }, + "StartingPackage": { + "type": "byte", + "value": 24 + }, + "Str": { + "type": "byte", + "value": 14 + }, + "Subrace": { + "type": "cexostring", + "value": "Undead" + }, + "Tag": { + "type": "cexostring", + "value": "NPC_ANNIHILUS001" + }, + "Tail_New": { + "type": "dword", + "value": 0 + }, + "TemplateList": { + "type": "list", + "value": [] + }, + "TemplateResRef": { + "type": "resref", + "value": "npc_annihilus001" + }, + "WalkRate": { + "type": "int", + "value": 1 + }, + "willbonus": { + "type": "short", + "value": 0 + }, + "Wings_New": { + "type": "dword", + "value": 0 + }, + "Wis": { + "type": "byte", + "value": 8 + } +} diff --git a/_release/Aschbourne [PRC8-CEP3].7z b/_release/Aschbourne [PRC8-CEP3].7z index 904fae51..f53b4e93 100644 Binary files a/_release/Aschbourne [PRC8-CEP3].7z and b/_release/Aschbourne [PRC8-CEP3].7z differ diff --git a/_release/prc8_cep1_merge.hak b/_release/prc8_cep1_merge.hak deleted file mode 100644 index af454e5f..00000000 Binary files a/_release/prc8_cep1_merge.hak and /dev/null differ diff --git a/_release/prc8_cep1_merge.tlk b/_release/prc8_cep1_merge.tlk deleted file mode 100644 index 3f12a448..00000000 Binary files a/_release/prc8_cep1_merge.tlk and /dev/null differ