Hallo Leute,
da ich mich mal wieder langsam mit lua vertraut machen will habe ich letztens eine Quest geschrieben. Was macht sie:
Ganz einfach, ihr zieht ein EQ-Gegenstand auf einen NPC (In diesem Fall "Handu-Up") und eure Gegenstand bekommt dann perfekte PVP Bonis.
Steine werden auch mit uebernommen!
Was die Quest(noch) nicht kann bzw. was ich nicht effizient hinbekommen habe:
-
Unterscheiden zwischen dss & fks waffen, Giftschwert bekommt also auch ganz normale Attribute (Wenn mir jemand sagen kann, wie man eine FOR-Schleife unterbricht, koennte ich es hinbekommen) #hinzugefuegt
- Bisher nur "normales" switchbar (d.h. keine Kostueme oder so)
Klar, kann man die Quest schoener schreiben, aber mir ging es lediglich darum wieder in Lua reinzukommen, und sie funktioniert ja, von daher habe ich von meiner Seite aus nichts zu meckern
Ich denke mal, einige PvP-Server könnten für sowas Verwendung haben.
UPDATE 1.1:
- jetzt wird in dss & fks waffen, wie zum beispiel Gifti dss & fks reingeswitcht, anstelle der standard bonis fuer andere waffen
- einfach die vnums in die function addonType() hinzufuegen und am anfang der Quest die maximalen DSS(AVG)-Werte und die maximalen FKS(fks)-Werte festlegen
-
addonType zu den quest function hinzufuegen
Hier die Quest:
- -----------------------------made by Passi-------------------------------------
- quest auto_boni_easy begin
- state start begin
- when 20086.take begin
- --Item
- local name = item.get_name()
- local vnum = item.get_vnum()
- local sock1 = item.get_socket(0)
- local sock2 = item.get_socket(1)
- local sock3 = item.get_socket(2)
- local type = item.get_type()
- local sub = item.get_sub_type()
- local dss = false
- -----max. dss & fks einstellen------------
- local avg = 60
- local fks = 25
- function addonType(num)
- local w = {189,188, 187, 186, 185, 184, 184,183, 182, 181, 180, --gifti
- 3169, 3168, 3167, 3166, 3165, 3164, 3163, 3162, 3161, 3160, --grolli
- 1130,1131,1132,1133,1134,1135,1136,1137,1138,1139, --tfc
- 2170,2171,2172,2173,2174,2175,2176,2177,2178,2179, --kraehi
- 199, 198, 197, 196, 195, 194, 193, 192, 191, 190, --loewi
- 5120,5121,5122,5123,5124,5125,5126,5127,5128,5129, --orchi
- 290,291,292, 293, 294, 295, 296, 297, 298, 299, --vms
- 1170,1171,1172,1173,1174,1175,1176,1177,1178,1179, --sbd
- 3210,3211,3212,3213,3214,3215,3216,3217,3218,3219, --rek
- 2150,2151,2152,2153,2154,2155,2156,2157,2158,2159, --horni
- 5110,5111,5112,5113,5114,5115,5116,5117,5118,5119, --antig
- 7160,7161,7162,7163,7164,7165,7166,7167,7168,7169 --hwf
- }
- for a = 1, table.getn(w), 1 do
- if w[a] == num then
- return true
- end
- end
- end
- --Player
- local job = pc.get_job()
- --EQ
- local halskette1 = { ---schwert,2hand, dolch
- {1, 5000},
- {15, 10},
- {29, 15},
- {30, 15},
- {31, 15}
- }
- local halskette2 = { ---glocke faecher, pfeil
- {1, 5000},
- {15, 10},
- {32, 15},
- {33, 15},
- {34, 15}
- }
- local armband1 = { ---tp,mgdeff, tp abs, db, hm
- {1, 5000},
- {23, 15},
- {16, 10},
- {37, 15},
- {17, 15}
- }
- local ohrringe1 = { ---hm, schwert, 2hand, dolch, giftwd
- {17, 15},
- {29, 15},
- {30, 15},
- {31, 15},
- {41, 15}
- }
- local ohrringe2 = { ---hm, glocke, faecher, pfeil, giftwd
- {17, 15},
- {32, 15},
- {33, 15},
- {34, 15},
- {41, 15}
- }
- local schuhe1 = { ---tp, schwert, 2hand, dolch, krit
- {1, 5000},
- {29, 15},
- {30, 15},
- {31, 15},
- {15, 10}
- }
- local schuhe2 = { ---tp, glocke, faecher, pfeil, krit
- {1, 5000},
- {32, 15},
- {33, 15},
- {34, 15},
- {15, 10}
- }
- local helme1 = { ---vergiftung, magiedeff, hm, block, angriffsg
- {12, 15},
- {37, 15},
- {17, 15},
- {27, 15},
- {7, 15}
- }
- local ruestung1 = { ---tp, 1hand, 2hand, dolch, tp abs
- {1, 5000},
- {29, 15},
- {30, 15},
- {31, 15},
- {23, 15}
- }
- local ruestung2 = { ---tp, facher, glocke, pfeil, tp abs
- {1, 5000},
- {32, 15},
- {33, 15},
- {34, 15},
- {23, 15}
- }
- local schild1 = { ---str, dex, hm, abwohnm, block
- {5, 15},
- {6, 15},
- {17, 15},
- {48, 1},
- {27, 15}
- }
- local schild2 = { ---int, str, hm, abwohnm, block
- {4, 15},
- {5, 15},
- {17, 15},
- {48, 1},
- {27, 15}
- }
- ------------------------------
- say_title(""..name..":")
- say("Moechtest du die Bonis veraendern?")
- say("")
- say_show_item(vnum)
- say("")
- say("")
- say("")
- local q = select3("Neu bonieren")
- if q == 1 then
- if type == 1 then --waffen
- if job == 0 then
- if sub == 0 then --Schwerter
- local dss = addonType(vnum)
- if dss == true then
- local a = select3("Durchschnittsschaden", "Fertigkeitsschaden")
- if a == 1 then
- pc.remove_item(vnum)
- pc.give_item2(vnum)
- item.set_value(0, 72, avg) --dss
- item.set_value(1, 71, -30) --fks
- item.set_socket(0, sock1)
- item.set_socket(1, sock2)
- item.set_socket(2, sock3)
- say(bool_to_str(dss))
- elseif a == 2 then
- pc.remove_item(vnum)
- pc.give_item2(vnum)
- item.set_value(0, 72, -40) --dss
- item.set_value(1, 71, fks) --fks
- item.set_socket(0, sock1)
- item.set_socket(1, sock2)
- item.set_socket(2, sock3)
- end
- else
- pc.remove_item(vnum)
- pc.give_item2(vnum)
- item.set_value(0, 5, 15) --- 1 Boni --- str
- item.set_value(1, 6, 15) --- 2 Boni --- dex
- item.set_value(2, 17, 15) --- 3 Boni --- hm
- item.set_value(3, 15, 10) --- 4 Boni --- krit
- item.set_value(4, 16, 10) --- 5 Boni --- db
- item.set_socket(0, sock1)
- item.set_socket(1, sock2)
- item.set_socket(2, sock3)
- say(bool_to_str(dss))
- end
- elseif sub == 3 then --2hand
- local dss = addonType(vnum)
- if dss == true then
- local a = select3("Durchschnittsschaden", "Fertigkeitsschaden")
- if a == 1 then
- pc.remove_item(vnum)
- pc.give_item2(vnum)
- item.set_value(0, 72, avg) --dss
- item.set_value(1, 71, -30) --fks
- item.set_socket(0, sock1)
- item.set_socket(1, sock2)
- item.set_socket(2, sock3)
- say(bool_to_str(dss))
- elseif a == 2 then
- pc.remove_item(vnum)
- pc.give_item2(vnum)
- item.set_value(0, 72, -40) --dss
- item.set_value(1, 71, fks) --fks
- item.set_socket(0, sock1)
- item.set_socket(1, sock2)
- item.set_socket(2, sock3)
- say(bool_to_str(dss))
- end
- else
- pc.remove_item(vnum)
- pc.give_item2(vnum)
- item.set_value(0, 5, 15) --- 1 Boni --- str
- item.set_value(1, 6, 15) --- 2 Boni --- dex
- item.set_value(2, 17, 15) --- 3 Boni --- hm
- item.set_value(3, 9, 20) --- 4 Boni --- zg
- item.set_value(4, 16, 10) --- 5 Boni --- db
- item.set_socket(0, sock1)
- item.set_socket(1, sock2)
- item.set_socket(2, sock3)
- say(bool_to_str(dss))
- end
- end
- elseif job == 2 then
- local dss = addonType(vnum)
- if dss == true then
- local a = select3("Durchschnittsschaden", "Fertigkeitsschaden")
- if a == 1 then
- pc.remove_item(vnum)
- pc.give_item2(vnum)
- item.set_value(0, 72, avg) --dss
- item.set_value(1, 71, -30) --fks
- item.set_socket(0, sock1)
- item.set_socket(1, sock2)
- item.set_socket(2, sock3)
- say(bool_to_str(dss))
- elseif a == 2 then
- pc.remove_item(vnum)
- pc.give_item2(vnum)
- item.set_value(0, 72, -40) --dss
- item.set_value(1, 71, fks) --fks
- item.set_socket(0, sock1)
- item.set_socket(1, sock2)
- item.set_socket(2, sock3)
- say(bool_to_str(dss))
- end
- else
- if pc.get_skill_group() == 1 then --waffensura
- pc.remove_item(vnum)
- pc.give_item2(vnum)
- item.set_value(0, 5, 15) --- 1 Boni --- str
- item.set_value(1, 4, 15) --- 2 Boni --- int
- item.set_value(2, 17, 15) --- 3 Boni --- hm
- item.set_value(3, 15, 10) --- 4 Boni --- krit
- item.set_value(4, 16, 10) --- 5 Boni --- db
- item.set_socket(0, sock1)
- item.set_socket(1, sock2)
- item.set_socket(2, sock3)
- elseif pc.get_skill_group() == 2 then --Magiesura
- pc.remove_item(vnum)
- pc.give_item2(vnum)
- item.set_value(0, 9, 20) --- 1 Boni --- zg
- item.set_value(1, 4, 15) --- 2 Boni --- int
- item.set_value(2, 17, 15) --- 3 Boni --- hm
- item.set_value(3, 15, 10) --- 4 Boni --- krit
- item.set_value(4, 16, 10) --- 5 Boni --- db
- item.set_socket(0, sock1)
- item.set_socket(1, sock2)
- item.set_socket(2, sock3)
- end
- end
- elseif job == 1 then
- local dss = addonType(vnum)
- if dss == true then
- local a = select3("Durchschnittsschaden", "Fertigkeitsschaden")
- if a == 1 then
- pc.remove_item(vnum)
- pc.give_item2(vnum)
- item.set_value(0, 72, avg) --dss
- item.set_value(1, 71, -30) --fks
- item.set_socket(0, sock1)
- item.set_socket(1, sock2)
- item.set_socket(2, sock3)
- say(bool_to_str(dss))
- elseif a == 2 then
- pc.remove_item(vnum)
- pc.give_item2(vnum)
- item.set_value(0, 72, -40) --dss
- item.set_value(1, 71, fks) --fks
- item.set_socket(0, sock1)
- item.set_socket(1, sock2)
- item.set_socket(2, sock3)
- say(bool_to_str(dss))
- end
- else
- if sub == 1 then --dolche
- pc.remove_item(vnum)
- pc.give_item2(vnum)
- item.set_value(0, 5, 15) --- 1 Boni --- str
- item.set_value(1, 6, 15) --- 2 Boni --- dex
- item.set_value(2, 17, 15) --- 3 Boni --- hm
- item.set_value(3, 15, 10) --- 4 Boni --- krit
- item.set_value(4, 9, 15) --- 5 Boni --- zg
- item.set_socket(0, sock1)
- item.set_socket(1, sock2)
- item.set_socket(2, sock3)
- elseif sub == 2 then --bogen
- pc.remove_item(vnum)
- pc.give_item2(vnum)
- item.set_value(0, 5, 15) --- 1 Boni --- str
- item.set_value(1, 6, 15) --- 2 Boni --- dex
- item.set_value(2, 17, 15) --- 3 Boni --- hm
- item.set_value(3, 9, 20) --- 4 Boni --- zg
- item.set_value(4, 15, 10) --- 5 Boni --- krit
- item.set_socket(0, sock1)
- item.set_socket(1, sock2)
- item.set_socket(2, sock3)
- end
- end
- elseif job == 3 then --schamie
- local dss = addonType(vnum)
- if dss == true then
- local a = select3("Durchschnittsschaden", "Fertigkeitsschaden")
- if a == 1 then
- pc.remove_item(vnum)
- pc.give_item2(vnum)
- item.set_value(0, 72, avg) --dss
- item.set_value(1, 71, -30) --fks
- item.set_socket(0, sock1)
- item.set_socket(1, sock2)
- item.set_socket(2, sock3)
- say(bool_to_str(dss))
- elseif a == 2 then
- pc.remove_item(vnum)
- pc.give_item2(vnum)
- item.set_value(0, 72, -40) --dss
- item.set_value(1, 71, fks) --fks
- item.set_socket(0, sock1)
- item.set_socket(1, sock2)
- item.set_socket(2, sock3)
- say(bool_to_str(dss))
- end
- else
- if sub == 4 then
- pc.remove_item(vnum)
- pc.give_item2(vnum)
- item.set_value(0, 9, 20) --- 1 Boni --- zg
- item.set_value(1, 4, 15) --- 2 Boni --- int
- item.set_value(2, 17, 15) --- 3 Boni --- hm
- item.set_value(3, 15, 10) --- 4 Boni --- krit
- item.set_value(4, 16, 10) --- 5 Boni --- db
- item.set_socket(0, sock1)
- item.set_socket(1, sock2)
- item.set_socket(2, sock3)
- elseif sub == 5 then --faecher
- pc.remove_item(vnum)
- pc.give_item2(vnum)
- item.set_value(0, 9, 20) --- 1 Boni --- zg
- item.set_value(1, 4, 15) --- 2 Boni --- int
- item.set_value(2, 17, 15) --- 3 Boni --- hm
- item.set_value(3, 15, 10) --- 4 Boni --- krit
- item.set_value(4, 16, 10) --- 5 Boni --- db
- item.set_socket(0, sock1)
- item.set_socket(1, sock2)
- item.set_socket(2, sock3)
- end
- end
- end
- elseif type == 2 then --schmuck
- if sub == 5 then --halskette
- local s = select3("1Hand,2hand,Dolch", "Glocke, Faecher, Pfeildeff")
- if s == 1 then
- pc.remove_item(vnum)
- pc.give_item2(vnum)
- local i = 0
- for a = 1, 5, 1 do
- item.set_value(i, halskette1[a][1], halskette1[a][2])
- i = i+1
- end
- item.set_socket(0, sock1)
- item.set_socket(1, sock2)
- item.set_socket(2, sock3)
- elseif s == 2 then
- pc.remove_item(vnum)
- pc.give_item2(vnum)
- local i = 0
- for a = 1, 5, 1 do
- item.set_value(i, halskette2[a][1], halskette2[a][2])
- i = i+1
- end
- item.set_socket(0, sock1)
- item.set_socket(1, sock2)
- item.set_socket(2, sock3)
- end
- elseif sub == 3 then --armband
- pc.remove_item(vnum)
- pc.give_item2(vnum)
- local i = 0
- for a = 1, 5, 1 do
- item.set_value(i, armband1[a][1], armband1[a][2])
- i = i+1
- end
- item.set_socket(0, sock1)
- item.set_socket(1, sock2)
- item.set_socket(2, sock3)
- elseif sub == 6 then --ohrringe
- local k = select3("1Hand,2hand,Dolch", "Glocke, Faecher, Pfeildeff")
- if k == 1 then
- pc.remove_item(vnum)
- pc.give_item2(vnum)
- local i = 0
- for a = 1, 5, 1 do
- item.set_value(i, ohrringe1[a][1], ohrringe1[a][2])
- i = i+1
- end
- item.set_socket(0, sock1)
- item.set_socket(1, sock2)
- item.set_socket(2, sock3)
- elseif k == 2 then
- pc.remove_item(vnum)
- pc.give_item2(vnum)
- local i = 0
- for a = 1, 5, 1 do
- item.set_value(i, ohrringe2[a][1], ohrringe2[a][2])
- i = i+1
- end
- item.set_socket(0, sock1)
- item.set_socket(1, sock2)
- item.set_socket(2, sock3)
- end
- elseif sub == 4 then --ohrringe
- local l = select3("1Hand,2hand,Dolch", "Glocke, Faecher, Pfeildeff")
- if l == 1 then
- pc.remove_item(vnum)
- pc.give_item2(vnum)
- local i = 0
- for a = 1, 5, 1 do
- item.set_value(i, schuhe1[a][1], schuhe1[a][2])
- i = i+1
- end
- item.set_socket(0, sock1)
- item.set_socket(1, sock2)
- item.set_socket(2, sock3)
- elseif l == 2 then
- pc.remove_item(vnum)
- pc.give_item2(vnum)
- local i = 0
- for a = 1, 5, 1 do
- item.set_value(i, schuhe2[a][1], schuhe2[a][2])
- i = i+1
- end
- item.set_socket(0, sock1)
- item.set_socket(1, sock2)
- item.set_socket(2, sock3)
- end
- elseif sub == 1 then --helme
- pc.remove_item(vnum)
- pc.give_item2(vnum)
- local i = 0
- for a = 1, 5, 1 do
- item.set_value(i, helme1[a][1], helme1[a][2])
- i = i+1
- end
- item.set_socket(0, sock1)
- item.set_socket(1, sock2)
- item.set_socket(2, sock3)
- elseif sub == 0 then --ruestung
- local t = select3("1Hand,2hand,Dolch", "Glocke, Faecher, Pfeildeff")
- if t == 1 then
- pc.remove_item(vnum)
- pc.give_item2(vnum)
- local i = 0
- for a = 1, 5, 1 do
- item.set_value(i, ruestung1[a][1], ruestung1[a][2])
- i = i+1
- end
- item.set_socket(0, sock1)
- item.set_socket(1, sock2)
- item.set_socket(2, sock3)
- elseif t == 2 then
- pc.remove_item(vnum)
- pc.give_item2(vnum)
- local i = 0
- for a = 1, 5, 1 do
- item.set_value(i, ruestung2[a][1], ruestung2[a][2])
- i = i+1
- end
- item.set_socket(0, sock1)
- item.set_socket(1, sock2)
- item.set_socket(2, sock3)
- end
- elseif sub == 2 then --schilder
- if job <= 1 then
- pc.remove_item(vnum)
- pc.give_item2(vnum)
- local i = 0
- for a = 1, 5, 1 do
- item.set_value(i, schild1[a][1], schild1[a][2])
- i = i+1
- end
- item.set_socket(0, sock1)
- item.set_socket(1, sock2)
- item.set_socket(2, sock3)
- elseif job > 1 then
- pc.remove_item(vnum)
- pc.give_item2(vnum)
- local i = 0
- for a = 1, 5, 1 do
- item.set_value(i, schild2[a][1], schild2[a][2])
- i = i+1
- end
- item.set_socket(0, sock1)
- item.set_socket(1, sock2)
- item.set_socket(2, sock3)
- end
- end
- else
- say("Falsches Item")
- end
- end
- end
- end
- end
Alles anzeigen
Liebe Grüsse,
Passi
PS: Wenn ihr Anregungen, Verbesserungsvorschläge oder allgemein Kritik habt, dann immer her damit.