witam mam wkurwiający problem, mam skrypt na zmiane profesji który działa w połowie.
Gdy pisze do niego hi,sorcerer,yes to zmienia mi tą vocation na sorcerera w bazie danych też się zmienia id profesji na 1 ale po relogu wszystko wraca do wcześniejszej formy.
2 problem to ustawiłem sobie że w accmakerze robi się postać z id 5 (w bazie też się robi 5) ale gdy zaloguje to pisze że moja vocation to ., po kolejnym relogu id w bazie zmienia się na 0 i piszę moja prawdziwa vocation, choć z vocation.xml tak wynikać nie powinno.
a tu ten nieszczęsny promoter
dodam że korzystam z tfs 3.6.0, z gotowego projektu Simple War.
Jeżeli jest ktoś w stanie bardzo proszę o pomoc ;x
Gdy pisze do niego hi,sorcerer,yes to zmienia mi tą vocation na sorcerera w bazie danych też się zmienia id profesji na 1 ale po relogu wszystko wraca do wcześniejszej formy.
2 problem to ustawiłem sobie że w accmakerze robi się postać z id 5 (w bazie też się robi 5) ale gdy zaloguje to pisze że moja vocation to ., po kolejnym relogu id w bazie zmienia się na 0 i piszę moja prawdziwa vocation, choć z vocation.xml tak wynikać nie powinno.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<vocations>
<vocation id="0" name="none" description="a none" needpremium="0" gaincap="5" gainhp="5" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="1" manamultiplier="4.0" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="0" attackable="no">
<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
<skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
</vocation>
<vocation id="5" name="Adept" description="a Adept" needpremium="0" gaincap="5" gainhp="5" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="1" manamultiplier="4.0" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="0" attackable="no">
<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
<skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
</vocation>
<vocation id="1" name="Sorcerer" description="a sorcerer" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="6" gainhpamount="5" gainmanaticks="3" gainmanaamount="5" manamultiplier="1.1" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="1">
<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
<skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
</vocation>
<vocation id="2" name="Druid" description="a druid" needpremium="0" gaincap="10" gainhp="5" gainmana="30" gainhpticks="6" gainhpamount="5" gainmanaticks="3" gainmanaamount="5" manamultiplier="1.1" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="2">
<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
<skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>
</vocation>
<vocation id="3" name="Paladin" description="a paladin" needpremium="0" gaincap="20" gainhp="10" gainmana="15" gainhpticks="4" gainhpamount="5" gainmanaticks="4" gainmanaamount="5" manamultiplier="1.4" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="3">
<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
<skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
</vocation>
<vocation id="4" name="Knight" description="a knight" needpremium="0" gaincap="25" gainhp="15" gainmana="5" gainhpticks="3" gainhpamount="5" gainmanaticks="6" gainmanaamount="5" manamultiplier="3.0" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="4">
<formula meleeDamage="0.8" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
<skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>
</vocation>
</vocations>
a tu ten nieszczęsny promoter
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if msgcontains(msg, 'hi') or msgcontains(msg, 'Hi') then
if getPlayerVocation(cid) > 0 then
npcHandler:say("You have choosed your destiny.", cid)
else
npcHandler:say("Hello! I can change your vocation. Do you want to change vocation to sorcerer? Or any information about?", cid)
talkState[talkUser] = 1
end
elseif msgcontains(msg, 'yes') then
if talkState[talkUser] == 1 then
npcHandler:say("Now you are sorcerer.", cid)
doPlayerSetVocation(cid, 1)
end
elseif msgcontains(msg, 'sorcerer') then
npcHandler:say("DO YOU WANT TO BE A SORCERER?", cid)
talkState[talkUser] = 1
elseif msgcontains(msg, 'about') then
npcHandler:say("Sorcerer is a mage who uses fire, death and energy magic. He fight only magic and don't use fist weapons.", cid)
end
return TRUE
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Jeżeli jest ktoś w stanie bardzo proszę o pomoc ;x