diff --git a/MainUnit.dfm b/MainUnit.dfm index 55755b6..dac571a 100644 --- a/MainUnit.dfm +++ b/MainUnit.dfm @@ -11429,6 +11429,353 @@ object MainForm: TMainForm OnClick = btFullScriptTrainerClick end end + object tsCreatureText: TTabSheet + Caption = 'Creature Text' + ImageIndex = 2 + object cttSearchCreatureText: TJvListView + Left = 0 + Top = 89 + Width = 964 + Height = 320 + Align = alClient + BorderStyle = bsNone + Columns = < + item + Caption = 'CreatureID' + Width = 63 + end + item + Caption = 'GroupID' + Width = 52 + end + item + Caption = 'ID' + Width = 28 + end + item + Caption = 'Text' + Width = 250 + end + item + Caption = 'Type' + Width = 39 + end + item + Caption = 'Language' + Width = 60 + end + item + Caption = 'Probability' + Width = 62 + end + item + Caption = 'Emote' + Width = 42 + end + item + Caption = 'Duration' + Width = 52 + end + item + Caption = 'Sound' + Width = 44 + end + item + Caption = 'BroadcastTextID' + Width = 92 + end + item + Caption = 'TextRange' + Width = 65 + end + item + Caption = 'comment' + Width = 180 + end> + HideSelection = False + ReadOnly = True + RowSelect = True + TabOrder = 0 + ViewStyle = vsReport + OnSelectItem = cttSearchCreatureTextSelectItem + ColumnsOrder = '0=63,1=52,2=28,3=250,4=39,5=60,6=62,7=42,8=52,9=44,10=92,11=65,12=180' + ExtendedColumns = < + item + end + item + end + item + end + item + end + item + end + item + end + item + end + item + end + item + end + item + end + item + end + item + end + item + end> + end + object cttGroupBox: TGroupBox + Left = 0 + Top = 0 + Width = 964 + Height = 89 + Align = alTop + TabOrder = 1 + DesignSize = ( + 964 + 89) + object cttClearSearchCreatureText: TBitBtn + Left = 867 + Top = 56 + Width = 75 + Height = 25 + Anchors = [akTop, akRight] + Caption = 'Clear' + TabOrder = 4 + OnClick = btClearSearchCreatureClick + end + object btSearchCreatureText: TBitBtn + Left = 867 + Top = 24 + Width = 75 + Height = 25 + Anchors = [akTop, akRight] + Caption = 'Search' + Default = True + Glyph.Data = { + 36050000424D3605000000000000360400002800000010000000100000000100 + 080000000000000100000000000000000000000100000000000000000000FFFF + FF00957D6E00F9C6940043454800AEAEAE00E4D3CE006567690094949400C0A3 + 8800D5BBA700FFE2B300FFF0DA00C3C3C300787A7B00E3E2E400DEB48F005858 + 58008888880079706900F2D3B600FFF5EE00C5B0A700FFD3A100D2D2D200EEEE + EE00FFE8C400B6B8BA00897D7B009D9D9D00F9DBC3006E6E6E005F5F5F00CBCB + CC00C1BBBA008A7C6F0081818100FFCC9A00908C8B00FFE8CD0073737300B3B3 + B30096989A00746B670063636300AAAAAA006B6969007D7B780048484800FFE4 + C0006864650073716E005C5C5C0076767600858585008B8B8B009A9A9A007C7B + 7C005A5A5A00717171008D8D8D009292920097979700686969006B6B6B005D5E + 5E008A898900FFCA99007A7A7A00977D6D004747470072727200828080009898 + 980062626300C0C0C00000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000004B4B4B4B4B4B + 4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B + 4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B + 2B022E4B4B4B4B4B4B4B4B4B4B4B4B3F0325100E4B3945134B4B4B4B4B4B4A26 + 31270B3407091743334B4B4B4B461D1B161514042A0A0C1A234B4B4B40443D19 + 0F1C32412122061E2F4B4B302D051D3828303A24010148424B4B4B1136180D29 + 49243B28202C4B4B4B4B4B4B47243D123C3E081F4B4B4B4B4B4B4B4B4B4B4B4B + 37354B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B + 4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B4B} + Margin = 4 + TabOrder = 3 + OnClick = btSearchCreatureTextClick + end + object edSearchCreatureText: TLabeledEdit + Left = 96 + Top = 32 + Width = 433 + Height = 21 + EditLabel.Width = 21 + EditLabel.Height = 13 + EditLabel.Caption = 'Text' + TabOrder = 1 + end + object edSearchCreatureTextCreatureID: TLabeledEdit + Left = 8 + Top = 32 + Width = 81 + Height = 21 + EditLabel.Width = 9 + EditLabel.Height = 13 + EditLabel.Caption = 'CreatureID' + TabOrder = 0 + end + end + object cttPanel13: TPanel + Left = 0 + Top = 409 + Width = 964 + Height = 218 + Align = alBottom + BevelOuter = bvNone + TabOrder = 2 + DesignSize = ( + 964 + 218) + object edcttCreatureId: TLabeledEdit + Left = 8 + Top = 25 + Width = 73 + Height = 21 + EditLabel.Width = 58 + EditLabel.Height = 13 + EditLabel.Caption = 'CreatureID' + TabOrder = 0 + end + object edcttGroupID: TLabeledEdit + Left = 87 + Top = 25 + Width = 73 + Height = 21 + EditLabel.Width = 58 + EditLabel.Height = 13 + EditLabel.Caption = 'GroupID' + TabOrder = 1 + end + object edcttText: TLabeledEdit + Left = 243 + Top = 25 + Width = 699 + Height = 141 + EditLabel.Width = 58 + EditLabel.Height = 13 + EditLabel.Caption = 'Text' + TabOrder = 2 + end + object btScriptCreatureText: TButton + Left = 867 + Top = 183 + Width = 70 + Height = 25 + Anchors = [akLeft, akBottom] + Caption = 'Show Script' + TabOrder = 3 + OnClick = btScriptCreatureTextClick + end + object edcttID: TLabeledEdit + Left = 166 + Top = 25 + Width = 71 + Height = 21 + EditLabel.Width = 58 + EditLabel.Height = 13 + EditLabel.Caption = 'ID' + TabOrder = 4 + end + object edcttType: TLabeledEdit + Left = 8 + Top = 65 + Width = 71 + Height = 21 + EditLabel.Width = 58 + EditLabel.Height = 13 + EditLabel.Caption = 'Type' + TabOrder = 5 + end + object edcttLanguage: TLabeledEdit + Left = 85 + Top = 65 + Width = 71 + Height = 21 + EditLabel.Width = 58 + EditLabel.Height = 13 + EditLabel.Caption = 'Language' + TabOrder = 6 + end + object edcttProbability: TLabeledEdit + Left = 166 + Top = 65 + Width = 71 + Height = 21 + EditLabel.Width = 58 + EditLabel.Height = 13 + EditLabel.Caption = 'Probability' + TabOrder = 7 + end + object edcttEmote: TLabeledEdit + Left = 243 + Top = 65 + Width = 71 + Height = 21 + EditLabel.Width = 58 + EditLabel.Height = 13 + EditLabel.Caption = 'Emote' + TabOrder = 8 + end + object edcttDuration: TLabeledEdit + Left = 320 + Top = 65 + Width = 71 + Height = 21 + EditLabel.Width = 58 + EditLabel.Height = 13 + EditLabel.Caption = 'Duration' + TabOrder = 9 + end + object edcttSound: TLabeledEdit + Left = 397 + Top = 65 + Width = 71 + Height = 21 + EditLabel.Width = 58 + EditLabel.Height = 13 + EditLabel.Caption = 'Sound' + TabOrder = 10 + end + object edcttBroadcastTextId: TLabeledEdit + Left = 474 + Top = 65 + Width = 80 + Height = 21 + EditLabel.Width = 58 + EditLabel.Height = 13 + EditLabel.Caption = 'BroadcastTextId' + TabOrder = 11 + end + object edcttTextRange: TLabeledEdit + Left = 560 + Top = 65 + Width = 71 + Height = 21 + EditLabel.Width = 58 + EditLabel.Height = 13 + EditLabel.Caption = 'TextRange' + TabOrder = 12 + end + object edcttcomment: TLabeledEdit + Left = 8 + Top = 105 + Width = 460 + Height = 21 + EditLabel.Width = 58 + EditLabel.Height = 13 + EditLabel.Caption = 'comment' + TabOrder = 13 + end + end + end object tsCreatureTemplateAddon: TTabSheet Caption = 'Creature Template Addon' ImageIndex = 16 diff --git a/MainUnit.pas b/MainUnit.pas index 1f05525..c1f9513 100644 --- a/MainUnit.pas +++ b/MainUnit.pas @@ -25,7 +25,7 @@ interface VERSION_EXE = VERSION_1 + '.' + VERSION_2 + '.' + VERSION_3 + '.' + VERSION_4; SCRIPT_TAB_NO_QUEST = 6; - SCRIPT_TAB_NO_CREATURE = 16; + SCRIPT_TAB_NO_CREATURE = 17; SCRIPT_TAB_NO_GAMEOBJECT = 6; SCRIPT_TAB_NO_ITEM = 10; SCRIPT_TAB_NO_SMARTAI = 1; @@ -64,6 +64,7 @@ interface PFX_MILLING_LOOT_TEMPLATE = 'im'; PFX_REFERENCE_LOOT_TEMPLATE = 'ir'; PFX_PAGE_TEXT = 'pt'; + PFX_CREATURE_TEXT = 'ctt'; PFX_FISHING_LOOT_TEMPLATE = 'ot'; PFX_CHARACTER = 'ht'; PFX_CHARACTER_INVENTORY = 'hi'; @@ -879,6 +880,28 @@ TMainForm = class(TForm) btFullScriptFishLoot: TButton; edotZone: TJvComboEdit; btGetLootForZone: TButton; + tsCreatureText: TTabSheet; + cttSearchCreatureText: TJvListView; + cttGroupBox: TGroupBox; + cttClearSearchCreatureText: TBitBtn; + btSearchCreatureText: TBitBtn; + edSearchCreatureText: TLabeledEdit; + edSearchCreatureTextCreatureID: TLabeledEdit; + cttPanel13: TPanel; + edcttCreatureId: TLabeledEdit; + edcttGroupID: TLabeledEdit; + edcttText: TLabeledEdit; + btScriptCreatureText: TButton; + edcttID: TLabeledEdit; + edcttType: TLabeledEdit; + edcttLanguage: TLabeledEdit; + edcttProbability: TLabeledEdit; + edcttEmote: TLabeledEdit; + edcttDuration: TLabeledEdit; + edcttSound: TLabeledEdit; + edcttBroadcastTextId: TLabeledEdit; + edcttTextRange: TLabeledEdit; + edcttcomment: TLabeledEdit; tsPageText: TTabSheet; lvSearchPageText: TJvListView; GroupBox1: TGroupBox; @@ -1808,6 +1831,10 @@ TMainForm = class(TForm) procedure edqtQuestSortIDButtonClick(Sender: TObject); procedure edqtQuestSortIDChange(Sender: TObject); procedure edQuestSortIDSearchButtonClick(Sender: TObject); + procedure btSearchCreatureTextClick(Sender: TObject); + procedure cttSearchCreatureTextSelectItem(Sender: TObject; Item: TListItem; + Selected: Boolean); + procedure btScriptCreatureTextClick(Sender: TObject); procedure btSearchPageTextClick(Sender: TObject); procedure lvSearchPageTextSelectItem(Sender: TObject; Item: TListItem; Selected: Boolean); @@ -2050,6 +2077,7 @@ TMainForm = class(TForm) {creatures} procedure SearchCreature; procedure SearchCreatureModelInfo; + procedure SearchCreatureText; procedure LoadCreature(Entry: integer); procedure LoadCreatureTemplateAddon(entry: integer); @@ -2074,6 +2102,7 @@ TMainForm = class(TForm) procedure CompleteCreatureAddonScript; procedure CompleteCreatureTemplateMovementScript; procedure CompleteCreatureOnKillReputationScript; + procedure CompleteCreatureTextScript; {gameobjects} procedure SearchGO; @@ -3961,6 +3990,7 @@ procedure TMainForm.btClearSearchCreatureClick(Sender: TObject); edSearchCreatureSubName.Clear; lvSearchCreature.Clear; edSearchCreaturenpcflag.Clear; + edSearchCreatureTextCreatureID.Clear; end; procedure TMainForm.btSearchCreatureClick(Sender: TObject); @@ -4622,8 +4652,9 @@ procedure TMainForm.tsCreatureScriptShow(Sender: TObject); 7: CompleteSkinLootScript; 8: CompleteNPCVendorScript; 9: CompleteNPCTrainerScript; - 10: CompleteCreatureTemplateAddonScript; - 11: CompleteCreatureAddonScript; + 10: CompleteCreatureTextScript; + 11: CompleteCreatureTemplateAddonScript; + 12: CompleteCreatureAddonScript; 13: CompleteCreatureTemplateMovementScript; 14: CompleteCreatureOnKillReputationScript; 15: {involved in tab - do nothing}; @@ -9182,6 +9213,58 @@ procedure TMainForm.edQuestSortIDSearchButtonClick(Sender: TObject); GetValueFromSimpleList(Sender, 11, 'QuestSort', false); end; +procedure TMainForm.btSearchCreatureTextClick(Sender: TObject); +begin + SearchCreatureText(); + with cttSearchCreatureText do + if Items.Count > 0 then + begin + SetFocus; + Selected := Items[0]; + end; +end; + +procedure TMainForm.cttSearchCreatureTextSelectItem(Sender: TObject; Item: TListItem; Selected: Boolean); +begin + if Selected then + begin + edcttCreatureId.Text := Item.Caption; + edcttGroupID.Text := Item.SubItems[0]; + edcttID.Text := Item.SubItems[1]; + edcttText.Text := Item.SubItems[2]; + edcttType.Text := Item.SubItems[3]; + edcttLanguage.Text := Item.SubItems[4]; + edcttProbability.Text := Item.SubItems[5]; + edcttEmote.Text := Item.SubItems[6]; + edcttDuration.Text := Item.SubItems[7]; + edcttSound.Text := Item.SubItems[8]; + edcttBroadcastTextId.Text := Item.SubItems[9]; + edcttTextRange.Text := Item.SubItems[10]; + edcttcomment.Text := Item.SubItems[11]; + end; +end; + +procedure TMainForm.btScriptCreatureTextClick(Sender: TObject); +begin + PageControl3.ActivePageIndex := SCRIPT_TAB_NO_CREATURE; +end; + +procedure TMainForm.CompleteCreatureTextScript; +var + CreatureID, Fields, Values: string; +begin + mectLog.Clear; + CreatureID := edcttCreatureId.Text; + if (CreatureID='') then Exit; + SetFieldsAndValues(Fields, Values, 'creature_text', PFX_CREATURE_TEXT, mectLog); + case SyntaxStyle of + ssInsertDelete: mectScript.Text := Format('DELETE FROM `creature_text` WHERE (`CreatureID`=%s);'#13#10+ + 'INSERT INTO `creature_text` (%s) VALUES (%s);'#13#10,[CreatureID, Fields, Values]); + ssReplace: mectScript.Text := Format('REPLACE INTO `creature_text` (%s) VALUES (%s);'#13#10,[Fields, Values]); + ssUpdate: mectScript.Text := MakeUpdate('creature_text', PFX_CREATURE_TEXT, 'CreatureID', CreatureID) ; + end; +end; + procedure TMainForm.btSearchPageTextClick(Sender: TObject); begin SearchPageText(); @@ -9225,6 +9308,70 @@ procedure TMainForm.CompletePageTextScript; end; end; +procedure TMainForm.SearchCreatureText; +var + i: integer; + CreatureID, Name, QueryStr, WhereStr, t: string; + Field: TField; +begin + CreatureID := edSearchCreatureTextCreatureID.Text; + Name := edSearchCreatureText.Text; + Name := StringReplace(Name, '''', '\''', [rfReplaceAll]); + Name := StringReplace(Name, ' ', '%', [rfReplaceAll]); + Name := '%'+Name+'%'; + + QueryStr := ''; + WhereStr := ''; + if CreatureID<>'' then + begin + if pos('-', CreatureID)=0 then + WhereStr := Format('WHERE (`CreatureID` in (%s))',[CreatureID]) + else + WhereStr := Format('WHERE (`CreatureID` >= %s) AND (`CreatureID` <= %s)',[MidStr(CreatureID,1,pos('-',creatureid)-1), MidStr(CreatureID,pos('-',creatureid)+1,length(creatureid))]); + end; + + if Name<>'%%' then + begin + if WhereStr<> '' then + WhereStr := Format('%s AND (`text` LIKE ''%s'')',[WhereStr, Name]) + else + WhereStr := Format('WHERE (`text` LIKE ''%s'')',[Name]); + end; + + if Trim(WhereStr)='' then + if MessageDlg(dmMain.Text[134], mtConfirmation, mbYesNoCancel, -1)<>mrYes then Exit; + + QueryStr := Format('SELECT * FROM `creature_text` %s',[WhereStr]); + + MyQuery.SQL.Text := QueryStr; + cttSearchCreatureText.Items.BeginUpdate; + try + MyQuery.Open; + cttSearchCreatureText.Clear; + while (MyQuery.Eof=false) do + begin + with cttSearchCreatureText.Items.Add do + begin + for i := 0 to cttSearchCreatureText.Columns.Count - 1 do + begin + Field := MyQuery.FindField(cttSearchCreatureText.Columns[i].Caption); + t := ''; + if Assigned(Field) then + begin + t := Field.AsString; + if i=0 then Caption := t; + end; + if i<>0 then SubItems.Add(t); + end; + MyQuery.Next; + end; + end; + finally + cttSearchCreatureText.Items.EndUpdate; + MyQuery.Close; + end; +end; + procedure TMainForm.SearchPageText; var i: integer;