private string ConsumableName(CNWSpell spell, int spellId, int spellLevel, int casterLevel)
 {
     string prefix;
     if (casterLevel > 10)
         prefix = spellLevel + ", CL " + casterLevel;
     else if(casterLevel > 0)
         prefix = spellLevel + ", CL 0" + casterLevel;
     else prefix = spellLevel.ToString();
     
     return "{" + prefix + "}" + GetSpellName(spell) + ", " + baseName(spellId);
 }
Example #2
0
 internal NwSpell(int spellId, CNWSpell spellInfo)
 {
     Id             = spellId;
     this.spellInfo = spellInfo;
 }
 protected abstract string findIconName(int spellId, CNWSpell spell, int spellLevel);
 protected virtual string GetAuraDescription(int spellLevel, CNWSpell spell)
 {
     if (Globals.spellschools2da["Label"][spell.GetSpellSchool()].ToLower() == "g")
         return "Under a Detect Magic or similar spell, this item radiates a " + GetAuraStrength(spellLevel) + " magical aura.";
     return "Under a Detect Magic or similar spell, this item radiates a " + GetAuraStrength(spellLevel) + " magical aura of " + Globals.spellschools2da["Label"][spell.GetSpellSchool()].ToLower();
 }
 public Wand(int ip, int spellId, int spellLevel, int casterLevel, CNWSpell spell) : base(ip, spellId, spellLevel, casterLevel, spell, false)
 {
     blueprint.Charges = 50;
 }
        protected override string findIconName(int spellId, CNWSpell spell, int spellLevel)
        {
            switch (spellId)
            {
                case 32:
                case 33:
                case 1021:
                    return "it_wm_wandcureLwound";

                case 34:
                case 35:
                case 1020:
                    return "it_wm_wandcureCwound";

                case 10:
                case 58:
                case 59:
                case 61:
                case 191:
                case 461:
                case 518:
                case 542:
                case 851:
                case 1099:
                case 1208:
                case 1055: return "it_wm_wandfire";

                case 25:
                case 144:
                    return "it_wm_rodfrost";

                case 165:
                case 855:
                    return "it_wm_wandsleep";

                case 100:
                case 419:
                    return "it_wm_rodthundlight";

                case 107:
                case 447:
                    return "it_wm_wandmagicmis";
                
                case 11:
                case 101:
                case 847:
                case 1162:
                case 1198:
                case 1207:
                    return "it_wm_wandlightning";
            }

            switch (spell.GetSpellSchoolString().CStr())
            {
                case "A": return "it_wm_rodreversal";
                case "C": return "it_wm_wandsummon";
                case "D": return "it_wm_wandlesssummon";
                case "E": return "it_wm_rodbeguile";
                case "I": return "it_wm_rodwonder";
                case "N": return "it_wm_wanddisjunct";
                case "T": return "it_wm_wandnegenergy";
                case "V": return "it_wd_qstaff05";
                case "G": return "it_wm_wandstinkcloud";
            }

            return null;
        }
 public Potion(int ip, int spellId, int spellLevel, int casterLevel, CNWSpell spell) : base(ip, spellId, spellLevel, casterLevel, spell) {}
        protected override string findIconName(int spellId, CNWSpell spell, int spellLevel)
        {
            switch(spellId)
            {
                case 1: return "it_aidpotion"; // Aid
                case 97: return "it_pot_salveofchauntea"; // Lesser restoration
                case 126: return "it_ps_centstrong"; // Neutralize poison
            }

            switch(spell.GetSpellSchoolString().CStr())
            {
                case "A":
                    switch(spellLevel)
                    {
                        case 0:
                        case 1: return "it_pot_greentube";
                        case 2: return "it_pot_greenbot";
                        case 3: return "it_pot_greenflask";
                    }
                    break;
                case "C":
                    switch(spellLevel)
                    {
                        case 0:
                        case 1: return "it_healpotion";
                        case 2: return "it_pot_bluebot";
                        case 3: return "it_pot_blueflask";
                    }
                    break;
                case "D":
                    switch(spellLevel)
                    {
                        case 0:
                        case 1: return "it_pot_whitetube";
                        case 2: return "it_pot_whitebot";
                        case 3: return "it_pot_whiteflask";
                    }
                    break;
                case "E":
                    switch(spellLevel)
                    {
                        case 0:
                        case 1: return "it_pot_orangetube";
                        case 2: return "it_pot_orangebot";
                        case 3: return "it_pot_orangeflask";
                    }
                    break;
                case "I":
                    switch(spellLevel)
                    {
                        case 0:
                        case 1: return "it_pot_purpletube";
                        case 2: return "it_pot_purplebot";
                        case 3: return "it_pot_purpleflask";
                    }
                    break;
                case "N":
                    switch(spellLevel)
                    {
                        case 0:
                        case 1: return "it_ps_scorpmild";
                        case 2: return "it_ps_scorpavg";
                        case 3: return "it_ps_scorpstrong";
                    }
                    break;
                case "T":
                    switch(spellLevel)
                    {
                        case 0:
                        case 1: return "it_pot_orangetube";
                        case 2: return "it_pot_orangebot";
                        case 3: return "it_pot_orangeflask";
                    }
                    break;
                case "V":
                    switch(spellLevel)
                    {
                        case 0:
                        case 1: return "it_pot_blacktube";
                        case 2: return "it_pot_blackbot";
                        case 3: return "it_pot_blackflask";
                    }
                    break;
                case "G":
                    switch (spellLevel)
                    {
                        case 0:
                        case 1: return "it_pot_whitetube";
                        case 2: return "it_pot_whitebot";
                        case 3: return "it_pot_whiteflask";
                    }
                    break;
            }

            return null;
        }
 override protected string GetAuraDescription(int spellLevel, CNWSpell spell) { return ""; }
 public TradeScroll(int ip, int spellId, int spellLevel, CNWSpell spell) : base(ip, spellId, spellLevel, 0, spell, "it_yellowparch") {
     blueprint.Tag = "acr_it_tradescroll";
 }
 public DivineScroll(int ip, int spellId, int spellLevel, int casterLevel, CNWSpell spell, string icon) : base(ip, spellId, spellLevel, casterLevel, spell, icon) {}
 protected override string findIconName(int spellId, CNWSpell spell, int spellLevel)
 {
     return spell.GetSpellIcon().ToString();
 }
        public Consumable(int ip, int spellId, int spellLevel, int casterLevel, CNWSpell spell, bool adjustCost = true, string iconName = null)
        {
            blueprint = new NWN2ItemBlueprint();

            string tag = tagPrefix + spellId.ToString() + "_" + casterLevel.ToString();
            ushort resType = OEIShared.Utils.BWResourceTypes.GetResourceType("UTI");

            blueprint.Resource = Globals.repository.CreateResource(new OEIShared.Utils.OEIResRef(tag), resType);
            
            blueprint.TemplateResRef = new OEIShared.Utils.OEIResRef(tag);
            blueprint.Tag = tag;
            blueprint.ResourceName = new OEIShared.Utils.OEIResRef(tag);

            blueprint.BaseItem = new OEIShared.IO.TwoDA.TwoDAReference("baseitems", "Name", true, baseType);

            string name = ConsumableName(spell, spellId, spellLevel, casterLevel);
            blueprint.LocalizedName = new OEIShared.Utils.OEIExoLocString();
            blueprint.LocalizedName[OEIShared.Utils.BWLanguages.BWLanguage.English] = name;

            blueprint.LocalizedDescriptionIdentified = new OEIShared.Utils.OEIExoLocString();
            blueprint.LocalizedDescriptionIdentified[OEIShared.Utils.BWLanguages.BWLanguage.English] =
                baseDescription + Environment.NewLine + Environment.NewLine +
                Globals.GetTlkEntry((uint)spell.GetSpellDescription()) + Environment.NewLine + Environment.NewLine +
                GetAuraDescription(spellLevel, spell);

            if (ip >= 0) blueprint.Properties.Add(itemProperty(ip));

            blueprint.Classification = baseCategory;

            if (iconName == null)
                iconName = findIconName(spellId, spell, spellLevel);
            int iconId = Globals.getIconId(iconName);
            if (iconId == 0)
                flagIconMissingForSpell(spellId, GetSpellName(spell));
            blueprint.Icon = new TwoDAReference("nwn2_icons", "ICON", false, iconId);

            blueprint.CalculateBaseCosts();
            if (adjustCost)
                blueprint.AdditionalCost = cost(spellLevel, casterLevel) - (int)blueprint.Cost;
        }
 protected virtual string GetAuraDescription(int spellLevel, CNWSpell spell)
 {
     return "\n\nThis item radiates a " + GetAuraStrength(spellLevel) + " aura of " + Globals.spellschools2da["Label"][spell.GetSpellSchool()].ToLower();
 }
 protected override string findIconName(int spellId, CNWSpell spell, int spellLevel)
 {
     return null;
 }