• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[MUI] Full screen inventory and shop + Custom item

content:
- mainly full screen inventory and shop without ~terrain cost and few other lil thing, check the images

Note:

1. Don't post nothing if you can't comment something usefull what improve this (exclude if u talk about in vjass this could be better, also irritate me that bullsht if someone say it is copy since i wrote this from 0 till now exclude the indexer and bribe dd's)

2. If you got good idea or helpfull ideea, comment about how to improve i am glad if u write it here.
ty very much



my rest upload was deleted about full screen craps but if someone want light height non attachment full screen inv. map then have old one http://shadowvzs87.uw.hu/upload/Advanced Inventory v2.0 -- Without attachments.w3x or with attachment http://shadowvzs87.uw.hu/upload/Advanced Inventory v2.0 --.w3x

Triggers and jass functions (outdated - not was time yet for change the uploaded ones)
http://www.hiveworkshop.com/forums/pastebin.php?id=zjvm9h - header
http://www.hiveworkshop.com/forums/pastebin.php?id=sfcvtd - map init
http://www.hiveworkshop.com/forums/pastebin.php?id=z437oq - create interface and trackables
http://www.hiveworkshop.com/forums/pastebin.php?id=tiyrmx - create item and bonus
http://www.hiveworkshop.com/forums/pastebin.php?id=3fuzux - Click to trackable
http://www.hiveworkshop.com/forums/pastebin.php?id=d93bmw - MouseOverTrackable
http://www.hiveworkshop.com/forums/pastebin.php?id=qhvdqs - item pick and stack
http://www.hiveworkshop.com/forums/pastebin.php?id=k9x38m - smaller trigger and functions

UPDATES


v0.99b
- few minor changes (like RegHero function at "init hashtables and .." trigger automatical save hero type into save load hashtable)
- Save - Load code added:
Features:
- data saved directly into hard disc, you can copy paste the code (example u started the map, copy-paste with notepad)
- few thing customizable in header - constants "SL_" functions (SL=the function or variable is part of the save load system)
- saveable: gold/lumber/coord/stat (str/agi/int)/class/hero/level & exp (dynamic), craft skill progress
-stat saving: hero current stat - stat from items - start stat
- since we talk about random stat items, not constant items, code became long, so this
system support multi save/load lines like: -load code1 then -load code2 ...
(where code1 and code2 is the saved code)
- multiple code line limit is 39 line, each line could be around max 100 character
- added the equipment saves too but still don't got time to make the loading part aswell
*idk about inventory saveing worth to do or no*

v0.99a
- fixed the bag system included with multiboard (ex. not was showed in multiboard the 1st item in bag)
and fixed when charm item bonus not was removed/added when u moved into bag, moved out
- summoner class stuffs
- several text fix with item properties in hover tool tip in shop (like if mouse on helm then its show buyable helm mdef/pdef)
- added timer to multiboard item tooltip, damage detection system - set damage part etc
- few minor changes

v0.99
- New socket items added and now easier to register new socket gems
in "Item Registration at Map Init" you need refister like ever item for attach icon to it
then use: call RegSocketGem (ItemRawCode, GemType, Grade, ItemLevelRequiment, ItemStatInArmor1, StatValueInArmor1, ItemStatInWeapon2, StatValueInWeapon2, ItemStatInWings3, StatValueInWings3)
- New socket gems also added to shop for test
- Gems working
- Minor text fix at multiboard pager (when u are at socket view)
- Since items & gems can give critical dmg bonus i reduced the default critical dmg (if u want change then constant function in header DEFAULT_CRITICAL_DAMAGE())
- Minor fix at tooltip in shop about weapon dmg, weapon dmg now globally changeable in header easily
- added minimum damage to weapons, multiboard/stats in inventory (ratio easily changeable in header)
- gem icon showed if u check Socket/Set view and item got inserted gem
- added item stat 82 => this attack or damage but depend on weapon, if physical weapon then give pattak if magic then magic attack, only used for gems

v0.98d
- replaced Damage detection system (see DamageEvent trigger, still using bribe unit indexer but now DDS by looking_for_help)
- at shop -> where is the wings added another 2 unique item, Hammer+Ring, they also a new set
you can combine the sets :)
- greatly decreased armor penetration effect becuase its op vs low hp and high defence boss
- reduced the mobs defence but increased the boss def lv by boss level/2

v0.98c
- set bonus stuff totally changed
- multiboard now show different page the inserted sockets and set list
useing Up / Down arrow on keyboard for change multiboard page
- same time multiboard functions a bit reorganised same like equipment systems
- Set and Unique item datas is in "Item Registratration at Map Init" trigger
- you can set your own set bonus
Note: total set bonus, so if ex. 2 item is equiped from same unique set then you get 1 bonus totally not per piece


v0.98b
- enabled the duratibility showing and reduced the value duratibility (200-500 at max level)
- disable the animation changes for non villager
- removed teh bonus socket slot (i don't see point in it)
- multiboard a bit changed (bonus thing in loop now)
- added 3 different icon to armor/ring/helmet/boot/amulet (depend on quality)
- fixed the bug when full screen player gold floating text dissappear when inventory was launched 2+ times and u equiped something
- bonus block damage add

v0.98
- changes was in:
Header - GetCraftLevel
ClickToTrackable - AddItem2HeroExt, CraftShopItem, FadeSlot, Craft_Quality_Chance, BuyItemFromShop
OnTrackable - Tooltip
Create Interface
Harvester Timer
- changed the prfession/craft leveling formula, now work well
- in shop the tooltip in right bottom corner now show with
yellow that item for what we got sufficient craft skill level
and red what is required higher craft level than we got
- item stack fix when u buy item from shop and its stack with another item
- fixed the bug when the slot 2211/-17/-21 not was clickable :D
- now the life materia lv3-6 craftable too
- rearranged the craft a bit, so can't craft high craft requiment item than ur craft skill
few item like wing/tome need jewellery lv3, life materia and few potion need pahamacist lv1
- added refine stone with 20x stack into shop
- harvest speed is configurable in Harvest Timer trigger.
- harvest speed increased by total craft skill (if you level your crafting skill => harvest faster)
- fixed a minor bug in FadeSlot function (nearly never occured)
- in ClickToTrackable>BuyItemFromShop function settable the craft fail chance and crafted item quality chance
JASS:
    //ClickToTrackable>BuyItemFromShop
    local boolean CraftFail = true
    local integer CraftFailChance = 33
    local integer CQCE_Normal = 80 // 80% quality chance equipment: normal
    local integer CQCE_Magic = 10 // 10% quality chance equipment: magic
    local integer CQCE_Rare = 6 // 6% quality chance equipment: rare
    local integer CQCE_VeryRare = 3 // 3% quality chance equipment: very rare
    local integer CQCE_Excelent = 1 // 1% quality chance equipment: excelent

v0.97
- minor fix with stat window border
- minor labels example at create item trigger
- minor fix of the icons when charged item used in old/regular wc3 inventory
- minor fix with multiboard when u click to potion/life materia etc what got description
- minor fix where any player hero can gain exp not only that one in hero variable array

v0.96
- floating text bug fixed at harvisting
- path blocker changed to flying unit path blocker
- optionable the inventory sensibility when u reicive damage, use chat for toggle it, command: "-inv sens"
- disable the defence bonus per agility because useless if i use my own system

v0.95b
- fix few trade problem (in normal 0.95 u was unable to leave or even u quited there was still the trade partner gold floating text)
- added ally function + replace the red startlocation function to native function what dont use location - in create heroes trigger
- few indentation thing

v0.95
- Tradeing gold and items enable again, so can trade with different players hero without problem
- also notice for scan target now u need type "-scan" then right click to target

v0.94
- dummy.mdx added
- now dont need to create dummy units anymore for inventory hero, just at
register hero set your hero path, then system create a dummy unit
attach the hero model like special effect and set the unit pitch angle with animation index
- added the inventory gold icon for inventory too
- added few thing to inventory hero box for look like 3d box


v0.93
- new design for inventory, dont flicker the destructibles anymore
- debug things remove, weapon activation and buffs tested

v0.92
- buff system added - core part merged into timer trigger
- fixed the revive trigger because the action was attached in loop

v0.91h
- fixed the bug when dummy villager disappear when u wear bow and reopen the inventory, also was few attachment problem after i introduced the non attachment heroes, but now all fixed
- added weapon activation/special skill what activated during u attack somebody


v0.91g
- unit now unselectable during FSS
- dropped and bought items are invulnarable now

v0.91f
- labels and function organizations, table description added

v0.91e
- added few tooltip and minor things
- added potion and gold drop for treasure box

v0.91d
- Bagpack system added, what is it? i added a item what could store 0-24 another item
- you can drop out this item and who pick up can open the bag and can swap item between items in bag and inventory
- when bag is sold to shop (full screen shop) then automatical destroyed all item what was inside with their data
- Treasure box
- Windows transition and close windows with ESC
-Window transition: change the current opened window to another, example from inventory to bag system

v0.91c
- pharmacist craft requiment added for custom potions also gave chance for stronger potions
- if u press ESC when you dont ahve multiboard then its show the total time when u played :D

v0.91b
- created hit function, for easily change the accurancy/eva=< hit rate formula
- added regen pots too
- scan changed, tiny change, use player index not unit custom value for array index but this way easier to check if player use atm a scan or no
- mp regen changed to flat value and isnt % now (ty maker for tip about useing mana regen neutral unit ability)
- set bonus fix (was a bit problem if u equiped too fast the items, its fixed)
- few correction on shop: now if item not craftable then craftbox is hidden, double icon=deselect, now allways buy item if u click 1st to item and 2nd time to any other item in unit inventory what not craft materia of selected item or just no item.
- added the chance option for AddRandomBonus function (this function give random bonus to items)
also made few modification about bonuses, like magic weapon don't get pattack bonus etc
- super potion added [hp/mp], pharmacist depend crafting aswell
- level requiment potion with dynmic heal/mana restore amount

v0.91a
- changed the life regen/mp regen to MUI
- added to drop/shop the Charm item type, 3 rarity:
- Common Charm (1-2 random bonus stat) - 88% chance
- Uncommon Charm (3-5 random stat) - 10% chance
- Superior Charm (5-7 random stat) - 2% chance
- fixed few price
- accurancy/evasion random stat now fixed (was shifted with 1 properties)

v0.9
- changed the item pick/attack so basically the right clicking
- 1st right click on item = item multiboard info, 2nd right click pick up
- 1st click on unit is scan unit, 2nd attack him
- lil fix on multiboard and added 5 materia into shop and into craft system

v0.8
- class restriction text fixed for armors what viable for 2 class too
- scan now periodical check the target hp
- with ESC u can destroy the multiboards

v0.7
- inventory work with non attachment heroes and with attachment heroes (like villager or just normal Paladin)
- inventory and shoping is MUI now, with simple
call RegHeroes ('unit raw code', 'unit raw code 2 for inventory', true/false (attachemnt unit or no), 1 (size, coz some hero could be bigger than inventory window, this way u can set it), 0 (hero class), 2 (unit type default damage without str))
- item class requiment added
- shop discount tiem properties added

v0.6
- added MUI nateria items harvesting, its mean u cant simple just right click and pick up a iron ore, u ened dig out
and this need time, have floating text what show the digging process percentage
Note: - once u digged out something and drop out, dont ened dig out again
- cant 2 people dig same item

v0.5
- added craft level system (higher level item need higher level craft skill)
- chance for getting better eq depend on craft level

v0.4
- drop fix
- added the 4 craft job:
- Blacksmith (weapons)
- Tailor (armors)
- Jeweller (ring/amulet+wing+tome)
- Pharmacist (potions but not added yet)

v0.3
- added info to multiboard tooltip and shop tooltip if mouse over a socket/refines stone/materia, atm u can assign +3 description for each item type
- equipments craft: now for higher level equipment need more craft materia (i use now a function what return with correct mat amount)


v0.2
- at craft you can get enhanced item (20% chance and 80% for normal item)
- this will be changed when i will add the production skills

v0.1
the starting map



[Working]
on item rot system

SCREEN SHOTS

fake%20interface.JPG

new_100.jpg

new_101.jpg

new_102.jpg

new_103.jpg

new_104.jpg

new_105.jpg

new_106.jpg

new_107.jpg

new_108.jpg

new_109.jpg

new_110.jpg
new_111.jpg

new_112.jpg

new_113.jpg



[Credit]
Damage Detection system with indexer:
Bribe

Model and icons:
Ergius - silver ore
Sunchips - few attachemnt
Blizzard - ore icons (copper + iron ore)
PeeKey - emerald/ametyst/ruby icon
others who made attachment and icons, i don't got their name but if u want use this map the pls add credit to them too

Keywords:
custom item stat attachment fun orpg rpg mui mpi full screen
Contents

Shadowvzs ORPG v0.99 (Map)

Reviews
Full screen inventory and shop + Custom item | Reviewed by Maker | 17th Aug 2013 APPROVED [tr][td] This is a cool system with nice features. It seems to work well. However it is a nightmare to import and configure. It should have been done in vjass.
Level 17
Joined
Nov 13, 2006
Messages
1,814
Okay system is great, but, what if i dont want to have completly random items?

Where I can manualy create items?

normal items?

call GenerateEQ (a, b, c, d, e, x, y, f, s)

explanation:
a=item type (already lsit somewhere, its like 1 if helm, a=2 if armor, a=3 if weapon etc)
b=subitem type (if item type helm/armor or booth then 1 if heavy wear, 2 if light wear, 3 if mage wear)
c=quality (0-6), 0 cracked,1=low quality,2=normal....5=excelent etc)
d=grade (damage for weapons or defence/hp for armor, critical strike for ring, etc is scaled to grade) (0-9999+)
e=item level requiment (0-9999+)
x=x coordinate where u want create
y=y coordinate where u want create
f=true or false (random element defence if armor, true or false. if true then armor can get example alot fire resistance and low water etc)
s=socket, how many socket item u want insert to this item maximum (0-499)

if u want special item then you can use the previous function to create normal one and add manually another bonus, like

set i = GenerateEQ (a, b, c, d, e, x, y, f, s)
call SaveInteger(udg_CItem_Table, i, BONUS, VALUE)


(BONUS=is number and it is the item properties, i listed the item properties already)
(VALUE obviously a number :p)

example u want +5% critical strike to item (lets say normal item, ring and gr10 with lv5 requiment) then it is

set i = GenerateEQ (6, 1, 2, 10, 5, GetUnitX(*your unit*), GetUnitY(*your unit*), false, 0)
call SaveInteger(udg_CItem_Table, i, 66, 5)
 
Level 1
Joined
Jun 19, 2014
Messages
3
too many bugs on this system. example

if u click to inventory spell on inventory.You cant close inventory.

if u click to esc on villager it starts to throw items but items don't clean on villager's inventory
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
too many bugs on this system. example

if u click to inventory spell on inventory.You cant close inventory.

if u click to esc on villager it starts to throw items but items don't clean on villager's inventory

exclude these what is the other too many bug?

but let me check too later, so if u use inventory ability during inventory then u unable click to esc button or it not work?

btw idk about esc thing, if that drop item or just create random items at villager position, coz i did that for able test the random items, maybe i didn't turned of the test trigger where the event is pressing escape button? or what esc do u mean what drop item?
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
@raijinthunderkeg

pls call something bug only if u understanded what it do, because i got no problem with working in ur "bug"

too many bugs on this system. example

if u click to inventory spell on inventory.You cant close inventory.

are u tested on this map or after u copied? because for me work properly without any problem, if u already in inventory then u can click to inventory icon but not do nothing :p

Code:
function Trig_Open_Inventory_Actions takes nothing returns nothing
    local integer pl = GetPlayerId(GetTriggerPlayer()) + 1
    set udg_Inv_Unit[pl] = GetUnitUserData(GetTriggerUnit())
[b]    if udg_Camera_Lock[pl] == 0 then[/b]
        call EnableCamLock(pl, 1)
     endif
endfunction

so when u already in invetory then if udg_Camera_Lock[pl] isn't 0

if u click to esc on villager it starts to throw items but items don't clean on villager's inventory

acctually u not drop it, it is a NEW random generated item, just try it out, press ESC on keyboard, it create random item at ur hero location and to be honest, this created when u press ESC and not when u click to close icon in inventory

trigger: Create item
Code:
function Trig_create_item_Actions takes nothing returns nothing
    local integer pl = GetPlayerId(GetTriggerPlayer()) + 1
    local unit u = udg_Hero[pl]

        //call GenerateEQ (- 1, - 1, -1, GetHeroLevel(u), GetHeroLevel(u), GetUnitX(u), GetUnitY(u), false, - 1)
        [b]call GenerateEQ (-1, -1, 6, 2, 2, GetUnitX(u), GetUnitY(u), false, - 1)
        [i]//if u dont want create item then simple remove this line above with bolded letters[/i][/b]
//call SetItemBaseData (itm, itype, subtype, quality, grade, lvreq, ethernal, dur, maxdur, maxsocket, setid)
//call SetItemProperties1 (id, hp, hpreg, hpsteal, hpkill, mp, mpreg, mpsteal, mpkill, phydef, fdef, wdef, ldef, pdef, edef)
//call SetItemProperties2 (id, mspeed, acc, eva, str, agi, int, attspd, block, exp, gold, drop)
//call SetItemProperties3 (id, refl, armpen, attlv, deflv, pdmg, mdmg, crit, cdmg, pp, bdmg1, bdmg2, bdmg3, bdmg4, bdmg5)

    set u = null
endfunction

//===========================================================================
function InitTrig_Create_item takes nothing returns nothing
    set gg_trg_Create_item = CreateTrigger( )
[b]    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Create_item, Player(0) )[/b]
  [b][i] //u can see this is only for player 1 and for test :p[/b][/i]
    call TriggerAddAction( gg_trg_Create_item, function Trig_create_item_Actions )
endfunction


Desync's seem to happen still, maybe check into it shadow.

Also when more then one enters into inventory and one leaves, the border of stats get removed.

when happen the desync?

about stat board, that was hard to me to see because tryed on virtualbox and on normal win and in virtual box the vga not work properly :/

oh i tested, with my wife laptop+my pc, we got no dc at all, i tryed turn on inventory, yes there a minor problem, its show to her the stat border, but thats all, then we try both launcfh inventory and work fairy good without dc
 
Last edited:
Level 24
Joined
Aug 1, 2013
Messages
4,657
Dem bugs

One question: How do I change the starting unspend stat points?
It is set to 500 at the start but I want to change it to 5.

Ow and here are 2 bugs that I saw in there.

1. The paladin seems to loop in channel stance somehow. (not from the beginning though)

2. Using a consumeable item in the regular inventory while your system is open, the inventory in the system doesn't update.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
One question: How do I change the starting unspend stat points?
It is set to 500 at the start but I want to change it to 5.

nvm I found it.

I must say that it is hard to implement because you also change the alliance of players and remove exp etc and people who want to use your systems do not want to have 3 hours of finding the source of those problems and then spending another 3 hours to set them right.

I now try to let another unit open the inventory of my hero (yes it is complicated but it is the only way) but I am starting to have problems.

These problems are a big problem for me because I am not used to jass or code at all.

Everyone understands triggers and maybe you should set basic stuff that people want to change those things.

Maybe also make simple instructions about how to create more items.
 
Last edited:
Level 17
Joined
Nov 13, 2006
Messages
1,814
One question: How do I change the starting unspend stat points?
It is set to 500 at the start but I want to change it to 5.

Ow and here are 2 bugs that I saw in there.

1. The paladin seems to loop in channel stance somehow. (not from the beginning though)

2. Using a consumeable item in the regular inventory while your system is open, the inventory in the system doesn't update.

1. in this map or where u added ? happened something before?
2. fixed

u can fix too just scroll down in Unit Use Item
and replace this the part with this
JASS:
    if udg_Camera_Lock[pl] > 0 then
   // if udg_Camera_Lock[pl] == 1 then
        set i = 0
        set c = GetItemCharges(itm1)

        if c == 0 then
            loop
                exitwhen i > 5
                set itm2 = UnitItemInSlot(u, i)
                if itm1 == itm2 then
                   call RemoveIcon(pl, 200+i)
                endif
                if itm2 == null then
                    set d = LoadDestructableHandle(udg_FSS, 2409 + pl, 200 + i)
                    if d != null then
                        call RemoveDestructable(d)
                    endif
                endif
                set i = i + 1
            endloop
        endif

        call SetChargesText(pl)

        set itm2 = null
        set d = null
    endif

you also change the alliance of players

reason is because when i test it, i dislike when i want trade or do something then another player attack me

if u want disable then go to Create Heroes and gold for test and Lv up func trigger
and disable this line
JASS:
       call MakeAllyFromPlayer(i - 1)

you can disable with //

JASS:
       //call MakeAllyFromPlayer(i - 1)

few thing in that trigger was made for test

and remove exp ....

this if i remove then exp doesn't became customized, default wc3 exp system is bad, like u see have item option with + %exp, there usefull if we add exp with trigger, it is automatical added to killer hero anyway because it is here Revive Respawn Drop trigger.

JASS:
            set exp = R2I((udg_Global_Exp[cvd] * ((100.00 + udg_Stat_Exp[cvk]) / 100.00)))
            call SuspendHeroXP(ku, false) // this turn on exp
            call AddHeroXP(ku, exp, true) //this add exp to killer unit (ku variable), exp variable calculated by
            //your bonus %exp lets say 10%+100%=>110%=>1.10*experience value of dieing unit what was stored into Gloval_Exp[custom value of dieing unit]
          //this make u able the enemy unit exp value when u want, example u want make a quest where need kill something and you want make these unit give higher exp than useally then change that variable
            call SuspendHeroXP(ku, true)  //this turn off exp

I now try to let another unit open the inventory of my hero (yes it is complicated but it is the only way) but I am starting to have problems.
this ahve no point, why do you want open with another unit ur hero inventory if u can pout into spellbook ur inventory ability and dont take much space?
or make every unit inventory by adding inventory ability?

with other player u can trade and if u move ur item into trade slot then he can see it as u

Maybe also make simple instructions about how to create more items.
create new item like its do the ESC key or what?


Wietlol said:
shadowvzs said:
createing new item like a new kind example new weapon type what not exist or simple just a item what type exist?

Creating a new item with the same subtype as another. Like creating a new shield.
I can see the different grades on items in-game but I can't see where they are made.
The idea is that I make items with different names, models, stats, icons, etc.
(I don't need a shop for now so that will not be a big problem.)

Also I tried to change the names of the classes and add some new ones but I can't find the source of any of those.
I do see that they are in the 633rd column/row of the FSS hashtable but I don't know how you connect it to the classes.

Creating a new hero with his new class wouldn't be a problem.
That part is just very simple and doesnot require much to be made.

I can try to simplify it all together and give you an example of easy implementation but not before I know how it works myself.

shadowvzs said:
about experience, it was disabled for able add with trigger because then customizable the exp reward for monster, else if u use normal wc3 exp then u screwed because must set after every mosnter type etc until with unit indexer it is easily made in few line.

btw u get exp just with trigger not directly.

That does make sense.
In the normal system, the exp you gain depends on the type of unit and on its level. So far I know it is the only thing that level actually does.

the item model was added in header, here we associet to item type a item raw code, example ring with 'rin1' raw code what is a existing item like other items too, i can use more item type if u make if with let say quality 4,5 etc (quality numbers was noted at item properties at triggers)
JASS:
function itype2TOitemId takes integer itype, integer subtype, integer quality returns integer
    local integer i = 0
    if itype == 1 then
        set i = 'ckng'
    elseif itype == 2 then
        set i = 'rin1'
    elseif itype == 3 then
        if subtype == 1 then //short sword
            set i = 'rat9'
        elseif subtype == 2 then // mace
            set i = 'rde3'
        elseif subtype == 3 then // axe / hammer
            set i = 'rde1'
        elseif subtype == 4 then // polearm
            set i = 'evtl'
        elseif subtype == 5 then // long sword
            set i = 'ajen'
        elseif subtype == 6 then // bow
            set i = 'lgdh'
        elseif subtype == 7 then // dagger
            set i = 'desc'
        elseif subtype == 8 then // wand
            set i = 'ward'
        elseif subtype == 9 then // staff
            set i = 'brac'
        endif
    elseif itype == 4 then //shoes or boot
        set i = 'rag1'
    elseif itype == 5 then //shield
        set i = 'sbch'
    elseif itype == 6 then //ring
        set i = 'rlif'
    elseif itype == 8 then //amulet
        set i = 'spsh'
    elseif itype == 9 then // wing
        set i = 'ccmd'
    elseif itype == 10 then //tome
        set i = 'hval'
    elseif itype == 11 then //charm
        set i = 'cnob'
    endif
    return i
endfunction

if this done then u need copy a existing icon (object editor destructible since they are descructible just the texture different) for able show in full screen inventory,we must assign desctructible raw code to item raw code in map init

JASS:
    call RegisterItem('rin1', 'B00K', "Armor1.mdx", 13, 102, "Armor", 0)

Armor1.mdx is the imported armor model what we attach the villager chest but u can use null too if u dont use villager, 102 is the item level (u can check item level in object editor), 13 is the price (note: lv*13), desc=description its string

JASS:
function RegisterItem takes integer id, integer dest, string path, integer price, integer lv, string descr, integer subtype returns nothing
    if path != null then
        call SaveStr(udg_FSS, 601, id, path)
    endif
    if descr != null then
        call SaveStr(udg_FSS, 604, id, descr)
    endif
    call SaveInteger(udg_FSS, 600, id, dest)
    call SaveInteger(udg_FSS, 602, id, price)
    call SaveInteger(udg_FSS, 603, id, lv)
    if subtype > 0 then
        call SaveInteger(udg_FSS, 605, id, subtype)
    endif
endfunction

another header function for item createion and formulas
JASS:
function SetItemBaseData takes item itm, integer itype, integer subtype, integer quality, integer grade, integer lvreq, integer ethernal, real dur, real maxdur, integer maxsocket, integer setid returns nothing
    local integer id = GetHandleId(itm)
    local integer str = 0
    local integer agi = 0
    local integer int = 0
    local integer price = grade * 10
    local integer class = 0
    local real r = 0

    if itype == 5 and subtype == 0 then
        set subtype = 1
    endif

    if lvreq > 0 then
        if itype < 5 and itype != 3 then
            if subtype == 1 then
                set class = 1
                set str = lvreq * 3 + 5
                set agi = lvreq * 1 + 5
            elseif subtype == 2 then
                set class = 3
                set str = lvreq * 1 + 5
                set agi = lvreq * 3 + 5
            elseif subtype == 3 then
                set class = 5
                set str = lvreq * 1 + 5
                set int = lvreq * 3 + 5
            endif
        elseif itype == 3 or itype == 5 then
            if subtype < 3 or itype == 5 then
                set class = 2
                set str = lvreq * 2 + 5
                set agi = lvreq * 2 + 5
            elseif subtype == 3 then
                set class = 1
                set str = lvreq * 4 + 5
                set agi = lvreq + 5
            elseif subtype < 6 then
                set class = 2
                set str = lvreq * 4 + 5
                set agi = lvreq + 5
            elseif subtype < 8 then
                set str = lvreq + 5
                set agi = lvreq * 4 + 5
                if subtype == 6 then
                    set class = 3
                else
                    set class = 4
                endif
            elseif subtype == 8 then
                set class = 5
                set str = lvreq * 2 + 5
                set int = lvreq * 3 + 5
            elseif subtype == 9 then
                set class = 5
                set str = lvreq + 5
                set int = lvreq * 4 + 5
            endif
        endif
    endif

    if maxdur == 0 then
        if itype == 1 then
            set r = 1.5
        elseif itype == 2 then
            set r = 2
        elseif itype == 3 then
            set r = 2.8
        elseif itype == 4 then
            set r = 1.2
        elseif itype == 5 then
            set r = 2.4
        elseif itype == 6 then
            set r = 1.7
        elseif itype == 8 then
            set r = 1.9
        elseif itype == 9 then
            set r = 2.3
        endif

        set maxdur = (grade * 5.00 + 33) * r
        set dur = maxdur

        if quality == 0 then
            set dur = dur / 3.00 + 10
            set maxdur = dur * 2.00
            set price = price / 2
        elseif quality == 1 then
            set dur = dur / 3.00 + 10
            set maxdur = dur * 2.00
            set price = price / 2
        elseif quality == 6 then
            set dur = dur * 1.2
            set maxdur = dur
            set price = R2I(price * 1.2)
        elseif quality == 7 then
            set dur = dur * 1.5
            set maxdur = dur
            set price = R2I(price * 1.5)
        endif
    endif

    if maxsocket == - 1 then
         set maxsocket = GetRandomInt(quality/2+grade/50, quality/2 + grade/50 + 1)
    endif

    if itype == 10 or itype == 11 then
        set price = price * 2
        set maxsocket = 0
        set lvreq = 0
    elseif itype == 6 or itype == 8 or itype == 5 then
        set maxsocket = 0
    endif

    call SaveInteger(udg_CItem_Table, id, 1, GetItemTypeId(itm))
    call SaveInteger(udg_CItem_Table, id, 2, itype)
    call SaveInteger(udg_CItem_Table, id, 3, subtype)
    call SaveInteger(udg_CItem_Table, id, 4, quality)
    call SaveInteger(udg_CItem_Table, id, 6, class)
    call SaveInteger(udg_CItem_Table, id, 7, grade)
    call SaveInteger(udg_CItem_Table, id, 8, lvreq)
    call SaveInteger(udg_CItem_Table, id, 12, price)
    if itype != 11 then
        call SaveInteger(udg_CItem_Table, id, 9, str)
        call SaveInteger(udg_CItem_Table, id, 10, agi)
        call SaveInteger(udg_CItem_Table, id, 11, int)
        call SaveInteger(udg_CItem_Table, id, 13, ethernal)
        call SaveReal(udg_CItem_Table, id, 14, dur)
        call SaveReal(udg_CItem_Table, id, 15, maxdur)
        call SaveInteger(udg_CItem_Table, id, 20, maxsocket)
        if setid > 0 then
            call SaveInteger(udg_CItem_Table, id, 5, setid)
        endif
    endif
endfunction
 
Last edited:
Level 24
Joined
Aug 1, 2013
Messages
4,657
1. It happens only sometimes... Maybe it happened because I changed something to the triggers.

The bigger problem of the EXP system is that in your map the heroes don't gain exp too.
So I thought that it was some kind of mistake in what you made.
Maybe it is unfinished or just didn't work on neutral monsters but a custom exp system is nice indeed.

Opening it with another units is just something that I wanted to have for my map.
I have a unit (Menu) that has all stuff like inventory.
I found out how I could do it and it works fine.

new items is a lot of information in one moment.
We will complete that in private messages.
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
isn't bug, just i forgeted change... to know why not work u must know the ystory, this map originally was made for use 1 hero per player, the village is the hero, so i stored like

Hero[player number of that player what owning the villager] = villager

now u will understand this in respawn trigger
JASS:
   if ku == udg_Hero[plk] then
replace that with this, this give to every player unit who is hero too
JASS:
 if GetPlayerController(pk) == MAP_CONTROL_USER and IsUnitType(ku, UNIT_TYPE_HERO) then

1. It happens only sometimes... Maybe it happened because I changed something to the triggers.

could if u pause the unit or the ability is channel based and u forget remove the channeling effect from it

Wietlol said:
I've read your post and most of it makes sense now.
The only thing that I couldn't find is the stats of an item.
I do see where you set the requirements of an item if I am right.
At the bottom of SetItemBaseData, you save integers of str, agi and int.
I guess that those are requirements for the item.

I can't see what bonusses it grants.
for example:
- Bonus HP
- Physical Defense
- Physical Damage
- Bonus Exp
- etc.

And what does dur and maxdur?
(Just a question but before everything is ruined I would like to know before I create numberless items and get hours of work to set everything right.)

It can be true that I read over it.

I also see that you create the names of the classes in the header. I will take a look and see if I can do that on my own.

Now there is only one more question.
I create a simple unit and when I kill it I want it to drop a specific item.
Like an Excellent Mage Boot of grade 5.

How do I do that?
Also how do I create an Item (Same stuff) and give it to the hero?

Both have to be called when a trigger runs.
I do like to create quests and stuff in regular triggers and normally I use the "Create Item and give it to the Hero" or "Create Item on location of dying unit".

Can I just use "Custom Script" and then type call ThisFunction() in a trigger while ThisFunction is declarated in another Trigger?


you are right about stat thing

about where the addons comming its mostly whole create item trigger

but mostly this (btw addon is the stat what is bonus on item and not default)

JASS:
function GenerateEQ takes integer itype, integer subtype, integer quality, integer grade, integer lv, real x, real y, boolean rndDef, integer maxsocket returns integer
    local integer rnd = GetRandomInt(0, 99)
    local integer mingrade = 1
    local integer ethernal = 0
    local integer pdef
    local integer mdef
    local integer mdef1 = 0
    local integer mdef2 = 0
    local integer mdef3 = 0
    local integer mdef4 = 0
    local integer mdef5 = 0
    local integer i
    local integer tmdef
    local integer id
    local real m
    local real m2
    local item itm
    if itype == 7 then
        set itype = 3
        set subtype = GetRandomInt(0, 9)
    endif

    if grade == - 1 and rnd < 10 then
        set ethernal = 1
    endif

    set rnd = GetRandomInt(0, 99)

    if grade == - 1 then
        if lv < 1 then
            set lv = 1
        endif
        if lv > 10 then
            set mingrade = lv - 10
        endif
        set grade = GetRandomInt(mingrade, lv)
        if lv > grade then
            set lv = grade
        endif
    endif

    if itype == - 1 or subtype == -1 then
       if itype == -1 then
        set itype = GetRandomInt(1, 9)
       endif
        if itype == 7 then
            set itype = 3
            set subtype = GetRandomInt(1, 9)
        elseif itype == 9 then
            set itype = 11
        endif
        if itype == 1 or itype == 2 or itype == 4 then
            set subtype = GetRandomInt(1, 3)
        elseif itype == 3 then
            set subtype = GetRandomInt(1, 9)
        else
            set subtype = 1
        endif
    endif

    if itype == 11 then
       if quality == -1 then
           set rnd = GetRandomInt(0, 99)
           if rnd < 2 then
              set quality = 3
           elseif rnd < 10 then
              set quality = 2
           else
              set quality = 1
           endif
       endif
    endif

    set itm = AddCustomItem (x, y, itype, subtype, quality)
    call SetItemBaseData (itm, itype, subtype, quality, grade, lv, ethernal, 0, 0, maxsocket, 0)

    set id = GetHandleId(itm)
    call SaveItemHandle(udg_CItem_Table, id, 100, itm)
    if itype == 1 or itype == 2 or itype == 4 then
        if itype == 1 then
            set m = 0.7
        elseif itype == 2 then
            set m = 1
        elseif itype == 4 then
            set m = 0.55
        endif
        if subtype == 1 then
            set m2 = 1.5
            set pdef = R2I((10.00 * 3.33 * grade * ((8 + quality) / 10.00)) * m) + 30
            set mdef = R2I((3 * 3.33 * grade * ((8 + quality) / 10.00)) * m) + 10
        elseif subtype == 2 then
            set m2 = 1.25
            set pdef = R2I((5.00 * 3.33 * grade * ((8 + quality) / 10.00)) * m) + 15
            set mdef = R2I((5 * 3.33 * grade * ((8 + quality) / 10.00)) * m) + 15
        elseif subtype == 3 then
            set m2 = 1
            set pdef = R2I((3.00 * 3.33 * grade * ((8 + quality) / 10.00)) * m) + 10
            set mdef = R2I((10 * 3.33 * grade * ((8 + quality) / 10.00)) * m) + 30
        endif
        if rndDef then

            set tmdef = mdef * 5
            set i = GetRandomInt(0, mdef * 2)
            set tmdef = tmdef - i
            set mdef1 = i
            set i = GetRandomInt(0, mdef * 2)
            set tmdef = tmdef - i
            set mdef2 = i
            set i = GetRandomInt(0, mdef * 2)
            if i > tmdef then
                set mdef3 = tmdef
                set tmdef = 0
            else
                set tmdef = tmdef - i
                set mdef3 = i
            endif
            set i = GetRandomInt(0, mdef * 2)
            if i > tmdef then
                set mdef4 = tmdef
                set tmdef = 0
            else
                set tmdef = tmdef - i
                set mdef4 = i
            endif
            set i = GetRandomInt(0, mdef * 2)
            if i > tmdef then
                set mdef4 = tmdef
                set tmdef = 0
            else
                set tmdef = tmdef - i
                set mdef4 = i
            endif
        else
            set mdef1 = mdef
            set mdef2 = mdef
            set mdef3 = mdef
            set mdef4 = mdef
            set mdef5 = mdef
        endif

        call SaveInteger(udg_CItem_Table, id, 26, R2I(m2 * m * 10.00 * grade * ((8 + quality) / 10.00)))
        call SaveInteger(udg_CItem_Table, id, 34, R2I(pdef))
        call SaveInteger(udg_CItem_Table, id, 35, R2I(mdef1))
        call SaveInteger(udg_CItem_Table, id, 36, R2I(mdef2))
        call SaveInteger(udg_CItem_Table, id, 37, R2I(mdef3))
        call SaveInteger(udg_CItem_Table, id, 38, R2I(mdef4))
        call SaveInteger(udg_CItem_Table, id, 39, R2I(mdef5))

    elseif itype == 3 then
       if subtype < 8 then
         call SaveInteger(udg_CItem_Table, id, 52, R2I((grade * (8 + quality) / 10.00) * WeaponDamageModifier(subtype)) )
       else
         call SaveInteger(udg_CItem_Table, id, 53, R2I((grade * (8 + quality) / 10.00) * WeaponDamageModifier(subtype)) )
       endif
    elseif itype == 9 then
        call SaveInteger(udg_CItem_Table, id, 50, R2I((grade * (8 + quality) / 10.00) / 3 + 1))
        call SaveInteger(udg_CItem_Table, id, 51, R2I((grade * (8 + quality) / 10.00) / 3 + 1) )
    elseif itype == 5 then
        call SaveInteger(udg_CItem_Table, id, 34, R2I((grade * (8 + quality) / 10.00) * 3 + 30))
        call SaveInteger(udg_CItem_Table, id, 43, R2I((grade * (8 + quality) / 10.00) / 10 + 5))
    elseif itype == 8 then
        call SaveInteger(udg_CItem_Table, id, 34, R2I((grade * (8 + quality) / 10.00) * 8.75 + 30))
        call SaveInteger(udg_CItem_Table, id, 41, R2I((grade * (8 + quality) / 10.00) * 1.5 + 10))
        call SaveInteger(udg_CItem_Table, id, 42, R2I((grade * (8 + quality) / 10.00) * 1 + 10))
    elseif itype == 6 then
        call SaveInteger(udg_CItem_Table, id, 52, R2I((grade * (8 + quality) * 0.135) + 1))
        call SaveInteger(udg_CItem_Table, id, 53, R2I((grade * (8 + quality) * 0.135) + 1))
        call SaveInteger(udg_CItem_Table, id, 54, R2I((grade * (8 + quality) / 250.00) + 1))
    endif
  

    if quality == 1 then
        if itype == 11 then
           call AddRandomBonus (id, grade, itype, GetRandomInt(1,2))
        endif
    elseif quality == 2 then
        if itype == 11 then
           call AddRandomBonus (id, grade, itype, GetRandomInt(3,4))
        endif
    elseif quality == 3 then
        if itype == 11 then
           call AddRandomBonus (id, grade, itype, GetRandomInt(5,7))
        else
        set rnd = GetRandomInt(0, 9)
        if rnd < 7 then
            call AddRandomBonus (id, grade, itype, 1)
        elseif rnd < 9 then
            call AddRandomBonus (id, grade, itype, 2)
        elseif rnd == 9 then
            call AddRandomBonus (id, grade, itype, 3)
        endif
        endif
    elseif quality == 4 then
        set rnd = GetRandomInt(0, 9)
        if rnd < 4 then
            call AddRandomBonus (id, grade, itype, 2)
        elseif rnd < 7 then
            call AddRandomBonus (id, grade, itype, 3)
        elseif rnd == 9 then
            call AddRandomBonus (id, grade, itype, 4)
        endif
    elseif quality == 5 then
        set rnd = GetRandomInt(0, 9)
        if rnd < 5 then
            call AddRandomBonus (id, grade, itype, 3)
        elseif rnd < 9 then
            call AddRandomBonus (id, grade, itype, 4)
        else
            call AddRandomBonus (id, grade, itype, 5)
        endif
    elseif quality == 6 then
        set rnd = GetRandomInt(0, 9)
        if rnd < 4 then
            call AddRandomBonus (id, grade, itype, 4)
        elseif rnd < 6 then
            call AddRandomBonus (id, grade, itype, 5)
        elseif rnd < 9 then
            call AddRandomBonus (id, grade, itype, 6)
        elseif rnd == 9 then
            call AddRandomBonus (id, grade, itype, 7)
        endif
    endif
 
    set itm = null
    return id
endfunction

dur/maxdur = duratibility like if duratibility is 0 then item will be automatical deequiped/removed from slot and cant equip again until u repair it


about createing excelent items, u must check the item qualities, have cracked, low quality, normal, magic rare excelent, so just a number

JASS:
call GenerateEQ (-1, -1, 6, 100, 1, GetUnitX(u), GetUnitY(u), false, - 1)
//that 6 is the quality and that is excelent,2 is normal etc its wrote on map
// boot will be
call GenerateEQ (4, 3, 6, 5, 5, GetUnitX(u), GetUnitY(u), false, - 1)
//2 - type  (1=helm,2=amor,3=weapon,4=boot,5=shield,6=ring,8=amulet,9=wing,10=tome)
//3 - sub type (if armor then heavy/light/robe, weapon: 1.short sword/2. mace/3. axe/4. spear/5. long sword/6. dagger/7. bow/8. wand/9.staff)  
//4 - quality (0-cracked,1-low quality,2=normal, 3=magical, 4=rare, 5=crafted, 6=excelent, 7=unique)

here

JASS:
function GenerateEQ takes integer itype, integer subtype, integer quality, integer grade, integer lv, real x, real y, boolean rndDef, integer maxsocket returns integer

btw -1 is allways random, so its randomize the item type,subtype is random in above example, grade is 100 and level requiment is 1.

functions can use if:
a) what u want call it is on same trigger than from where u call, like its above than ur function
b) in header function, from header any function callable

btw the multiboard a bit fixed if u want search the multiboard tooltip function from header and replace on ur map with new one

my advice if u want play with it u can move exclude the action and main trigger function everything from create item to map header and call it when u want with generateeq stuff or drop
 
Level 28
Joined
Oct 28, 2011
Messages
4,759
I don't know if someone already brought this up before(or if it is already fixed) but the profession thingy doesn't level up well. I can't remember all the details because I tested this like a month ago. I tried to level up all the profession but the all three doesn't level up anymore when it reaches Level 3.( And I think the exp raise also doesn't scale well). It has other factors on the bug that I can't recall but the problem is pretty obvious and major.
 

Kazeon

Hosted Project: EC
Level 33
Joined
Oct 12, 2011
Messages
3,449
Here, take my 5/5 :)

Perhaps it's a leviathan to be imported but still far better than making it from scratch ;) Great job!

EDIT:
I've been eyeing this system for several days. For efficiency it's good enough for a huge system like this. But this is just totally not user friendly. Looked at header code and found that it's not friendly at all. First of all, I would suggest that you should have done this in vJass to make things easier and neater. And this system is way too static, it's hard or even impossible to add some custom additional plug-ins like item forging (from user's perspective). Then you should write some wrappers for registering things. e.g.
JASS:
constant function EFFECT takes integer i returns string
    if i == 1 then
        return "Objects\\Spawnmodels\\Human\\HumanBlood\\HumanBloodPeasant.mdl"
    elseif i == 26 then
        return "Abilities\\Spells\\Human\\Heal\\HealTarget.mdl"
    elseif i == 30 then
        return "Abilities\\Spells\\Undead\\ReplenishMana\\SpiritTouchTarget.mdl"
    else
        return ""
    endif
endfunction

//where we want attach the effect on unit
constant function EFFECT_POINT takes integer i returns string
    if i == 1 then
        return "chest"
    elseif i == 26 then
        return "origin"
    elseif i == 30 then
        return "origin"
    else
        return ""
    endif
endfunction
=>
JASS:
function RegisterEffect takes integer index, string filePath, string attachPt returns nothing
I'm sorry, this is one great system. But it's just not enough for my 5/5, I'm sorry again.
 
Last edited:
Level 17
Joined
Nov 13, 2006
Messages
1,814
I don't know if someone already brought this up before(or if it is already fixed) but the profession thingy doesn't level up well. I can't remember all the details because I tested this like a month ago. I tried to level up all the profession but the all three doesn't level up anymore when it reaches Level 3.( And I think the exp raise also doesn't scale well). It has other factors on the bug that I can't recall but the problem is pretty obvious and major.

can you explain what do you mean about exp doesnt scaled well?

normally its must work each level need more exp for level up like for lv2 need more exp than lv1,for lv3 need more than lv2 also u need craft same level than ur craft skill or 1 level lower, so normally if i remember then lv1 craft dont give exp anymore if ur skill is lv3, so u need craft lv3 or lv2 for gain exp

i have very short time due of work, i added 98 lumber, iron ore and leather (i forget change your start level but with whosyourdaddy i guess still could be ok)

btw ty vm the testings
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
update
last changes - have fun :)
v0.98
- changes was in:
Header - GetCraftLevel
ClickToTrackable - AddItem2HeroExt, CraftShopItem, FadeSlot, Craft_Quality_Chance, BuyItemFromShop
OnTrackable - Tooltip
Create Interface
Harvester Timer
- changed the prfession/craft leveling formula, now work well
- in shop the tooltip in right bottom corner now show with
yellow that item for what we got sufficient craft skill level
and red what is required higher craft level than we got
- item stack fix when u buy item from shop and its stack with another item
- fixed the bug when the slot 2211/-17/-21 not was clickable :D
- now the life materia lv3-6 craftable too
- rearranged the craft a bit, so can't craft high craft requiment item than ur craft skill
few item like wing/tome need jewellery lv3, life materia and few potion need pahamacist lv1
- added refine stone with 20x stack into shop
- harvest speed is configurable in Harvest Timer trigger.
- harvest speed increased by total craft skill (if you level your crafting skill => harvest faster)
- fixed a minor bug in FadeSlot function (nearly never occured)
- in ClickToTrackable>BuyItemFromShop function settable the craft fail chance and crafted item quality chance

can anyone make it to GUI
Because i don't know how to Import a JASS
and i'm working with GUI
i don't know how to fix a problem in JASS
impossible to make in fully gui i guess
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
well an a lil alpha update :p

o uploaded the map but got no time for longer description, basically gem/socket stone registration added, new gem option and more variation, smart gem/potion stack (not based on item type, its based on unique id), gems got grade, something like quality in diablo where was chipped, broken, flawed, normal, flawless, perfect, *super


screenshot added

*later will work on save load code and minor icon in multiboard for gems
 

Attachments

  • 1.JPG
    1.JPG
    363.5 KB · Views: 102
  • 2.jpg
    2.jpg
    358.2 KB · Views: 82
  • 3.jpg
    3.jpg
    357.3 KB · Views: 88
Level 17
Joined
Nov 13, 2006
Messages
1,814
well i acctually curious about if someone found bug or got a nice ideea, because i am glad to fix if someone see something not ok

(the topic about rewriteing in vjass for me closed since already have alot vjass stuff but no jass :p)
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
I've test it many times. And I try to rewrite this. It'll be mine :))

in vjass someone already write similiar system so u don't make big deal if u write it in vjass lol
already was dgui system in vjass what look better than this :p

other side i not copied this system at all, i wrote from 0 because i wanted make myself, ofc till here was alot, i starte with multiboard bag hehe, but if u see i don't asked credit at 1st post, if someone want give , then give, if no then dont give, its ok to me, same if u want rewrite :p

but i will finish this ....

ok ok ill test it for ya

ty, any comment about where improve the map could be nice (well if good and i can do hehe)

atm i writeing saveload system into this

-btw have a minor bug when 2 unit spawned at shop area (like cast feral spirit near shop) but that i fixed already just not uploaded yet (it was disapeared floating text and sometimes 1 summoned unit stucked )

-another what was fixed but not uploaded yet is: no exp floating text if hero is max level, same no gold floating text if player gold is maxed

-sometimes don't show dmg floating text at dmage (only at revived boss) - atm i working on fixing this too if i can but seems a bit complex (simple dmg trigger sometimes skipper then sometimes work again, units well indexed)
 
Last edited:
Level 17
Joined
Nov 13, 2006
Messages
1,814
add some custom additional plug-ins like item forging (from user's perspective). Then you should write some wrappers for registering things. e.g.
JASS:
constant function EFFECT takes integer i returns string
    if i == 1 then
        return "Objects\\Spawnmodels\\Human\\HumanBlood\\HumanBloodPeasant.mdl"
    elseif i == 26 then
        return "Abilities\\Spells\\Human\\Heal\\HealTarget.mdl"
    elseif i == 30 then
        return "Abilities\\Spells\\Undead\\ReplenishMana\\SpiritTouchTarget.mdl"
    else
        return ""
    endif
endfunction

//where we want attach the effect on unit
constant function EFFECT_POINT takes integer i returns string
    if i == 1 then
        return "chest"
    elseif i == 26 then
        return "origin"
    elseif i == 30 then
        return "origin"
    else
        return ""
    endif
endfunction
=>
JASS:
function RegisterEffect takes integer index, string filePath, string attachPt returns nothing

i checked, these effect part was made long ago but acctually it was used this way (below) and i don't see how would work what you said

JASS:
AddSpecialEffectTarget(EFFECT(eff), udg_UDexUnits[cv], EFFECT_POINT(eff))
AddSpecialEffectTarget(EFFECT(1), t, EFFECT_POINT(30))
//so not allways same effect on same place also then i must put 
//AddSpecialEffectTarget into register function what at end look like a bj stuff :/

//this no point in this form because where the unit where u attach the effect?
function RegisterEffect takes integer index, string filePath, string attachPt returns nothing
//if i use this then it just a parent function for normal native one lol
function RegisterEffect takes unit u, string filePath, string attachPt returns nothing

i don't got what pluggin do you mean and how could be impossible to add except if u mean the progressbar
 

Kazeon

Hosted Project: EC
Level 33
Joined
Oct 12, 2011
Messages
3,449
i checked, these effect part was made long ago but acctually it was used this way (below) and i don't see how would work what you said

JASS:
AddSpecialEffectTarget(EFFECT(eff), udg_UDexUnits[cv], EFFECT_POINT(eff))
AddSpecialEffectTarget(EFFECT(1), t, EFFECT_POINT(30))
//so not allways same effect on same place also then i must put 
//AddSpecialEffectTarget into register function what at end look like a bj stuff :/

//this no point in this form because where the unit where u attach the effect?
function RegisterEffect takes integer index, string filePath, string attachPt returns nothing
//if i use this then it just a parent function for normal native one lol
function RegisterEffect takes unit u, string filePath, string attachPt returns nothing

i don't got what pluggin do you mean and how could be impossible to add except if u mean the progressbar

I understand why you were doing so, but adding some wrappers, like what I have suggested before, is way better and more friednly. Those long and fat ITE checking is one poor and slow approach. Consider using array variables more than ITE checking:
JASS:
function RegisterItem takes integer id, real data1, ...<some other datas>... , string sfxFilePath, string sfxAttachPt returns nothing
    set ItemCounter = ItemCounter + 1
    // First save the index into a hashtable with item's id as parent key
    call StoreInteger(Hashtable, id, 0, ItemCounter)
    set ItemTable[ItemCounter].data1 = data1
    ....
    set ItemTable[ItemCounter].sfx = sfxFilePath
    set ItemTable[ItemCounter].sfxPt = sfxAttachPt
endfunction

Later if you want to call for the datas you can use this:
JASS:
// Getting item's index in the list
local integer dex = GetStoredInteger(Hashtable, itemID, 0)

//Getting item's sfx
call AddSpecialEffect(ItemTable[dex].sfx, x, y)

It's vJass indeed. But I hope you understand my point.
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
I understand why you were doing so, but adding some wrappers, like what I have suggested before, is way better and more friednly. Those long and fat ITE checking is one poor and slow approach. Consider using array variables more than ITE checking:
JASS:
function RegisterItem takes integer id, real data1, ...<some other datas>... , string sfxFilePath, string sfxAttachPt returns nothing
    set ItemCounter = ItemCounter + 1
    // First save the index into a hashtable with item's id as parent key
    call StoreInteger(Hashtable, id, 0, ItemCounter)
    set ItemTable[ItemCounter].data1 = data1
    ....
    set ItemTable[ItemCounter].sfx = sfxFilePath
    set ItemTable[ItemCounter].sfxPt = sfxAttachPt
endfunction

Later if you want to call for the datas you can use this:
JASS:
// Getting item's index in the list
local integer dex = GetStoredInteger(Hashtable, itemID, 0)

//Getting item's sfx
call AddSpecialEffect(ItemTable[dex].sfx, x, y)

It's vJass indeed. But I hope you understand my point.

but i dont wanted use alot hashtable because that also make it slow, no? without vjass (like mentioned above i wanted this in jass section and not in vjass) only option is hashtable, and from that already use several :/
 
Level 5
Joined
Aug 29, 2014
Messages
105
Lucky you, this is one of the hardest system to import. Use JNGP to at least make it a little easier.

I highly recommend that you just build a map around this instead of importing this massive system.

how can i know that the trigger is BUG when i'm using JNGP?:hohum:

Because in the GUI, the Trigger become Red and or X-Mark on Center in Trigger.

On JNGP how can i See the Error?:confused:


- Sorry for Bad English
- I'm 13 Years Old<<<< Filipino<<<
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
update

if someone have time to test then could be nice
*known bugs but not know yet how to fix well*:
These are mini problem i guess, visually stuff
- charge text sometimes shrinking
- sometimes stat window border gone for few sec

Damage Detection System bug (this isn't depend on me)
bugged when u attack sometimes the revived boss then dds stop work, to be honest 1st i thougth its my fault, but then i checked on DDS map directly without my script and there same bug occoured sometimes
link: http://www.hiveworkshop.com/forums/2602284-post111.html


v0.99b
- few minor changes (like RegHero function at "init hashtables and .." trigger automatical save hero type into save load hashtable)
- Save - Load code added:
Features:
- data saved directly into hard disc, you can copy paste the code (example u started the map, copy-paste with notepad)
- few thing customizable in header - constants "SL_" functions (SL=the function or variable is part of the save load system)
- saveable: gold/lumber/coord/stat (str/agi/int)/class/hero/level & exp (dynamic), craft skill progress
-stat saving: hero current stat - stat from items - start stat
- since we talk about random stat items, not constant items, code became long, so this
system support multi save/load lines like: -load code1 then -load code2 ...
(where code1 and code2 is the saved code)
- multiple code line limit is 39 line, each line could be around max 100 character
- added the equipment saves too but still don't got time to make the loading part aswell
*idk about inventory saveing worth to do or no*

v0.99a
- fixed the bag system included with multiboard (ex. not was showed in multiboard the 1st item in bag)
and fixed when charm item bonus not was removed/added when u moved into bag, moved out
- summoner class stuffs
- several text fix with item properties in hover tool tip in shop (like if mouse on helm then its show buyable helm mdef/pdef)
- added timer to multiboard item tooltip, damage detection system - set damage part etc
- few minor changes

v0.99
- New socket items added and now easier to register new socket gems
in "Item Registration at Map Init" you need refister like ever item for attach icon to it
then use: call RegSocketGem (ItemRawCode, GemType, Grade, ItemLevelRequiment, ItemStatInArmor1, StatValueInArmor1, ItemStatInWeapon2, StatValueInWeapon2, ItemStatInWings3, StatValueInWings3)
- New socket gems also added to shop for test
- Gems working
- Minor text fix at multiboard pager (when u are at socket view)
- Since items & gems can give critical dmg bonus i reduced the default critical dmg (if u want change then constant function in header DEFAULT_CRITICAL_DAMAGE())
- Minor fix at tooltip in shop about weapon dmg, weapon dmg now globally changeable in header easily
- added minimum damage to weapons, multiboard/stats in inventory (ratio easily changeable in header)
- gem icon showed if u check Socket/Set view and item got inserted gem
- added item stat 82 => this attack or damage but depend on weapon, if physical weapon then give pattak if magic then magic attack, only used for gems


Question:
save - load system is ok if:
- save character related thing + equiped items (1-3 code line)
- save all above+inventory? (code length drastically could increased if in inventory have equipable items too)

-or if save inventory then save only charms+materials(craft materias)+enhancements(gems & refine stones)?

or any other ideea, plz share it
 
Top