Sziasztok lenne 1 olyan problémám hogy 100milla rögöt megvettem 100millát le is vonta de én azt akarom hogy azt annyiba is adja el valaki leírhatná hogy számoljam kis !KÖSZI ELŐRE IS
Ezt próbáltad?
http://board.ddmt2.net/index.php/topic,95834.msg585681.html#msg585681
igen meg is csináltam az éjjel folyamán csak 1 gond van hogy -3%-lékot le is von . de én azt akarom hogy ha le von 3 %lékot akkor kijöjjön a kerek 100.000.000 milla
Próbáld questel
quest xy begin
state start begin
when NPCID.take with item.vnum == TARGYID begin
pc.removeitem(TARGYID, 1)
pc.changegold(100000000)
end
end
end
TARGYID meg NPCID -t írd át. Majd ingame húzd a rögöt az NPC-re, mint amikor Kovácsnál fejlesztessz.
Nem Questbe akarom bele írni!hanem vegyibe 100m ért meg veszi és annyiért is adja el de mivel -3% levon belőlle ezért nem 100milláért váltja vissza hanem kevesebbért de én azt akarom hogy ugyan annyit adjon érte .
yang bugot megelőzendő inkább így:
quest xy begin
state start begin
when NPCID.take with item.vnum == TARGYID begin
if pc.get_gold() < 1900000000 then
pc.removeitem(TARGYID, 1)
pc.changegold(100000000)
else
syschat("Nem tarthatsz magadnál 2 milliárdnál több yangot!")
end
end
end
end
Ha meg el akarod adni npc-nek, akkor alap szintű matematika:
x - 3x/100 = 100000000
97x/100 = 100000000
97x = 10000000000
x = 103092784
Gondolom ennek is az ötszörösét kell beírni. (515463918)
Köszi ATAG Megy a + :);)
Elfelejtettem rátenni pendriveomra a már otthon megírt questemet, ezért gyorsba megírtam most.
SQL-item_proto:
INSERT INTO `item_proto` VALUES ('90051', 0x53696C7665722831204D696C6C2E29, 0x457AFC737472FA642831204D696C6C2E29, '18', '0', '0', '1', '0', '0', '0', '', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '-1', '-1', '-1', '-1', '-1', '-1', '0', '0', '0');
INSERT INTO `item_proto` VALUES ('90052', 0x53696C76657228322C35204D696C6C2E29, 0x457AFC737472FA6428322C35204D696C6C2E29, '18', '0', '0', '1', '0', '0', '0', '', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '-1', '-1', '-1', '-1', '-1', '-1', '0', '0', '0');
INSERT INTO `item_proto` VALUES ('90053', 0x476F6C642835204D696C6C2E29, 0x4172616E7972FA642835204D696C6C2E29, '18', '0', '0', '1', '0', '0', '0', '', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '-1', '-1', '-1', '-1', '-1', '-1', '0', '0', '0');
INSERT INTO `item_proto` VALUES ('90054', 0x476F6C64283130204D696C6C2E29, 0x4172616E7972FA64283130204D696C6C2E29, '18', '0', '0', '1', '0', '0', '0', '', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '-1', '-1', '-1', '-1', '-1', '-1', '0', '0', '0');
INSERT INTO `item_proto` VALUES ('90055', 0x476F6C64283235204D696C6C2E29, 0x4172616E7972FA64283235204D696C6C2E29, '18', '0', '0', '1', '0', '0', '0', '', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '-1', '-1', '-1', '-1', '-1', '-1', '0', '0', '0');
INSERT INTO `item_proto` VALUES ('90056', 0x4372797374616C283530204D696C6C2E29, 0x4B72697374E16C7972FA64283530204D696C6C2E29, '18', '0', '0', '1', '0', '0', '0', '', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '-1', '-1', '-1', '-1', '-1', '-1', '0', '0', '0');
INSERT INTO `item_proto` VALUES ('90057', 0x536D617261676428323530204D696C6C2E29, 0x536D61726167642D72FA6428323530204D696C6C2E29, '18', '0', '0', '1', '0', '0', '0', '', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '-1', '-1', '-1', '-1', '-1', '-1', '0', '0', '0');
INSERT INTO `item_proto` VALUES ('90058', 0x5275627928353030204D696C6C2E29, 0x527562696E2D72FA6428353030204D696C6C2E29, '18', '0', '0', '1', '0', '0', '0', '', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '-1', '-1', '-1', '-1', '-1', '-1', '0', '0', '0');
INSERT INTO `item_proto` VALUES ('90059', 0x53617070686972652831204D642E29, 0x5A6166ED722D72FA642831204D642E29, '18', '0', '0', '1', '0', '0', '0', '', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '-1', '-1', '-1', '-1', '-1', '-1', '0', '0', '0');
INSERT INTO `item_proto` VALUES ('90060', 0x4469616D6F6E6428312C35204D642E29, 0x4779E96DE16E7472FA6428312C35204D642E29, '18', '0', '0', '1', '0', '0', '0', '', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '-1', '-1', '-1', '-1', '-1', '-1', '0', '0', '0');
XML-item_proto:
<!--AddonType="0"--><Item vnum="90051" name="Silver(1 Mill.)" gb2312name="Ezüstrúd(1 Mill.)" type="18" subtype="0" weight="0" size="1" antiflag="0" flag="0" wearflag="0" immuneflag="0" gold="0" buy_price="0" limittype0="0" limitvalue0="0" limittype1="0" limitvalue1="0" applytype0="0" applyvalue0="0" applytype1="0" applyvalue1="0" applytype2="0" applyvalue2="0" value0="0" value1="0" value2="0" value3="0" value4="0" value5="0" socket0="0" socket1="64992" socket2="127" socket3="64976" socket4="21631" socket5="4855" refine_vnum="0" refine_set="0" magic_pct="0" specular="0" socket_pct="0" />
<!--AddonType="0"--><Item vnum="90052" name="Silver(2,5 Mill.)" gb2312name="Ezüstrúd(2,5 Mill.)" type="18" subtype="0" weight="0" size="1" antiflag="0" flag="0" wearflag="0" immuneflag="0" gold="0" buy_price="0" limittype0="0" limitvalue0="0" limittype1="0" limitvalue1="0" applytype0="0" applyvalue0="0" applytype1="0" applyvalue1="0" applytype2="0" applyvalue2="0" value0="0" value1="0" value2="0" value3="0" value4="0" value5="0" socket0="0" socket1="64992" socket2="127" socket3="64976" socket4="21631" socket5="4855" refine_vnum="0" refine_set="0" magic_pct="0" specular="0" socket_pct="0" />
<!--AddonType="0"--><Item vnum="90053" name="Gold(5 Mill.)" gb2312name="Aranyrúd(5 Mill.)" type="18" subtype="0" weight="0" size="1" antiflag="0" flag="0" wearflag="0" immuneflag="0" gold="0" buy_price="0" limittype0="0" limitvalue0="0" limittype1="0" limitvalue1="0" applytype0="0" applyvalue0="0" applytype1="0" applyvalue1="0" applytype2="0" applyvalue2="0" value0="0" value1="0" value2="0" value3="0" value4="0" value5="0" socket0="0" socket1="64992" socket2="127" socket3="64976" socket4="21631" socket5="4855" refine_vnum="0" refine_set="0" magic_pct="0" specular="0" socket_pct="0" />
<!--AddonType="0"--><Item vnum="90054" name="Gold(10 Mill.)" gb2312name="Aranyrúd(10 Mill.)" type="18" subtype="0" weight="0" size="1" antiflag="0" flag="0" wearflag="0" immuneflag="0" gold="0" buy_price="0" limittype0="0" limitvalue0="0" limittype1="0" limitvalue1="0" applytype0="0" applyvalue0="0" applytype1="0" applyvalue1="0" applytype2="0" applyvalue2="0" value0="0" value1="0" value2="0" value3="0" value4="0" value5="0" socket0="0" socket1="64992" socket2="127" socket3="64976" socket4="21631" socket5="4855" refine_vnum="0" refine_set="0" magic_pct="0" specular="0" socket_pct="0" />
<!--AddonType="0"--><Item vnum="90055" name="Gold(25 Mill.)" gb2312name="Aranyrúd(25 Mill.)" type="18" subtype="0" weight="0" size="1" antiflag="0" flag="0" wearflag="0" immuneflag="0" gold="0" buy_price="0" limittype0="0" limitvalue0="0" limittype1="0" limitvalue1="0" applytype0="0" applyvalue0="0" applytype1="0" applyvalue1="0" applytype2="0" applyvalue2="0" value0="0" value1="0" value2="0" value3="0" value4="0" value5="0" socket0="0" socket1="64992" socket2="127" socket3="64976" socket4="21631" socket5="4855" refine_vnum="0" refine_set="0" magic_pct="0" specular="0" socket_pct="0" />
<!--AddonType="0"--><Item vnum="90056" name="Crystal(50 Mill.)" gb2312name="Kristályrúd(50 Mill.)" type="18" subtype="0" weight="0" size="1" antiflag="0" flag="0" wearflag="0" immuneflag="0" gold="0" buy_price="0" limittype0="0" limitvalue0="0" limittype1="0" limitvalue1="0" applytype0="0" applyvalue0="0" applytype1="0" applyvalue1="0" applytype2="0" applyvalue2="0" value0="0" value1="0" value2="0" value3="0" value4="0" value5="0" socket0="0" socket1="64992" socket2="127" socket3="64976" socket4="21631" socket5="4855" refine_vnum="0" refine_set="0" magic_pct="0" specular="0" socket_pct="0" />
<!--AddonType="0"--><Item vnum="90057" name="Smaragd(250 Mill.)" gb2312name="Smaragd-rúd(250 Mill.)" type="18" subtype="0" weight="0" size="1" antiflag="0" flag="0" wearflag="0" immuneflag="0" gold="0" buy_price="0" limittype0="0" limitvalue0="0" limittype1="0" limitvalue1="0" applytype0="0" applyvalue0="0" applytype1="0" applyvalue1="0" applytype2="0" applyvalue2="0" value0="0" value1="0" value2="0" value3="0" value4="0" value5="0" socket0="0" socket1="64992" socket2="127" socket3="64976" socket4="21631" socket5="4855" refine_vnum="0" refine_set="0" magic_pct="0" specular="0" socket_pct="0" />
<!--AddonType="0"--><Item vnum="90058" name="Ruby(500 Mill.)" gb2312name="Rubin-rúd(500 Mill.)" type="18" subtype="0" weight="0" size="1" antiflag="0" flag="0" wearflag="0" immuneflag="0" gold="0" buy_price="0" limittype0="0" limitvalue0="0" limittype1="0" limitvalue1="0" applytype0="0" applyvalue0="0" applytype1="0" applyvalue1="0" applytype2="0" applyvalue2="0" value0="0" value1="0" value2="0" value3="0" value4="0" value5="0" socket0="0" socket1="64992" socket2="127" socket3="64976" socket4="21631" socket5="4855" refine_vnum="0" refine_set="0" magic_pct="0" specular="0" socket_pct="0" />
<!--AddonType="0"--><Item vnum="90059" name="Sapphire(1 Md.)" gb2312name="Zafír-rúd(1 Md.)" type="18" subtype="0" weight="0" size="1" antiflag="0" flag="0" wearflag="0" immuneflag="0" gold="0" buy_price="0" limittype0="0" limitvalue0="0" limittype1="0" limitvalue1="0" applytype0="0" applyvalue0="0" applytype1="0" applyvalue1="0" applytype2="0" applyvalue2="0" value0="0" value1="0" value2="0" value3="0" value4="0" value5="0" socket0="0" socket1="64992" socket2="127" socket3="64976" socket4="21631" socket5="4855" refine_vnum="0" refine_set="0" magic_pct="0" specular="0" socket_pct="0" />
<!--AddonType="0"--><Item vnum="90060" name="Diamond(1,5 Md.)" gb2312name="Gyémántrúd(1,5 Md.)" type="18" subtype="0" weight="0" size="1" antiflag="0" flag="0" wearflag="0" immuneflag="0" gold="0" buy_price="0" limittype0="0" limitvalue0="0" limittype1="0" limitvalue1="0" applytype0="0" applyvalue0="0" applytype1="0" applyvalue1="0" applytype2="0" applyvalue2="0" value0="0" value1="0" value2="0" value3="0" value4="0" value5="0" socket0="0" socket1="64992" socket2="127" socket3="64976" socket4="21631" socket5="4855" refine_vnum="0" refine_set="0" magic_pct="0" specular="0" socket_pct="0" />
LUA-quest:
quest bars begin
state start begin
function yangbars(vnum)
if vnum==nil or vnum>90060 or vnum<90051 then return end
return ({1000000, 2500000, 5000000, 10000000, 25000000, 50000000, 250000000, 500000000, 1000000000, 1500000000})[vnum-90050]
end
when 90051.use or 90052.use or 90053.use or 90054.use or 90055.use or
90056.use or 90057.use or 90058.use or 90059.use or 90060.use begin
local vnum = item.get_vnum()
local currentmoney = pc.get_money() or pc.get_gold() or 0
local gettingmoney = bars.yangbars(vnum)
if currentmoney+gettingmoney>=2000000000 then
syschat("Sajnálom ezt nem teheted meg, mert a vagyonod meghaladná a maximum limitet!")
else
syschat(string.format("%d Yangot kaptál.", gettingmoney))
pc.change_money(gettingmoney)
if item.get_count()>1 then
pc.remove_item(vnum,1)
else
item.remove()
end
end
end
end
end
Nincs tesztelve ha bármi probléma van vele PM!