ultimate polypile thread

Girls only want boyfriends who have great skills.

Moderator: EUO Moderators

ultimate polypile thread

Postby eggmceye » Fri May 10, 2013 8:36 am

Massive spoilers: if you want to discover polypile leave now! Otherwise it's all laid bare here.

As far as I can understand it poly pile always req 3 items. These can be 3 different items (a PILE of 3) or 3 identical items (a stack of 3) or a combination thereof.

Basic polypile will let you:
* combine 3 foods into 2 new foods
* combine 3 gems into 2 new gems
* combine 3 scrolls into 2 new scrolls
* combine 3 potions into 2 new potions
* combine 3 reagants into 2 new reagants
* combine 3 body parts into 2 new body parts
* combine 3 rare items (eg sextant) into 2 rare items

Other recipes
dwarves
When polypiling potions, dwarves get a special ruleset:
- 3x yellow pot->2x mead
- 3x blue pot-> 2x pale ale
- 3x red pot -> extra stout

polypiling ingots & crafting mats
You can poly a stack of 3 of one crafting material into 1 of the same material with the enchantment (as in, attack) increased by +1
- min input item enchant is +1 - does not work on 3x plain ingots
- max input item is +4 for ingots of attack - as in you can poly 3x +4 attack ingots but not 3x +5 !
-- max is +14 for STR, DEX, INT (will make one ingot of +15)
-- max is +3 for def (will make one ingot of +4 defense)
- not all tints are accepted - generally speaking only the tints are allowed to be crafted with can be poly'd

polypiling weapons & armour
A pile or stack of 3 weapons and armour can be poly'd into one new piece. Study the code below to determine how that works. Hopefully it isn't too cheeseable - nor too useless!




Actual polypile code below!
hint: the line function use_502() is where most of the action begins

Code: Select all
-- Polypile Wand  -  0x502

pp_food = {
0x117, -- fish
0x12a, -- cheese
0x12b, -- bread
0x17f, --boiled egg
0x500, --carrot
0x12c, -- meat
0x440, --fortune cookie
0x530, 0x54d, 0x54e, 0x54f, 0x550, 0x551, 0x552, 0x553, 0x554, 0x556, 0x557, 0x559, 0x599, 0x59a
}
pp_gems = {
0x427, -- diamond
0x428, -- emerald
0x429, -- ruby
0x42a, -- sapphire
0x42c, -- onyx
0x42d, -- topaz
0x42e, -- amethyst
0x42f, -- zircon
0x430 -- fire opal
}
pp_potions = {
0x104, -- yellow potion
0x105, -- blue potion
0x106, -- red potion
0x160, -- black potion
0x161, -- green potion
0x162, -- white potion
0x163, -- orange potion
0x164, -- cyan potion
0x165, -- lime potion
0x166, -- brown potion
0x167, -- clear potion
0x168, -- purple potion
0x169, -- pink potion
0x16b, -- mega yellow potion
0x16c -- mega blue potion
}
pp_scrolls = {
0x41d, -- blank scroll
0x120, -- ressurection scroll
0x125, -- town portal scroll
0x13a, -- scroll of unweld
0x13b, -- scroll of uncurse
0x13c, -- scroll of identify
0x16d -- raise pet scroll
}
pp_reagents = {
0x146, -- black_pearl
0x147, -- blood moss
0x148, -- garlic
0x149, -- ginseng
0x14a, -- mandrake root
0x14b, -- nightshade
0x14c, -- spider's silk
0x14d -- sulphurous ash
}
pp_parts = {
0x401, -- eye
0x403, -- heart
0x406, -- ooze
0x407, -- brain
0x402, -- horn
0x404, -- carapace
0x405, -- fang
0x40a, -- diseased bandage
0x40b, -- sparkling mote
0x412, -- dragon hide
0x41b, -- raw glass
0x41e, -- cowhide
0x528, -- wet clay
0x52d, -- hydra fang
0x52e, -- glowing ember
0x5e4 -- magic spleen
}
pp_rare_items = {
0x17c, -- khaki potion
0x502, -- polypile wand
0x43e, -- goblin brew
0x432, -- golem power crystal
0x107, -- sextant
0x53b, -- deconstruction wand
0x529, -- healing ward
0x52a  -- fire ward
}
pp_rare_mobs = {
0x297, -- cow
0x264, -- horse
0x24a, -- rabbit
0x255, -- wisp
0x213, -- bat
0x21b, -- rat
0x298, -- insect swarm
0x210, -- snake
0x21a  -- slime
}

pp_crafting_materials = {
0x118, -- ingot
0x115, -- log
0x40e, -- cloth
0x40f, -- leather
}

pp_crafting_weapon_enchants = {
{0x1,4} -- +ATK, max +5; accept up to +4s
}

pp_crafting_armour_enchants = {
{0x7,3}, -- +DEF, max +4; accept up to +3s
{0x4,14}, -- +DEX, max +15; accept up to +14s
{0x3,14}, -- +STR, max +15; accept up to +14s
{0x2,14}, -- +INT, max +15; accept up to +14s
}

pp_crafting_weapon_tints = {
0,
0x3, -- copper
0x6, -- silver
0x7, -- gold
0xa, -- venomous
}

pp_crafting_metal_armour_tints = {
0,
0x1, -- steel
0x3, -- copper
0x6, -- silver
0x7, -- gold
0xc, -- blackrock
}

pp_crafting_wooden_armour_tints = {
0,
0x3, -- oak
0x6, -- silverleaf
0x7, -- ash
0xc, -- ebony
}

pp_crafting_leather_armour_tints = {
0,
0x1, -- studded
0x3, -- boiled
0x6, -- silverhide
0x7, -- goldhide
0xc, -- darkhide
}

pp_crafting_cloth_armour_tints = {
0,
0x3, -- boiled
0x6, -- silverweave
0x7, -- goldweave
0xc, -- darkweave
}

accepted_crafting_materials={}
for i=1,#pp_crafting_materials do
    for j=1,#pp_crafting_weapon_enchants do
     for k=1,pp_crafting_weapon_enchants[j][2] do
       for l=1,#pp_crafting_weapon_tints do
         tmp_itm=make_code(pp_crafting_materials[i],pp_crafting_weapon_tints[l],pp_crafting_weapon_enchants[j][1],k)
          table.insert(accepted_crafting_materials,tmp_itm)
      end
       end
  end
  for j=1,#pp_crafting_armour_enchants do
     for k=1,pp_crafting_armour_enchants[j][2] do
       for l=1,#pp_crafting_metal_armour_tints do
         tmp_itm=make_code(pp_crafting_materials[i],pp_crafting_metal_armour_tints[l],pp_crafting_armour_enchants[j][1],k)
         table.insert(accepted_crafting_materials,tmp_itm)
      end
      for l=1,#pp_crafting_wooden_armour_tints do
         tmp_itm=make_code(pp_crafting_materials[i],pp_crafting_wooden_armour_tints[l],pp_crafting_armour_enchants[j][1],k)
             table.insert(accepted_crafting_materials,tmp_itm)
      end
      for l=1,#pp_crafting_leather_armour_tints do
         tmp_itm=make_code(pp_crafting_materials[i],pp_crafting_leather_armour_tints[l],pp_crafting_armour_enchants[j][1],k)
         table.insert(accepted_crafting_materials,tmp_itm)
      end
      for l=1,#pp_crafting_cloth_armour_tints do
         tmp_itm=make_code(pp_crafting_materials[i],pp_crafting_cloth_armour_tints[l],pp_crafting_armour_enchants[j][1],k)
         table.insert(accepted_crafting_materials,tmp_itm)
      end
       end         
  end
end

function use_502 (id,tgt_id,alt,itm,bcode,x,y,z)
   
   local plyr=get_player_ptr(id)
   local race=sc:get_racename(plyr.race)
   local map=get_map_ptr(z)
   
   if(map:feature_is_hook(x,y) and plyr.account_name~=map:get_feat_text(x,y)) then
      send_message(id, "Not here!");
      return
   end

   -- go thru the pile of items and make sure they are either ownerless or owned by user
   -- also no poly soulbound
   local ptr=map:get_item_ptr(x,y)
   local pilecnt=0
   local i1=Item(0)
   local i2=Item(0)
   local i3=Item(0)
   
   local cnt=0
   while ptr~=nil and cnt<3  do

      if(ptr.owner~="" and ptr.owner~=plyr.name or is_no_drop(ptr.code) or ptr.furniture)  then
         send_message(id, "There are items here that are either not yours or are soulbound!");
         return;
      end

      if cnt==0 then
         i1=ptr.code
         if ptr.qty>1 then
            i2=ptr.code
            if ptr.qty>2 then
               i3=ptr.code
               break
            end
         end
      end
     
      if cnt==1 then
         if not i2:isValid() then
            i2=ptr.code
            if ptr.qty>1 then
               i3=ptr.code
               break
            end
         else
            i3=ptr.code
            break
         end
      end
     
      if cnt==2 then
         i3=ptr.code
      end
     
      ptr=ptr.next
      cnt=cnt+1
   end
     
   if not i1:isValid() or not i2:isValid() or not i3:isValid()  then
       send_message(id, "Requires at least three items in the pile!")
       return
   end

   local i4 = 0
   local i5 = 0
   
   
   
   -- yellow pot+2other pot->2mead
   if race=="dwarf" and get_base_code(i1)==0x104 and in_array(get_base_code(i2), pp_potions) and in_array(get_base_code(i3), pp_potions) then
        i4=0x5b3
        i5=0x5b3
   elseif race=="dwarf" and get_base_code(i1)==0x105 and in_array(get_base_code(i2), pp_potions) and in_array(get_base_code(i3), pp_potions) then
        i4=0x5b4
        i5=0x5b4
   elseif race=="dwarf" and get_base_code(i1)==0x106 and in_array(get_base_code(i2), pp_potions) and in_array(get_base_code(i3), pp_potions) then
        i4=0x5b2
        i5=0x5b2               
   elseif (wl:is_weapon(i1) or wl:is_wearable(i1)) and (wl:is_weapon(i2) or wl:is_wearable(i2)) and (wl:is_weapon(i3) or wl:is_wearable(i3)) and wl:is_enchanted(i1) and wl:is_enchanted(i2) and wl:is_enchanted(i3) then
         -- sev's polypile
         local ia={i1,i2,i3}
         local t=0
      local found=0
      local i
         for i=1,3 do
            local m=get_to_mod(ia[i])
            local v=get_modifier(ia[i])
            if m==MP_WEAPON_BONUS then
               if v>MAX_WEAPON_BONUS then v=MAX_WEAPON_BONUS end
               t=t+16*v/MAX_WEAPON_BONUS
               found=found+1
            elseif m==MP_ARMOUR_BONUS then   
               if v>MAX_ARMOUR_BONUS then v=MAX_ARMOUR_BONUS end
               t=t+16*v/MAX_ARMOUR_BONUS      
               found=found+1
            elseif m==MP_INT_BONUS or m==MP_STR_BONUS or m==MP_DEX_BONUS then   
               if v>MAX_ITEM_STAT_BONUS then v=MAX_ITEM_STAT_BONUS end
               t=t+16*(v-MIN_ITEM_STAT_BONUS)/(MAX_ITEM_STAT_BONUS-MIN_ITEM_STAT_BONUS)                                       
               found=found+1
            elseif m==MP_VIGOUR then   
               if v>MAX_VIGOUR_BONUS then v=MAX_VIGOUR_BONUS end
               t=t+16*(v-MIN_VIGOUR_BONUS)/(MAX_VIGOUR_BONUS-MIN_VIGOUR_BONUS)         
               found=found+1
            elseif m==MP_MAGIC_RESISTANCE then   
               if v>MAX_MR_BONUS then v=MAX_MR_BONUS end
               t=t+16*v/MAX_MR_BONUS         
               found=found+1
            elseif m==MP_NIGHTVISION then   
               if v>MAX_NV_BONUS then v=MAX_NV_BONUS end
               t=t+16*v/MAX_NV_BONUS
               found=found+1
            elseif m==MP_LEECHING then   
               if v>3 then v=3 end
               t=t+2*v+5
               found=found+1      
            elseif m==MP_ENCHANTED then   
               t=t+int_rand(6)+10         
               found=found+1
            end                                                                                             
         end
         
         if found~=3 then
             send_message(id, "Nothing happened.")
             return
         end
         local q=t/3 -- work out avg
      
         local itm=wl:get_rand_weapon_armour()
         -- itm=Item(0x72)
         i4=random_enchant(itm, q)
         -- end_message(id,"q="..q.." result="..wl:get_full_name(i4))
                  
   -- for plain orbs, runes, rods
   elseif in_array(get_base_code(i1),{0x036,0x037,0x038}) and in_array(get_base_code(i2),{0x036,0x037,0x038}) and in_array(get_base_code(i3),{0x036,0x037,0x038}) then
     if math.random(1,3)==1 then i4=0x036
     elseif math.random(1,2)==1 then i4=0x037
     else i4=0x038 end
     if math.random(1,3)==1 then i5=0x036
     elseif math.random(1,2)==1 then i5=0x037
     else i5=0x038 end
   elseif wl:is_food(i1) and wl:is_food(i2) and wl:is_food(i3) then
      i4 = get_random_element(pp_food)
      i5 = get_random_element(pp_food)
   elseif in_array(get_base_code(i1), pp_gems) and in_array(get_base_code(i2), pp_gems) and in_array(get_base_code(i3), pp_gems) then
      i4 = get_random_element(pp_gems)
      i5 = get_random_element(pp_gems)
   elseif in_array(get_base_code(i1), pp_potions) and in_array(get_base_code(i2), pp_potions) and in_array(get_base_code(i3), pp_potions) then
      i4 = get_random_element(pp_potions)
      i5 = get_random_element(pp_potions)
   elseif in_array(get_base_code(i1), pp_scrolls) and in_array(get_base_code(i2), pp_scrolls) and in_array(get_base_code(i3), pp_scrolls) then
      i4 = get_random_element(pp_scrolls)
      i5 = get_random_element(pp_scrolls)
   elseif in_array(get_base_code(i1), pp_reagents) and in_array(get_base_code(i2), pp_reagents) and in_array(get_base_code(i3), pp_reagents) then
      i4 = get_random_element(pp_reagents)
      i5 = get_random_element(pp_reagents)
   elseif in_array(get_base_code(i1), pp_parts) and in_array(get_base_code(i2), pp_parts) and in_array(get_base_code(i3), pp_parts) then
      i4 = get_random_element(pp_parts)
      i5 = get_random_element(pp_parts)
   elseif i1 == i2 and i2 == i3 and in_array(i1, accepted_crafting_materials) then
     i4 = make_code(get_base_code(i1), get_material(i1), get_to_mod(i1), get_modifier(i1)+1)
   else
      send_message(id, "Nothing happened.")
      return
   end
   
   if math.random(1,25) == 1 then
      local rr = math.random(1,3) -- rare item, mob or explosion
      if rr == 1 then -- rare item
         i4 = get_random_element(pp_rare_items)
         map:remove_item(x,y)
         map:remove_item(x,y)
         map:remove_item(x,y)
         --map:add_item(x,y,1,Item(i4),true,game_time,plyr.name)
       give_item(id,Item(i4),1)
         send_message(id, "Something strange happened!")
         update_fov(id)
         return
      elseif rr == 2 or PERMADEATH then -- summon mob
         map:remove_item(x,y)
         map:remove_item(x,y)
         map:remove_item(x,y)
         m = spawn_at(get_random_element(pp_rare_mobs), x, y, plyr.map_level)
         if math.random(1,3) == 1 then
            m.large = true
            m:set_hp_max(m:get_hp_max() * 10)
            save_achievement(id, 12)
         end
         simple_send_event(id,EVENT_MAGIC,0x17,x,y)
         send_message(id, "Something strange happened!")
         update_fov(id)
         return
      else -- explosion
         map:remove_item(x,y)
         map:remove_item(x,y)
         map:remove_item(x,y)
         -- send_message(id, "Explosion!")
         send_event(plyr.map_level,-1,x,y,26,0); -- 26 is explosion
         agls = 45
         for d = 1, 3 do
            for a = 0, 360, agls / (2 ^ (d-1)) do
               xx = x + d * math.cos(math.rad(a))
               yy = y + d * math.sin(math.rad(a))
               ptr=get_sent_ptr_xyz(xx,yy,plyr.map_level)
               if ptr~=nil and not ptr:is_dm() and ptr.id < 100 then
                  hurt(ptr.id, math.random(10,30), "the explosion")
               end
            end
         end
         update_fov(id)
         return
      end
   else
      map:remove_item(x,y)
      map:remove_item(x,y)
      map:remove_item(x,y)
      --if i4~=0 then map:add_item(x,y,1,Item(i4),true,game_time,plyr.name); end
      --if i5~=0 then map:add_item(x,y,1,Item(i5),true,game_time,plyr.name); end
     if i4~=0 then give_item(id,Item(i4),1); end
     if i5~=0 then give_item(id,Item(i5),1); end
      send_message(id, "Polypile successful!")
   end
   
   if math.random(1,50) == 1 and not plyr:is_dm() and not plyr.perks[PERK_LOTL] and get_material(itm)~=MAT_BLACKROCK then
      send_message(id,"Your wand fizzles!")
      remove_item(id,itm)
   end

   update_fov(id)
   
end
User avatar
eggmceye
hello
 
Posts: 9732
Joined: Mon Mar 11, 2002 3:55 pm
Location: Sydney, Australia

Re: ultimate polypile thread

Postby Keighn » Fri May 10, 2013 9:37 am

GAH! I can't read code. It's all GEEK to me.
User avatar
Keighn
Stop posting already --;
 
Posts: 4704
Joined: Sat Jun 26, 2004 10:13 am
Location: From the depths of Oregon he returns.... KEIGHN!!!!

Re: ultimate polypile thread

Postby treos » Wed Jul 10, 2013 7:51 am

curse this confusing wand >.< most confusing thing i ever found in EUO, EVER!

also on crafting mats does that only upgrade the +stat ingots or something?
User avatar
treos
I once posted in TFIOOC!
 
Posts: 101
Joined: Fri Dec 21, 2012 12:23 am

Re: ultimate polypile thread

Postby Keighn » Thu Jul 11, 2013 12:45 am

I reread the initial post and took this part as the most important with the code being possible things that might pop up from it. I was really hoping for more rare recipes like the horadric cube but this appears to be all there is:

eggmceye wrote:Massive spoilers: if you want to discover polypile leave now! Otherwise it's all laid bare here.

As far as I can understand it poly pile always req 3 items. These can be 3 different items (a PILE of 3) or 3 identical items (a stack of 3) or a combination thereof.

Basic polypile will let you:
* combine 3 foods into 2 new foods
* combine 3 gems into 2 new gems
* combine 3 scrolls into 2 new scrolls
* combine 3 potions into 2 new potions
* combine 3 reagants into 2 new reagants
* combine 3 body parts into 2 new body parts
* combine 3 rare items (eg sextant) into 2 rare items

Other recipes
dwarves
When polypiling potions, dwarves get a special ruleset:
- 3x yellow pot->2x mead
- 3x blue pot-> 2x pale ale
- 3x red pot -> extra stout

polypiling ingots & crafting mats
You can poly a stack of 3 of one crafting material into 1 of the same material with the enchantment (as in, attack) increased by +1
- min input item enchant is +1 - does not work on 3x plain ingots
- max input item is +4 for ingots of attack - as in you can poly 3x +4 attack ingots but not 3x +5 !
-- max is +14 for STR, DEX, INT (will make one ingot of +15)
-- max is +3 for def (will make one ingot of +4 defense)
- not all tints are accepted - generally speaking only the tints are allowed to be crafted with can be poly'd

polypiling weapons & armour
A pile or stack of 3 weapons and armour can be poly'd into one new piece. Study the code below to determine how that works. Hopefully it isn't too cheeseable - nor too useless!


A neat tidbit small note that I have thought very cool is that when you polypile the items the successful items(s) go into your inventory instead of just sitting there. That is pretty awesome IMHO.
User avatar
Keighn
Stop posting already --;
 
Posts: 4704
Joined: Sat Jun 26, 2004 10:13 am
Location: From the depths of Oregon he returns.... KEIGHN!!!!

Re: ultimate polypile thread

Postby Rumper » Fri Nov 06, 2015 3:08 am

Is it a bit too much too ask to be able to polypile addled and runed ingots?
User avatar
Rumper
I used to bake rockcakes in my bakery.
 
Posts: 152
Joined: Sun Jan 25, 2015 11:49 pm

Re: ultimate polypile thread

Postby Rumper » Thu Sep 22, 2016 7:09 pm

Also in the code I've seen the letter q. It decides how much the bonus is for a particular enchant. i4=random_enchant(itm, q)
Would you mind sharing the code for that q?

:)
User avatar
Rumper
I used to bake rockcakes in my bakery.
 
Posts: 152
Joined: Sun Jan 25, 2015 11:49 pm

Re: ultimate polypile thread

Postby 1[WoWz] » Fri Sep 23, 2016 2:16 am

Rumper wrote:Also in the code I've seen the letter q. It decides how much the bonus is for a particular enchant. i4=random_enchant(itm, q)
Would you mind sharing the code for that q?

:)


I don't know the code. But I've got a few tinted enchanted weapons from polypile.

Here is the list of the currently available enchants for random weapons:
AM - Harm
VAM - Greater Harm
XJ - Hex
AEP - Paralyze
OG - Lightning
IVPY - Earthquake
XMP - Vampire Bite
KXQ - Clone
VOG - Chain Lightning
IJO - Mana Burn
IMJ - Soul Trap
IGN: 1
User avatar
1[WoWz]
Girls only want boyfriends who have great skills.
 
Posts: 767
Joined: Wed Apr 21, 2004 6:48 pm
Location: Southern California, USA

Re: ultimate polypile thread

Postby LaughingCoyote » Tue Aug 22, 2017 8:50 pm

You guys probably all know this happens already, but can I keep this one? Pretty please with sugar on top?
You do not have the required permissions to view the files attached to this post.
Hecate wrote: I feel even more evil than ever, milking cows before killing them.

eggmceye wrote:pretty cool having vigour put in the manual after 14 years X-D
User avatar
LaughingCoyote
Girls only want boyfriends who have great skills.
 
Posts: 703
Joined: Fri Jan 02, 2004 10:30 pm

Re: ultimate polypile thread

Postby Keighn » Thu Aug 24, 2017 12:24 am

I guess the bug was fixed where giant polymorphs didnt shift chest containers around. Was Sooooo annoying.
Photobucket Suckz Monkey Nutz
User avatar
Keighn
Stop posting already --;
 
Posts: 4704
Joined: Sat Jun 26, 2004 10:13 am
Location: From the depths of Oregon he returns.... KEIGHN!!!!

Re: ultimate polypile thread

Postby Xophias » Sat Sep 16, 2017 8:39 am

Keighn wrote:I guess the bug was fixed where giant polymorphs didnt shift chest containers around. Was Sooooo annoying.

Nah, still does it if it spawns on the chests :roll:
Xophias
LAUGHING OUT LOUD LIKE A MORON
 
Posts: 59
Joined: Thu Sep 29, 2005 2:10 pm


Return to EUO Character Builds, Class Guides and Skill Guides

Who is online

Users browsing this forum: No registered users and 1 guest

cron