static void CreatePlayerVob(Hook hook, RegisterMemory rmem) { try { oCNpc player = oCNpc.Create(); //player.SetVisual("HUMANS.MDS"); //player.SetAdditionalVisuals("hum_body_Naked0", 9, 0, "Hum_Head_Pony", 2, 0, -1); player.SetVisual("Scavenger.mds"); player.SetAdditionalVisuals("Sca_Body", 0, 0, "", 0, 0, -1); player.SetToFistMode(); player.HPMax = 10; player.HP = 10; rmem[Registers.EAX] = player.Address; } catch (Exception e) { Logger.LogError(e); } }
public override void Spawn(String map, Vec3f position, Vec3f direction) { this.Map = map; this.Position = position; this.Direction = direction; spawned = true; if (this.Address != 0) { return; } if (this.Map != Player.Hero.Map) { return; } Process process = Process.ThisProcess(); oCNpc npc = oCObjectFactory.GetFactory(process).CreateNPC("OTHERS_NPC"); this.Address = npc.Address; sWorld.SpawnedVobDict.Add(npc.Address, this); if (npc.MagBook == null || npc.MagBook.Address == 0) { npc.MagBook = oCMag_Book.Create(process); npc.MagBook.SetOwner(npc); } setHideNames(this.hideName); for (int i = 0; i < this.Attributes.Length; i++) { npc.setAttributes((byte)i, this.Attributes[i]); } for (int i = 0; i < this.TalentSkills.Length; i++) { npc.SetTalentSkill(i, this.TalentSkills[i]); } for (int i = 0; i < this.TalentValues.Length; i++) { npc.SetTalentValue(i, this.TalentValues[i]); } for (int i = 0; i < this.Hitchances.Length; i++) { npc.SetHitChances(i, this.Hitchances[i]); } npc.SetVisual(this.Visual); npc.SetAdditionalVisuals(BodyMesh, bodyTex, skinColor, HeadMesh, headTex, teethTex, -1); //npc.HumanAI = new oCAiHuman(process, 0); //npc.AniCtrl = new oCAniCtrl_Human(process, 0); this.setDirection(direction); //Enable(Position); foreach (Item it in itemList) { this.addItemToContainer(it); } foreach (Item it in EquippedList) { if (!it.ItemInstance.MainFlags.HasFlag(MainFlags.ITEM_KAT_ARMOR) && !it.ItemInstance.MainFlags.HasFlag(MainFlags.ITEM_KAT_FF) && !it.ItemInstance.MainFlags.HasFlag(MainFlags.ITEM_KAT_NF)) { hNpc.blockSendEquip = true; npc.Equip(new oCItem(process, it.Address)); } } //if (this.Armor != null) // setArmor(this.Armor); if (this.Weapon != null) { setWeapon(this.Weapon); } if (this.RangeWeapon != null) { setRangeWeapon(this.RangeWeapon); } for (int i = 0; i < Slots.Length; i++) { if (Slots[i] != null) { setSlotItem(i, Slots[i]); } } foreach (String act in Overlays) { zString overlayStr = zString.Create(process, act); npc.ApplyOverlay(overlayStr); overlayStr.Dispose(); } setScale(this.Scale); setFatness(this.Fatness); setWeaponMode(this.WeaponMode); if (enabled) { Enable(this.Position); } this.setInvisible(this.IsInvisible); }
public void SetVisual(string visual) { thisVob.SetVisual(visual.ToUpperInvariant()); vis.SetVisualFromVob(thisVob); }